Skip to content

Commit

Permalink
Merge pull request #473 from galacticcouncil/rococo
Browse files Browse the repository at this point in the history
Merge rococo to production
  • Loading branch information
mrq1911 authored Mar 13, 2024
2 parents 810f6c7 + 6db1c67 commit dc9afa2
Show file tree
Hide file tree
Showing 61 changed files with 885 additions and 1,139 deletions.
4 changes: 4 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
VITE_PROVIDER_URL=wss://basilisk-rococo-rpc.play.hydration.cloud
VITE_DOMAIN_URL=https://testnet-app.basilisk.cloud
VITE_INDEXER_URL=https://basilisk-rococo-explorer.play.hydration.cloud/graphql
VITE_GRAFANA_URL=https://grafana-api.play.hydration.cloud/api/ds/query
VITE_GRAFANA_DSN=5
VITE_USD_PEGGED_ASSET_NAME=USDT
VITE_USD_PEGGED_ASSET_ID=19
VITE_FF_XCM_ENABLED=true
VITE_ENV=rococo
VITE_WC_PROJECT_ID=8acb5f70a756a0a3bea40322364949c1
VITE_BSX_CAIP_ID=polkadot:a85cfb9b9fd4d622a5b28289a02347af
VITE_GRAFANA_URL=https://grafana-api.play.hydration.cloud/api/ds/query
VITE_GRAFANA_DSN=11
3 changes: 2 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
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_GRAFANA_URL=https://grafana-api.play.hydration.cloud/api/ds/query
VITE_GRAFANA_DSN=5
VITE_USD_PEGGED_ASSET_NAME=USDT
VITE_USD_PEGGED_ASSET_ID=14
VITE_FF_XCM_ENABLED=true
VITE_ENV=production

VITE_WC_PROJECT_ID=8acb5f70a756a0a3bea40322364949c1
VITE_BSX_CAIP_ID=polkadot:a85cfb9b9fd4d622a5b28289a02347af
2 changes: 2 additions & 0 deletions .env.rococo
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
VITE_PROVIDER_URL=wss://basilisk-rococo-rpc.play.hydration.cloud
VITE_DOMAIN_URL=https://rococo-app.basilisk.cloud
VITE_INDEXER_URL=https://basilisk-rococo-explorer.play.hydration.cloud/graphql
VITE_GRAFANA_URL=https://grafana-api.play.hydration.cloud/api/ds/query
VITE_GRAFANA_DSN=5
VITE_USD_PEGGED_ASSET_NAME=USDT
VITE_USD_PEGGED_ASSET_ID=19
VITE_FF_XCM_ENABLED=false
Expand Down
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@galacticcouncil/api-augment": "^0.0.3",
"@galacticcouncil/apps": "1.4.3-1",
"@galacticcouncil/bridge": "0.0.16",
"@galacticcouncil/apps": "3.3.3",
"@galacticcouncil/math-lbp": "^0.1.3",
"@galacticcouncil/math-liquidity-mining": "^0.1.3",
"@galacticcouncil/math-xyk": "^0.1.3",
"@galacticcouncil/sdk": "0.3.1",
"@galacticcouncil/ui": "^1.2.12",
"@galacticcouncil/sdk": "^1.1.11",
"@galacticcouncil/ui": "^3.1.2",
"@galacticcouncil/xcm-cfg": "^1.10.4",
"@galacticcouncil/xcm-sdk": "^2.3.1",
"@lit-labs/react": "^1.1.0",
"@polkadot/api": "10.9.1",
"@polkadot/apps-config": "^0.132.1",
"@polkadot/extension-inject": "^0.44.5",
"@polkadot/ui-shared": "^3.1.4",
"@radix-ui/react-dialog": "^1.0.0",
Expand All @@ -45,7 +47,7 @@
"@radix-ui/react-slider": "^1.0.0",
"@radix-ui/react-switch": "^1.0.0",
"@radix-ui/react-toast": "^1.0.0",
"@radix-ui/react-tooltip": "^1.0.2",
"@radix-ui/react-tooltip": "^1.0.7",
"@sentry/react": "^7.16.0",
"@sentry/tracing": "^7.16.0",
"@talismn/connect-wallets": "^1.2.1",
Expand Down Expand Up @@ -81,7 +83,7 @@
"react-remove-scroll": "^2.5.5",
"react-use": "^17.4.0",
"recharts": "^2.1.13",
"typescript": "^4.7.4",
"typescript": "^5.4.2",
"uuid": "^9.0.0",
"vite-plugin-wasm": "^2.1.0",
"web-vitals": "^2.1.4",
Expand All @@ -90,6 +92,8 @@
},
"scripts": {
"dev": "vite",
"dev:rococo": "vite -m rococo",
"dev:production": "vite -m production",
"build": "vite build && cp ./build/index.html ./build/404.html",
"preview": "vite preview",
"postinstall": "patch-package",
Expand Down
22 changes: 0 additions & 22 deletions patches/@acala-network+types+5.1.1.patch

This file was deleted.

4 changes: 2 additions & 2 deletions src/api/accountBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface PalletBalancesAccountDataCustom extends PalletBalancesAccountData {
}

export const useAccountBalances = (id: Maybe<AccountId32 | string>) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(
QUERY_KEYS.accountBalances(id),
!!id ? getAccountBalances(api, id) : undefinedNoop,
Expand Down Expand Up @@ -104,7 +104,7 @@ const getTokenAccountBalancesList =
export const useTokenAccountBalancesList = (
pairs: Array<[address: AccountId32 | string, assetId: u32 | string]>,
) => {
const api = useApiPromise()
const { api } = useApiPromise()

return useQuery(
QUERY_KEYS.tokenAccountBalancesList(pairs),
Expand Down
4 changes: 2 additions & 2 deletions src/api/addLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ interface AddLiquidityAsset {
}

export function useAddLiquidityPaymentInfo(assetA: string, assetB: string) {
const api = useApiPromise()
const { api } = useApiPromise()
return usePaymentInfo(api.tx.xyk.addLiquidity(assetA, assetB, "0", "0"))
}

export function useAddLiquidityMutation(onClose: () => void) {
const api = useApiPromise()
const { api } = useApiPromise()
const { createTransaction } = useStore()
const { account } = useAccountStore()

Expand Down
4 changes: 2 additions & 2 deletions src/api/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getAssetLogo } from "components/AssetIcon/AssetIcon"
import { u32 } from "@polkadot/types"
import { Maybe, useQueryReduce, useQuerySelect } from "utils/helpers"
import { TradeRouter } from "@galacticcouncil/sdk"
import { useTradeRouter } from "utils/api"
import { useApiPromise } from "utils/api"
import { useQuery } from "@tanstack/react-query"
import { QUERY_KEYS } from "utils/queryKeys"

Expand Down Expand Up @@ -34,7 +34,7 @@ export const useUsdPeggedAsset = () => {
}

export const useTradeAssets = () => {
const tradeRouter = useTradeRouter()
const { tradeRouter } = useApiPromise()
return useQuery(QUERY_KEYS.tradeAssets, getTradeAssets(tradeRouter))
}

Expand Down
4 changes: 2 additions & 2 deletions src/api/assetDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { PalletAssetRegistryAssetType } from "@polkadot/types/lookup"
import { BN_0 } from "utils/constants"

export const useAssetDetails = (id: Maybe<u32 | string>) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(QUERY_KEYS.assets, getAssetDetails(api), {
select: (data) => data.find((i) => i.id === id?.toString()),
})
Expand All @@ -26,7 +26,7 @@ export const useAssetDetailsList = (
assetType: ["Token"],
},
) => {
const api = useApiPromise()
const { api } = useApiPromise()

const normalizedIds = ids?.filter(isNotNil).map(normalizeId)

Expand Down
4 changes: 2 additions & 2 deletions src/api/assetMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { u32, u8 } from "@polkadot/types"
import { Maybe } from "utils/helpers"

export const useAssetMeta = (id: Maybe<u32 | string>) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(QUERY_KEYS.assetsMeta, getAllAssetMeta(api), {
select: (data) => data.find((i) => i.id === id?.toString()),
})
}

export const useAssetMetaList = (ids: Array<Maybe<u32 | string>>) => {
const api = useApiPromise()
const { api } = useApiPromise()

const normalizedIds = ids
.filter((x): x is u32 | string => !!x)
Expand Down
8 changes: 4 additions & 4 deletions src/api/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const useTokenBalance = (
id: Maybe<string | u32>,
address: Maybe<AccountId32 | string>,
) => {
const api = useApiPromise()
const { api } = useApiPromise()

return useQuery(
QUERY_KEYS.tokenBalance(id, address),
Expand All @@ -80,7 +80,7 @@ export function useTokensBalances(
tokenIds: (string | u32)[],
address: Maybe<AccountId32 | string>,
) {
const api = useApiPromise()
const { api } = useApiPromise()

return useQueries({
queries: tokenIds.map((id) => ({
Expand All @@ -97,15 +97,15 @@ const getExistentialDeposit = (api: ApiPromise) => {
}

export function useExistentialDeposit() {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(QUERY_KEYS.existentialDeposit, async () => {
const existentialDeposit = await getExistentialDeposit(api)
return existentialDeposit.toBigNumber()
})
}

export const useTokensLocks = (ids: Maybe<u32 | string>[]) => {
const api = useApiPromise()
const { api } = useApiPromise()
const { account } = useAccountStore()

const normalizedIds = ids?.reduce<string[]>((memo, item) => {
Expand Down
6 changes: 3 additions & 3 deletions src/api/bestTrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { TradeRouter } from "@galacticcouncil/sdk"
import BigNumber from "bignumber.js"
import { useQuery } from "@tanstack/react-query"
import { QUERY_KEYS } from "utils/queryKeys"
import { useTradeRouter } from "utils/api"
import { useApiPromise } from "utils/api"

export const useBestBuy = (props: BestTradeProps) => {
const tradeRouter = useTradeRouter()
const { tradeRouter } = useApiPromise()

return useQuery(QUERY_KEYS.bestBuy(props), getBestBuy(tradeRouter, props))
}

export const useBestSell = (props: BestTradeProps) => {
const tradeRouter = useTradeRouter()
const { tradeRouter } = useApiPromise()

return useQuery(QUERY_KEYS.bestSell(props), getBestSell(tradeRouter, props))
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useApiPromise } from "utils/api"
import { QUERY_KEYS } from "utils/queryKeys"

export const useBestNumber = (disable?: boolean) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(
QUERY_KEYS.bestNumber,
async () => {
Expand Down
8 changes: 4 additions & 4 deletions src/api/deposits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export type DepositNftType = Awaited<
>[number]

export const useDeposits = (poolId?: string) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(QUERY_KEYS.deposits(poolId), getDeposits(api, poolId))
}

export const useAllDeposits = (poolIds?: string[]) => {
const api = useApiPromise()
const { api } = useApiPromise()
const ids = poolIds?.filter((id): id is string => !!id) ?? []

return useQueries({
Expand All @@ -29,7 +29,7 @@ export const useAllDeposits = (poolIds?: string[]) => {
}

export const useDeposit = (id: Maybe<u128>) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(
QUERY_KEYS.deposit(id),
id != null ? getDeposit(api, id) : undefinedNoop,
Expand All @@ -40,7 +40,7 @@ export const useDeposit = (id: Maybe<u128>) => {
export const useAccountDepositIds = (
accountId: Maybe<AccountId32 | string>,
) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(
QUERY_KEYS.accountDepositIds(accountId),
accountId != null ? getAccountDepositIds(api, accountId) : undefinedNoop,
Expand Down
2 changes: 1 addition & 1 deletion src/api/exchangeFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import BN from "bignumber.js"
import { TRADING_FEE } from "utils/constants"

export const useExchangeFee = () => {
const api = useApiPromise()
const { api } = useApiPromise()

return useQuery(QUERY_KEYS.exchangeFee, getExchangeFee(api))
}
Expand Down
12 changes: 6 additions & 6 deletions src/api/farms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { isNotNil, useQueryReduce } from "utils/helpers"
import { QUERY_KEYS } from "utils/queryKeys"

export const useYieldFarms = (ids: FarmIds[]) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(QUERY_KEYS.yieldFarms(ids), getYieldFarms(api, ids))
}

Expand All @@ -16,14 +16,14 @@ export const useYieldFarm = (ids: {
globalFarmId: u32 | string
yieldFarmId: u32 | string
}) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(QUERY_KEYS.yieldFarm(ids), getYieldFarm(api, ids), {
enabled: !!ids,
})
}

export const useActiveYieldFarms = (poolIds: (AccountId32 | string)[]) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQueries({
queries: poolIds.map((poolId) => ({
queryKey: QUERY_KEYS.activeYieldFarms(poolId),
Expand All @@ -33,19 +33,19 @@ export const useActiveYieldFarms = (poolIds: (AccountId32 | string)[]) => {
}

export const useGlobalFarms = (ids: u32[]) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(QUERY_KEYS.globalFarms(ids), getGlobalFarms(api, ids), {
enabled: !!ids.length,
})
}

export const useGlobalFarm = (id: u32) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(QUERY_KEYS.globalFarm(id), getGlobalFarm(api, id))
}

export const useInactiveYieldFarms = (poolIds: (AccountId32 | string)[]) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQueries({
queries: poolIds.map((poolId) => ({
queryKey: QUERY_KEYS.inactiveYieldFarms(poolId),
Expand Down
6 changes: 3 additions & 3 deletions src/api/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const getAcceptedCurrency = (api: ApiPromise, id: u32 | string) => async () => {
}

export const useAcceptedCurrencies = (ids: Maybe<string | u32>[]) => {
const api = useApiPromise()
const { api } = useApiPromise()

return useQueries({
queries: ids.map((id) => ({
Expand All @@ -34,7 +34,7 @@ export const useAcceptedCurrencies = (ids: Maybe<string | u32>[]) => {
}

export const useSetAsFeePayment = () => {
const api = useApiPromise()
const { api } = useApiPromise()
const { account } = useAccountStore()
const { createTransaction } = useStore()
const queryClient = useQueryClient()
Expand Down Expand Up @@ -75,7 +75,7 @@ const getAccountCurrency =
}

export const useAccountCurrency = (address: Maybe<string | AccountId32>) => {
const api = useApiPromise()
const { api } = useApiPromise()
return useQuery(
QUERY_KEYS.accountCurrency(address),
!!address ? getAccountCurrency(api, address) : undefinedNoop,
Expand Down
Loading

0 comments on commit dc9afa2

Please sign in to comment.