From 2ae2b956a35bda531e33e37f43b049de93e77dcd Mon Sep 17 00:00:00 2001 From: tomiir Date: Fri, 24 Jan 2025 13:09:23 +0100 Subject: [PATCH 1/9] chore: unify sign message examples for basic --- .../components/UPA/UpaEvmSignMessageTest.tsx | 54 ------------------- ...MessageTest.tsx => UpaSignMessageTest.tsx} | 28 +++++++--- .../src/components/UPA/UpaTests.tsx | 13 +---- .../src/pages/library/multichain-basic.tsx | 27 +++++----- packages/appkit/exports/constants.ts | 2 +- 5 files changed, 37 insertions(+), 87 deletions(-) delete mode 100644 apps/laboratory/src/components/UPA/UpaEvmSignMessageTest.tsx rename apps/laboratory/src/components/UPA/{UpaSolanaSignMessageTest.tsx => UpaSignMessageTest.tsx} (79%) diff --git a/apps/laboratory/src/components/UPA/UpaEvmSignMessageTest.tsx b/apps/laboratory/src/components/UPA/UpaEvmSignMessageTest.tsx deleted file mode 100644 index 4f6c507a89..0000000000 --- a/apps/laboratory/src/components/UPA/UpaEvmSignMessageTest.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import * as React from 'react' - -import { Button } from '@chakra-ui/react' -import Provider from '@walletconnect/universal-provider' - -import { useAppKitAccount, useAppKitProvider } from '@reown/appkit/react' - -import { ConstantsUtil } from '../../utils/ConstantsUtil' -import { useChakraToast } from '../Toast' - -export function UpaEvmSignMessageTest() { - const toast = useChakraToast() - const { isConnected, address } = useAppKitAccount() - const { walletProvider } = useAppKitProvider('eip155') - - async function onSignMessage() { - try { - if (!walletProvider || !address) { - throw Error('user is disconnected') - } - - await walletProvider.request({ - method: 'eth_sign', - params: [address, 'Hello AppKit!'] - }) - - toast({ - title: ConstantsUtil.SigningSucceededToastTitle, - description: 'Success', - type: 'success' - }) - } catch (error) { - toast({ - title: ConstantsUtil.SigningFailedToastTitle, - description: 'Failed to sign message', - type: 'error' - }) - } - } - - return ( - <> - - - - ) -} diff --git a/apps/laboratory/src/components/UPA/UpaSolanaSignMessageTest.tsx b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx similarity index 79% rename from apps/laboratory/src/components/UPA/UpaSolanaSignMessageTest.tsx rename to apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx index cb0523a5e6..17fded61e4 100644 --- a/apps/laboratory/src/components/UPA/UpaSolanaSignMessageTest.tsx +++ b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx @@ -9,24 +9,38 @@ import { useAppKitAccount, useAppKitNetwork, useAppKitProvider } from '@reown/ap import { ConstantsUtil } from '../../utils/ConstantsUtil' import { useChakraToast } from '../Toast' -export function UpaSolanaSignMessageTest() { +export function UpaSignMessageTest() { const toast = useChakraToast() const { isConnected, address } = useAppKitAccount() const { walletProvider } = useAppKitProvider('solana') const { caipNetwork } = useAppKitNetwork() + function payloadByNamespace(namespace: string) { + return { + solana: { + method: 'solana_signMessage', + params: { + message: base58.encode(new TextEncoder().encode('Hello Appkit!')), + pubkey: address + } + }, + eip155: { + method: 'personal_sign', + params: [address, 'Hello AppKit!'] + } + }[namespace] + } + async function onSignMessage() { try { if (!walletProvider || !address) { throw Error('user is disconnected') } - const payload = { - method: 'solana_signMessage', - params: { - message: base58.encode(new TextEncoder().encode('Hello Appkit!')), - pubkey: address - } + const payload = payloadByNamespace(caipNetwork?.chainNamespace) + + if (!payload) { + throw Error('Chain not supported by laboratory') } await walletProvider.request(payload, caipNetwork?.caipNetworkId) diff --git a/apps/laboratory/src/components/UPA/UpaTests.tsx b/apps/laboratory/src/components/UPA/UpaTests.tsx index 6b8533e034..a2109ccd70 100644 --- a/apps/laboratory/src/components/UPA/UpaTests.tsx +++ b/apps/laboratory/src/components/UPA/UpaTests.tsx @@ -1,13 +1,8 @@ import { Box, Card, CardBody, CardHeader, Heading, Stack, StackDivider } from '@chakra-ui/react' -import { useAppKitNetwork } from '@reown/appkit/react' - -import { UpaEvmSignMessageTest } from './UpaEvmSignMessageTest' -import { UpaSolanaSignMessageTest } from './UpaSolanaSignMessageTest' +import { UpaSignMessageTest } from './UpaSignMessageTest' export function UpaTests() { - const { caipNetwork } = useAppKitNetwork() - return ( @@ -19,11 +14,7 @@ export function UpaTests() { Sign Message - {caipNetwork?.chainNamespace === 'eip155' ? ( - - ) : ( - - )} + diff --git a/apps/laboratory/src/pages/library/multichain-basic.tsx b/apps/laboratory/src/pages/library/multichain-basic.tsx index fd406fcf5a..adcd24faa9 100644 --- a/apps/laboratory/src/pages/library/multichain-basic.tsx +++ b/apps/laboratory/src/pages/library/multichain-basic.tsx @@ -7,20 +7,19 @@ import { UpaTests } from '../../components/UPA/UpaTests' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { ThemeStore } from '../../utils/StoreUtil' -const networks = [ - ...ConstantsUtil.AllNetworks, - defineChain({ - id: '91b171bb158e2d3848fa23a9f1c25182', - name: 'Polkadot', - network: 'polkadot', - nativeCurrency: { name: 'Polkadot', symbol: 'DOT', decimals: 18 }, - rpcUrls: { - default: { http: ['https://rpc.polkadot.io'] } - }, - chainNamespace: 'polkadot', - caipNetworkId: 'polkadot:mainnet' - }) -] +const polkadot = defineChain({ + id: '91b171bb158e2d3848fa23a9f1c25182', + name: 'Polkadot', + network: 'polkadot', + nativeCurrency: { name: 'Polkadot', symbol: 'DOT', decimals: 18 }, + rpcUrls: { + default: { http: ['https://rpc.polkadot.io'] } + }, + chainNamespace: 'polkadot', + caipNetworkId: 'polkadot:mainnet' +}) + +const networks = [...ConstantsUtil.AllNetworks, polkadot] const modal = createAppKit({ networks: networks as [AppKitNetwork, ...AppKitNetwork[]], diff --git a/packages/appkit/exports/constants.ts b/packages/appkit/exports/constants.ts index c53aea96a7..90ae53e844 100644 --- a/packages/appkit/exports/constants.ts +++ b/packages/appkit/exports/constants.ts @@ -1 +1 @@ -export const PACKAGE_VERSION = '1.6.4' +export const PACKAGE_VERSION = '1.6.5' From d9e7713c2c95766f406cc6373ccbcba9c754bfe6 Mon Sep 17 00:00:00 2001 From: tomiir Date: Fri, 24 Jan 2025 13:21:17 +0100 Subject: [PATCH 2/9] chore: fix wallet provider issue --- apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx | 3 ++- packages/appkit/src/client.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx index 17fded61e4..541f8f1f41 100644 --- a/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx +++ b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx @@ -12,8 +12,8 @@ import { useChakraToast } from '../Toast' export function UpaSignMessageTest() { const toast = useChakraToast() const { isConnected, address } = useAppKitAccount() - const { walletProvider } = useAppKitProvider('solana') const { caipNetwork } = useAppKitNetwork() + const { walletProvider } = useAppKitProvider(caipNetwork.chainNamespace) function payloadByNamespace(namespace: string) { return { @@ -51,6 +51,7 @@ export function UpaSignMessageTest() { type: 'success' }) } catch (error) { + console.log('>>> Error signing message ', error) toast({ title: ConstantsUtil.SigningFailedToastTitle, description: 'Failed to sign message', diff --git a/packages/appkit/src/client.ts b/packages/appkit/src/client.ts index 9b4a4e8595..3bb5f8b32b 100644 --- a/packages/appkit/src/client.ts +++ b/packages/appkit/src/client.ts @@ -203,7 +203,7 @@ export class AppKit { // -- Public ------------------------------------------------------------------- public async open(options?: OpenOptions) { await this.injectModalUi() - if (options?.uri && this.universalAdapter) { + if (options?.uri && this.universalProvider) { ConnectionController.setUri(options.uri) } ModalController.open(options) From 421bb13b17e8f6eb724ef5facef2882ba24ee350 Mon Sep 17 00:00:00 2001 From: tomiir Date: Fri, 24 Jan 2025 14:10:23 +0100 Subject: [PATCH 3/9] chore: add polkadot sign message support --- .../src/components/UPA/UpaSignMessageTest.tsx | 70 +++++++++++++++++-- .../library/custom-universal-provider.tsx | 2 +- .../src/pages/library/multichain-basic.tsx | 2 +- .../src/connectors/WalletConnectConnector.ts | 4 +- packages/appkit/src/utils/HelpersUtil.ts | 4 +- 5 files changed, 74 insertions(+), 8 deletions(-) diff --git a/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx index 541f8f1f41..c24e2dc183 100644 --- a/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx +++ b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx @@ -6,6 +6,7 @@ import base58 from 'bs58' import { useAppKitAccount, useAppKitNetwork, useAppKitProvider } from '@reown/appkit/react' +import { BitcoinUtil } from '../../utils/BitcoinUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { useChakraToast } from '../Toast' @@ -13,10 +14,15 @@ export function UpaSignMessageTest() { const toast = useChakraToast() const { isConnected, address } = useAppKitAccount() const { caipNetwork } = useAppKitNetwork() + + if (!caipNetwork) { + return null + } + const { walletProvider } = useAppKitProvider(caipNetwork.chainNamespace) - function payloadByNamespace(namespace: string) { - return { + async function getPayload() { + const map: Record = { solana: { method: 'solana_signMessage', params: { @@ -27,8 +33,64 @@ export function UpaSignMessageTest() { eip155: { method: 'personal_sign', params: [address, 'Hello AppKit!'] + }, + bip122: { + method: 'signPsbt', + params: { + psbt: '', + account: address + } + }, + polkadot: { + method: 'polkadot_signMessage', + params: { + transactionPayload: { + specVersion: '0x00002468', + transactionVersion: '0x0000000e', + address: `${address}`, + blockHash: '0x554d682a74099d05e8b7852d19c93b527b5fae1e9e1969f6e1b82a2f09a14cc9', + blockNumber: '0x00cb539c', + era: '0xc501', + genesisHash: '0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e', + method: '0x0001784920616d207369676e696e672074686973207472616e73616374696f6e21', + nonce: '0x00000000', + signedExtensions: [ + 'CheckNonZeroSender', + 'CheckSpecVersion', + 'CheckTxVersion', + 'CheckGenesis', + 'CheckMortality', + 'CheckNonce', + 'CheckWeight', + 'ChargeTransactionPayment' + ], + tip: '0x00000000000000000000000000000000', + version: 4 + }, + address + } } - }[namespace] + } + + const payload = map[caipNetwork?.chainNamespace || ''] + + if (payload && address && caipNetwork?.chainNamespace === 'bip122') { + const utxos = await BitcoinUtil.getUTXOs(address, caipNetwork.caipNetworkId) + const feeRate = await BitcoinUtil.getFeeRate() + + const { psbt } = BitcoinUtil.createSignPSBTParams({ + amount: 1000, + feeRate, + network: caipNetwork, + recipientAddress: address, + senderAddress: address, + utxos + }) + + payload.params.psbt = psbt + } + + return payload } async function onSignMessage() { @@ -37,7 +99,7 @@ export function UpaSignMessageTest() { throw Error('user is disconnected') } - const payload = payloadByNamespace(caipNetwork?.chainNamespace) + const payload = await getPayload() if (!payload) { throw Error('Chain not supported by laboratory') diff --git a/apps/laboratory/src/pages/library/custom-universal-provider.tsx b/apps/laboratory/src/pages/library/custom-universal-provider.tsx index b6c2007bff..e3d9d2c2d4 100644 --- a/apps/laboratory/src/pages/library/custom-universal-provider.tsx +++ b/apps/laboratory/src/pages/library/custom-universal-provider.tsx @@ -11,7 +11,7 @@ import { UpaTests } from '../../components/UPA/UpaTests' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { ThemeStore } from '../../utils/StoreUtil' -const networks = ConstantsUtil.EvmNetworks +const networks = [...ConstantsUtil.AllNetworks, ...ConstantsUtil.BitcoinNetworks] export default function MultiChainWagmiAdapterOnly() { const [uprovider, setUprovider] = useState(null) diff --git a/apps/laboratory/src/pages/library/multichain-basic.tsx b/apps/laboratory/src/pages/library/multichain-basic.tsx index adcd24faa9..008d4145bb 100644 --- a/apps/laboratory/src/pages/library/multichain-basic.tsx +++ b/apps/laboratory/src/pages/library/multichain-basic.tsx @@ -19,7 +19,7 @@ const polkadot = defineChain({ caipNetworkId: 'polkadot:mainnet' }) -const networks = [...ConstantsUtil.AllNetworks, polkadot] +const networks = [...ConstantsUtil.EvmNetworks, polkadot] const modal = createAppKit({ networks: networks as [AppKitNetwork, ...AppKitNetwork[]], diff --git a/packages/appkit/src/connectors/WalletConnectConnector.ts b/packages/appkit/src/connectors/WalletConnectConnector.ts index c2e89db7e2..b593575e4b 100644 --- a/packages/appkit/src/connectors/WalletConnectConnector.ts +++ b/packages/appkit/src/connectors/WalletConnectConnector.ts @@ -37,8 +37,10 @@ export class WalletConnectConnector> Connecting WalletConnect', namespaces) await this.provider.connect({ - optionalNamespaces: WcHelpersUtil.createNamespaces(this.caipNetworks) + optionalNamespaces: namespaces }) } diff --git a/packages/appkit/src/utils/HelpersUtil.ts b/packages/appkit/src/utils/HelpersUtil.ts index 4d07d58484..5fe6452c09 100644 --- a/packages/appkit/src/utils/HelpersUtil.ts +++ b/packages/appkit/src/utils/HelpersUtil.ts @@ -44,6 +44,8 @@ export const WcHelpersUtil = { }, createNamespaces(caipNetworks: CaipNetwork[]): NamespaceConfig { + console.log('>> Creating namespaces', caipNetworks) + return caipNetworks.reduce((acc, chain) => { const { id, chainNamespace, rpcUrls } = chain const rpcUrl = rpcUrls.default.http[0] @@ -52,7 +54,7 @@ export const WcHelpersUtil = { if (!acc[chainNamespace]) { acc[chainNamespace] = { - methods, + optionalMethods: methods, events: ['accountsChanged', 'chainChanged'], chains: [], rpcMap: {} From 961fae6019a7e3a6e147494f598fdf1eaed28657 Mon Sep 17 00:00:00 2001 From: tomiir Date: Fri, 24 Jan 2025 14:14:03 +0100 Subject: [PATCH 4/9] chore: fix issue --- packages/appkit/src/connectors/WalletConnectConnector.ts | 4 +--- packages/appkit/src/utils/HelpersUtil.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/appkit/src/connectors/WalletConnectConnector.ts b/packages/appkit/src/connectors/WalletConnectConnector.ts index b593575e4b..c2e89db7e2 100644 --- a/packages/appkit/src/connectors/WalletConnectConnector.ts +++ b/packages/appkit/src/connectors/WalletConnectConnector.ts @@ -37,10 +37,8 @@ export class WalletConnectConnector> Connecting WalletConnect', namespaces) await this.provider.connect({ - optionalNamespaces: namespaces + optionalNamespaces: WcHelpersUtil.createNamespaces(this.caipNetworks) }) } diff --git a/packages/appkit/src/utils/HelpersUtil.ts b/packages/appkit/src/utils/HelpersUtil.ts index 5fe6452c09..a44a77737e 100644 --- a/packages/appkit/src/utils/HelpersUtil.ts +++ b/packages/appkit/src/utils/HelpersUtil.ts @@ -54,7 +54,7 @@ export const WcHelpersUtil = { if (!acc[chainNamespace]) { acc[chainNamespace] = { - optionalMethods: methods, + methods, events: ['accountsChanged', 'chainChanged'], chains: [], rpcMap: {} From 8ca2bb11cdbc6f0d4795bb97d2c65cac463dd22c Mon Sep 17 00:00:00 2001 From: tomiir Date: Fri, 24 Jan 2025 14:59:43 +0100 Subject: [PATCH 5/9] chore: remove logs --- apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx | 1 - packages/appkit/src/utils/HelpersUtil.ts | 2 -- 2 files changed, 3 deletions(-) diff --git a/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx index c24e2dc183..bb0cdb8bf9 100644 --- a/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx +++ b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx @@ -113,7 +113,6 @@ export function UpaSignMessageTest() { type: 'success' }) } catch (error) { - console.log('>>> Error signing message ', error) toast({ title: ConstantsUtil.SigningFailedToastTitle, description: 'Failed to sign message', diff --git a/packages/appkit/src/utils/HelpersUtil.ts b/packages/appkit/src/utils/HelpersUtil.ts index a44a77737e..4d07d58484 100644 --- a/packages/appkit/src/utils/HelpersUtil.ts +++ b/packages/appkit/src/utils/HelpersUtil.ts @@ -44,8 +44,6 @@ export const WcHelpersUtil = { }, createNamespaces(caipNetworks: CaipNetwork[]): NamespaceConfig { - console.log('>> Creating namespaces', caipNetworks) - return caipNetworks.reduce((acc, chain) => { const { id, chainNamespace, rpcUrls } = chain const rpcUrl = rpcUrls.default.http[0] From 0e2dae836c8e6301accecdcec7065671768108df Mon Sep 17 00:00:00 2001 From: tomiir Date: Fri, 24 Jan 2025 15:07:06 +0100 Subject: [PATCH 6/9] chore: replace any for unknown0 --- apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx index bb0cdb8bf9..b7dc1810d5 100644 --- a/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx +++ b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx @@ -22,7 +22,7 @@ export function UpaSignMessageTest() { const { walletProvider } = useAppKitProvider(caipNetwork.chainNamespace) async function getPayload() { - const map: Record = { + const map: Record = { solana: { method: 'solana_signMessage', params: { From d8db56ea808cb5934515dfc799e2e02210a3ade9 Mon Sep 17 00:00:00 2001 From: tomiir Date: Fri, 24 Jan 2025 15:11:59 +0100 Subject: [PATCH 7/9] chore: ignore ts error --- apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx index b7dc1810d5..7fa9478d7a 100644 --- a/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx +++ b/apps/laboratory/src/components/UPA/UpaSignMessageTest.tsx @@ -22,7 +22,8 @@ export function UpaSignMessageTest() { const { walletProvider } = useAppKitProvider(caipNetwork.chainNamespace) async function getPayload() { - const map: Record = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const map: Record = { solana: { method: 'solana_signMessage', params: { From 2c010d5407603b9046d14519eaa0057c2745f53e Mon Sep 17 00:00:00 2001 From: tomiir Date: Fri, 24 Jan 2025 15:18:45 +0100 Subject: [PATCH 8/9] chore: fix type issue --- .../src/pages/library/custom-universal-provider.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/laboratory/src/pages/library/custom-universal-provider.tsx b/apps/laboratory/src/pages/library/custom-universal-provider.tsx index e3d9d2c2d4..50920f469b 100644 --- a/apps/laboratory/src/pages/library/custom-universal-provider.tsx +++ b/apps/laboratory/src/pages/library/custom-universal-provider.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import Provider, { UniversalProvider } from '@walletconnect/universal-provider' -import { mainnet } from '@reown/appkit/networks' +import { type AppKitNetwork, mainnet } from '@reown/appkit/networks' import { AppKit, createAppKit } from '@reown/appkit/react' import { AppKitButtons } from '../../components/AppKitButtons' @@ -11,7 +11,10 @@ import { UpaTests } from '../../components/UPA/UpaTests' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { ThemeStore } from '../../utils/StoreUtil' -const networks = [...ConstantsUtil.AllNetworks, ...ConstantsUtil.BitcoinNetworks] +const networks = [...ConstantsUtil.AllNetworks, ...ConstantsUtil.BitcoinNetworks] as [ + AppKitNetwork, + ...AppKitNetwork[] +] export default function MultiChainWagmiAdapterOnly() { const [uprovider, setUprovider] = useState(null) From 0760198226f7683e67adf77f9625a5691b34db6f Mon Sep 17 00:00:00 2001 From: tomiir Date: Fri, 24 Jan 2025 15:30:26 +0100 Subject: [PATCH 9/9] chore: add solana and bitcoin --- .../src/pages/library/multichain-basic.tsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/apps/laboratory/src/pages/library/multichain-basic.tsx b/apps/laboratory/src/pages/library/multichain-basic.tsx index 008d4145bb..080fee75a3 100644 --- a/apps/laboratory/src/pages/library/multichain-basic.tsx +++ b/apps/laboratory/src/pages/library/multichain-basic.tsx @@ -1,4 +1,4 @@ -import { type AppKitNetwork, defineChain, mainnet } from '@reown/appkit/networks' +import { type AppKitNetwork, mainnet } from '@reown/appkit/networks' import { createAppKit } from '@reown/appkit/react' import { AppKitButtons } from '../../components/AppKitButtons' @@ -7,19 +7,7 @@ import { UpaTests } from '../../components/UPA/UpaTests' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { ThemeStore } from '../../utils/StoreUtil' -const polkadot = defineChain({ - id: '91b171bb158e2d3848fa23a9f1c25182', - name: 'Polkadot', - network: 'polkadot', - nativeCurrency: { name: 'Polkadot', symbol: 'DOT', decimals: 18 }, - rpcUrls: { - default: { http: ['https://rpc.polkadot.io'] } - }, - chainNamespace: 'polkadot', - caipNetworkId: 'polkadot:mainnet' -}) - -const networks = [...ConstantsUtil.EvmNetworks, polkadot] +const networks = [...ConstantsUtil.AllNetworks, ...ConstantsUtil.BitcoinNetworks] const modal = createAppKit({ networks: networks as [AppKitNetwork, ...AppKitNetwork[]],