Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master to rococo #472

Merged
merged 55 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
1685162
Merge pull request #317 from galacticcouncil/master
jak-pan Feb 9, 2023
9a7e7cb
Merge pull request #319 from galacticcouncil/master
jak-pan Feb 9, 2023
6d85e8c
Merge pull request #322 from galacticcouncil/master
jak-pan Feb 9, 2023
9bb3352
Merge pull request #334 from galacticcouncil/master
jak-pan Feb 16, 2023
3e46fc8
Merge pull request #348 from galacticcouncil/master
jak-pan Mar 17, 2023
31d2e5e
Merge pull request #411 from galacticcouncil/rococo
nohaapav Apr 24, 2023
7852776
Merge pull request #414 from galacticcouncil/rococo
nohaapav Apr 24, 2023
de3edc7
Merge pull request #416 from galacticcouncil/rococo
jak-pan Apr 25, 2023
166aa05
Merge pull request #430 from galacticcouncil/rococo
nohaapav Jun 14, 2023
1b27403
Merge pull request #435 from galacticcouncil/rococo
nohaapav Jun 16, 2023
390a65d
Merge pull request #438 from galacticcouncil/rococo
vkulinich-cl Jun 22, 2023
0f894fb
Merge pull request #446 from galacticcouncil/rococo
vkulinich-cl Aug 24, 2023
9f064e5
Merge branch 'rococo' into production
mrq1911 Oct 16, 2023
e52c882
Merge pull request #450 from galacticcouncil/rococo
vkulinich-cl Nov 20, 2023
4cc5355
Merge pull request #453 from galacticcouncil/rococo
vkulinich-cl Jan 15, 2024
5d06eb4
Merge branch 'rococo' into production
mrq1911 Jan 18, 2024
447d832
Merge pull request #457 from galacticcouncil/rococo
vkulinich-cl Jan 25, 2024
50472cc
Merge pull request #460 from galacticcouncil/rococo
vkulinich-cl Jan 26, 2024
836bd22
FIx textation
vkulinich-cl Jan 26, 2024
ce386fb
Enable xcm
vkulinich-cl Feb 9, 2024
b8942e6
Fix basilisk & tinkernet xcm multiloc
nohaapav Feb 12, 2024
0c9e724
Merge pull request #461 from galacticcouncil/enable-xcm
nohaapav Feb 12, 2024
4611830
Merge pull request #462 from galacticcouncil/master
nohaapav Feb 13, 2024
4062659
Fix lint
vkulinich-cl Feb 13, 2024
1644a2d
Merge pull request #463 from galacticcouncil/fix-lint
vkulinich-cl Feb 13, 2024
9e0b8f2
Fix lint frozen
vkulinich-cl Feb 13, 2024
839b26e
wip
vkulinich-cl Feb 13, 2024
b701994
Fix lint warning
vkulinich-cl Feb 13, 2024
9a5b00d
Format code
vkulinich-cl Feb 13, 2024
810f6c7
Merge pull request #464 from galacticcouncil/fix-lint
vkulinich-cl Feb 13, 2024
5a2091b
Upgrade to newest stack
nohaapav Mar 12, 2024
e25e282
Fix xcm
nohaapav Mar 12, 2024
a545666
Merge pull request #465 from galacticcouncil/production
vkulinich-cl Mar 12, 2024
b6f6d4d
Merge branch 'master' into gc-apps
nohaapav Mar 12, 2024
16c64fe
Update typescript
vkulinich-cl Mar 12, 2024
779f403
Fix notif rendering
nohaapav Mar 12, 2024
489e600
Temp disable KSM Basilisk - Karura
nohaapav Mar 12, 2024
63dcf96
set ecosystem for xcm
nohaapav Mar 12, 2024
5f63a21
blacklist integritee
nohaapav Mar 12, 2024
fa4b3c8
Integritee support
nohaapav Mar 12, 2024
6355da3
fix integritee imports
nohaapav Mar 12, 2024
6c81587
Merge pull request #467 from galacticcouncil/gc-apps
nohaapav Mar 12, 2024
75379a6
Enable trade chart
nohaapav Mar 13, 2024
e37ab87
Rework RCP connect
vkulinich-cl Mar 13, 2024
cd09f9a
wip
vkulinich-cl Mar 13, 2024
1961447
setup grafana
nohaapav Mar 13, 2024
ba63d39
Bump apps to 3.3.3 (stribrnych strikacek)
nohaapav Mar 13, 2024
f5e8cfa
set kusama as assetIn
nohaapav Mar 13, 2024
b47020b
Merge pull request #469 from galacticcouncil/rpc-connect
nohaapav Mar 13, 2024
480f088
Merge branch 'master' into gc-apps
nohaapav Mar 13, 2024
2e1a789
Merge pull request #468 from galacticcouncil/gc-apps
nohaapav Mar 13, 2024
fe66f0e
Fix styling
nohaapav Mar 13, 2024
1402437
Merge pull request #470 from galacticcouncil/gc-apps
nohaapav Mar 13, 2024
ab3a340
Fix tooltip
vkulinich-cl Mar 13, 2024
11080b0
Merge pull request #471 from galacticcouncil/fix-tooltip
vkulinich-cl Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.3-1",
"@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.

22 changes: 15 additions & 7 deletions src/api/accountBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import { useQuery } from "@tanstack/react-query"
import { QUERY_KEYS } from "utils/queryKeys"
import { ApiPromise } from "@polkadot/api"
import { Maybe, undefinedNoop } from "utils/helpers"
import { u32 } from "@polkadot/types"
import { u32, u128 } from "@polkadot/types"
import { PalletBalancesAccountData } from "@polkadot/types/lookup"
import { BN } from "@polkadot/util"
interface PalletBalancesAccountDataCustom extends PalletBalancesAccountData {
frozen: u128
}

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 @@ -65,10 +69,14 @@ const getTokenAccountBalancesList =
const [, assetId] = pairs[idx]

if (assetId.toString() === NATIVE_ASSET_ID) {
let {data} = natives[nativeIdx]
const frozen = data.feeFrozen ? data.feeFrozen.add(
data.miscFrozen,
) : data.frozen
//@ts-ignore
let { data }: { data: PalletBalancesAccountDataCustom } =
natives[nativeIdx]

const frozen = data.feeFrozen
? data.feeFrozen.add(data.miscFrozen)
: data.frozen

values.push({
free: data.free,
reserved: data.reserved,
Expand Down Expand Up @@ -96,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
22 changes: 15 additions & 7 deletions src/api/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ export const getTokenBalance =
(api: ApiPromise, account: AccountId32 | string, id: string | u32) =>
async () => {
if (id.toString() === NATIVE_ASSET_ID) {
const res = await api.query.system.account(account)
const res = (await api.query.system.account(account)) as any
const freeBalance = new BigNumber(res.data.free.toHex())
const miscFrozenBalance = new BigNumber(res.data.miscFrozen ? res.data.miscFrozen.toHex() : res.data.frozen.toHex())
const feeFrozenBalance = new BigNumber(res.data.feeFrozen ? res.data.feeFrozen.toHex() : res.data.frozen.toHex())
const miscFrozenBalance = new BigNumber(
res.data.miscFrozen
? res.data.miscFrozen.toHex()
: res.data.frozen.toHex(),
)
const feeFrozenBalance = new BigNumber(
res.data.feeFrozen
? res.data.feeFrozen.toHex()
: res.data.frozen.toHex(),
)
const reservedBalance = new BigNumber(res.data.reserved.toHex())

const balance = new BigNumber(
Expand Down Expand Up @@ -57,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 @@ -72,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 @@ -89,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
Loading
Loading