Skip to content

Commit

Permalink
Merge pull request #433 from galacticcouncil/gc-apps
Browse files Browse the repository at this point in the history
Static dollar asset id, fix undefined hook on init
  • Loading branch information
nohaapav committed Jun 16, 2023
2 parents 20c6140 + 1ee1d48 commit 2f3756c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ VITE_PROVIDER_URL=wss://rococo-basilisk-rpc.hydration.dev
VITE_DOMAIN_URL=https://testnet-app.basilisk.cloud
VITE_INDEXER_URL=https://basilisk-rococo-explorer.play.hydration.cloud/graphql
VITE_USD_PEGGED_ASSET_NAME=USDT
VITE_USD_PEGGED_ASSET_ID=19
VITE_FF_XCM_ENABLED=true
VITE_ENV=rococo
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ VITE_PROVIDER_URL=wss://rpc.basilisk.cloud
VITE_DOMAIN_URL=https://app.basilisk.cloud
VITE_INDEXER_URL=https://basilisk-explorer.play.hydration.cloud/graphql
VITE_USD_PEGGED_ASSET_NAME=USDT
VITE_USD_PEGGED_ASSET_ID=14
VITE_FF_XCM_ENABLED=true
VITE_ENV=production
1 change: 1 addition & 0 deletions .env.rococo
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ VITE_PROVIDER_URL=wss://rococo-basilisk-rpc.hydration.dev
VITE_DOMAIN_URL=https://rococo-app.basilisk.cloud
VITE_INDEXER_URL=https://basilisk-rococo-explorer.play.hydration.cloud/graphql
VITE_USD_PEGGED_ASSET_NAME=USDT
VITE_USD_PEGGED_ASSET_ID=19
VITE_FF_XCM_ENABLED=false
VITE_ENV=rococo
5 changes: 2 additions & 3 deletions src/sections/trade/TradePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { TxInfo } from "@galacticcouncil/apps"
import * as React from "react"
import * as Apps from "@galacticcouncil/apps"
import { createComponent, EventName } from "@lit-labs/react"
import { useUsdPeggedAsset } from "api/asset"
import { useAccountStore, useStore } from "state/store"
import { z } from "zod"
import { MakeGenerics, useSearch } from "@tanstack/react-location"
Expand Down Expand Up @@ -47,7 +46,7 @@ export function TradePage() {

const ref = React.useRef<Apps.TradeApp>(null)
const rawSearch = useSearch<SearchGenerics>()
const usd = useUsdPeggedAsset()
const usdAssetId = import.meta.env.VITE_USD_PEGGED_ASSET_ID
const search = TradeAppSearch.safeParse(rawSearch)

const handleSubmit = async (e: CustomEvent<TxInfo>) => {
Expand Down Expand Up @@ -95,7 +94,7 @@ export function TradePage() {
accountProvider={account?.provider}
accountAddress={account?.address}
apiAddress={rpcUrl}
stableCoinAssetId={usd.data?.id}
stableCoinAssetId={usdAssetId}
assetIn={search.success ? search.data.assetIn : undefined}
assetOut={search.success ? search.data.assetOut : undefined}
pools={PoolType.XYK}
Expand Down

0 comments on commit 2f3756c

Please sign in to comment.