From ff68bb314533fa406e9a8b53916c3584255bc397 Mon Sep 17 00:00:00 2001 From: tomiir Date: Tue, 24 Sep 2024 21:39:58 -0300 Subject: [PATCH] chore: make all lab pages use shared networks constant (#2917) Co-authored-by: Felipe Mendes --- .../src/pages/library/ethers-all-internal.tsx | 6 +++-- .../src/pages/library/ethers-all.tsx | 6 +++-- .../src/pages/library/ethers-no-email.tsx | 6 +++-- .../src/pages/library/ethers-no-socials.tsx | 6 +++-- .../src/pages/library/ethers-siwe.tsx | 7 +++-- apps/laboratory/src/pages/library/ethers.tsx | 7 +++-- .../pages/library/ethers5-all-internal.tsx | 5 ++-- .../src/pages/library/ethers5-all.tsx | 6 +++-- .../src/pages/library/ethers5-no-email.tsx | 6 +++-- .../src/pages/library/ethers5-no-socials.tsx | 6 +++-- .../src/pages/library/ethers5-siwe.tsx | 6 +++-- apps/laboratory/src/pages/library/ethers5.tsx | 7 +++-- .../laboratory/src/pages/library/external.tsx | 5 ++-- .../src/pages/library/multichain-basic.tsx | 8 +++--- .../library/multichain-ethers-solana-siwe.tsx | 14 +++------- .../library/multichain-ethers-solana.tsx | 14 +++------- .../multichain-ethers5-solana-siwe.tsx | 15 ++++------- .../library/multichain-ethers5-solana.tsx | 15 ++++------- .../library/multichain-wagmi-solana-siwe.tsx | 27 +++---------------- .../pages/library/multichain-wagmi-solana.tsx | 12 ++------- .../src/pages/library/solana-no-email.tsx | 6 +++-- .../src/pages/library/solana-no-socials.tsx | 5 ++-- apps/laboratory/src/pages/library/solana.tsx | 5 ++-- .../pages/library/verify-domain-mismatch.tsx | 9 ++++--- .../src/pages/library/verify-evil.tsx | 6 +++-- .../src/pages/library/verify-valid.tsx | 6 +++-- .../src/pages/library/wagmi-all-internal.tsx | 4 +-- .../src/pages/library/wagmi-all.tsx | 4 +-- .../src/pages/library/wagmi-no-email.tsx | 4 +-- .../src/pages/library/wagmi-no-socials.tsx | 4 +-- .../pages/library/wagmi-permissions-async.tsx | 4 +-- .../pages/library/wagmi-permissions-sync.tsx | 4 +-- .../src/pages/library/wagmi-siwe.tsx | 8 +++--- apps/laboratory/src/pages/library/wagmi.tsx | 7 ++--- apps/laboratory/src/utils/ConstantsUtil.ts | 20 +++++++++++++- apps/laboratory/src/utils/SiweUtils.ts | 4 +-- examples/html-ethers/src/main.js | 2 +- 37 files changed, 143 insertions(+), 143 deletions(-) diff --git a/apps/laboratory/src/pages/library/ethers-all-internal.tsx b/apps/laboratory/src/pages/library/ethers-all-internal.tsx index 5d99cb4921..498b2eb292 100644 --- a/apps/laboratory/src/pages/library/ethers-all-internal.tsx +++ b/apps/laboratory/src/pages/library/ethers-all-internal.tsx @@ -7,13 +7,15 @@ import { siweConfig } from '../../utils/SiweUtils' import { SiweData } from '../../components/Siwe/SiweData' import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo' import { EthersAdapter } from '@reown/appkit-adapter-ethers' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.EvmNetworks const ethersAdapter = new EthersAdapter() const modal = createAppKit({ adapters: [ethersAdapter], - networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], + networks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/ethers-all.tsx b/apps/laboratory/src/pages/library/ethers-all.tsx index 9edf847176..25119b410b 100644 --- a/apps/laboratory/src/pages/library/ethers-all.tsx +++ b/apps/laboratory/src/pages/library/ethers-all.tsx @@ -7,13 +7,15 @@ import { siweConfig } from '../../utils/SiweUtils' import { SiweData } from '../../components/Siwe/SiweData' import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo' import { EthersAdapter } from '@reown/appkit-adapter-ethers' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.EvmNetworks const ethersAdapter = new EthersAdapter() const modal = createAppKit({ adapters: [ethersAdapter], - networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], + networks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/ethers-no-email.tsx b/apps/laboratory/src/pages/library/ethers-no-email.tsx index 4dcbb9cef9..d6a1ecec46 100644 --- a/apps/laboratory/src/pages/library/ethers-no-email.tsx +++ b/apps/laboratory/src/pages/library/ethers-no-email.tsx @@ -5,13 +5,15 @@ import { ConstantsUtil } from '../../utils/ConstantsUtil' import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo' import { AppKitButtons } from '../../components/AppKitButtons' import { EthersTests } from '../../components/Ethers/EthersTests' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.EvmNetworks const ethersAdapter = new EthersAdapter() const modal = createAppKit({ adapters: [ethersAdapter], - networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], + networks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/ethers-no-socials.tsx b/apps/laboratory/src/pages/library/ethers-no-socials.tsx index e965b8fd6d..c75561491d 100644 --- a/apps/laboratory/src/pages/library/ethers-no-socials.tsx +++ b/apps/laboratory/src/pages/library/ethers-no-socials.tsx @@ -6,13 +6,15 @@ import { ConstantsUtil } from '../../utils/ConstantsUtil' import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo' import { EthersAdapter } from '@reown/appkit-adapter-ethers' import { siweConfig } from '../../utils/SiweUtils' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.EvmNetworks const ethersAdapter = new EthersAdapter() const modal = createAppKit({ adapters: [ethersAdapter], - networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], + networks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/ethers-siwe.tsx b/apps/laboratory/src/pages/library/ethers-siwe.tsx index 11586db912..8983bf8767 100644 --- a/apps/laboratory/src/pages/library/ethers-siwe.tsx +++ b/apps/laboratory/src/pages/library/ethers-siwe.tsx @@ -7,13 +7,16 @@ import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { siweConfig } from '../../utils/SiweUtils' import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.EvmNetworks const ethersAdapter = new EthersAdapter() const modal = createAppKit({ adapters: [ethersAdapter], - networks: [mainnet, optimism, polygon, zkSync, arbitrum, sepolia], + networks, + defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { analytics: true diff --git a/apps/laboratory/src/pages/library/ethers.tsx b/apps/laboratory/src/pages/library/ethers.tsx index c3d23f5f59..803abc19a0 100644 --- a/apps/laboratory/src/pages/library/ethers.tsx +++ b/apps/laboratory/src/pages/library/ethers.tsx @@ -5,13 +5,16 @@ import { AppKitButtons } from '../../components/AppKitButtons' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.EvmNetworks const ethersAdapter = new EthersAdapter() const modal = createAppKit({ adapters: [ethersAdapter], - networks: [mainnet, optimism, polygon, zkSync, arbitrum, sepolia], + networks, + defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { analytics: true diff --git a/apps/laboratory/src/pages/library/ethers5-all-internal.tsx b/apps/laboratory/src/pages/library/ethers5-all-internal.tsx index 3db542a539..cadea78383 100644 --- a/apps/laboratory/src/pages/library/ethers5-all-internal.tsx +++ b/apps/laboratory/src/pages/library/ethers5-all-internal.tsx @@ -6,14 +6,15 @@ import { siweConfig } from '../../utils/SiweUtils' import { SiweData } from '../../components/Siwe/SiweData' import { Ethers5Tests } from '../../components/Ethers/Ethers5Tests' import { Ethers5ModalInfo } from '../../components/Ethers/Ethers5ModalInfo' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' import { Ethers5Adapter } from '@reown/appkit-adapter-ethers5' +import { mainnet } from '@reown/appkit/networks' +const networks = ConstantsUtil.EvmNetworks const ethers5Adapter = new Ethers5Adapter() const modal = createAppKit({ adapters: [ethers5Adapter], - networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], + networks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/ethers5-all.tsx b/apps/laboratory/src/pages/library/ethers5-all.tsx index ba476c8301..a6ab849f6e 100644 --- a/apps/laboratory/src/pages/library/ethers5-all.tsx +++ b/apps/laboratory/src/pages/library/ethers5-all.tsx @@ -6,14 +6,16 @@ import { siweConfig } from '../../utils/SiweUtils' import { SiweData } from '../../components/Siwe/SiweData' import { Ethers5Tests } from '../../components/Ethers/Ethers5Tests' import { Ethers5ModalInfo } from '../../components/Ethers/Ethers5ModalInfo' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' import { Ethers5Adapter } from '@reown/appkit-adapter-ethers5' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.EvmNetworks const ethers5Adapter = new Ethers5Adapter() const modal = createAppKit({ adapters: [ethers5Adapter], - networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], + networks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/ethers5-no-email.tsx b/apps/laboratory/src/pages/library/ethers5-no-email.tsx index ec4b3ac456..2456ad8ce7 100644 --- a/apps/laboratory/src/pages/library/ethers5-no-email.tsx +++ b/apps/laboratory/src/pages/library/ethers5-no-email.tsx @@ -5,13 +5,15 @@ import { ConstantsUtil } from '../../utils/ConstantsUtil' import { Ethers5ModalInfo } from '../../components/Ethers/Ethers5ModalInfo' import { AppKitButtons } from '../../components/AppKitButtons' import { Ethers5Tests } from '../../components/Ethers/Ethers5Tests' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.EvmNetworks const ethers5Adapter = new Ethers5Adapter() const modal = createAppKit({ adapters: [ethers5Adapter], - networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], + networks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/ethers5-no-socials.tsx b/apps/laboratory/src/pages/library/ethers5-no-socials.tsx index 2d4c82db4c..9e85907682 100644 --- a/apps/laboratory/src/pages/library/ethers5-no-socials.tsx +++ b/apps/laboratory/src/pages/library/ethers5-no-socials.tsx @@ -7,13 +7,15 @@ import { SiweData } from '../../components/Siwe/SiweData' import { Ethers5Tests } from '../../components/Ethers/Ethers5Tests' import { Ethers5ModalInfo } from '../../components/Ethers/Ethers5ModalInfo' import { Ethers5Adapter } from '@reown/appkit-adapter-ethers5' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.EvmNetworks const ethersAdapter = new Ethers5Adapter() const modal = createAppKit({ adapters: [ethersAdapter], - networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], + networks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/ethers5-siwe.tsx b/apps/laboratory/src/pages/library/ethers5-siwe.tsx index 7bff4ce37d..fb8948243a 100644 --- a/apps/laboratory/src/pages/library/ethers5-siwe.tsx +++ b/apps/laboratory/src/pages/library/ethers5-siwe.tsx @@ -6,14 +6,16 @@ import { ConstantsUtil } from '../../utils/ConstantsUtil' import { siweConfig } from '../../utils/SiweUtils' import { Ethers5Tests } from '../../components/Ethers/Ethers5Tests' import { Ethers5ModalInfo } from '../../components/Ethers/Ethers5ModalInfo' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' import { Ethers5Adapter } from '@reown/appkit-adapter-ethers5' +const networks = ConstantsUtil.EvmNetworks + const ethers5Adapter = new Ethers5Adapter() const modal = createAppKit({ adapters: [ethers5Adapter], - networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], + networks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/ethers5.tsx b/apps/laboratory/src/pages/library/ethers5.tsx index fbc18221ff..315a3d4346 100644 --- a/apps/laboratory/src/pages/library/ethers5.tsx +++ b/apps/laboratory/src/pages/library/ethers5.tsx @@ -5,13 +5,16 @@ import { ConstantsUtil } from '../../utils/ConstantsUtil' import { Ethers5ModalInfo } from '../../components/Ethers/Ethers5ModalInfo' import { Ethers5Tests } from '../../components/Ethers/Ethers5Tests' import { Ethers5Adapter } from '@reown/appkit-adapter-ethers5' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.EvmNetworks const ethers5Adapter = new Ethers5Adapter() const modal = createAppKit({ adapters: [ethers5Adapter], - networks: [mainnet, optimism, polygon, zkSync, arbitrum, sepolia], + networks, + defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { analytics: true, diff --git a/apps/laboratory/src/pages/library/external.tsx b/apps/laboratory/src/pages/library/external.tsx index 95cc985b5e..d0ae028473 100644 --- a/apps/laboratory/src/pages/library/external.tsx +++ b/apps/laboratory/src/pages/library/external.tsx @@ -7,13 +7,13 @@ import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' import { externalTestConnector } from '../../utils/ConnectorUtil' +import { mainnet } from '@reown/appkit/networks' const queryClient = new QueryClient() const connectors = [externalTestConnector()] -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.EvmNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, @@ -25,6 +25,7 @@ const wagmiAdapter = new WagmiAdapter({ const modal = createAppKit({ adapters: [wagmiAdapter], networks, + defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { analytics: true diff --git a/apps/laboratory/src/pages/library/multichain-basic.tsx b/apps/laboratory/src/pages/library/multichain-basic.tsx index 1c1af6796c..a8937c4dd3 100644 --- a/apps/laboratory/src/pages/library/multichain-basic.tsx +++ b/apps/laboratory/src/pages/library/multichain-basic.tsx @@ -2,13 +2,15 @@ import { createAppKit } from '@reown/appkit/react' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { AppKitButtons } from '../../components/AppKitButtons' -import { mainnet, optimism, arbitrum, solana } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' import { MultiChainInfo } from '../../components/MultiChainInfo' - import { UpaTests } from '../../components/UPA/UpaTests' +const networks = ConstantsUtil.AllNetworks + const modal = createAppKit({ - networks: [mainnet, optimism, arbitrum, solana], + networks, + defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, metadata: ConstantsUtil.Metadata }) diff --git a/apps/laboratory/src/pages/library/multichain-ethers-solana-siwe.tsx b/apps/laboratory/src/pages/library/multichain-ethers-solana-siwe.tsx index 6c34241749..be4a1271e7 100644 --- a/apps/laboratory/src/pages/library/multichain-ethers-solana-siwe.tsx +++ b/apps/laboratory/src/pages/library/multichain-ethers-solana-siwe.tsx @@ -3,20 +3,14 @@ import { EthersAdapter } from '@reown/appkit-adapter-ethers' import { SolanaAdapter } from '@reown/appkit-adapter-solana' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' -import { - mainnet, - polygon, - solana, - arbitrum, - optimism, - solanaTestnet, - solanaDevnet -} from '@reown/appkit/networks' import { AppKitButtons } from '../../components/AppKitButtons' import { HuobiWalletAdapter, SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' import { MultiChainTestsEthersSolana } from '../../components/MultiChainTestsEthersSolana' import { siweConfig } from '../../utils/SiweUtils' import { SiweData } from '../../components/Siwe/SiweData' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.AllNetworks const etherAdapter = new EthersAdapter() @@ -27,7 +21,7 @@ const solanaWeb3JsAdapter = new SolanaAdapter({ const modal = createAppKit({ adapters: [etherAdapter, solanaWeb3JsAdapter], projectId: ConstantsUtil.ProjectId, - networks: [mainnet, arbitrum, polygon, optimism, solana, solanaTestnet, solanaDevnet], + networks, defaultNetwork: mainnet, features: { analytics: true diff --git a/apps/laboratory/src/pages/library/multichain-ethers-solana.tsx b/apps/laboratory/src/pages/library/multichain-ethers-solana.tsx index c5c7fb297d..ac84aeb2f5 100644 --- a/apps/laboratory/src/pages/library/multichain-ethers-solana.tsx +++ b/apps/laboratory/src/pages/library/multichain-ethers-solana.tsx @@ -3,18 +3,12 @@ import { EthersAdapter } from '@reown/appkit-adapter-ethers' import { SolanaAdapter } from '@reown/appkit-adapter-solana' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' -import { - mainnet, - polygon, - solana, - arbitrum, - optimism, - solanaTestnet, - solanaDevnet -} from '@reown/appkit/networks' + import { AppKitButtons } from '../../components/AppKitButtons' import { HuobiWalletAdapter, SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' import { MultiChainTestsEthersSolana } from '../../components/MultiChainTestsEthersSolana' +import { mainnet } from '@reown/appkit/networks' +const networks = ConstantsUtil.AllNetworks const etherAdapter = new EthersAdapter() @@ -25,7 +19,7 @@ const solanaWeb3JsAdapter = new SolanaAdapter({ const modal = createAppKit({ adapters: [etherAdapter, solanaWeb3JsAdapter], projectId: ConstantsUtil.ProjectId, - networks: [mainnet, arbitrum, polygon, optimism, solana, solanaTestnet, solanaDevnet], + networks, defaultNetwork: mainnet, features: { analytics: true diff --git a/apps/laboratory/src/pages/library/multichain-ethers5-solana-siwe.tsx b/apps/laboratory/src/pages/library/multichain-ethers5-solana-siwe.tsx index 65c8132585..df3fdd108c 100644 --- a/apps/laboratory/src/pages/library/multichain-ethers5-solana-siwe.tsx +++ b/apps/laboratory/src/pages/library/multichain-ethers5-solana-siwe.tsx @@ -3,20 +3,14 @@ import { EthersAdapter } from '@reown/appkit-adapter-ethers' import { SolanaAdapter } from '@reown/appkit-adapter-solana' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' -import { - mainnet, - polygon, - solana, - arbitrum, - optimism, - solanaTestnet, - solanaDevnet -} from '@reown/appkit/networks' import { AppKitButtons } from '../../components/AppKitButtons' import { HuobiWalletAdapter, SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' import { MultiChainTestsEthersSolana } from '../../components/MultiChainTestsEthersSolana' import { siweConfig } from '../../utils/SiweUtils' import { SiweData } from '../../components/Siwe/SiweData' +import { mainnet } from '@reown/appkit/networks' + +const networks = ConstantsUtil.AllNetworks const etherAdapter = new EthersAdapter() @@ -27,7 +21,8 @@ const solanaWeb3JsAdapter = new SolanaAdapter({ const modal = createAppKit({ adapters: [etherAdapter, solanaWeb3JsAdapter], projectId: ConstantsUtil.ProjectId, - networks: [mainnet, arbitrum, polygon, optimism, solana, solanaTestnet, solanaDevnet], + networks, + defaultNetwork: mainnet, features: { analytics: true }, diff --git a/apps/laboratory/src/pages/library/multichain-ethers5-solana.tsx b/apps/laboratory/src/pages/library/multichain-ethers5-solana.tsx index 7e3398f6bf..b31b8a4c83 100644 --- a/apps/laboratory/src/pages/library/multichain-ethers5-solana.tsx +++ b/apps/laboratory/src/pages/library/multichain-ethers5-solana.tsx @@ -3,19 +3,13 @@ import { EthersAdapter } from '@reown/appkit-adapter-ethers' import { SolanaAdapter } from '@reown/appkit-adapter-solana' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' -import { - mainnet, - polygon, - solana, - arbitrum, - optimism, - solanaTestnet, - solanaDevnet -} from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' import { AppKitButtons } from '../../components/AppKitButtons' import { HuobiWalletAdapter, SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' import { MultiChainTestsEthersSolana } from '../../components/MultiChainTestsEthersSolana' +const networks = ConstantsUtil.AllNetworks + const etherAdapter = new EthersAdapter() const solanaWeb3JsAdapter = new SolanaAdapter({ @@ -25,7 +19,8 @@ const solanaWeb3JsAdapter = new SolanaAdapter({ const modal = createAppKit({ adapters: [etherAdapter, solanaWeb3JsAdapter], projectId: ConstantsUtil.ProjectId, - networks: [mainnet, arbitrum, polygon, optimism, solana, solanaTestnet, solanaDevnet], + networks, + defaultNetwork: mainnet, features: { analytics: true }, diff --git a/apps/laboratory/src/pages/library/multichain-wagmi-solana-siwe.tsx b/apps/laboratory/src/pages/library/multichain-wagmi-solana-siwe.tsx index 5bbb25bf6c..5be9a8b6d1 100644 --- a/apps/laboratory/src/pages/library/multichain-wagmi-solana-siwe.tsx +++ b/apps/laboratory/src/pages/library/multichain-wagmi-solana-siwe.tsx @@ -6,19 +6,7 @@ import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { WagmiProvider } from 'wagmi' -import { - arbitrum, - mainnet, - polygon, - base, - binanceSmartChain, - solana, - solanaTestnet, - solanaDevnet, - optimism, - zkSync, - sepolia -} from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' import { AppKitButtons } from '../../components/AppKitButtons' import { HuobiWalletAdapter, SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' import { MultiChainTestsWagmiSolana } from '../../components/MultiChainTestsWagmiSolana' @@ -27,7 +15,7 @@ import { SiweData } from '../../components/Siwe/SiweData' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.AllNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, @@ -41,16 +29,7 @@ const solanaWeb3JsAdapter = new SolanaAdapter({ const modal = createAppKit({ adapters: [wagmiAdapter, solanaWeb3JsAdapter], - networks: [ - mainnet, - polygon, - base, - binanceSmartChain, - arbitrum, - solana, - solanaTestnet, - solanaDevnet - ], + networks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/multichain-wagmi-solana.tsx b/apps/laboratory/src/pages/library/multichain-wagmi-solana.tsx index 25c12cbad2..18c817ce44 100644 --- a/apps/laboratory/src/pages/library/multichain-wagmi-solana.tsx +++ b/apps/laboratory/src/pages/library/multichain-wagmi-solana.tsx @@ -6,22 +6,14 @@ import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { WagmiProvider } from 'wagmi' -import { - mainnet, - polygon, - solana, - arbitrum, - optimism, - solanaTestnet, - solanaDevnet -} from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' import { AppKitButtons } from '../../components/AppKitButtons' import { HuobiWalletAdapter, SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' import { MultiChainTestsWagmiSolana } from '../../components/MultiChainTestsWagmiSolana' const queryClient = new QueryClient() -const networks = [mainnet, polygon, solana, arbitrum, optimism, solanaTestnet, solanaDevnet] +const networks = ConstantsUtil.AllNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, diff --git a/apps/laboratory/src/pages/library/solana-no-email.tsx b/apps/laboratory/src/pages/library/solana-no-email.tsx index cd7c6d9637..ee7f24753d 100644 --- a/apps/laboratory/src/pages/library/solana-no-email.tsx +++ b/apps/laboratory/src/pages/library/solana-no-email.tsx @@ -5,9 +5,11 @@ import { AppKitButtons } from '../../components/AppKitButtons' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { SolanaTests } from '../../components/Solana/SolanaTests' import { HuobiWalletAdapter, SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' -import { solana, solanaDevnet, solanaTestnet } from '@reown/appkit/networks' +import { solana } from '@reown/appkit/networks' import { SolanaAdapter } from '@reown/appkit-adapter-solana/react' +const networks = ConstantsUtil.SolanaNetworks + const solanaWeb3JsAdapter = new SolanaAdapter({ wallets: [new HuobiWalletAdapter(), new SolflareWalletAdapter()] }) @@ -15,7 +17,7 @@ const solanaWeb3JsAdapter = new SolanaAdapter({ const modal = createAppKit({ adapters: [solanaWeb3JsAdapter], projectId: ConstantsUtil.ProjectId, - networks: [solana, solanaTestnet, solanaDevnet], + networks, defaultNetwork: solana, features: { analytics: false, diff --git a/apps/laboratory/src/pages/library/solana-no-socials.tsx b/apps/laboratory/src/pages/library/solana-no-socials.tsx index 2742031ce7..c4f9d0804c 100644 --- a/apps/laboratory/src/pages/library/solana-no-socials.tsx +++ b/apps/laboratory/src/pages/library/solana-no-socials.tsx @@ -2,13 +2,13 @@ import { createAppKit } from '@reown/appkit/react' import { SolanaAdapter } from '@reown/appkit-adapter-solana/react' import { ThemeStore } from '../../utils/StoreUtil' -import { solana, solanaDevnet, solanaTestnet } from '@reown/appkit/networks' import { AppKitButtons } from '../../components/AppKitButtons' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { SolanaTests } from '../../components/Solana/SolanaTests' import { HuobiWalletAdapter, SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' +import { solana } from '@reown/appkit/networks' -const networks = [solana, solanaTestnet, solanaDevnet] +const networks = ConstantsUtil.SolanaNetworks const solanaWeb3JsAdapter = new SolanaAdapter({ wallets: [new HuobiWalletAdapter(), new SolflareWalletAdapter()] @@ -17,6 +17,7 @@ const solanaWeb3JsAdapter = new SolanaAdapter({ const modal = createAppKit({ adapters: [solanaWeb3JsAdapter], networks, + defaultNetwork: solana, projectId: ConstantsUtil.ProjectId, metadata: ConstantsUtil.Metadata, features: { diff --git a/apps/laboratory/src/pages/library/solana.tsx b/apps/laboratory/src/pages/library/solana.tsx index 45358f7802..ec24814ba3 100644 --- a/apps/laboratory/src/pages/library/solana.tsx +++ b/apps/laboratory/src/pages/library/solana.tsx @@ -2,12 +2,13 @@ import { createAppKit, type CaipNetwork } from '@reown/appkit/react' import { SolanaAdapter } from '@reown/appkit-adapter-solana/react' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' -import { solana, solanaDevnet, solanaTestnet } from '@reown/appkit/networks' import { HuobiWalletAdapter, SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' import { AppKitButtons } from '../../components/AppKitButtons' import { SolanaTests } from '../../components/Solana/SolanaTests' +const networks = ConstantsUtil.SolanaNetworks + const solanaWeb3JsAdapter = new SolanaAdapter({ wallets: [new HuobiWalletAdapter(), new SolflareWalletAdapter()] }) @@ -24,7 +25,7 @@ export const solanaNotExist = { const modal = createAppKit({ adapters: [solanaWeb3JsAdapter], - networks: [solana, solanaTestnet, solanaDevnet, solanaNotExist], + networks, projectId: ConstantsUtil.ProjectId, features: { analytics: true, diff --git a/apps/laboratory/src/pages/library/verify-domain-mismatch.tsx b/apps/laboratory/src/pages/library/verify-domain-mismatch.tsx index c46d3482e8..12756c5c55 100644 --- a/apps/laboratory/src/pages/library/verify-domain-mismatch.tsx +++ b/apps/laboratory/src/pages/library/verify-domain-mismatch.tsx @@ -1,20 +1,20 @@ import { createAppKit } from '@reown/appkit/react' +import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { WagmiProvider } from 'wagmi' import { AppKitButtons } from '../../components/AppKitButtons' import { WagmiTests } from '../../components/Wagmi/WagmiTests' import { ThemeStore } from '../../utils/StoreUtil' import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' - -import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { ConstantsUtil } from '../../utils/ConstantsUtil' +import { mainnet } from '@reown/appkit/networks' // Special project ID with verify enabled on localhost const projectId = 'e4eae1aad4503db9966a04fd045a7e4d' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.EvmNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, @@ -25,6 +25,7 @@ const wagmiAdapter = new WagmiAdapter({ const modal = createAppKit({ adapters: [wagmiAdapter], networks, + defaultNetwork: mainnet, projectId, termsConditionsUrl: 'https://reown.com/terms-of-service', privacyPolicyUrl: 'https://reown.com/privacy-policy' diff --git a/apps/laboratory/src/pages/library/verify-evil.tsx b/apps/laboratory/src/pages/library/verify-evil.tsx index f552ccd185..98ec057022 100644 --- a/apps/laboratory/src/pages/library/verify-evil.tsx +++ b/apps/laboratory/src/pages/library/verify-evil.tsx @@ -5,8 +5,9 @@ import { AppKitButtons } from '../../components/AppKitButtons' import { WagmiTests } from '../../components/Wagmi/WagmiTests' import { ThemeStore } from '../../utils/StoreUtil' import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' +import { ConstantsUtil } from '../../utils/ConstantsUtil' +import { mainnet } from '@reown/appkit/networks' const metadata = { name: 'Evil AppKit', @@ -21,7 +22,7 @@ const projectId = '9d176efa3150a1df0a76c8c138b6b657' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.EvmNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, @@ -32,6 +33,7 @@ const wagmiAdapter = new WagmiAdapter({ const modal = createAppKit({ adapters: [wagmiAdapter], networks, + defaultNetwork: mainnet, projectId, metadata, termsConditionsUrl: 'https://reown.com/terms-of-service', diff --git a/apps/laboratory/src/pages/library/verify-valid.tsx b/apps/laboratory/src/pages/library/verify-valid.tsx index ec0456b0c2..3aae04fe56 100644 --- a/apps/laboratory/src/pages/library/verify-valid.tsx +++ b/apps/laboratory/src/pages/library/verify-valid.tsx @@ -6,7 +6,8 @@ import { WagmiTests } from '../../components/Wagmi/WagmiTests' import { ThemeStore } from '../../utils/StoreUtil' import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { ConstantsUtil } from '../../utils/ConstantsUtil' +import { mainnet } from '@reown/appkit/networks' const metadata = { name: 'AppKit', @@ -22,7 +23,7 @@ const projectId = 'e4eae1aad4503db9966a04fd045a7e4d' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.EvmNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, @@ -34,6 +35,7 @@ const modal = createAppKit({ adapters: [wagmiAdapter], networks, projectId, + defaultNetwork: mainnet, metadata, termsConditionsUrl: 'https://reown.com/terms-of-service', privacyPolicyUrl: 'https://reown.com/privacy-policy' diff --git a/apps/laboratory/src/pages/library/wagmi-all-internal.tsx b/apps/laboratory/src/pages/library/wagmi-all-internal.tsx index cbd54ea584..0c70337b12 100644 --- a/apps/laboratory/src/pages/library/wagmi-all-internal.tsx +++ b/apps/laboratory/src/pages/library/wagmi-all-internal.tsx @@ -8,12 +8,12 @@ import { ConstantsUtil } from '../../utils/ConstantsUtil' import { SiweData } from '../../components/Siwe/SiweData' import { siweConfig } from '../../utils/SiweUtils' import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' +import { mainnet } from '@reown/appkit/networks' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.EvmNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, diff --git a/apps/laboratory/src/pages/library/wagmi-all.tsx b/apps/laboratory/src/pages/library/wagmi-all.tsx index cd2a651359..36c1c28de9 100644 --- a/apps/laboratory/src/pages/library/wagmi-all.tsx +++ b/apps/laboratory/src/pages/library/wagmi-all.tsx @@ -9,11 +9,11 @@ import { SiweData } from '../../components/Siwe/SiweData' import { siweConfig } from '../../utils/SiweUtils' import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.EvmNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, diff --git a/apps/laboratory/src/pages/library/wagmi-no-email.tsx b/apps/laboratory/src/pages/library/wagmi-no-email.tsx index f1c8321b41..bf7b11b8c0 100644 --- a/apps/laboratory/src/pages/library/wagmi-no-email.tsx +++ b/apps/laboratory/src/pages/library/wagmi-no-email.tsx @@ -7,11 +7,11 @@ import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.EvmNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, diff --git a/apps/laboratory/src/pages/library/wagmi-no-socials.tsx b/apps/laboratory/src/pages/library/wagmi-no-socials.tsx index 17b1ed8744..2f97632944 100644 --- a/apps/laboratory/src/pages/library/wagmi-no-socials.tsx +++ b/apps/laboratory/src/pages/library/wagmi-no-socials.tsx @@ -5,13 +5,13 @@ import { AppKitButtons } from '../../components/AppKitButtons' import { WagmiTests } from '../../components/Wagmi/WagmiTests' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' +import { mainnet } from '@reown/appkit/networks' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.EvmNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, diff --git a/apps/laboratory/src/pages/library/wagmi-permissions-async.tsx b/apps/laboratory/src/pages/library/wagmi-permissions-async.tsx index c27907d628..8f5d27e1bf 100644 --- a/apps/laboratory/src/pages/library/wagmi-permissions-async.tsx +++ b/apps/laboratory/src/pages/library/wagmi-permissions-async.tsx @@ -5,14 +5,14 @@ import { AppKitButtons } from '../../components/AppKitButtons' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { WagmiPermissionsAsyncTest } from '../../components/Wagmi/WagmiPermissionsAsyncTest' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' import { ERC7715PermissionsProvider } from '../../context/ERC7715PermissionsContext' import { LocalEcdsaKeyProvider } from '../../context/LocalEcdsaKeyContext' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.EvmNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, diff --git a/apps/laboratory/src/pages/library/wagmi-permissions-sync.tsx b/apps/laboratory/src/pages/library/wagmi-permissions-sync.tsx index 58604ed6b2..86a02aa083 100644 --- a/apps/laboratory/src/pages/library/wagmi-permissions-sync.tsx +++ b/apps/laboratory/src/pages/library/wagmi-permissions-sync.tsx @@ -5,14 +5,14 @@ import { AppKitButtons } from '../../components/AppKitButtons' import { ThemeStore } from '../../utils/StoreUtil' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { WagmiPermissionsSyncTest } from '../../components/Wagmi/WagmiPermissionsSyncTest' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' import { PasskeyProvider } from '../../context/PasskeyContext' import { ERC7715PermissionsProvider } from '../../context/ERC7715PermissionsContext' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const networks = ConstantsUtil.EvmNetworks const wagmiAdapter = new WagmiAdapter({ ssr: true, diff --git a/apps/laboratory/src/pages/library/wagmi-siwe.tsx b/apps/laboratory/src/pages/library/wagmi-siwe.tsx index 168bf9ff5b..5d5a39c6cc 100644 --- a/apps/laboratory/src/pages/library/wagmi-siwe.tsx +++ b/apps/laboratory/src/pages/library/wagmi-siwe.tsx @@ -9,21 +9,19 @@ import { ConstantsUtil } from '../../utils/ConstantsUtil' import { siweConfig } from '../../utils/SiweUtils' import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { mainnet } from '@reown/appkit/networks' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] - const wagmiAdapter = new WagmiAdapter({ ssr: true, - networks, + networks: ConstantsUtil.EvmNetworks, projectId: ConstantsUtil.ProjectId }) const modal = createAppKit({ adapters: [wagmiAdapter], - networks, + networks: ConstantsUtil.EvmNetworks, defaultNetwork: mainnet, projectId: ConstantsUtil.ProjectId, features: { diff --git a/apps/laboratory/src/pages/library/wagmi.tsx b/apps/laboratory/src/pages/library/wagmi.tsx index 5ee3411b72..2466f0cc07 100644 --- a/apps/laboratory/src/pages/library/wagmi.tsx +++ b/apps/laboratory/src/pages/library/wagmi.tsx @@ -5,23 +5,20 @@ import { WagmiTests } from '../../components/Wagmi/WagmiTests' import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' import { createAppKit } from '@reown/appkit/react' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' import { ConstantsUtil } from '../../utils/ConstantsUtil' import { ThemeStore } from '../../utils/StoreUtil' const queryClient = new QueryClient() -const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] - const wagmiAdapter = new WagmiAdapter({ ssr: true, - networks, + networks: ConstantsUtil.EvmNetworks, projectId: ConstantsUtil.ProjectId }) const modal = createAppKit({ adapters: [wagmiAdapter], - networks, + networks: ConstantsUtil.EvmNetworks, projectId: ConstantsUtil.ProjectId, features: { analytics: true, diff --git a/apps/laboratory/src/utils/ConstantsUtil.ts b/apps/laboratory/src/utils/ConstantsUtil.ts index 87f838d555..64dc893a8e 100644 --- a/apps/laboratory/src/utils/ConstantsUtil.ts +++ b/apps/laboratory/src/utils/ConstantsUtil.ts @@ -1,3 +1,15 @@ +import { + arbitrum, + mainnet, + optimism, + polygon, + zkSync, + sepolia, + solana, + solanaTestnet, + solanaDevnet, + base +} from '@reown/appkit/networks' import { getLocalStorageItem } from './LocalStorage' const projectId = process.env['NEXT_PUBLIC_PROJECT_ID'] @@ -36,6 +48,9 @@ if (typeof window !== 'undefined') { const customWallet = storedCustomWallet ? [JSON.parse(storedCustomWallet)] : [] +const EvmNetworks = [mainnet, optimism, polygon, zkSync, arbitrum, base, sepolia] +const SolanaNetworks = [solana, solanaTestnet, solanaDevnet] + export const ConstantsUtil = { SigningSucceededToastTitle: 'Signing Succeeded', SigningFailedToastTitle: 'Signing Failed', @@ -87,5 +102,8 @@ export const ConstantsUtil = { image_url: '/sample-wallets/react-native.svg' } ], - ProjectId: projectId + ProjectId: projectId, + EvmNetworks, + SolanaNetworks, + AllNetworks: [...EvmNetworks, ...SolanaNetworks] } diff --git a/apps/laboratory/src/utils/SiweUtils.ts b/apps/laboratory/src/utils/SiweUtils.ts index d0bd97ef4c..42d9da236c 100644 --- a/apps/laboratory/src/utils/SiweUtils.ts +++ b/apps/laboratory/src/utils/SiweUtils.ts @@ -1,9 +1,9 @@ import { getCsrfToken, signIn, signOut, getSession } from 'next-auth/react' import type { SIWEVerifyMessageArgs, SIWECreateMessageArgs, SIWESession } from '@reown/appkit-siwe' import { createSIWEConfig, formatMessage } from '@reown/appkit-siwe' -import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' +import { ConstantsUtil } from './ConstantsUtil' -const chains = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] +const chains = ConstantsUtil.EvmNetworks export const siweConfig = createSIWEConfig({ signOutOnAccountChange: true, diff --git a/examples/html-ethers/src/main.js b/examples/html-ethers/src/main.js index a463ed6a29..25f27d93d4 100644 --- a/examples/html-ethers/src/main.js +++ b/examples/html-ethers/src/main.js @@ -14,7 +14,7 @@ const ethersAdapter = new EthersAdapter() // Instantiate AppKit const modal = createAppKit({ adapters: [ethersAdapter], - networks: [mainnet, optimism, polygon, zkSync, arbitrum, sepolia], + networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], projectId })