diff --git a/packages/ui/.papi/descriptors/package.json b/packages/ui/.papi/descriptors/package.json index 0ef063a1..68962575 100644 --- a/packages/ui/.papi/descriptors/package.json +++ b/packages/ui/.papi/descriptors/package.json @@ -1,5 +1,5 @@ { - "version": "0.1.0-autogenerated.16048031132384038004", + "version": "0.1.0-autogenerated.5905160511643341821", "name": "@polkadot-api/descriptors", "files": [ "dist" diff --git a/packages/ui/.papi/metadata/bifrostDot.scale b/packages/ui/.papi/metadata/bifrostDot.scale index 9a6e81f0..049c77f4 100644 Binary files a/packages/ui/.papi/metadata/bifrostDot.scale and b/packages/ui/.papi/metadata/bifrostDot.scale differ diff --git a/packages/ui/.papi/metadata/coretimeDot.scale b/packages/ui/.papi/metadata/coretimeDot.scale new file mode 100644 index 00000000..ac14aae9 Binary files /dev/null and b/packages/ui/.papi/metadata/coretimeDot.scale differ diff --git a/packages/ui/.papi/metadata/hydration.scale b/packages/ui/.papi/metadata/hydration.scale index 85126702..ea8bc53f 100644 Binary files a/packages/ui/.papi/metadata/hydration.scale and b/packages/ui/.papi/metadata/hydration.scale differ diff --git a/packages/ui/.papi/metadata/khala.scale b/packages/ui/.papi/metadata/khala.scale index edf90a34..2e83704b 100644 Binary files a/packages/ui/.papi/metadata/khala.scale and b/packages/ui/.papi/metadata/khala.scale differ diff --git a/packages/ui/.papi/metadata/paseo.scale b/packages/ui/.papi/metadata/paseo.scale index a52b204e..53bb1448 100644 Binary files a/packages/ui/.papi/metadata/paseo.scale and b/packages/ui/.papi/metadata/paseo.scale differ diff --git a/packages/ui/.papi/metadata/phala.scale b/packages/ui/.papi/metadata/phala.scale index b2d8876b..fe919712 100644 Binary files a/packages/ui/.papi/metadata/phala.scale and b/packages/ui/.papi/metadata/phala.scale differ diff --git a/packages/ui/.papi/metadata/polimec.scale b/packages/ui/.papi/metadata/polimec.scale new file mode 100644 index 00000000..db1d17ce Binary files /dev/null and b/packages/ui/.papi/metadata/polimec.scale differ diff --git a/packages/ui/.papi/metadata/wesPpl.scale b/packages/ui/.papi/metadata/wesPpl.scale index d846f607..64cbfee7 100644 Binary files a/packages/ui/.papi/metadata/wesPpl.scale and b/packages/ui/.papi/metadata/wesPpl.scale differ diff --git a/packages/ui/.papi/metadata/westend.scale b/packages/ui/.papi/metadata/westend.scale new file mode 100644 index 00000000..1a1071ae Binary files /dev/null and b/packages/ui/.papi/metadata/westend.scale differ diff --git a/packages/ui/.papi/polkadot-api.json b/packages/ui/.papi/polkadot-api.json index 7cf217d7..47335119 100644 --- a/packages/ui/.papi/polkadot-api.json +++ b/packages/ui/.papi/polkadot-api.json @@ -22,22 +22,6 @@ "chain": "polkadot_people", "metadata": ".papi/metadata/dotPpl.scale" }, - "dotAssetHub": { - "chain": "polkadot_asset_hub", - "metadata": ".papi/metadata/dotAssetHub.scale" - }, - "rococo": { - "chain": "rococo_v2_2", - "metadata": ".papi/metadata/rococo.scale" - }, - "rococoAssetHub": { - "chain": "rococo_v2_2_asset_hub", - "metadata": ".papi/metadata/rococoAssetHub.scale" - }, - "rococoPpl": { - "chain": "rococo_v2_2_people", - "metadata": ".papi/metadata/rococoPpl.scale" - }, "bifrostDot": { "wsUrl": "wss://eu.bifrost-polkadot-rpc.liebi.com/ws", "metadata": ".papi/metadata/bifrostDot.scale" @@ -69,6 +53,22 @@ "wesPpl": { "wsUrl": "wss://westend-people-rpc.polkadot.io", "metadata": ".papi/metadata/wesPpl.scale" + }, + "dotAssetHub": { + "chain": "polkadot_asset_hub", + "metadata": ".papi/metadata/dotAssetHub.scale" + }, + "polimec": { + "wsUrl": "wss://polimec.ibp.network", + "metadata": ".papi/metadata/polimec.scale" + }, + "coretimeDot": { + "wsUrl": "wss://polkadot-coretime-rpc.polkadot.io", + "metadata": ".papi/metadata/coretimeDot.scale" + }, + "westend": { + "chain": "westend2", + "metadata": ".papi/metadata/westend.scale" } } -} +} \ No newline at end of file diff --git a/packages/ui/package.json b/packages/ui/package.json index 77dc7b1b..6c489567 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -10,7 +10,7 @@ "@mui/material": "^6.1.10", "@mui/styled-engine": "^6.1.10", "@polkadot-api/descriptors": "portal:.papi/descriptors", - "@polkadot-api/tx-utils": "^0.0.6", + "@polkadot-api/tx-utils": "^0.0.8", "@polkadot-labs/hdkd": "^0.0.10", "@polkadot-labs/hdkd-helpers": "^0.0.10", "@polkadot/react-identicon": "^3.11.3", @@ -25,7 +25,7 @@ "graphql-request": "^7.1.2", "graphql-ws": "^5.16.0", "json5": "^2.2.3", - "polkadot-api": "^1.7.7", + "polkadot-api": "^1.8.2", "react": "18.3.1", "react-dom": "18.3.1", "react-icons": "^5.4.0", diff --git a/packages/ui/src/components/CallInfo.tsx b/packages/ui/src/components/CallInfo.tsx index ff45a0e2..41ebb387 100644 --- a/packages/ui/src/components/CallInfo.tsx +++ b/packages/ui/src/components/CallInfo.tsx @@ -1,7 +1,7 @@ import Expander from './Expander' import { styled } from '@mui/material/styles' import { ReactNode, useMemo } from 'react' -import { ApiType, useApi } from '../contexts/ApiContext' +import { IApiContext, useApi } from '../contexts/ApiContext' import { getExtrinsicName } from '../utils/getExtrinsicName' import { isProxyCall } from '../utils/isProxyCall' import { formatBigIntBalance } from '../utils/formatBnBalance' @@ -29,7 +29,7 @@ interface CreateTreeParams { decimals: number unit: string name?: string - api: ApiType + api: IApiContext['api'] chainInfo?: ChainInfoHuman } diff --git a/packages/ui/src/components/EasySetup/BalancesTransfer.tsx b/packages/ui/src/components/EasySetup/BalancesTransfer.tsx index 2d77660f..41c309f5 100644 --- a/packages/ui/src/components/EasySetup/BalancesTransfer.tsx +++ b/packages/ui/src/components/EasySetup/BalancesTransfer.tsx @@ -8,8 +8,8 @@ import { inputToBigInt, getGlobalMaxValue } from '../../utils/bnUtils' import { TextField } from '../library' import { getOptionLabel } from '../../utils/getOptionLabel' import { useAccountBaseFromAccountList } from '../../hooks/useAccountBaseFromAccountList' -import { dot, hydration, MultiAddress } from '@polkadot-api/descriptors' -import { Transaction, TypedApi } from 'polkadot-api' +import { MultiAddress } from '@polkadot-api/descriptors' +import { Transaction } from 'polkadot-api' import { useNetwork } from '../../contexts/NetworkContext' interface Props { @@ -22,7 +22,7 @@ interface Props { const BalancesTransfer = ({ className, onSetExtrinsic, onSetErrorMessage, from }: Props) => { const accountBase = useAccountBaseFromAccountList({ withAccountsFromAddressBook: true }) const [selected, setSelected] = useState() - const { api, chainInfo } = useApi() + const { api, chainInfo, apiDescriptor } = useApi() const [amountString, setAmountString] = useState('') const [amount, setAmount] = useState() const [amountError, setAmountError] = useState('') @@ -54,18 +54,18 @@ const BalancesTransfer = ({ className, onSetExtrinsic, onSetErrorMessage, from } } const extrinsic = - selectedNetwork === 'hydration' - ? (api as TypedApi).tx.Balances.transfer_keep_alive({ + apiDescriptor === 'hydration' + ? api.tx.Balances.transfer_keep_alive({ dest: toAddress, value: amount }) - : (api as TypedApi).tx.Balances.transfer_keep_alive({ + : api.tx.Balances.transfer_keep_alive({ dest: MultiAddress.Id(toAddress), value: amount }) onSetExtrinsic(extrinsic) - }, [amount, api, chainInfo, onSetExtrinsic, selectedNetwork, toAddress]) + }, [amount, api, apiDescriptor, chainInfo, onSetExtrinsic, selectedNetwork, toAddress]) const onAddressDestChange = useCallback((account: AccountBaseInfo) => { setSelected(account) diff --git a/packages/ui/src/components/library/AssetBalance.tsx b/packages/ui/src/components/library/AssetBalance.tsx new file mode 100644 index 00000000..21b28f39 --- /dev/null +++ b/packages/ui/src/components/library/AssetBalance.tsx @@ -0,0 +1,37 @@ +import { styled } from '@mui/material/styles' +import { useGetAssetBalance } from '../../hooks/useGetAssetBalance' + +interface BalanceProps { + address: string + assetId: number + logo: string +} + +const AssetBalance = ({ address, assetId, logo }: BalanceProps) => { + const { balanceFormatted } = useGetAssetBalance({ address, assetId }) + + if (!balanceFormatted) return null + + return ( + + + {balanceFormatted} + + ) +} + +const BalanceStyled = styled('div')` + display: flex; + color: ${({ theme }) => theme.custom.gray[700]}; + font-size: 1rem; + margin-top: 0.5rem; +` + +const ImgStyled = styled('img')` + margin-right: 0.5rem; + width: 1.5rem; +` +export default AssetBalance diff --git a/packages/ui/src/components/library/Balance.tsx b/packages/ui/src/components/library/Balance.tsx index 3cba9601..6436cc97 100644 --- a/packages/ui/src/components/library/Balance.tsx +++ b/packages/ui/src/components/library/Balance.tsx @@ -1,14 +1,26 @@ import { styled } from '@mui/material/styles' import { useGetBalance } from '../../hooks/useGetBalance' +import { chainsPolkadotCircleSVG } from '../../logos/polkadot-circleSVG' interface BalanceProps { address: string + withIcon?: boolean } -const Balance = ({ address }: BalanceProps) => { +const Balance = ({ address, withIcon = false }: BalanceProps) => { const { balanceFormatted } = useGetBalance({ address }) - return {balanceFormatted} + return ( + + {withIcon && ( + + )} + {balanceFormatted} + + ) } const BalanceStyled = styled('div')` @@ -17,4 +29,8 @@ const BalanceStyled = styled('div')` font-size: 1rem; ` +const ImgStyled = styled('img')` + margin-right: 0.5rem; + width: 1.5rem; +` export default Balance diff --git a/packages/ui/src/components/modals/ChangeMultisig.tsx b/packages/ui/src/components/modals/ChangeMultisig.tsx index 2be161cf..2f0b38da 100644 --- a/packages/ui/src/components/modals/ChangeMultisig.tsx +++ b/packages/ui/src/components/modals/ChangeMultisig.tsx @@ -30,8 +30,8 @@ import { ModalCloseButton } from '../library/ModalCloseButton' import { useGetSortAddress } from '../../hooks/useGetSortAddress' import { useGetMultisigAddress } from '../../contexts/useGetMultisigAddress' import { getAsMultiTx } from '../../utils/getAsMultiTx' -import { Enum, TypedApi } from 'polkadot-api' -import { dot, hydration, MultiAddress } from '@polkadot-api/descriptors' +import { Enum } from 'polkadot-api' +import { MultiAddress } from '@polkadot-api/descriptors' import { useNetwork } from '../../contexts/NetworkContext' interface Props { @@ -44,7 +44,7 @@ type Step = 'selection' | 'summary' | 'call1' | 'call2' const ChangeMultisig = ({ onClose, className }: Props) => { const { selectedNetwork } = useNetwork() const modalRef = useRef(null) - const { api, chainInfo, compatibilityToken } = useApi() + const { api, chainInfo, compatibilityToken, apiDescriptor } = useApi() const { selectedMultiProxy, getMultisigAsAccountBaseInfo, getMultisigByAddress } = useMultiProxy() const signCallBack2 = useSigningCallback({ onSuccess: onClose, @@ -123,30 +123,79 @@ const ChangeMultisig = ({ onClose, className }: Props) => { ) const addProxyTx = - selectedNetwork === 'hydration' - ? (api as TypedApi).tx.Proxy.add_proxy({ + apiDescriptor === 'hydration' + ? api.tx.Proxy.add_proxy({ delegate: newMultisigAddress, proxy_type: Enum('Any'), delay: 0 }) - : (api as TypedApi).tx.Proxy.add_proxy({ - delegate: MultiAddress.Id(newMultisigAddress), - proxy_type: Enum('Any'), - delay: 0 - }) + : apiDescriptor === 'acala' + ? api.tx.Proxy.add_proxy({ + delegate: MultiAddress.Id(newMultisigAddress), + proxy_type: Enum('Any'), + delay: 0 + }) + : apiDescriptor === 'khala' + ? api.tx.Proxy.add_proxy({ + delegate: MultiAddress.Id(newMultisigAddress), + proxy_type: Enum('Any'), + delay: 0 + }) + : apiDescriptor === 'kusama' + ? api.tx.Proxy.add_proxy({ + delegate: MultiAddress.Id(newMultisigAddress), + proxy_type: Enum('Any'), + delay: 0 + }) + : apiDescriptor === 'phala' + ? api.tx.Proxy.add_proxy({ + delegate: MultiAddress.Id(newMultisigAddress), + proxy_type: Enum('Any'), + delay: 0 + }) + : api.tx.Proxy.add_proxy({ + delegate: MultiAddress.Id(newMultisigAddress), + proxy_type: Enum('Any'), + delay: 0 + }) const proxyTx = - selectedNetwork === 'hydration' - ? (api as TypedApi).tx.Proxy.proxy({ + apiDescriptor === 'hydration' + ? api.tx.Proxy.proxy({ real: selectedMultiProxy?.proxy, force_proxy_type: undefined, call: addProxyTx.decodedCall }) - : (api as TypedApi).tx.Proxy.proxy({ - real: MultiAddress.Id(selectedMultiProxy?.proxy), - force_proxy_type: undefined, - call: addProxyTx.decodedCall - }) + : apiDescriptor === 'acala' + ? api.tx.Proxy.proxy({ + real: MultiAddress.Id(selectedMultiProxy?.proxy), + force_proxy_type: undefined, + call: addProxyTx.decodedCall + }) + : apiDescriptor === 'khala' + ? api.tx.Proxy.proxy({ + real: MultiAddress.Id(selectedMultiProxy?.proxy), + force_proxy_type: undefined, + call: addProxyTx.decodedCall + }) + : apiDescriptor === 'kusama' + ? api.tx.Proxy.proxy({ + real: MultiAddress.Id(selectedMultiProxy?.proxy), + force_proxy_type: undefined, + call: addProxyTx.decodedCall + }) + : apiDescriptor === 'phala' + ? api.tx.Proxy.proxy({ + real: MultiAddress.Id(selectedMultiProxy?.proxy), + force_proxy_type: undefined, + call: addProxyTx.decodedCall + }) + : api.tx.Proxy.proxy({ + real: MultiAddress.Id(selectedMultiProxy?.proxy), + force_proxy_type: undefined, + call: addProxyTx.decodedCall + }) + // call with the old multisig to delete the new one return getAsMultiTx({ api, @@ -166,7 +215,8 @@ const ChangeMultisig = ({ onClose, className }: Props) => { selectedAccount, selectedMultiProxy?.proxy, selectedMultisig, - selectedNetwork + selectedNetwork, + apiDescriptor ]) const firstCall = useMemo(() => { @@ -198,16 +248,79 @@ const ChangeMultisig = ({ onClose, className }: Props) => { const otherNewSignatories = getSortAddress( newSignatories.filter((sig) => sig !== selectedAccount.address) ) - const removeProxyTx = (api as TypedApi).tx.Proxy.remove_proxy({ - delegate: MultiAddress.Id(selectedMultisig?.address), - proxy_type: Enum('Any'), - delay: 0 - }) - const proxyTx = (api as TypedApi).tx.Proxy.proxy({ - real: MultiAddress.Id(selectedMultiProxy?.proxy), - force_proxy_type: undefined, - call: removeProxyTx.decodedCall - }) + const removeProxyTx = + apiDescriptor === 'hydration' + ? api.tx.Proxy.remove_proxy({ + delegate: selectedMultisig?.address, + proxy_type: Enum('Any'), + delay: 0 + }) + : apiDescriptor === 'acala' + ? api.tx.Proxy.remove_proxy({ + delegate: MultiAddress.Id(selectedMultisig?.address), + proxy_type: Enum('Any'), + delay: 0 + }) + : apiDescriptor === 'khala' + ? api.tx.Proxy.remove_proxy({ + delegate: MultiAddress.Id(selectedMultisig?.address), + proxy_type: Enum('Any'), + delay: 0 + }) + : apiDescriptor === 'kusama' + ? api.tx.Proxy.remove_proxy({ + delegate: MultiAddress.Id(selectedMultisig?.address), + proxy_type: Enum('Any'), + delay: 0 + }) + : apiDescriptor === 'phala' + ? api.tx.Proxy.remove_proxy({ + delegate: MultiAddress.Id(selectedMultisig?.address), + proxy_type: Enum('Any'), + delay: 0 + }) + : api.tx.Proxy.remove_proxy({ + delegate: MultiAddress.Id(selectedMultisig?.address), + proxy_type: Enum('Any'), + delay: 0 + }) + + const proxyTx = + apiDescriptor === 'hydration' + ? api.tx.Proxy.proxy({ + real: selectedMultiProxy?.proxy, + force_proxy_type: undefined, + call: removeProxyTx.decodedCall + }) + : apiDescriptor === 'acala' + ? api.tx.Proxy.proxy({ + real: MultiAddress.Id(selectedMultiProxy?.proxy), + force_proxy_type: undefined, + call: removeProxyTx.decodedCall + }) + : apiDescriptor === 'khala' + ? api.tx.Proxy.proxy({ + real: MultiAddress.Id(selectedMultiProxy?.proxy), + force_proxy_type: undefined, + call: removeProxyTx.decodedCall + }) + : apiDescriptor === 'kusama' + ? api.tx.Proxy.proxy({ + real: MultiAddress.Id(selectedMultiProxy?.proxy), + force_proxy_type: undefined, + call: removeProxyTx.decodedCall + }) + : apiDescriptor === 'phala' + ? api.tx.Proxy.proxy({ + real: MultiAddress.Id(selectedMultiProxy?.proxy), + force_proxy_type: undefined, + call: removeProxyTx.decodedCall + }) + : api.tx.Proxy.proxy({ + real: MultiAddress.Id(selectedMultiProxy?.proxy), + force_proxy_type: undefined, + call: removeProxyTx.decodedCall + }) return getAsMultiTx({ api, @@ -225,7 +338,8 @@ const ChangeMultisig = ({ onClose, className }: Props) => { selectedAccount, selectedMultiProxy, selectedMultisig, - compatibilityToken + compatibilityToken, + apiDescriptor ]) const { multisigProposalNeededFunds: firstCallNeededFunds, reserved: firstCallReserved } = diff --git a/packages/ui/src/constants.ts b/packages/ui/src/constants.ts index 1b808cc8..5e36a910 100644 --- a/packages/ui/src/constants.ts +++ b/packages/ui/src/constants.ts @@ -1,31 +1,38 @@ +// import { nodesAstarPNG } from './logos/astarPNG' +// import { nodesInterlaySVG } from './logos/interlaySVG' +// import { nodesMoonriverSVG } from './logos/moonriverSVG' +// import { nodesMoonbeamSVG } from './logos/moonbeamSVG' +// import { nodesKiltPNG } from './logos/kiltPNG' +// import { chainsPendulumSVG } from './logos/pendulumSVG' +// import { chainsAmplitudeSVG } from './logos/amplitudeSVG' +// import { nodesJoystreamSVG } from './logos/joystreamSVG' +// import { chainsWatrPNG } from './logos/watrPNG' import { nodesKhalaSVG } from './logos/khalaSVG' import { chainsKusamaSVG } from './logos/kusamaSVG ' import { localSVG } from './logos/localSVG' import { chainsPolkadotCircleSVG } from './logos/polkadot-circleSVG' import { phalaSVG } from './logos/phalaSVG' -import { nodesAstarPNG } from './logos/astarPNG' import { nodesAssetHubSVG } from './logos/assetHubSVG' import { hydrationSVG } from './logos/hydrationSVG' import { nodesWestendColourSVG } from './logos/westend_colourSVG' import { chainsAcalaSVG } from './logos/acalaSVG' import { nodesBifrostSVG } from './logos/bifrostSVG' -import { nodesInterlaySVG } from './logos/interlaySVG' -import { nodesMoonriverSVG } from './logos/moonriverSVG' -import { nodesMoonbeamSVG } from './logos/moonbeamSVG' -import { nodesKiltPNG } from './logos/kiltPNG' -import { chainsPendulumSVG } from './logos/pendulumSVG' -import { chainsAmplitudeSVG } from './logos/amplitudeSVG' -import { nodesJoystreamSVG } from './logos/joystreamSVG' -import { chainsWatrPNG } from './logos/watrPNG' import paseoSVG from './logos/paseoSVG.svg' import { nodesCoretimeSVG } from './logos/coretimeSVG' import { polimecSVG } from './logos/polimecSVG' +import usdc from './logos/usdc.svg' +import usdt from './logos/usdt.svg' +import { DESCRIPTORS } from './contexts/ApiContext' export const DAPP_NAME = 'Multix' export const ICON_SIZE_LARGE = 92 export const ICON_SIZE_MEDIUM = 40 export const ICON_SIZE_SMALL = 30 export const DEFAULT_ICON_THEME = 'polkadot' +export const AH_SUPPORTED_ASSETS = [ + { assetId: 1984, logo: usdt }, + { assetId: 1337, logo: usdc } +] export interface NetworkInfo { chainId: string @@ -34,6 +41,7 @@ export interface NetworkInfo { httpGraphqlUrl: string logo: string pplChainRpcUrls?: string[] + descriptor: keyof typeof DESCRIPTORS } export const HTTP_GRAPHQL_URL = `https://chainsafe.squids.live/multix-arrow@v6/api/graphql` @@ -82,7 +90,8 @@ export const networkList: Record = { // 'wss://polkadot.rpc.subquery.network/public/ws' ], httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: chainsPolkadotCircleSVG + logo: chainsPolkadotCircleSVG, + descriptor: 'dot' }, kusama: { chainId: 'kusama', @@ -101,17 +110,18 @@ export const networkList: Record = { // 'wss://kusama.rpc.subquery.network/public/ws' ], httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: chainsKusamaSVG + logo: chainsKusamaSVG, + descriptor: 'ksm' }, - 'asset-hub-dot': { + 'asset-hub-polkadot': { chainId: 'asset-hub-polkadot', explorerNetworkName: 'assethub-polkadot', rpcUrls: [ - // 'wss://asset-hub-polkadot-rpc.dwellir.com', + // 'wss://asset-hub-polkadot-rpc.dwellir.com' // 'wss://statemint-rpc-tn.dwellir.com', - // 'wss://sys.ibp.network/asset-hub-polkadot', + 'wss://sys.ibp.network/asset-hub-polkadot' // 'wss://asset-hub-polkadot.dotters.network', - 'wss://rpc-asset-hub-polkadot.luckyfriday.io' + // 'wss://rpc-asset-hub-polkadot.luckyfriday.io' // 'wss://statemint.api.onfinality.io/public-ws', // 'wss://polkadot-asset-hub-rpc.polkadot.io', // 'wss://statemint.public.curie.radiumblock.co/ws', @@ -119,9 +129,10 @@ export const networkList: Record = { ], pplChainRpcUrls: polkadotPplChains, httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesAssetHubSVG + logo: nodesAssetHubSVG, + descriptor: 'dotAssetHub' }, - 'asset-hub-ksm': { + 'asset-hub-kusama': { chainId: 'asset-hub-kusama', explorerNetworkName: 'assethub-kusama', rpcUrls: [ @@ -136,9 +147,10 @@ export const networkList: Record = { ], pplChainRpcUrls: kusamaPplChains, httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesAssetHubSVG + logo: nodesAssetHubSVG, + descriptor: 'ksmAssetHub' }, - 'coretime-dot': { + 'coretime-polkadot': { chainId: 'coretime-polkadot', explorerNetworkName: 'coretime-polkadot', rpcUrls: [ @@ -148,23 +160,25 @@ export const networkList: Record = { ], pplChainRpcUrls: polkadotPplChains, httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesCoretimeSVG - }, - 'coretime-ksm': { - chainId: 'coretime-kusama', - explorerNetworkName: 'coretime-kusama', - rpcUrls: [ - 'wss://coretime-kusama-rpc.dwellir.com', - 'wss://sys.ibp.network/coretime-kusama', - 'wss://coretime-kusama.dotters.network', - 'wss://rpc-coretime-kusama.luckyfriday.io', - 'wss://kusama-coretime-rpc.polkadot.io' - // 'wss://ksm-rpc.stakeworld.io/coretime' - ], - pplChainRpcUrls: kusamaPplChains, - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesCoretimeSVG + logo: nodesCoretimeSVG, + descriptor: 'coretimeDot' }, + // 'coretime-kusama': { + // chainId: 'coretime-kusama', + // explorerNetworkName: 'coretime-kusama', + // rpcUrls: [ + // 'wss://coretime-kusama-rpc.dwellir.com', + // 'wss://sys.ibp.network/coretime-kusama', + // 'wss://coretime-kusama.dotters.network', + // 'wss://rpc-coretime-kusama.luckyfriday.io', + // 'wss://kusama-coretime-rpc.polkadot.io' + // // 'wss://ksm-rpc.stakeworld.io/coretime' + // ], + // pplChainRpcUrls: kusamaPplChains, + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: nodesCoretimeSVG, + // descriptor: coretimeKsm + // }, acala: { chainId: 'acala', explorerNetworkName: 'acala', @@ -174,21 +188,22 @@ export const networkList: Record = { 'wss://acala-polkadot.api.onfinality.io/public-ws' ], httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: chainsAcalaSVG - }, - astar: { - chainId: 'astar', - explorerNetworkName: 'astar', - rpcUrls: [ - 'wss://rpc.astar.network', - 'wss://1rpc.io/astr', - 'wss://astar-rpc.dwellir.com', - 'wss://astar.api.onfinality.io/public-ws', - 'wss://astar.public.curie.radiumblock.co/ws' - ], - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesAstarPNG + logo: chainsAcalaSVG, + descriptor: 'acala' }, + // astar: { + // chainId: 'astar', + // explorerNetworkName: 'astar', + // rpcUrls: [ + // 'wss://rpc.astar.network', + // 'wss://1rpc.io/astr', + // 'wss://astar-rpc.dwellir.com', + // 'wss://astar.api.onfinality.io/public-ws', + // 'wss://astar.public.curie.radiumblock.co/ws' + // ], + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: nodesAstarPNG + // }, 'bifrost-dot': { chainId: 'bifrost-polkadot', explorerNetworkName: 'bifrost', @@ -201,7 +216,8 @@ export const networkList: Record = { 'wss://bifrost.public.curie.radiumblock.co/ws' ], httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesBifrostSVG + logo: nodesBifrostSVG, + descriptor: 'bifrostDot' }, hydration: { chainId: 'hydradx', @@ -214,15 +230,16 @@ export const networkList: Record = { 'wss://hydration.dotters.network' ], httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: hydrationSVG - }, - interlay: { - chainId: 'interlay', - explorerNetworkName: 'interlay', - rpcUrls: ['wss://interlay-rpc.dwellir.com'], - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesInterlaySVG + logo: hydrationSVG, + descriptor: 'hydration' }, + // interlay: { + // chainId: 'interlay', + // explorerNetworkName: 'interlay', + // rpcUrls: ['wss://interlay-rpc.dwellir.com'], + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: nodesInterlaySVG, + // }, khala: { chainId: 'khala', explorerNetworkName: 'khala', @@ -234,22 +251,23 @@ export const networkList: Record = { 'wss://khala.public.curie.radiumblock.co/ws' ], httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesKhalaSVG - }, - moonbeam: { - chainId: 'moonbeam', - explorerNetworkName: 'moonbeam', - rpcUrls: ['wss://moonbeam-rpc.dwellir.com'], - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesMoonbeamSVG - }, - moonriver: { - chainId: 'moonriver', - explorerNetworkName: 'moonriver', - rpcUrls: ['wss://moonriver-rpc.dwellir.com'], - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesMoonriverSVG + logo: nodesKhalaSVG, + descriptor: 'khala' }, + // moonbeam: { + // chainId: 'moonbeam', + // explorerNetworkName: 'moonbeam', + // rpcUrls: ['wss://moonbeam-rpc.dwellir.com'], + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: nodesMoonbeamSVG + // }, + // moonriver: { + // chainId: 'moonriver', + // explorerNetworkName: 'moonriver', + // rpcUrls: ['wss://moonriver-rpc.dwellir.com'], + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: nodesMoonriverSVG + // }, phala: { chainId: 'phala', explorerNetworkName: 'phala', @@ -261,15 +279,16 @@ export const networkList: Record = { 'wss://phala.public.curie.radiumblock.co/ws' ], httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: phalaSVG - }, - 'rhala testnet': { - chainId: 'rhala', - explorerNetworkName: '', - rpcUrls: ['wss://rhala-node.phala.network/ws'], - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesKhalaSVG + logo: phalaSVG, + descriptor: 'phala' }, + // 'rhala testnet': { + // chainId: 'rhala', + // explorerNetworkName: '', + // rpcUrls: ['wss://rhala-node.phala.network/ws'], + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: nodesKhalaSVG + // }, // rococo: { // chainId: 'rococo', // explorerNetworkName: 'rococo', @@ -291,7 +310,8 @@ export const networkList: Record = { 'wss://westend.public.curie.radiumblock.co/ws' ], httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesWestendColourSVG + logo: nodesWestendColourSVG, + descriptor: 'westend' }, paseo: { chainId: 'paseo', @@ -305,43 +325,44 @@ export const networkList: Record = { ], httpGraphqlUrl: HTTP_GRAPHQL_URL, pplChainRpcUrls: ['wss://people-paseo.rpc.amforc.com', 'wss://people-paseo.dotters.network'], - logo: paseoSVG - }, - amplitude: { - chainId: 'amplitude', - explorerNetworkName: 'amplitude', - rpcUrls: ['wss://rpc-amplitude.pendulumchain.tech'], - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: chainsAmplitudeSVG - }, - pendulum: { - chainId: 'pendulum', - explorerNetworkName: 'pendulum', - rpcUrls: ['wss://rpc-pendulum.prd.pendulumchain.tech'], - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: chainsPendulumSVG - }, - joystream: { - chainId: 'joystream', - explorerNetworkName: 'joystream', - rpcUrls: ['wss://rpc.joystream.org'], - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesJoystreamSVG - }, - watr: { - chainId: 'watr', - explorerNetworkName: '', - rpcUrls: ['wss://watr-rpc.watr-api.network'], - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: chainsWatrPNG - }, - kilt: { - chainId: 'kilt', - explorerNetworkName: 'spiritnet', - rpcUrls: ['wss://spiritnet.kilt.io'], - httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: nodesKiltPNG + logo: paseoSVG, + descriptor: 'paseo' }, + // amplitude: { + // chainId: 'amplitude', + // explorerNetworkName: 'amplitude', + // rpcUrls: ['wss://rpc-amplitude.pendulumchain.tech'], + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: chainsAmplitudeSVG + // }, + // pendulum: { + // chainId: 'pendulum', + // explorerNetworkName: 'pendulum', + // rpcUrls: ['wss://rpc-pendulum.prd.pendulumchain.tech'], + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: chainsPendulumSVG + // }, + // joystream: { + // chainId: 'joystream', + // explorerNetworkName: 'joystream', + // rpcUrls: ['wss://rpc.joystream.org'], + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: nodesJoystreamSVG + // }, + // watr: { + // chainId: 'watr', + // explorerNetworkName: '', + // rpcUrls: ['wss://watr-rpc.watr-api.network'], + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: chainsWatrPNG + // }, + // kilt: { + // chainId: 'kilt', + // explorerNetworkName: 'spiritnet', + // rpcUrls: ['wss://spiritnet.kilt.io'], + // httpGraphqlUrl: HTTP_GRAPHQL_URL, + // logo: nodesKiltPNG + // }, polimec: { chainId: 'polimec', explorerNetworkName: 'polimec', @@ -351,21 +372,23 @@ export const networkList: Record = { 'wss://polimec.ibp.network' ], httpGraphqlUrl: HTTP_GRAPHQL_URL, - logo: polimecSVG + logo: polimecSVG, + descriptor: 'polimec' }, local: { chainId: import.meta.env.VITE_CHAIN_ID, explorerNetworkName: import.meta.env.VITE_NETWORK_NAME as 'kusama', rpcUrls: [import.meta.env.VITE_WS_PROVIDER], httpGraphqlUrl: import.meta.env.VITE_GRAPHQL_HTTP_PROVIDER, - logo: localSVG + logo: localSVG, + descriptor: 'dot' } } export const polkadotNetworksAndParachains: Partial[] = [ 'polkadot', - 'asset-hub-dot', - 'coretime-dot', + 'asset-hub-polkadot', + 'coretime-polkadot', 'acala', // 'astar', 'bifrost-dot', @@ -380,8 +403,8 @@ export const polkadotNetworksAndParachains: Partial[] ] export const kusamaNetworksAndParachains: Partial[] = [ 'kusama', - 'asset-hub-ksm', - // 'coretime-ksm' + 'asset-hub-kusama', + // 'coretime-kusama' // 'amplitude', 'khala' // 'moonriver' diff --git a/packages/ui/src/contexts/ApiContext.tsx b/packages/ui/src/contexts/ApiContext.tsx index 15dfcdf6..2711b7e8 100644 --- a/packages/ui/src/contexts/ApiContext.tsx +++ b/packages/ui/src/contexts/ApiContext.tsx @@ -2,7 +2,7 @@ import React from 'react' import { useState, useEffect, createContext, useContext } from 'react' import { useNetwork } from './NetworkContext' import { ethereumChains } from '../utils/ethereumChains' -import { createClient, PolkadotClient, TypedApi } from 'polkadot-api' +import { CompatibilityToken, createClient, PolkadotClient, TypedApi } from 'polkadot-api' import { getWsProvider } from 'polkadot-api/ws-provider/web' import { withPolkadotSdkCompat } from 'polkadot-api/polkadot-sdk-compat' import { @@ -10,48 +10,62 @@ import { bifrostDot, dot, dotAssetHub, - // dotPpl, hydration, khala, ksm, ksmAssetHub, - // ksmPpl, paseo, - phala - // rhala, - // rococo, - // rococoAssetHub, - // rococoPpl + phala, + polimec, + coretimeDot, + westend } from '@polkadot-api/descriptors' +type DescriptorsType = { + acala: typeof acala + bifrostDot: typeof bifrostDot + dot: typeof dot + dotAssetHub: typeof dotAssetHub + hydration: typeof hydration + khala: typeof khala + ksm: typeof ksm + ksmAssetHub: typeof ksmAssetHub + paseo: typeof paseo + phala: typeof phala + polimec: typeof polimec + coretimeDot: typeof coretimeDot + westend: typeof westend +} + +export const DESCRIPTORS: DescriptorsType = { + acala, + bifrostDot, + dot, + dotAssetHub, + hydration, + khala, + ksm, + ksmAssetHub, + paseo, + phala, + polimec, + coretimeDot, + westend +} as const + +export type ApiDescriptors = keyof typeof DESCRIPTORS +export type Descriptors = (typeof DESCRIPTORS)[Id] + type ApiContextProps = { children: React.ReactNode | React.ReactNode[] } -export type ApiType = TypedApi< - | typeof dot - | typeof dotAssetHub - // | typeof dotPpl - | typeof ksm - | typeof ksmAssetHub - // | typeof ksmPpl - | typeof hydration - | typeof acala - | typeof bifrostDot - | typeof phala - | typeof khala - // | typeof rhala - // | typeof rococo - // | typeof rococoAssetHub - // | typeof rococoPpl - | typeof paseo -> - -export interface IApiContext { - api?: ApiType +export type IApiContext = { + api?: TypedApi> + apiDescriptor?: Id chainInfo?: ChainInfoHuman client?: PolkadotClient - compatibilityToken?: Awaited['compatibilityToken']> + compatibilityToken?: CompatibilityToken } interface ChainInfoHuman { @@ -61,77 +75,26 @@ interface ChainInfoHuman { isEthereum: boolean } -const ApiContext = createContext(undefined) +const ApiContext = createContext | undefined>(undefined) const ApiContextProvider = ({ children }: ApiContextProps) => { const { selectedNetworkInfo } = useNetwork() - const [chainInfo, setChainInfo] = useState() - const [client, setClient] = useState() - const [api, setApi] = useState() - const [compatibilityToken, setCompatibilityToken] = useState() + const [chainInfo, setChainInfo] = useState['chainInfo']>() + const [client, setClient] = useState['client']>() + const [api, setApi] = useState['api']>() + const [compatibilityToken, setCompatibilityToken] = + useState['compatibilityToken']>() + const [apiDescriptor, setApiDescriptor] = useState['apiDescriptor']>() useEffect(() => { - if (!selectedNetworkInfo) return - - let cl: PolkadotClient - let typedApi: ApiType - - switch (selectedNetworkInfo?.chainId) { - case 'kusama': - cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - typedApi = cl.getTypedApi(ksm) - break - case 'asset-hub-dot': - cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - typedApi = cl.getTypedApi(dotAssetHub) - break - case 'asset-hub-ksm': - cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - typedApi = cl.getTypedApi(ksmAssetHub) - break - case 'acala': - cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - typedApi = cl.getTypedApi(acala) - break - case 'bifrost-dot': - cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - typedApi = cl.getTypedApi(bifrostDot) - break - case 'phala': - cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - typedApi = cl.getTypedApi(phala) - break - // case 'rhala': - // cl = createClient(getWsProvider(selectedNetworkInfo.rpcUrl)) - // typedApi = cl.getTypedApi(rhala) - // break - case 'khala': - cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - typedApi = cl.getTypedApi(khala) - break - // case 'rococo': - // cl = createClient(getWsProvider(selectedNetworkInfo.rpcUrl)) - // typedApi = cl.getTypedApi(rococo) - // break - // case 'rococo-asset-hub': - // cl = createClient(getWsProvider(selectedNetworkInfo.rpcUrl)) - // typedApi = cl.getTypedApi(rococoAssetHub) - // break - case 'hydradx': - cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - typedApi = cl.getTypedApi(hydration) - break - case 'paseo': - cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - typedApi = cl.getTypedApi(paseo) - break - - default: - cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - typedApi = cl.getTypedApi(dot) - } + if (!selectedNetworkInfo?.chainId || !selectedNetworkInfo?.descriptor) return + + const cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) + + const typedApi = cl.getTypedApi(DESCRIPTORS[selectedNetworkInfo.descriptor]) setClient(cl) setApi(typedApi) + setApiDescriptor(selectedNetworkInfo.descriptor) }, [selectedNetworkInfo]) useEffect(() => { @@ -171,6 +134,7 @@ const ApiContextProvider = ({ children }: ApiContextProps) => { - type ApiContextProps = { children: React.ReactNode | React.ReactNode[] } -export interface IApiContext { - pplApi?: false | PplApiType +type BaseTypes = { pplChainInfo?: ChainInfoHuman pplClient?: PolkadotClient pplCompatibilityToken?: CompatibilityToken } +export type IPplApiContext = + | ({ + pplApi?: TypedApi + pplApiDescriptor: 'dotPpl' + } & BaseTypes) + | ({ + pplApi?: TypedApi + pplApiDescriptor: 'ksmPpl' + } & BaseTypes) + | ({ + pplApi?: TypedApi + pplApiDescriptor: 'pasPpl' + } & BaseTypes) + | ({ + pplApi?: TypedApi + pplApiDescriptor: 'wesPpl' + } & BaseTypes) + export interface ChainInfoHuman { ss58Format: number tokenDecimals: number tokenSymbol: string } -const PplApiContext = createContext(undefined) +const PplApiContext = createContext(undefined) const PplApiContextProvider = ({ children }: ApiContextProps) => { const { selectedNetworkInfo } = useNetwork() const [pplChainInfo, setPplChainInfo] = useState() - const [pplApi, setPplApi] = useState() - const [client, setClient] = useState() + const [pplApi, setPplApi] = useState() + const [client, setClient] = useState() const [compatibilityToken, setCompatibilityToken] = - useState() + useState() useEffect(() => { if (!pplApi) return @@ -44,7 +59,7 @@ const PplApiContextProvider = ({ children }: ApiContextProps) => { if (!selectedNetworkInfo?.pplChainRpcUrls) return let cl: PolkadotClient | undefined - let typedApi: PplApiType | undefined + let typedApi: IPplApiContext['pplApi'] switch (selectedNetworkInfo?.chainId) { case 'kusama': @@ -99,6 +114,7 @@ const PplApiContextProvider = ({ children }: ApiContextProps) => { { + const { api } = useApi() + const [balance, setBalance] = useState(null) + const [balanceFormatted, setFormattedBalance] = useState(null) + const [assetMetadata, setAssetMetadata] = useState< + DotAssetHubQueries['Assets']['Metadata']['Value'] | null + >(null) + + useEffect(() => { + if (!api || !assetId) return + ;(api as TypedApi).query.Assets.Metadata.getValue(assetId) + .then(setAssetMetadata) + .catch(console.error) + }, [api, assetId]) + + useEffect(() => { + if (!api || !address || !assetMetadata || !assetId) return + + const unsub = (api as TypedApi).query.Assets.Account.watchValue( + assetId, + address, + 'best' + ).subscribe((res) => { + const balance = res?.balance || 0n + + setBalance(balance) + setFormattedBalance( + formatBigIntBalance(balance, assetMetadata.decimals, { + numberAfterComma, + tokenSymbol: assetMetadata.symbol.asText() + }) + ) + }) + + return () => unsub && unsub.unsubscribe() + }, [address, api, assetId, assetMetadata, numberAfterComma]) + + return { balance, balanceFormatted } +} diff --git a/packages/ui/src/hooks/useIdentityApi.tsx b/packages/ui/src/hooks/useIdentityApi.tsx index 9c5126da..bc57bfc7 100644 --- a/packages/ui/src/hooks/useIdentityApi.tsx +++ b/packages/ui/src/hooks/useIdentityApi.tsx @@ -1,11 +1,13 @@ import { useState, useEffect } from 'react' -import { ChainInfoHuman, PplApiType, usePplApi } from '../contexts/PeopleChainApiContext' -import { ApiType, useApi } from '../contexts/ApiContext' +import { ChainInfoHuman, IPplApiContext, usePplApi } from '../contexts/PeopleChainApiContext' +import { IApiContext, useApi } from '../contexts/ApiContext' export const useIdenityApi = () => { const { pplApi, pplChainInfo } = usePplApi() const { api, chainInfo } = useApi() - const [apiToUse, setApiToUse] = useState(null) + const [apiToUse, setApiToUse] = useState( + null + ) const [chainInfoToUse, setChainInfoToUse] = useState(undefined) useEffect(() => { diff --git a/packages/ui/src/hooks/usePendingTx.tsx b/packages/ui/src/hooks/usePendingTx.tsx index d366829a..33efa7cb 100644 --- a/packages/ui/src/hooks/usePendingTx.tsx +++ b/packages/ui/src/hooks/usePendingTx.tsx @@ -5,7 +5,7 @@ import { useMultisigCallQuery } from './useQueryMultisigCalls' import { isEmptyArray } from '../utils/arrayUtils' import { isProxyCall } from '../utils/isProxyCall' import { useAccountId } from './useAccountId' -import { ApiType, useApi } from '../contexts/ApiContext' +import { IApiContext, useApi } from '../contexts/ApiContext' import dayjs from 'dayjs' import localizedFormat from 'dayjs/plugin/localizedFormat' import { PolkadotClient, Transaction } from 'polkadot-api' @@ -37,7 +37,13 @@ type AggGroupedByDate = { [index: string]: CallDataInfoFromChain[] } const opaqueMetadata = Tuple(compact, Bin(Infinity)).dec -const getExtDecoderAt = async (api: ApiType, client: PolkadotClient, blockHash?: string) => { +const getExtDecoderAt = async ( + api: IApiContext['api'], + client: PolkadotClient, + blockHash?: string +) => { + if (!api) return + const rawMetadata = await (blockHash && !import.meta.env.DEV ? client ._request<{ @@ -53,8 +59,10 @@ const getExtDecoderAt = async (api: ApiType, client: PolkadotClient, blockHash?: const getMultisigInfo = async ( call: Transaction['decodedCall'], - api: ApiType + api: IApiContext['api'] ): Promise[]> => { + if (!api) return [] + const compatibilityToken = await api.compatibilityToken const result: any[] = [] @@ -103,7 +111,7 @@ const getMultisigInfo = async ( const getCallDataFromChainPromise = ( pendingTxData: PendingTx[], - api: ApiType, + api: IApiContext['api'], client: PolkadotClient ) => pendingTxData.map(async (pendingTx) => { @@ -124,6 +132,8 @@ const getCallDataFromChainPromise = ( const decoder = await getExtDecoderAt(api, client, blockHash) + if (!decoder || !api) return + const txPromises = body.map((extrinsics) => { const decodedExtrinsic = decoder(extrinsics) const toDecode = decodedExtrinsic.callData diff --git a/packages/ui/src/logos/usdc.svg b/packages/ui/src/logos/usdc.svg new file mode 100644 index 00000000..78ca467f --- /dev/null +++ b/packages/ui/src/logos/usdc.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/packages/ui/src/logos/usdt.svg b/packages/ui/src/logos/usdt.svg new file mode 100644 index 00000000..8b4ac905 --- /dev/null +++ b/packages/ui/src/logos/usdt.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/packages/ui/src/pages/Home/HeaderView.tsx b/packages/ui/src/pages/Home/HeaderView.tsx index 3be76f72..6dff1070 100644 --- a/packages/ui/src/pages/Home/HeaderView.tsx +++ b/packages/ui/src/pages/Home/HeaderView.tsx @@ -7,11 +7,19 @@ import { Balance, ButtonWithIcon } from '../../components/library' import { HiOutlineArrowLongRight } from 'react-icons/hi2' import { createSearchParams, useNavigate, useSearchParams } from 'react-router' import { useMemo } from 'react' +import { useNetwork } from '../../contexts/NetworkContext' +import AssetBalance from '../../components/library/AssetBalance' +import { AH_SUPPORTED_ASSETS } from '../../constants' const HeaderView = () => { + const { selectedNetwork } = useNetwork() const navigate = useNavigate() const [searchParams] = useSearchParams() const { selectedMultiProxy, selectedHasProxy, selectedIsWatched } = useMultiProxy() + const isAssetHub = useMemo( + () => selectedNetwork === 'asset-hub-polkadot' || selectedNetwork === 'asset-hub-kusama', + [selectedNetwork] + ) const selectedAddress = useMemo(() => { return selectedHasProxy ? selectedMultiProxy?.proxy : selectedMultiProxy?.multisigs[0].address @@ -47,7 +55,19 @@ const HeaderView = () => { Balance - + + {isAssetHub && + AH_SUPPORTED_ASSETS.map(({ assetId, logo }) => ( + + ))} diff --git a/packages/ui/src/utils/getApproveAsMultiTx.ts b/packages/ui/src/utils/getApproveAsMultiTx.ts index 0b4e96dc..3fca8a2d 100644 --- a/packages/ui/src/utils/getApproveAsMultiTx.ts +++ b/packages/ui/src/utils/getApproveAsMultiTx.ts @@ -1,9 +1,9 @@ import { FixedSizeBinary, HexString } from 'polkadot-api' -import { ApiType } from '../contexts/ApiContext' +import { IApiContext } from '../contexts/ApiContext' import { MultisigStorageInfo } from '../types' interface Params { - api: ApiType + api: IApiContext['api'] threshold: number otherSignatories: string[] when?: MultisigStorageInfo['when'] @@ -11,7 +11,7 @@ interface Params { } export const getApproveAsMultiTx = ({ api, threshold, otherSignatories, hash, when }: Params) => { - if (!hash) return + if (!hash || !api) return return api.tx.Multisig.approve_as_multi({ threshold, diff --git a/packages/ui/src/utils/getAsMultiTx.ts b/packages/ui/src/utils/getAsMultiTx.ts index 0314b138..ec9c6a81 100644 --- a/packages/ui/src/utils/getAsMultiTx.ts +++ b/packages/ui/src/utils/getAsMultiTx.ts @@ -1,9 +1,9 @@ import { MultisigStorageInfo, Weight } from '../types' import { Binary, HexString, Transaction } from 'polkadot-api' -import { ApiType, IApiContext } from '../contexts/ApiContext' +import { IApiContext } from '../contexts/ApiContext' interface Params { - api: ApiType + api: IApiContext['api'] threshold: number otherSignatories: string[] tx?: Transaction @@ -29,6 +29,7 @@ export const getAsMultiTx = ({ // we can pass either the tx, or the callData if (!callData && !tx) return if (!compatibilityToken) return + if (!api) return let txToSend: Transaction | undefined = tx diff --git a/packages/ui/src/utils/getEncodedCallFromDecodedTx.ts b/packages/ui/src/utils/getEncodedCallFromDecodedTx.ts index e14c5a54..7dcec3b3 100644 --- a/packages/ui/src/utils/getEncodedCallFromDecodedTx.ts +++ b/packages/ui/src/utils/getEncodedCallFromDecodedTx.ts @@ -1,11 +1,13 @@ import { CompatibilityToken, Transaction } from 'polkadot-api' -import { ApiType } from '../contexts/ApiContext' +import { IApiContext } from '../contexts/ApiContext' export const getEncodedCallFromDecodedTx = ( - api: ApiType, + api: IApiContext['api'], decodedTx: Transaction['decodedCall'], compatibilityToken: CompatibilityToken ) => { + if (!api) return + const batch = api.tx.Utility.batch({ calls: [decodedTx] }).getEncodedData(compatibilityToken) diff --git a/yarn.lock b/yarn.lock index 479115b6..49569778 100644 --- a/yarn.lock +++ b/yarn.lock @@ -689,12 +689,12 @@ __metadata: languageName: node linkType: hard -"@commander-js/extra-typings@npm:^12.1.0": - version: 12.1.0 - resolution: "@commander-js/extra-typings@npm:12.1.0" +"@commander-js/extra-typings@npm:^13.0.0": + version: 13.0.0 + resolution: "@commander-js/extra-typings@npm:13.0.0" peerDependencies: - commander: ~12.1.0 - checksum: 5d29eaa724b577e2a52a393ad54992924d2559931b8e493ab892477b7a4e878e475c6bf771260f8585d835f7d8e17ae4a2656c191e9595d210ae0b48291c0b3d + commander: ~13.0.0 + checksum: 7d1f75624ef5026462600b9ef9f7dbb701cefa3a17204bf57a9946aece44ccff343407d910620645c1daa9416439f5be6597adf75a0b8b4cfd08d59b345d0fcc languageName: node linkType: hard @@ -2698,53 +2698,53 @@ __metadata: languageName: node linkType: hard -"@polkadot-api/cli@npm:0.9.21": - version: 0.9.21 - resolution: "@polkadot-api/cli@npm:0.9.21" +"@polkadot-api/cli@npm:0.10.1": + version: 0.10.1 + resolution: "@polkadot-api/cli@npm:0.10.1" dependencies: - "@commander-js/extra-typings": ^12.1.0 - "@polkadot-api/codegen": 0.12.9 - "@polkadot-api/ink-contracts": 0.2.2 + "@commander-js/extra-typings": ^13.0.0 + "@polkadot-api/codegen": 0.12.12 + "@polkadot-api/ink-contracts": 0.2.4 "@polkadot-api/json-rpc-provider": 0.0.4 - "@polkadot-api/known-chains": 0.5.8 - "@polkadot-api/metadata-compatibility": 0.1.12 - "@polkadot-api/observable-client": 0.6.3 + "@polkadot-api/known-chains": 0.6.1 + "@polkadot-api/metadata-compatibility": 0.1.14 + "@polkadot-api/observable-client": 0.7.0 "@polkadot-api/polkadot-sdk-compat": 2.3.1 "@polkadot-api/sm-provider": 0.1.7 - "@polkadot-api/smoldot": 0.3.7 - "@polkadot-api/substrate-bindings": 0.9.4 + "@polkadot-api/smoldot": 0.3.8 + "@polkadot-api/substrate-bindings": 0.11.0 "@polkadot-api/substrate-client": 0.3.0 "@polkadot-api/utils": 0.1.2 "@polkadot-api/wasm-executor": ^0.1.2 "@polkadot-api/ws-provider": 0.3.6 - "@types/node": ^22.9.1 - commander: ^12.1.0 - execa: ^9.5.1 + "@types/node": ^22.10.5 + commander: ^13.0.0 + execa: ^9.5.2 fs.promises.exists: ^1.1.4 ora: ^8.1.1 read-pkg: ^9.0.1 rxjs: ^7.8.1 tsc-prog: ^2.3.0 tsup: ^8.3.5 - typescript: ^5.6.3 + typescript: ^5.7.3 write-package: ^7.1.0 bin: papi: dist/main.js polkadot-api: dist/main.js - checksum: 0d0e26e84998c6ddf5a13e1f701af5204c35ab06b7cdc3f8b1221cedd361922a5db904fbb32f0bb1416dd3f6570a1d36a6d7c94101612605a93baea77f32794a + checksum: c8cc76976208cdc321ea76d68d00176ff340a3ff4259573d1ca959849b5d2f86b9d19a4f6936035bbd44ff04688d12da0c7314715853f124e38158919cbe8c7a languageName: node linkType: hard -"@polkadot-api/codegen@npm:0.12.9": - version: 0.12.9 - resolution: "@polkadot-api/codegen@npm:0.12.9" +"@polkadot-api/codegen@npm:0.12.12": + version: 0.12.12 + resolution: "@polkadot-api/codegen@npm:0.12.12" dependencies: - "@polkadot-api/ink-contracts": 0.2.2 - "@polkadot-api/metadata-builders": 0.9.2 - "@polkadot-api/metadata-compatibility": 0.1.12 - "@polkadot-api/substrate-bindings": 0.9.4 + "@polkadot-api/ink-contracts": 0.2.4 + "@polkadot-api/metadata-builders": 0.10.0 + "@polkadot-api/metadata-compatibility": 0.1.14 + "@polkadot-api/substrate-bindings": 0.11.0 "@polkadot-api/utils": 0.1.2 - checksum: 9dce88598104cbe7f237860bbc31485e9ab84eac761b9a8ab0521f075b34915233ea855cf9245ca1c013e933ef8fa7aaecac376513b7e1c829f7b62f035c963e + checksum: 777e06cdf6b487a1cc814cebe344abf17939ffed927168f18721cccd448f10850a0afc2602ea64dcda83da99b4cc333cae1ade8e3062b8d4dab7e2b69bae14d9 languageName: node linkType: hard @@ -2756,15 +2756,15 @@ __metadata: languageName: node linkType: soft -"@polkadot-api/ink-contracts@npm:0.2.2": - version: 0.2.2 - resolution: "@polkadot-api/ink-contracts@npm:0.2.2" +"@polkadot-api/ink-contracts@npm:0.2.4": + version: 0.2.4 + resolution: "@polkadot-api/ink-contracts@npm:0.2.4" dependencies: - "@polkadot-api/metadata-builders": 0.9.2 - "@polkadot-api/substrate-bindings": 0.9.4 + "@polkadot-api/metadata-builders": 0.10.0 + "@polkadot-api/substrate-bindings": 0.11.0 "@polkadot-api/utils": 0.1.2 scale-ts: ^1.6.1 - checksum: 86ab565f94205f47887917b2193c5825c0f27a027442a2240a64e2e6885743334b4c526fb896cb6ad411311ae4c9a122fc37e98434b41aa895300e633d6347fb + checksum: 42184e035c83f80a40d0e82393649e1305b0b521b3efbed50bfdda7530eba0251fb07c0e6b2544e5869c4f25de0f6eb1fc925b35e5b01eddb3709f48ecd418cb languageName: node linkType: hard @@ -2796,10 +2796,10 @@ __metadata: languageName: node linkType: hard -"@polkadot-api/known-chains@npm:0.5.8": - version: 0.5.8 - resolution: "@polkadot-api/known-chains@npm:0.5.8" - checksum: 2f0dfd5f610927f00f41245113952c581cfa2b3fc0e1e29578ac52ca87b44a24aad5d10b76e3a79022cd6da46bb02048c854537004aee6da3df1a61bd53e0c72 +"@polkadot-api/known-chains@npm:0.6.1": + version: 0.6.1 + resolution: "@polkadot-api/known-chains@npm:0.6.1" + checksum: a7cbe7726778ae2c1503b41d5a2fe6f496a961deb25df17b336633d65827eb046651fc829ea8d490f1c7a11cd65b87b1e23009a8b1e6522fe5e4a57e6239422b languageName: node linkType: hard @@ -2812,6 +2812,16 @@ __metadata: languageName: node linkType: hard +"@polkadot-api/metadata-builders@npm:0.10.0": + version: 0.10.0 + resolution: "@polkadot-api/metadata-builders@npm:0.10.0" + dependencies: + "@polkadot-api/substrate-bindings": 0.11.0 + "@polkadot-api/utils": 0.1.2 + checksum: 0fb49a6cd4e2b66e3c3983f66e427b5763da0b67d5c4847c190e6e546f67bc4908d456b2afe80ce85316736d3aa408d779f309b292957648820aca44e6578719 + languageName: node + linkType: hard + "@polkadot-api/metadata-builders@npm:0.3.2": version: 0.3.2 resolution: "@polkadot-api/metadata-builders@npm:0.3.2" @@ -2822,37 +2832,27 @@ __metadata: languageName: node linkType: hard -"@polkadot-api/metadata-builders@npm:0.9.2": - version: 0.9.2 - resolution: "@polkadot-api/metadata-builders@npm:0.9.2" - dependencies: - "@polkadot-api/substrate-bindings": 0.9.4 - "@polkadot-api/utils": 0.1.2 - checksum: 2a5171e6659f0d99d247d4483ce7832bd803f563ce5eac59dbecd40d84eee4f0ff31ccbfdcd9c85fd805b5aeb4d865975f87ceba6dbb0de04753144988e8074f - languageName: node - linkType: hard - -"@polkadot-api/metadata-compatibility@npm:0.1.12": - version: 0.1.12 - resolution: "@polkadot-api/metadata-compatibility@npm:0.1.12" +"@polkadot-api/metadata-compatibility@npm:0.1.14": + version: 0.1.14 + resolution: "@polkadot-api/metadata-compatibility@npm:0.1.14" dependencies: - "@polkadot-api/metadata-builders": 0.9.2 - "@polkadot-api/substrate-bindings": 0.9.4 - checksum: b3aa63d3c9590cb4eff58825b5276bf523715f63277c5e2b048c2c5f7af8855fc2507b6a3142dddc8bc55188c8e423e707e35dfb2145154c84af78e0e1b0f4bb + "@polkadot-api/metadata-builders": 0.10.0 + "@polkadot-api/substrate-bindings": 0.11.0 + checksum: c660ad7334c69283498dc443d2f8aeb289b9b277f863bf8144cd2586e394b2e77e2521a33f7af5ca48be6a55144062e066657c7c3b8e3aa719219aca3535e012 languageName: node linkType: hard -"@polkadot-api/observable-client@npm:0.6.3": - version: 0.6.3 - resolution: "@polkadot-api/observable-client@npm:0.6.3" +"@polkadot-api/observable-client@npm:0.7.0": + version: 0.7.0 + resolution: "@polkadot-api/observable-client@npm:0.7.0" dependencies: - "@polkadot-api/metadata-builders": 0.9.2 - "@polkadot-api/substrate-bindings": 0.9.4 + "@polkadot-api/metadata-builders": 0.10.0 + "@polkadot-api/substrate-bindings": 0.11.0 "@polkadot-api/utils": 0.1.2 peerDependencies: "@polkadot-api/substrate-client": 0.3.0 rxjs: ">=7.8.0" - checksum: e5cc27b07546a78f892495c87c89e232458d0548311f3a5b55e0b2fe1745e2576575455f4af4cc0b13869d977e440f30e66476faf23dafe79996952a90320e3b + checksum: 3d71b230fa43af5238740a87619bc0a22d7f541e24f05d89f85d190689507832c39f58affc47d3c8596375c0504d4e2dc0348607dec7e2a04c9d2d5872c5a954 languageName: node linkType: hard @@ -2870,16 +2870,16 @@ __metadata: languageName: node linkType: hard -"@polkadot-api/pjs-signer@npm:0.6.1": - version: 0.6.1 - resolution: "@polkadot-api/pjs-signer@npm:0.6.1" +"@polkadot-api/pjs-signer@npm:0.6.3": + version: 0.6.3 + resolution: "@polkadot-api/pjs-signer@npm:0.6.3" dependencies: - "@polkadot-api/metadata-builders": 0.9.2 + "@polkadot-api/metadata-builders": 0.10.0 "@polkadot-api/polkadot-signer": 0.1.6 - "@polkadot-api/signers-common": 0.1.2 - "@polkadot-api/substrate-bindings": 0.9.4 + "@polkadot-api/signers-common": 0.1.4 + "@polkadot-api/substrate-bindings": 0.11.0 "@polkadot-api/utils": 0.1.2 - checksum: 76ec7481d36a575788303ec998d7c41246728ad82af4229ff33f8dd889ca8a8f109dd043ed69d38b7d31398355e8afe8864760287ab6e3de96718c3427654127 + checksum: 152f5e0b8bdac1666cae73683287ef26c15b1d15f9429e0826a50521e15d39d6d1ef27c4ed9553b41715d422b9887a2d7f3f5a359b47eca1a1eada7dc30eb8f1 languageName: node linkType: hard @@ -2899,28 +2899,28 @@ __metadata: languageName: node linkType: hard -"@polkadot-api/signer@npm:0.1.11": - version: 0.1.11 - resolution: "@polkadot-api/signer@npm:0.1.11" +"@polkadot-api/signer@npm:0.1.13": + version: 0.1.13 + resolution: "@polkadot-api/signer@npm:0.1.13" dependencies: - "@noble/hashes": ^1.5.0 + "@noble/hashes": ^1.6.1 "@polkadot-api/polkadot-signer": 0.1.6 - "@polkadot-api/signers-common": 0.1.2 - "@polkadot-api/substrate-bindings": 0.9.4 + "@polkadot-api/signers-common": 0.1.4 + "@polkadot-api/substrate-bindings": 0.11.0 "@polkadot-api/utils": 0.1.2 - checksum: 35048942c7dce5cec4918fd19fb6c4e8797b4a5a522ec4757f7f0db5eb9fec0e534269327dc09efb092e08c0a81f96b84133ec7a1125eeffbd1a48fd8d1cad71 + checksum: f536b57026076b3d8caf46541299247a46db179af0461256183050723557baa715b664bec84ad5d9a34a393ab0b56f2febd72aa05a63ee85d8c5e628dde301f8 languageName: node linkType: hard -"@polkadot-api/signers-common@npm:0.1.2": - version: 0.1.2 - resolution: "@polkadot-api/signers-common@npm:0.1.2" +"@polkadot-api/signers-common@npm:0.1.4": + version: 0.1.4 + resolution: "@polkadot-api/signers-common@npm:0.1.4" dependencies: - "@polkadot-api/metadata-builders": 0.9.2 + "@polkadot-api/metadata-builders": 0.10.0 "@polkadot-api/polkadot-signer": 0.1.6 - "@polkadot-api/substrate-bindings": 0.9.4 + "@polkadot-api/substrate-bindings": 0.11.0 "@polkadot-api/utils": 0.1.2 - checksum: 5bbb36f0258ec37e9daf459d40252329cb721a83dd1b1867a9f90e44946ab69b2f6ec8f11cb30ff330f4222280b1a92f828648e1b4edee341779d7849e909140 + checksum: f3406ec0e8166181de9c0bc99af3302fa96d1d309ac6c0a8f6ee59c4db1ff397443b7610a02c6d9c08a0db6256ae9b31299f88e8685ddef67b02b7b1ecd31d6c languageName: node linkType: hard @@ -2936,13 +2936,25 @@ __metadata: languageName: node linkType: hard -"@polkadot-api/smoldot@npm:0.3.7": - version: 0.3.7 - resolution: "@polkadot-api/smoldot@npm:0.3.7" +"@polkadot-api/smoldot@npm:0.3.8": + version: 0.3.8 + resolution: "@polkadot-api/smoldot@npm:0.3.8" dependencies: "@types/node": ^22.9.0 - smoldot: 2.0.33 - checksum: edd2e4b31a3f43231e86dc9452c8cf9c126858c48539d35d5f01146a6958db8f530dc01a9aaf01ffb8b7f0b3750cdc16223df80d548e212955de889defced114 + smoldot: 2.0.34 + checksum: d66575ba40a56c261d146910a7f9f14d9c42a9918fde70aa16435725a38dfe8e95b8153ae183b6f62a12087116c8aaa29c1cd916619a754078125ac3a0a6cd6c + languageName: node + linkType: hard + +"@polkadot-api/substrate-bindings@npm:0.11.0": + version: 0.11.0 + resolution: "@polkadot-api/substrate-bindings@npm:0.11.0" + dependencies: + "@noble/hashes": ^1.6.1 + "@polkadot-api/utils": 0.1.2 + "@scure/base": ^1.2.1 + scale-ts: ^1.6.1 + checksum: 8e0ea627a036b2bfd34adba06bb535d5ec473b118c53c2de88e48f245907decebbebd701b27f62d351509c6d28c88630160c1a4110ef5a61b0ca53088e94864f languageName: node linkType: hard @@ -2958,18 +2970,6 @@ __metadata: languageName: node linkType: hard -"@polkadot-api/substrate-bindings@npm:0.9.4": - version: 0.9.4 - resolution: "@polkadot-api/substrate-bindings@npm:0.9.4" - dependencies: - "@noble/hashes": ^1.5.0 - "@polkadot-api/utils": 0.1.2 - "@scure/base": ^1.1.9 - scale-ts: ^1.6.1 - checksum: eb4226807a07ed8f65ae641a1973d8b0b97410392b7c8d23002c9881d4098f31e31a14157a4e4adf250afd66355406a6108995d14a72ff3dfc15b17f314d2e61 - languageName: node - linkType: hard - "@polkadot-api/substrate-client@npm:0.3.0": version: 0.3.0 resolution: "@polkadot-api/substrate-client@npm:0.3.0" @@ -2990,14 +2990,14 @@ __metadata: languageName: node linkType: hard -"@polkadot-api/tx-utils@npm:^0.0.6": - version: 0.0.6 - resolution: "@polkadot-api/tx-utils@npm:0.0.6" +"@polkadot-api/tx-utils@npm:^0.0.8": + version: 0.0.8 + resolution: "@polkadot-api/tx-utils@npm:0.0.8" dependencies: - "@polkadot-api/metadata-builders": 0.9.2 - "@polkadot-api/substrate-bindings": 0.9.4 + "@polkadot-api/metadata-builders": 0.10.0 + "@polkadot-api/substrate-bindings": 0.11.0 "@polkadot-api/utils": 0.1.2 - checksum: 20b7d46b73b825c3c6e0040daa1e7c3be21d011424f4e823c874d967a77dab642c9cd38565b67186d3be758ed8f9148c21beefb3da7492b39286cc8e96e8783a + checksum: 36be45cab7e47e1052278e4c08161db036210446a9006b1698c3c10a93ca97822d9c9c62a2ee78a7e15bc2f8d08fd12d4791e3ac26564a7478db8fad38efd158 languageName: node linkType: hard @@ -3983,7 +3983,16 @@ __metadata: languageName: node linkType: hard -"@scure/base@npm:^1.1.1, @scure/base@npm:^1.1.3, @scure/base@npm:^1.1.9": +"@rx-state/core@npm:^0.1.4": + version: 0.1.4 + resolution: "@rx-state/core@npm:0.1.4" + peerDependencies: + rxjs: ">=7" + checksum: d1ca270c87d273fae93e84ee060d66cb3f60308e00cf72b87b6fae67d9478e2375724c8bd00751bb098f83097deb03d3000e642a441168fc4f9d5af8ad009997 + languageName: node + linkType: hard + +"@scure/base@npm:^1.1.1, @scure/base@npm:^1.1.3": version: 1.1.9 resolution: "@scure/base@npm:1.1.9" checksum: 77a06b9a2db8144d22d9bf198338893d77367c51b58c72b99df990c0a11f7cadd066d4102abb15e3ca6798d1529e3765f55c4355742465e49aed7a0c01fe76e8 @@ -4770,7 +4779,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:^22.9.0, @types/node@npm:^22.9.1": +"@types/node@npm:*, @types/node@npm:^22.9.0": version: 22.9.1 resolution: "@types/node@npm:22.9.1" dependencies: @@ -4788,6 +4797,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:^22.10.5": + version: 22.10.6 + resolution: "@types/node@npm:22.10.6" + dependencies: + undici-types: ~6.20.0 + checksum: 8b67affc211e5f9c74f7949cda04ca669721e50b83d71b8772a7bed7a4a3c41d663b3a794413f618e763ca6c5da8c234c25ffebcb0737983fc3e7415818ab9a7 + languageName: node + linkType: hard + "@types/normalize-package-data@npm:^2.4.3": version: 2.4.4 resolution: "@types/normalize-package-data@npm:2.4.4" @@ -6391,10 +6409,10 @@ __metadata: languageName: node linkType: hard -"commander@npm:^12.1.0": - version: 12.1.0 - resolution: "commander@npm:12.1.0" - checksum: 6e1996680c083b3b897bfc1cfe1c58dfbcd9842fd43e1aaf8a795fbc237f65efcc860a3ef457b318e73f29a4f4a28f6403c3d653d021d960e4632dd45bde54a9 +"commander@npm:^13.0.0": + version: 13.0.0 + resolution: "commander@npm:13.0.0" + checksum: 8ba1e2b83bfdbcefd967aa505f5f5dc58202aa5f8e10437f61f6980dd8a69f868dba439a261f9fb72fc543c5f6fe58140e37b001a4c70b92ae22527abe94dfe1 languageName: node linkType: hard @@ -7737,9 +7755,9 @@ __metadata: languageName: node linkType: hard -"execa@npm:^9.5.1": - version: 9.5.1 - resolution: "execa@npm:9.5.1" +"execa@npm:^9.5.2": + version: 9.5.2 + resolution: "execa@npm:9.5.2" dependencies: "@sindresorhus/merge-streams": ^4.0.0 cross-spawn: ^7.0.3 @@ -7753,7 +7771,7 @@ __metadata: signal-exit: ^4.1.0 strip-final-newline: ^4.0.0 yoctocolors: ^2.0.0 - checksum: 1a628d535c5a088f9e17a735bb3143efc4198095392b319ba877b2975d5c3c57724536dccb6f68f1cd9b3af331c5a9e8c1aeb338d52ab316b1e008ff453374a7 + checksum: 94782a6282e03253224406c29068d18f9095cc251a45d1f19ac3d8f2a9db2cbe32fb8ceb039db1451d8fce3531135a6c0c559f76d634f85416268fc4a6995365 languageName: node linkType: hard @@ -10160,7 +10178,7 @@ __metadata: "@mui/material": ^6.1.10 "@mui/styled-engine": ^6.1.10 "@polkadot-api/descriptors": "portal:.papi/descriptors" - "@polkadot-api/tx-utils": ^0.0.6 + "@polkadot-api/tx-utils": ^0.0.8 "@polkadot-labs/hdkd": ^0.0.10 "@polkadot-labs/hdkd-helpers": ^0.0.10 "@polkadot/react-identicon": ^3.11.3 @@ -10188,7 +10206,7 @@ __metadata: graphql-request: ^7.1.2 graphql-ws: ^5.16.0 json5: ^2.2.3 - polkadot-api: ^1.7.7 + polkadot-api: ^1.8.2 react: 18.3.1 react-dom: 18.3.1 react-icons: ^5.4.0 @@ -10948,34 +10966,35 @@ __metadata: languageName: node linkType: hard -"polkadot-api@npm:^1.7.7": - version: 1.7.7 - resolution: "polkadot-api@npm:1.7.7" +"polkadot-api@npm:^1.8.2": + version: 1.8.2 + resolution: "polkadot-api@npm:1.8.2" dependencies: - "@polkadot-api/cli": 0.9.21 - "@polkadot-api/ink-contracts": 0.2.2 + "@polkadot-api/cli": 0.10.1 + "@polkadot-api/ink-contracts": 0.2.4 "@polkadot-api/json-rpc-provider": 0.0.4 - "@polkadot-api/known-chains": 0.5.8 + "@polkadot-api/known-chains": 0.6.1 "@polkadot-api/logs-provider": 0.0.6 - "@polkadot-api/metadata-builders": 0.9.2 - "@polkadot-api/metadata-compatibility": 0.1.12 - "@polkadot-api/observable-client": 0.6.3 - "@polkadot-api/pjs-signer": 0.6.1 + "@polkadot-api/metadata-builders": 0.10.0 + "@polkadot-api/metadata-compatibility": 0.1.14 + "@polkadot-api/observable-client": 0.7.0 + "@polkadot-api/pjs-signer": 0.6.3 "@polkadot-api/polkadot-sdk-compat": 2.3.1 "@polkadot-api/polkadot-signer": 0.1.6 - "@polkadot-api/signer": 0.1.11 + "@polkadot-api/signer": 0.1.13 "@polkadot-api/sm-provider": 0.1.7 - "@polkadot-api/smoldot": 0.3.7 - "@polkadot-api/substrate-bindings": 0.9.4 + "@polkadot-api/smoldot": 0.3.8 + "@polkadot-api/substrate-bindings": 0.11.0 "@polkadot-api/substrate-client": 0.3.0 "@polkadot-api/utils": 0.1.2 "@polkadot-api/ws-provider": 0.3.6 + "@rx-state/core": ^0.1.4 peerDependencies: rxjs: ">=7.8.0" bin: papi: bin/cli.mjs polkadot-api: bin/cli.mjs - checksum: c1241d233662b78d9422bb97579bd75f667d15ee1ecc46cb4ef49041b5881d52084c08c97fbb59fee6a3a259a74d61250e0bbe64bb9eb3a1f511bc9fab662b6b + checksum: 9ec708089cfb2696e1ad9a5567c7ce8c6da5829a668f0efc667071b40be1ec5e0aa45b6467635c80147712ded9608afd70dc74c4c498e655e18abcf6edb96bff languageName: node linkType: hard @@ -11997,12 +12016,12 @@ __metadata: languageName: node linkType: hard -"smoldot@npm:2.0.33": - version: 2.0.33 - resolution: "smoldot@npm:2.0.33" +"smoldot@npm:2.0.34": + version: 2.0.34 + resolution: "smoldot@npm:2.0.34" dependencies: ws: ^8.8.1 - checksum: dada517972924017077b4e8c6f76169ddcd371c270e714db42e034c0c974898a15f640759576b712f9d0aa3e2f1bb01c7e5d2e711e329f0f6837902ac51bb1fa + checksum: b9079a70706c54ee16d0ec0b626f6f13807b6130856c570b84ca8dd0506283110017bcc7696d08f3a15e70c9bf2d5ba8a2d7249665347185593193beb1907d1e languageName: node linkType: hard @@ -12907,7 +12926,7 @@ __metadata: languageName: node linkType: hard -"typescript@npm:5.7.2, typescript@npm:^5.6.3": +"typescript@npm:5.7.2": version: 5.7.2 resolution: "typescript@npm:5.7.2" bin: @@ -12917,7 +12936,17 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@5.7.2#~builtin, typescript@patch:typescript@^5.6.3#~builtin": +"typescript@npm:^5.7.3": + version: 5.7.3 + resolution: "typescript@npm:5.7.3" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: b7580d716cf1824736cc6e628ab4cd8b51877408ba2be0869d2866da35ef8366dd6ae9eb9d0851470a39be17cbd61df1126f9e211d8799d764ea7431d5435afa + languageName: node + linkType: hard + +"typescript@patch:typescript@5.7.2#~builtin": version: 5.7.2 resolution: "typescript@patch:typescript@npm%3A5.7.2#~builtin::version=5.7.2&hash=f3b441" bin: @@ -12927,6 +12956,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@^5.7.3#~builtin": + version: 5.7.3 + resolution: "typescript@patch:typescript@npm%3A5.7.3#~builtin::version=5.7.3&hash=f3b441" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 3b56d6afa03d9f6172d0b9cdb10e6b1efc9abc1608efd7a3d2f38773d5d8cfb9bbc68dfb72f0a7de5e8db04fc847f4e4baeddcd5ad9c9feda072234f0d788896 + languageName: node + linkType: hard + "ua-parser-js@npm:^1.0.35": version: 1.0.39 resolution: "ua-parser-js@npm:1.0.39"