Skip to content

Commit

Permalink
Swap via Astroport
Browse files Browse the repository at this point in the history
  • Loading branch information
sim committed Dec 28, 2021
1 parent 2243ece commit 2ee16a6
Show file tree
Hide file tree
Showing 9 changed files with 638 additions and 49 deletions.
3 changes: 3 additions & 0 deletions src/data/Terra/TerraAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { AccAddress } from "@terra-money/terra.js"
import shuffle from "utils/shuffle"
import { queryKey, RefetchOptions } from "../query"
import { useNetworkName } from "../wallet"
import pairs from "./pairs.json"

const config = { baseURL: "https://assets.terra.money" }

Expand All @@ -30,6 +31,8 @@ export const useTerraAssetsByNetwork = <T>(
[queryKey.TerraAssets, path, networkName],
async () => {
const { data } = await axios.get<Record<NetworkName, T>>(path, config)
if (path === "cw20/pairs.json")
return (pairs as unknown as Record<NetworkName, T>)[networkName]
return callback?.(data[networkName]) ?? data[networkName]
},
{ ...RefetchOptions.INFINITY, enabled: !disabled }
Expand Down
Loading

0 comments on commit 2ee16a6

Please sign in to comment.