mars-v2-frontend/src/api/swap/getSwapRoute.ts
Linkie Link a8dc0950fa
Pyth history feed (#623)
* MP-3556: first PythDataFeed class

* fix: fixed the timestamp

* fix: fixed the chart data

* fix: fixed the prices

* fix: fixed the math and decimal scale

* tidy: refactor

* fix: update the pythFeedId

* fix: updated OsmosisTheGraphDataFeed

* fix: add a fallback for non pyth data

* tidy: refactor

* fix: adjusted to feedback
2023-11-10 13:56:17 +01:00

16 lines
392 B
TypeScript

import { getSwapperQueryClient } from 'api/cosmwasm-client'
export default async function getSwapRoute(denomIn: string, denomOut: string): Promise<Route[]> {
try {
const swapperClient = await getSwapperQueryClient()
const routes = await swapperClient.route({
denomIn,
denomOut,
})
return routes.route as unknown as Route[]
} catch (ex) {
return []
}
}