diff --git a/package.json b/package.json index d884226b..0330a891 100644 --- a/package.json +++ b/package.json @@ -47,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", diff --git a/src/api/accountBalances.ts b/src/api/accountBalances.ts index d12549f7..0575f956 100644 --- a/src/api/accountBalances.ts +++ b/src/api/accountBalances.ts @@ -12,7 +12,7 @@ interface PalletBalancesAccountDataCustom extends PalletBalancesAccountData { } export const useAccountBalances = (id: Maybe) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.accountBalances(id), !!id ? getAccountBalances(api, id) : undefinedNoop, @@ -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), diff --git a/src/api/addLiquidity.ts b/src/api/addLiquidity.ts index 39e052a6..e67fc400 100644 --- a/src/api/addLiquidity.ts +++ b/src/api/addLiquidity.ts @@ -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() diff --git a/src/api/asset.ts b/src/api/asset.ts index 07de6b47..25958030 100644 --- a/src/api/asset.ts +++ b/src/api/asset.ts @@ -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" @@ -34,7 +34,7 @@ export const useUsdPeggedAsset = () => { } export const useTradeAssets = () => { - const tradeRouter = useTradeRouter() + const { tradeRouter } = useApiPromise() return useQuery(QUERY_KEYS.tradeAssets, getTradeAssets(tradeRouter)) } diff --git a/src/api/assetDetails.ts b/src/api/assetDetails.ts index 28d36a1c..be255c8a 100644 --- a/src/api/assetDetails.ts +++ b/src/api/assetDetails.ts @@ -10,7 +10,7 @@ import { PalletAssetRegistryAssetType } from "@polkadot/types/lookup" import { BN_0 } from "utils/constants" export const useAssetDetails = (id: Maybe) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery(QUERY_KEYS.assets, getAssetDetails(api), { select: (data) => data.find((i) => i.id === id?.toString()), }) @@ -26,7 +26,7 @@ export const useAssetDetailsList = ( assetType: ["Token"], }, ) => { - const api = useApiPromise() + const { api } = useApiPromise() const normalizedIds = ids?.filter(isNotNil).map(normalizeId) diff --git a/src/api/assetMeta.ts b/src/api/assetMeta.ts index 4f8e2037..ccbf1f4c 100644 --- a/src/api/assetMeta.ts +++ b/src/api/assetMeta.ts @@ -6,14 +6,14 @@ import { u32, u8 } from "@polkadot/types" import { Maybe } from "utils/helpers" export const useAssetMeta = (id: Maybe) => { - 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>) => { - const api = useApiPromise() + const { api } = useApiPromise() const normalizedIds = ids .filter((x): x is u32 | string => !!x) diff --git a/src/api/balances.ts b/src/api/balances.ts index 791448a1..82c713f1 100644 --- a/src/api/balances.ts +++ b/src/api/balances.ts @@ -65,7 +65,7 @@ export const useTokenBalance = ( id: Maybe, address: Maybe, ) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.tokenBalance(id, address), @@ -80,7 +80,7 @@ export function useTokensBalances( tokenIds: (string | u32)[], address: Maybe, ) { - const api = useApiPromise() + const { api } = useApiPromise() return useQueries({ queries: tokenIds.map((id) => ({ @@ -97,7 +97,7 @@ 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() @@ -105,7 +105,7 @@ export function useExistentialDeposit() { } export const useTokensLocks = (ids: Maybe[]) => { - const api = useApiPromise() + const { api } = useApiPromise() const { account } = useAccountStore() const normalizedIds = ids?.reduce((memo, item) => { diff --git a/src/api/bestTrade.ts b/src/api/bestTrade.ts index 8857d175..d11945e2 100644 --- a/src/api/bestTrade.ts +++ b/src/api/bestTrade.ts @@ -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)) } diff --git a/src/api/chain.ts b/src/api/chain.ts index cd862003..c1146068 100644 --- a/src/api/chain.ts +++ b/src/api/chain.ts @@ -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 () => { diff --git a/src/api/deposits.ts b/src/api/deposits.ts index 9210227e..ed0b93c4 100644 --- a/src/api/deposits.ts +++ b/src/api/deposits.ts @@ -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({ @@ -29,7 +29,7 @@ export const useAllDeposits = (poolIds?: string[]) => { } export const useDeposit = (id: Maybe) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.deposit(id), id != null ? getDeposit(api, id) : undefinedNoop, @@ -40,7 +40,7 @@ export const useDeposit = (id: Maybe) => { export const useAccountDepositIds = ( accountId: Maybe, ) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.accountDepositIds(accountId), accountId != null ? getAccountDepositIds(api, accountId) : undefinedNoop, diff --git a/src/api/exchangeFee.ts b/src/api/exchangeFee.ts index 224397fc..6554ccd4 100644 --- a/src/api/exchangeFee.ts +++ b/src/api/exchangeFee.ts @@ -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)) } diff --git a/src/api/farms.ts b/src/api/farms.ts index 7d900c19..ba78647f 100644 --- a/src/api/farms.ts +++ b/src/api/farms.ts @@ -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)) } @@ -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), @@ -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), diff --git a/src/api/payments.ts b/src/api/payments.ts index e3ca1528..5348e1e2 100644 --- a/src/api/payments.ts +++ b/src/api/payments.ts @@ -22,7 +22,7 @@ const getAcceptedCurrency = (api: ApiPromise, id: u32 | string) => async () => { } export const useAcceptedCurrencies = (ids: Maybe[]) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQueries({ queries: ids.map((id) => ({ @@ -34,7 +34,7 @@ export const useAcceptedCurrencies = (ids: Maybe[]) => { } export const useSetAsFeePayment = () => { - const api = useApiPromise() + const { api } = useApiPromise() const { account } = useAccountStore() const { createTransaction } = useStore() const queryClient = useQueryClient() @@ -75,7 +75,7 @@ const getAccountCurrency = } export const useAccountCurrency = (address: Maybe) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.accountCurrency(address), !!address ? getAccountCurrency(api, address) : undefinedNoop, diff --git a/src/api/pools.ts b/src/api/pools.ts index e56b8a9a..525b3613 100644 --- a/src/api/pools.ts +++ b/src/api/pools.ts @@ -1,6 +1,6 @@ import { useQueries, useQuery } from "@tanstack/react-query" import { QUERY_KEYS } from "utils/queryKeys" -import { useApiPromise, useTradeRouter } from "utils/api" +import { useApiPromise } from "utils/api" import { ApiPromise } from "@polkadot/api" import { PoolBase, TradeRouter } from "@galacticcouncil/sdk" import { AccountId32 } from "@polkadot/types/interfaces" @@ -12,12 +12,12 @@ import { useAccountStore } from "../state/store" import { useQueryReduce } from "utils/helpers" export const usePools = () => { - const tradeRouter = useTradeRouter() + const { tradeRouter } = useApiPromise() return useQuery(QUERY_KEYS.pools, getPools(tradeRouter)) } export const usePoolShareToken = (poolId: string) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.poolShareToken(poolId), @@ -59,7 +59,7 @@ export const usePoolsWithShareTokens = () => { } export const usePoolShareTokens = (poolIds: (string | AccountId32)[]) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQueries({ queries: poolIds.map((id) => ({ diff --git a/src/api/provider.ts b/src/api/provider.ts index 2c6fdbdc..901180d0 100644 --- a/src/api/provider.ts +++ b/src/api/provider.ts @@ -1,31 +1,23 @@ import { useQuery } from "@tanstack/react-query" import { QUERY_KEYS } from "utils/queryKeys" -import { ApiPromise, WsProvider } from "@polkadot/api" -//import * as definitions from "@galacticcouncil/api-augment/basilisk/interfaces/voting/definitions" -import * as definitions from "interfaces/voting/definitions" - +import { WsProvider } from "@polkadot/api" import { create } from "zustand" import { persist } from "zustand/middleware" +import { SubstrateApis } from "@galacticcouncil/xcm-sdk" +import { PoolService, PoolType, TradeRouter } from "@galacticcouncil/sdk" -const fetchApi = async (api: string) => { - const provider = await new Promise((resolve, reject) => { - const provider = new WsProvider(api) +const fetchApi = async (url: string) => { + const provider = new WsProvider(url) - provider.on("connected", () => { - resolve(provider) - }) + const apiPool = SubstrateApis.getInstance() + const api = await apiPool.api(provider.endpoint) - provider.on("error", () => { - provider.disconnect() - reject("disconnected") - }) + const poolService = new PoolService(api) + const tradeRouter = new TradeRouter(poolService, { + includeOnly: [PoolType.XYK], }) - const types = Object.values(definitions).reduce( - (res, { types }): object => ({ ...res, ...types }), - {}, - ) - return ApiPromise.create({ provider, types }) + return { api, tradeRouter } } export const useProvider = (rpcUrl?: string) => { diff --git a/src/api/spotPrice.ts b/src/api/spotPrice.ts index 7b699c3a..eaceec54 100644 --- a/src/api/spotPrice.ts +++ b/src/api/spotPrice.ts @@ -4,14 +4,14 @@ import { u32 } from "@polkadot/types" import { TradeRouter } from "@galacticcouncil/sdk" import { BN_1, BN_10, BN_NAN } from "utils/constants" import BN from "bignumber.js" -import { useTradeRouter } from "utils/api" +import { useApiPromise } from "utils/api" import { Maybe } from "utils/helpers" export const useSpotPrice = ( assetA: Maybe, assetB: Maybe, ) => { - const tradeRouter = useTradeRouter() + const { tradeRouter } = useApiPromise() const tokenIn = assetA?.toString() ?? "" const tokenOut = assetB?.toString() ?? "" @@ -26,7 +26,7 @@ export const useSpotPrices = ( assetsIn: Maybe[], assetOut: Maybe, ) => { - const tradeRouter = useTradeRouter() + const { tradeRouter } = useApiPromise() const assets = assetsIn .filter((a): a is u32 | string => !!a) diff --git a/src/api/timestamp.ts b/src/api/timestamp.ts index ad6fc659..06dc703e 100644 --- a/src/api/timestamp.ts +++ b/src/api/timestamp.ts @@ -10,7 +10,7 @@ export function useTimestamp( blockNumber?: Maybe, enabled = true, ) { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.timestamp(blockNumber), () => diff --git a/src/api/totalIssuance.ts b/src/api/totalIssuance.ts index 6a4facd1..4017103e 100644 --- a/src/api/totalIssuance.ts +++ b/src/api/totalIssuance.ts @@ -7,7 +7,7 @@ import { u32 } from "@polkadot/types" import { Maybe, undefinedNoop } from "utils/helpers" export const useTotalIssuance = (token: Maybe) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.totalIssuance(token), @@ -17,7 +17,7 @@ export const useTotalIssuance = (token: Maybe) => { } export const useTotalIssuances = (tokens: Maybe[]) => { - const api = useApiPromise() + const { api } = useApiPromise() const tokenIds = tokens.filter((token): token is u32 => !!token) diff --git a/src/api/totalLiquidity.ts b/src/api/totalLiquidity.ts index 9cafc8e2..9cf134ad 100644 --- a/src/api/totalLiquidity.ts +++ b/src/api/totalLiquidity.ts @@ -7,7 +7,7 @@ import { AccountId32 } from "@polkadot/types/interfaces/runtime" import { Maybe, undefinedNoop } from "utils/helpers" export const useTotalLiquidity = (id: Maybe) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.totalLiquidity(id), @@ -17,7 +17,7 @@ export const useTotalLiquidity = (id: Maybe) => { } export const useTotalLiquidities = (ids: AccountId32[]) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.totalLiquidities(ids.map((id) => id.toHuman())), diff --git a/src/api/transaction.ts b/src/api/transaction.ts index 5064a5c7..3a21b96a 100644 --- a/src/api/transaction.ts +++ b/src/api/transaction.ts @@ -25,7 +25,7 @@ export function usePaymentInfo(tx: SubmittableExtrinsic) { } export function useNextNonce(account: Maybe) { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.nextNonce(account), account != null @@ -64,7 +64,7 @@ export async function getTransactionLinkFromHash( } export function useTransactionLink() { - const api = useApiPromise() + const { api } = useApiPromise() return useMutation( async ({ blockHash, diff --git a/src/api/vesting.ts b/src/api/vesting.ts index 71fd5758..394ddbfc 100644 --- a/src/api/vesting.ts +++ b/src/api/vesting.ts @@ -14,7 +14,7 @@ import { getExpectedBlockDate } from "../utils/block" import { compareAsc } from "date-fns" export const useVestingSchedules = (address: Maybe) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.vestingSchedules(address), address != null ? getVestingSchedules(api, address) : undefinedNoop, @@ -23,7 +23,7 @@ export const useVestingSchedules = (address: Maybe) => { } export const useVestingLockBalance = (address: Maybe) => { - const api = useApiPromise() + const { api } = useApiPromise() return useQuery( QUERY_KEYS.vestingLockBalance(address), address != null ? getVestingLockBalance(api, address) : undefinedNoop, diff --git a/src/components/AppProviders/AppProviders.tsx b/src/components/AppProviders/AppProviders.tsx index ab02ed12..27ea59d1 100644 --- a/src/components/AppProviders/AppProviders.tsx +++ b/src/components/AppProviders/AppProviders.tsx @@ -18,7 +18,7 @@ export const AppProviders: FC = ({ children }) => { diff --git a/src/components/InvalidateOnBlock.tsx b/src/components/InvalidateOnBlock.tsx index ce2eda4d..b12a093f 100644 --- a/src/components/InvalidateOnBlock.tsx +++ b/src/components/InvalidateOnBlock.tsx @@ -1,15 +1,14 @@ import { useQueryClient } from "@tanstack/react-query" import { ReactNode, useEffect } from "react" import { useApiPromise } from "utils/api" -import { isApiLoaded } from "utils/helpers" import { QUERY_KEY_PREFIX } from "utils/queryKeys" export const InvalidateOnBlock = (props: { children: ReactNode }) => { - const api = useApiPromise() + const { api, isLoaded } = useApiPromise() const queryClient = useQueryClient() useEffect(() => { - if (isApiLoaded(api)) { + if (isLoaded) { let cancel: () => void api.rpc.chain @@ -20,7 +19,7 @@ export const InvalidateOnBlock = (props: { children: ReactNode }) => { return () => cancel?.() } - }, [api, queryClient]) + }, [api, queryClient, isLoaded]) return <>{props.children} } diff --git a/src/components/WarningMessage/WarningMessage.tsx b/src/components/WarningMessage/WarningMessage.tsx index 219a69a6..fe2b6a63 100644 --- a/src/components/WarningMessage/WarningMessage.tsx +++ b/src/components/WarningMessage/WarningMessage.tsx @@ -65,7 +65,7 @@ export const WarningMessage = (props: { -

{props.text}

+ {props.text} { - const api = useApiPromise() - if (!isApiLoaded(api)) + const { isLoaded } = useApiPromise() + if (!isLoaded) return ( { }, BN_0) ?? BN_0 const { createTransaction } = useStore() - const api = useApiPromise() + const { api } = useApiPromise() const [assetIn, assetOut] = props.pool.tokens const { account } = useAccountStore() diff --git a/src/sections/pools/farm/withdraw/PoolFarmWithdraw.tsx b/src/sections/pools/farm/withdraw/PoolFarmWithdraw.tsx index dd2206cf..ed317e18 100644 --- a/src/sections/pools/farm/withdraw/PoolFarmWithdraw.tsx +++ b/src/sections/pools/farm/withdraw/PoolFarmWithdraw.tsx @@ -13,7 +13,7 @@ export function PoolFarmWithdraw(props: { onClose: () => void }) { const { account } = useAccountStore() - const api = useApiPromise() + const { api } = useApiPromise() const userDeposits = useUserDeposits(props.pool.address) const deposits = props.depositNft ? [props.depositNft] : userDeposits.data diff --git a/src/sections/pools/header/claim/PoolsHeaderClaim.tsx b/src/sections/pools/header/claim/PoolsHeaderClaim.tsx index 10ac4ff5..0f959145 100644 --- a/src/sections/pools/header/claim/PoolsHeaderClaim.tsx +++ b/src/sections/pools/header/claim/PoolsHeaderClaim.tsx @@ -8,16 +8,15 @@ import { theme } from "theme" import { SButton, SContent, STrigger } from "./PoolsHeaderClaim.styled" import { PoolsHeaderClaimContent } from "./content/PoolsHeaderClaimContent" import { useApiPromise } from "utils/api" -import { isApiLoaded } from "utils/helpers" export const PoolsHeaderClaim = () => { const { t } = useTranslation() const { account } = useAccountStore() - const api = useApiPromise() + const { isLoaded } = useApiPromise() const [open, setOpen] = useState(false) const isDesktop = useMedia(theme.viewport.gte.sm) - if (!account || !isApiLoaded(api)) return null + if (!account || !isLoaded) return null return (
diff --git a/src/sections/pools/header/total/PoolsHeaderTotal.tsx b/src/sections/pools/header/total/PoolsHeaderTotal.tsx index e4e60d87..77b00080 100644 --- a/src/sections/pools/header/total/PoolsHeaderTotal.tsx +++ b/src/sections/pools/header/total/PoolsHeaderTotal.tsx @@ -7,7 +7,6 @@ import { useTotalInUsersDeposits, } from "utils/farms/deposits" import { PoolsHeaderTotalValue } from "../value/PoolsHeaderValue" -import { isApiLoaded } from "utils/helpers" import { useTotalVolumesInPools, useTotalVolumesInPoolsUser, @@ -18,8 +17,8 @@ import Skeleton from "react-loading-skeleton" type Props = { myPositions: boolean; variant: "pools" | "farms" | "volume" } export const PoolsHeaderTotal = ({ myPositions, variant }: Props) => { - const api = useApiPromise() - if (!isApiLoaded(api)) + const { isLoaded } = useApiPromise() + if (!isLoaded) return if (myPositions && variant === "pools") return diff --git a/src/sections/pools/pool/modals/removeLiquidity/PoolRemoveLiquidity.tsx b/src/sections/pools/pool/modals/removeLiquidity/PoolRemoveLiquidity.tsx index 26e0eb90..7c62f60a 100644 --- a/src/sections/pools/pool/modals/removeLiquidity/PoolRemoveLiquidity.tsx +++ b/src/sections/pools/pool/modals/removeLiquidity/PoolRemoveLiquidity.tsx @@ -101,7 +101,7 @@ export const PoolRemoveLiquidity: FC = ({ isOpen, onClose, pool }) => { const feeMeta = useAssetMeta(accountCurrency.data) const feeSpotPrice = useSpotPrice(NATIVE_ASSET_ID, feeMeta.data?.id) - const api = useApiPromise() + const { api } = useApiPromise() const shareToken = usePoolShareToken(pool.address) const shareTokenBalance = useTokenBalance( diff --git a/src/sections/provider/ProviderSelectModal.tsx b/src/sections/provider/ProviderSelectModal.tsx index f98b95c8..ccdd7afc 100644 --- a/src/sections/provider/ProviderSelectModal.tsx +++ b/src/sections/provider/ProviderSelectModal.tsx @@ -4,17 +4,16 @@ import { Modal } from "components/Modal/Modal" import { Fragment, useState } from "react" import { useTranslation } from "react-i18next" import { SContainer, SHeader } from "./ProviderSelectModal.styled" - import { ProviderItem } from "./components/ProviderItem/ProviderItem" import { useRpcStore } from "state/store" import { Controller, useForm } from "react-hook-form" import { useMutation } from "@tanstack/react-query" import { FormValues } from "utils/helpers" import { connectWsProvider } from "./ProviderSelectModal.utils" -import { ApiPromise } from "@polkadot/api" import { ProviderInput } from "./components/ProviderInput/ProviderInput" import { Separator } from "components/Separator/Separator" import { DeleteModal } from "./components/DeleteModal/DeleteModal" +import { SubstrateApis } from "@galacticcouncil/xcm-sdk" export function ProviderSelectModal(props: { open: boolean @@ -36,9 +35,8 @@ export function ProviderSelectModal(props: { try { const provider = await connectWsProvider(value.address) - const api = await ApiPromise.create({ - provider, - }) + const apiPool = SubstrateApis.getInstance() + const api = await apiPool.api(provider.endpoint) const relay = await api.query.parachainSystem.validationData() const relayParentNumber = relay.unwrap().relayParentNumber diff --git a/src/sections/provider/components/ProviderItem/ProviderItem.tsx b/src/sections/provider/components/ProviderItem/ProviderItem.tsx index 59449ebf..343b1827 100644 --- a/src/sections/provider/components/ProviderItem/ProviderItem.tsx +++ b/src/sections/provider/components/ProviderItem/ProviderItem.tsx @@ -10,9 +10,9 @@ import { useBestNumber } from "api/chain" import { ProviderStatus } from "sections/provider/ProviderStatus" import { useEffect, useState } from "react" import { WsProvider } from "@polkadot/rpc-provider" -import { ApiPromise } from "@polkadot/api" import { u32, u64 } from "@polkadot/types" import { ProviderItemEdit } from "../ProviderItemEdit/ProviderItemEdit" +import { SubstrateApis } from "@galacticcouncil/xcm-sdk" const ProviderItemExternal = (props: { url: string; className?: string }) => { const [bestNumberState, setBestNumberState] = useState< @@ -26,7 +26,8 @@ const ProviderItemExternal = (props: { url: string; className?: string }) => { let cancel: () => void async function load() { - const api = await ApiPromise.create({ provider }) + const apiPool = SubstrateApis.getInstance() + const api = await apiPool.api(provider.endpoint) async function onNewBlock() { const [parachain, timestamp] = await Promise.all([ diff --git a/src/sections/provider/components/ProviderSelectButton/ProviderSelectButton.tsx b/src/sections/provider/components/ProviderSelectButton/ProviderSelectButton.tsx index 9db749ff..c8b6da99 100644 --- a/src/sections/provider/components/ProviderSelectButton/ProviderSelectButton.tsx +++ b/src/sections/provider/components/ProviderSelectButton/ProviderSelectButton.tsx @@ -9,7 +9,6 @@ import { ProviderStatus } from "sections/provider/ProviderStatus" import { SButton, SName } from "./ProviderSelectButton.styled" import { useRpcStore } from "state/store" import { useApiPromise } from "utils/api" -import { isApiLoaded } from "utils/helpers" import { useTranslation } from "react-i18next" export const ProviderSelectButton = () => { @@ -18,14 +17,13 @@ export const ProviderSelectButton = () => { const store = useProviderRpcUrlStore() const { rpcList } = useRpcStore() - const api = useApiPromise() - const isApi = isApiLoaded(api) + const { isLoaded, isError } = useApiPromise() const rpcUrl = store.rpcUrl ?? import.meta.env.VITE_PROVIDER_URL const selectedProviderName = rpcList.find((provider) => provider.url === rpcUrl)?.name ?? PROVIDERS.find((provider) => provider.url === rpcUrl)?.name - const number = useBestNumber(!isApi) + const number = useBestNumber(!isLoaded) return ( <> @@ -37,7 +35,7 @@ export const ProviderSelectButton = () => { > { transition={{ duration: 0.15, ease: "easeInOut" }} > - {api.isError ? t("rpc.error") : selectedProviderName} + {isError ? t("rpc.error") : selectedProviderName} ) { export class UnknownTransactionState extends Error {} export const useSendTransactionMutation = () => { - const api = useApiPromise() + const { api } = useApiPromise() const isMounted = useMountedState() const link = useTransactionLink() const [txState, setTxState] = useState(null) diff --git a/src/sections/wallet/assets/WalletAssets.tsx b/src/sections/wallet/assets/WalletAssets.tsx index 416330d3..8e28b702 100644 --- a/src/sections/wallet/assets/WalletAssets.tsx +++ b/src/sections/wallet/assets/WalletAssets.tsx @@ -12,7 +12,6 @@ import { WalletAssetsHeaderValue, } from "./WalletAssetsHeader" import { useApiPromise } from "utils/api" -import { isApiLoaded } from "utils/helpers" import { WalletFarmingPositionsSkeleton } from "./table/skeleton/WalletFarmingPositionsSkeleton" import { Separator } from "components/Separator/Separator" import { theme } from "theme" @@ -20,10 +19,10 @@ import { useTranslation } from "react-i18next" import { useFarmingPositionsData } from "./farmingPositions/WalletFarmingPositions.utils" export const WalletAssets = () => { - const api = useApiPromise() + const { isLoaded } = useApiPromise() const { t } = useTranslation() - if (!isApiLoaded(api)) + if (!isLoaded) return (
void }) => { - const api = useApiPromise() + const { api } = useApiPromise() const { account, setAccount } = useAccountStore() const isBasiliskAddress = address[0] === "b" const basiliskAddress = isBasiliskAddress diff --git a/src/sections/wallet/connect/modal/ExternalWalletConnectModal.tsx b/src/sections/wallet/connect/modal/ExternalWalletConnectModal.tsx index 28ddc69e..cda2f295 100644 --- a/src/sections/wallet/connect/modal/ExternalWalletConnectModal.tsx +++ b/src/sections/wallet/connect/modal/ExternalWalletConnectModal.tsx @@ -31,7 +31,7 @@ export const ExternalWalletConnectModal = ({ onBack, onClose, }: ExternalWalletConnectModalProps) => { - const api = useApiPromise() + const { api } = useApiPromise() const { t } = useTranslation() const { setAccount } = useAccountStore() const navigate = useNavigate() diff --git a/src/sections/wallet/transfer/liquidityPositions/WalletTransferSectionLiquidityPositions.tsx b/src/sections/wallet/transfer/liquidityPositions/WalletTransferSectionLiquidityPositions.tsx index 02c9023c..d55cfa7b 100644 --- a/src/sections/wallet/transfer/liquidityPositions/WalletTransferSectionLiquidityPositions.tsx +++ b/src/sections/wallet/transfer/liquidityPositions/WalletTransferSectionLiquidityPositions.tsx @@ -27,7 +27,7 @@ export function WalletTransferSectionLiquidityPositions(props: { (i) => i.address.toString() === props.poolAddress.toString(), ) - const api = useApiPromise() + const { api } = useApiPromise() const { createTransaction } = useStore() const { account } = useAccountStore() diff --git a/src/sections/wallet/transfer/onchain/WalletTransferSectionOnchain.tsx b/src/sections/wallet/transfer/onchain/WalletTransferSectionOnchain.tsx index 0c3ee237..1962a633 100644 --- a/src/sections/wallet/transfer/onchain/WalletTransferSectionOnchain.tsx +++ b/src/sections/wallet/transfer/onchain/WalletTransferSectionOnchain.tsx @@ -35,7 +35,7 @@ export const WalletTransferSectionOnchain = (props: Props) => { const { t } = useTranslation() const [asset, setAsset] = useState(props.initialAsset) - const api = useApiPromise() + const { api } = useApiPromise() const { createTransaction } = useStore() const { account } = useAccountStore() diff --git a/src/sections/wallet/upgrade/WalletUpgradeModal.utils.ts b/src/sections/wallet/upgrade/WalletUpgradeModal.utils.ts index 67b49851..73cf764f 100644 --- a/src/sections/wallet/upgrade/WalletUpgradeModal.utils.ts +++ b/src/sections/wallet/upgrade/WalletUpgradeModal.utils.ts @@ -32,7 +32,7 @@ function getChainMetadata(api: ApiPromise) { export const useUpdateMetadataMutation = () => { const { account } = useAccountStore() - const api = useApiPromise() + const { api } = useApiPromise() const cache = useCacheApiMetadataStore() diff --git a/src/sections/wallet/vesting/WalletVesting.tsx b/src/sections/wallet/vesting/WalletVesting.tsx index e60f6257..38f95080 100644 --- a/src/sections/wallet/vesting/WalletVesting.tsx +++ b/src/sections/wallet/vesting/WalletVesting.tsx @@ -1,7 +1,6 @@ import { WalletVestingHeader } from "./WalletVestingHeader" import { WalletVestingBox } from "./WalletVestingBox" import { useApiPromise } from "utils/api" -import { isApiLoaded } from "utils/helpers" import { Text } from "components/Typography/Text/Text" import { useTranslation } from "react-i18next" import Skeleton from "react-loading-skeleton" @@ -11,9 +10,9 @@ import { WalletVestingEmpty } from "./WalletVestingEmpty" export const WalletVesting = () => { const { t } = useTranslation() - const api = useApiPromise() + const { isLoaded } = useApiPromise() - if (!isApiLoaded(api)) + if (!isLoaded) return (
{ const { t } = useTranslation() - const api = useApiPromise() + const { api } = useApiPromise() const { createTransaction } = useStore() const { account } = useAccountStore() const meta = useAssetMeta(NATIVE_ASSET_ID) diff --git a/src/utils/api.ts b/src/utils/api.ts index cd306e50..993a9f0d 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -1,30 +1,19 @@ import { ApiPromise } from "@polkadot/api" -import { createContext, useContext, useMemo } from "react" -import { PoolService, PoolType, TradeRouter } from "@galacticcouncil/sdk" +import { createContext, useContext } from "react" +import { TradeRouter } from "@galacticcouncil/sdk" export const BASILISK_ADDRESS_PREFIX = 10041 export const NATIVE_ASSET_ID = "0" export const DEPOSIT_CLASS_ID = "1" // TODO: replace with constant from api export const POLKADOT_APP_NAME = "Basilisk Web App" -export type TApiPromiseCustom = ApiPromise & { isError?: boolean } +export type TApiPromiseCustom = { + api: ApiPromise + tradeRouter: TradeRouter + isLoaded: boolean +} & { isError?: boolean } -export const ApiPromiseContext = createContext( - {} as TApiPromiseCustom, -) +export const ApiPromiseContext = createContext({ + isLoaded: false, +} as TApiPromiseCustom) export const useApiPromise = () => useContext(ApiPromiseContext) - -export const useTradeRouter = () => { - const api = useApiPromise() - - const router = useMemo(() => { - const poolService = new PoolService(api) - const tradeRouter = new TradeRouter(poolService, { - includeOnly: [PoolType.XYK], - }) - - return tradeRouter - }, [api]) - - return router -} diff --git a/src/utils/farms/claiming.ts b/src/utils/farms/claiming.ts index fca4503b..b2a1e9ca 100644 --- a/src/utils/farms/claiming.ts +++ b/src/utils/farms/claiming.ts @@ -55,7 +55,7 @@ export const useClaimableAmount = ( const usd = useUsdPeggedAsset() - const api = useApiPromise() + const { api } = useApiPromise() const accountResolver = getAccountResolver(api.registry) const assetIds = [ @@ -167,7 +167,7 @@ export const useClaimAllMutation = ( toast?: ToastMessage, onClose?: () => void, ) => { - const api = useApiPromise() + const { api } = useApiPromise() const { createTransaction } = useStore() const userDeposits = useAllUserDeposits() diff --git a/src/utils/farms/redeposit.ts b/src/utils/farms/redeposit.ts index b3ba50ac..0160746b 100644 --- a/src/utils/farms/redeposit.ts +++ b/src/utils/farms/redeposit.ts @@ -11,7 +11,7 @@ export const useRedepositMutation = ( depositNfts: DepositNftType[], onClose?: () => void, ) => { - const api = useApiPromise() + const { api } = useApiPromise() const [assetIn, assetOut] = pool.tokens const { createTransaction } = useStore() diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 146a854d..f67a2924 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -5,7 +5,6 @@ import { useEffect, useState } from "react" import { UseFormReturn } from "react-hook-form" import { u32 } from "@polkadot/types-codec" -import { TApiPromiseCustom } from "./api" export const noop = () => {} export const undefinedNoop = () => undefined @@ -164,6 +163,3 @@ export function useQueryReduce( return trackedItem } - -export const isApiLoaded = (api: TApiPromiseCustom) => - Object.keys(api).length > 1 diff --git a/yarn.lock b/yarn.lock index 578aa6af..fb325468 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1496,7 +1496,7 @@ dependencies: "@floating-ui/core" "^0.7.3" -"@floating-ui/dom@^1.5.1": +"@floating-ui/dom@^1.5.1", "@floating-ui/dom@^1.6.1": version "1.6.3" resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.3.tgz#954e46c1dd3ad48e49db9ada7218b0985cee75ef" integrity sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw== @@ -1512,6 +1512,13 @@ "@floating-ui/dom" "^0.5.3" use-isomorphic-layout-effect "^1.1.1" +"@floating-ui/react-dom@^2.0.0": + version "2.0.8" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.0.8.tgz#afc24f9756d1b433e1fe0d047c24bd4d9cefaa5d" + integrity sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw== + dependencies: + "@floating-ui/dom" "^1.6.1" + "@floating-ui/utils@^0.2.0", "@floating-ui/utils@^0.2.1": version "0.2.1" resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.1.tgz#16308cea045f0fc777b6ff20a9f25474dd8293d2" @@ -2545,6 +2552,13 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/primitive@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.0.1.tgz#e46f9958b35d10e9f6dc71c497305c22e3e55dbd" + integrity sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-arrow@1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-arrow/-/react-arrow-1.0.2.tgz#93b0ff95f65e2264a05b14ef1031ec798243dd6f" @@ -2553,6 +2567,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-primitive" "1.0.2" +"@radix-ui/react-arrow@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-arrow/-/react-arrow-1.0.3.tgz#c24f7968996ed934d57fe6cde5d6ec7266e1d25d" + integrity sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-collection@1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-collection/-/react-collection-1.0.2.tgz#d50da00bfa2ac14585319efdbbb081d4c5a29a97" @@ -2571,6 +2593,13 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-compose-refs@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.1.tgz#7ed868b66946aa6030e580b1ffca386dd4d21989" + integrity sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-context@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.0.0.tgz#f38e30c5859a9fb5e9aa9a9da452ee3ed9e0aee0" @@ -2578,6 +2607,13 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-context@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.0.1.tgz#fe46e67c96b240de59187dcb7a1a50ce3e2ec00c" + integrity sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-dialog@^1.0.0": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.0.3.tgz#a715bf30f35fcd80476c0a07fcc073c1968e6d3e" @@ -2618,6 +2654,18 @@ "@radix-ui/react-use-callback-ref" "1.0.0" "@radix-ui/react-use-escape-keydown" "1.0.2" +"@radix-ui/react-dismissable-layer@1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz#3f98425b82b9068dfbab5db5fff3df6ebf48b9d4" + integrity sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-escape-keydown" "1.0.3" + "@radix-ui/react-dropdown-menu@^2.0.1": version "2.0.4" resolved "https://registry.yarnpkg.com/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.0.4.tgz#237909fb94622a4900b03fbbf75dd394f1ca6273" @@ -2657,6 +2705,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-use-layout-effect" "1.0.0" +"@radix-ui/react-id@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-id/-/react-id-1.0.1.tgz#73cdc181f650e4df24f0b6a5b7aa426b912c88c0" + integrity sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-layout-effect" "1.0.1" + "@radix-ui/react-label@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-label/-/react-label-1.0.0.tgz#c6691b0bec18958512a952c18732279285b61fef" @@ -2710,6 +2766,23 @@ "@radix-ui/react-use-size" "1.0.0" "@radix-ui/rect" "1.0.0" +"@radix-ui/react-popper@1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-popper/-/react-popper-1.1.3.tgz#24c03f527e7ac348fabf18c89795d85d21b00b42" + integrity sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w== + dependencies: + "@babel/runtime" "^7.13.10" + "@floating-ui/react-dom" "^2.0.0" + "@radix-ui/react-arrow" "1.0.3" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-layout-effect" "1.0.1" + "@radix-ui/react-use-rect" "1.0.1" + "@radix-ui/react-use-size" "1.0.1" + "@radix-ui/rect" "1.0.1" + "@radix-ui/react-portal@1.0.2", "@radix-ui/react-portal@^1.0.0": version "1.0.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-1.0.2.tgz#102370b1027a767a371cab0243be4bc664f72330" @@ -2718,6 +2791,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-primitive" "1.0.2" +"@radix-ui/react-portal@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-1.0.4.tgz#df4bfd353db3b1e84e639e9c63a5f2565fb00e15" + integrity sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-presence@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-presence/-/react-presence-1.0.0.tgz#814fe46df11f9a468808a6010e3f3ca7e0b2e84a" @@ -2727,6 +2808,15 @@ "@radix-ui/react-compose-refs" "1.0.0" "@radix-ui/react-use-layout-effect" "1.0.0" +"@radix-ui/react-presence@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-presence/-/react-presence-1.0.1.tgz#491990ba913b8e2a5db1b06b203cb24b5cdef9ba" + integrity sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-use-layout-effect" "1.0.1" + "@radix-ui/react-primitive@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-1.0.0.tgz#376cd72b0fcd5e0e04d252ed33eb1b1f025af2b0" @@ -2743,6 +2833,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-slot" "1.0.1" +"@radix-ui/react-primitive@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-1.0.3.tgz#d49ea0f3f0b2fe3ab1cb5667eb03e8b843b914d0" + integrity sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-slot" "1.0.2" + "@radix-ui/react-roving-focus@1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-roving-focus/-/react-roving-focus-1.0.3.tgz#0b4f4f9bd509f4510079e9e0734a734fd17cdce3" @@ -2801,6 +2899,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-compose-refs" "1.0.0" +"@radix-ui/react-slot@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.0.2.tgz#a9ff4423eade67f501ffb32ec22064bc9d3099ab" + integrity sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-switch@^1.0.0": version "1.0.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-switch/-/react-switch-1.0.2.tgz#e3d1b9fe18b6b1173aadc8b8e6efdc96a28a70f8" @@ -2834,24 +2940,24 @@ "@radix-ui/react-use-layout-effect" "1.0.0" "@radix-ui/react-visually-hidden" "1.0.2" -"@radix-ui/react-tooltip@^1.0.2": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@radix-ui/react-tooltip/-/react-tooltip-1.0.5.tgz#fe20274aeac874db643717fc7761d5a8abdd62d1" - integrity sha512-cDKVcfzyO6PpckZekODJZDe5ZxZ2fCZlzKzTmPhe4mX9qTHRfLcKgqb0OKf22xLwDequ2tVleim+ZYx3rabD5w== +"@radix-ui/react-tooltip@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@radix-ui/react-tooltip/-/react-tooltip-1.0.7.tgz#8f55070f852e7e7450cc1d9210b793d2e5a7686e" + integrity sha512-lPh5iKNFVQ/jav/j6ZrWq3blfDJ0OH9R6FlNUHPMqdLuQ9vwDgFsRxvl8b7Asuy5c8xmoojHUxKHQSOAvMHxyw== dependencies: "@babel/runtime" "^7.13.10" - "@radix-ui/primitive" "1.0.0" - "@radix-ui/react-compose-refs" "1.0.0" - "@radix-ui/react-context" "1.0.0" - "@radix-ui/react-dismissable-layer" "1.0.3" - "@radix-ui/react-id" "1.0.0" - "@radix-ui/react-popper" "1.1.1" - "@radix-ui/react-portal" "1.0.2" - "@radix-ui/react-presence" "1.0.0" - "@radix-ui/react-primitive" "1.0.2" - "@radix-ui/react-slot" "1.0.1" - "@radix-ui/react-use-controllable-state" "1.0.0" - "@radix-ui/react-visually-hidden" "1.0.2" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-dismissable-layer" "1.0.5" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-popper" "1.1.3" + "@radix-ui/react-portal" "1.0.4" + "@radix-ui/react-presence" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-slot" "1.0.2" + "@radix-ui/react-use-controllable-state" "1.0.1" + "@radix-ui/react-visually-hidden" "1.0.3" "@radix-ui/react-use-callback-ref@1.0.0": version "1.0.0" @@ -2860,6 +2966,13 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-use-callback-ref@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.0.1.tgz#f4bb1f27f2023c984e6534317ebc411fc181107a" + integrity sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-controllable-state@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.0.0.tgz#a64deaafbbc52d5d407afaa22d493d687c538b7f" @@ -2868,6 +2981,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-use-callback-ref" "1.0.0" +"@radix-ui/react-use-controllable-state@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.0.1.tgz#ecd2ced34e6330caf89a82854aa2f77e07440286" + integrity sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-escape-keydown@1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.2.tgz#09ab6455ab240b4f0a61faf06d4e5132c4d639f6" @@ -2876,6 +2997,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-use-callback-ref" "1.0.0" +"@radix-ui/react-use-escape-keydown@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.3.tgz#217b840c250541609c66f67ed7bab2b733620755" + integrity sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-layout-effect@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.0.tgz#2fc19e97223a81de64cd3ba1dc42ceffd82374dc" @@ -2883,6 +3012,13 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-use-layout-effect@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.1.tgz#be8c7bc809b0c8934acf6657b577daf948a75399" + integrity sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-previous@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-previous/-/react-use-previous-1.0.0.tgz#e48a69c3a7d8078a967084038df66d0d181c56ac" @@ -2898,6 +3034,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/rect" "1.0.0" +"@radix-ui/react-use-rect@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-rect/-/react-use-rect-1.0.1.tgz#fde50b3bb9fd08f4a1cd204572e5943c244fcec2" + integrity sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/rect" "1.0.1" + "@radix-ui/react-use-size@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-size/-/react-use-size-1.0.0.tgz#a0b455ac826749419f6354dc733e2ca465054771" @@ -2906,6 +3050,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-use-layout-effect" "1.0.0" +"@radix-ui/react-use-size@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-size/-/react-use-size-1.0.1.tgz#1c5f5fea940a7d7ade77694bb98116fb49f870b2" + integrity sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-layout-effect" "1.0.1" + "@radix-ui/react-visually-hidden@1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.0.2.tgz#29b117a59ef09a984bdad12cb98d81e8350be450" @@ -2914,6 +3066,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-primitive" "1.0.2" +"@radix-ui/react-visually-hidden@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.0.3.tgz#51aed9dd0fe5abcad7dee2a234ad36106a6984ac" + integrity sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/rect@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.0.0.tgz#0dc8e6a829ea2828d53cbc94b81793ba6383bf3c" @@ -2921,6 +3081,13 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/rect@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.0.1.tgz#bf8e7d947671996da2e30f4904ece343bc4a883f" + integrity sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@rollup/pluginutils@^4.2.0": version "4.2.1" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d"