diff --git a/apps/laboratory/package.json b/apps/laboratory/package.json index e8dbc0d229..3c684c5b11 100644 --- a/apps/laboratory/package.json +++ b/apps/laboratory/package.json @@ -78,7 +78,6 @@ "@tanstack/react-query": "5.24.8", "@wagmi/connectors": "5.1.9", "@wagmi/core": "2.13.4", - "@walletconnect/ethereum-provider": "2.16.1", "@walletconnect/universal-provider": "2.16.1", "@walletconnect/utils": "2.16.1", "@reown/appkit": "workspace:*", diff --git a/apps/laboratory/src/components/Ethers/Ethers5GetCallsStatusTest.tsx b/apps/laboratory/src/components/Ethers/Ethers5GetCallsStatusTest.tsx index b603681bfb..2ecc7d7712 100644 --- a/apps/laboratory/src/components/Ethers/Ethers5GetCallsStatusTest.tsx +++ b/apps/laboratory/src/components/Ethers/Ethers5GetCallsStatusTest.tsx @@ -6,7 +6,7 @@ import { useAppKitProvider, type Provider } from '@reown/appkit/react' -import { EthereumProvider } from '@walletconnect/ethereum-provider' +import { UniversalProvider } from '@walletconnect/universal-provider' import { useChakraToast } from '../Toast' import { ethers } from 'ethers5' import { W3mFrameProvider } from '@reown/appkit-wallet' @@ -59,9 +59,9 @@ export function Ethers5GetCallsStatusTest() { if (walletProvider instanceof W3mFrameProvider) { return true } - if (walletProvider instanceof EthereumProvider) { + if (walletProvider instanceof UniversalProvider) { return Boolean( - walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes( + walletProvider?.session?.namespaces?.['eip155']?.methods?.includes( EIP_5792_RPC_METHODS.WALLET_GET_CALLS_STATUS ) ) diff --git a/apps/laboratory/src/components/Ethers/Ethers5ModalInfo.tsx b/apps/laboratory/src/components/Ethers/Ethers5ModalInfo.tsx index 034f5c725b..7188f83c11 100644 --- a/apps/laboratory/src/components/Ethers/Ethers5ModalInfo.tsx +++ b/apps/laboratory/src/components/Ethers/Ethers5ModalInfo.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { useAppKitAccount, useAppKitNetwork, useAppKitProvider } from '@reown/appkit/react' -import EthereumProvider from '@walletconnect/ethereum-provider' +import UniversalProvider from '@walletconnect/universal-provider' import { AppKitInfo } from '../AppKitInfo' @@ -10,11 +10,11 @@ export function Ethers5ModalInfo() { const { chainId } = useAppKitNetwork() const { isConnected, address } = useAppKitAccount() - const { walletProvider, walletProviderType } = useAppKitProvider('eip155') + const { walletProvider, walletProviderType } = useAppKitProvider('eip155') async function getClientId() { if (walletProviderType === 'walletConnect') { - return await walletProvider?.signer?.client?.core?.crypto?.getClientId() + return await walletProvider?.client?.core?.crypto?.getClientId() } return undefined diff --git a/apps/laboratory/src/components/Ethers/Ethers5SendCallsTest.tsx b/apps/laboratory/src/components/Ethers/Ethers5SendCallsTest.tsx index 163c22cf82..d33e1056ee 100644 --- a/apps/laboratory/src/components/Ethers/Ethers5SendCallsTest.tsx +++ b/apps/laboratory/src/components/Ethers/Ethers5SendCallsTest.tsx @@ -1,7 +1,7 @@ import { Button, Stack, Text, Spacer, Heading } from '@chakra-ui/react' import { useState, useEffect } from 'react' import { useAppKitAccount, useAppKitProvider, useAppKitNetwork } from '@reown/appkit/react' -import { EthereumProvider } from '@walletconnect/ethereum-provider' +import { UniversalProvider } from '@walletconnect/universal-provider' import { useChakraToast } from '../Toast' import type { Address } from 'viem' import type { Provider as RawProvider } from '@reown/appkit' @@ -14,7 +14,7 @@ import { } from '../../utils/EIP5792Utils' import { W3mFrameProvider } from '@reown/appkit-wallet' -type Provider = W3mFrameProvider | Awaited> +type Provider = W3mFrameProvider | Awaited> export function Ethers5SendCallsTest() { const [loading, setLoading] = useState(false) @@ -102,9 +102,9 @@ export function Ethers5SendCallsTest() { if (walletProvider instanceof W3mFrameProvider) { return true } - if (walletProvider instanceof EthereumProvider) { + if (walletProvider instanceof UniversalProvider) { return Boolean( - walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes( + walletProvider?.session?.namespaces?.['eip155']?.methods?.includes( EIP_5792_RPC_METHODS.WALLET_SEND_CALLS ) ) diff --git a/apps/laboratory/src/components/Ethers/Ethers5SendCallsWithPaymasterServiceTest.tsx b/apps/laboratory/src/components/Ethers/Ethers5SendCallsWithPaymasterServiceTest.tsx index 5afb00f9b4..e4838da7de 100644 --- a/apps/laboratory/src/components/Ethers/Ethers5SendCallsWithPaymasterServiceTest.tsx +++ b/apps/laboratory/src/components/Ethers/Ethers5SendCallsWithPaymasterServiceTest.tsx @@ -6,7 +6,7 @@ import { useAppKitProvider, type Provider } from '@reown/appkit/react' -import { EthereumProvider } from '@walletconnect/ethereum-provider' +import { UniversalProvider } from '@walletconnect/universal-provider' import { useChakraToast } from '../Toast' import { parseGwei } from 'viem' import { vitalikEthAddress } from '../../utils/DataUtil' @@ -34,7 +34,7 @@ export function Ethers5SendCallsWithPaymasterServiceTest() { useEffect(() => { if ( address && - (walletProvider instanceof EthereumProvider || walletProvider instanceof W3mFrameProvider) + (walletProvider instanceof UniversalProvider || walletProvider instanceof W3mFrameProvider) ) { getCapabilitySupportedChainInfo( WALLET_CAPABILITIES.PAYMASTER_SERVICE, @@ -111,9 +111,9 @@ export function Ethers5SendCallsWithPaymasterServiceTest() { function isSendCallsSupported(): boolean { // We are currently checking capabilities above. We should use those capabilities instead of this check. - if (walletProvider instanceof EthereumProvider) { + if (walletProvider instanceof UniversalProvider) { return Boolean( - walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes( + walletProvider?.session?.namespaces['eip155']?.methods?.includes( EIP_5792_RPC_METHODS.WALLET_SEND_CALLS ) ) diff --git a/apps/laboratory/src/components/Ethers/EthersGetCallsStatusTest.tsx b/apps/laboratory/src/components/Ethers/EthersGetCallsStatusTest.tsx index 5230452dc8..56a317ace7 100644 --- a/apps/laboratory/src/components/Ethers/EthersGetCallsStatusTest.tsx +++ b/apps/laboratory/src/components/Ethers/EthersGetCallsStatusTest.tsx @@ -6,7 +6,7 @@ import { useAppKitProvider, type Provider } from '@reown/appkit/react' -import { EthereumProvider } from '@walletconnect/ethereum-provider' +import { UniversalProvider } from '@walletconnect/universal-provider' import { useChakraToast } from '../Toast' import { BrowserProvider } from 'ethers' import { W3mFrameProvider } from '@reown/appkit-wallet' @@ -58,9 +58,9 @@ export function EthersGetCallsStatusTest() { if (walletProvider instanceof W3mFrameProvider) { return true } - if (walletProvider instanceof EthereumProvider) { + if (walletProvider instanceof UniversalProvider) { return Boolean( - walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes( + walletProvider?.session?.namespaces?.['eip155']?.methods?.includes( EIP_5792_RPC_METHODS.WALLET_GET_CALLS_STATUS ) ) diff --git a/apps/laboratory/src/components/Ethers/EthersModalInfo.tsx b/apps/laboratory/src/components/Ethers/EthersModalInfo.tsx index 1732bb0fe7..5486c48dec 100644 --- a/apps/laboratory/src/components/Ethers/EthersModalInfo.tsx +++ b/apps/laboratory/src/components/Ethers/EthersModalInfo.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { useAppKitAccount, useAppKitNetwork, useAppKitProvider } from '@reown/appkit/react' -import EthereumProvider from '@walletconnect/ethereum-provider' +import UniversalProvider from '@walletconnect/universal-provider' import { AppKitInfo } from '../AppKitInfo' @@ -9,11 +9,11 @@ export function EthersModalInfo() { const [clientId, setClientId] = React.useState(undefined) const { isConnected, address } = useAppKitAccount() const { chainId } = useAppKitNetwork() - const { walletProvider, walletProviderType } = useAppKitProvider('eip155') + const { walletProvider, walletProviderType } = useAppKitProvider('eip155') async function getClientId() { if (walletProviderType === 'walletConnect') { - return await walletProvider?.signer?.client?.core?.crypto?.getClientId() + return await walletProvider?.client?.core?.crypto?.getClientId() } return undefined diff --git a/apps/laboratory/src/components/Ethers/EthersSendCallsTest.tsx b/apps/laboratory/src/components/Ethers/EthersSendCallsTest.tsx index 649934b560..df93a7c27a 100644 --- a/apps/laboratory/src/components/Ethers/EthersSendCallsTest.tsx +++ b/apps/laboratory/src/components/Ethers/EthersSendCallsTest.tsx @@ -1,7 +1,7 @@ import { Button, Stack, Text, Spacer, Heading } from '@chakra-ui/react' import { useState, useEffect } from 'react' import { useAppKitAccount, useAppKitNetwork, useAppKitProvider } from '@reown/appkit/react' -import { EthereumProvider } from '@walletconnect/ethereum-provider' +import { UniversalProvider } from '@walletconnect/universal-provider' import { useChakraToast } from '../Toast' import type { Address } from 'viem' import { vitalikEthAddress } from '../../utils/DataUtil' @@ -12,8 +12,7 @@ import { getCapabilitySupportedChainInfo } from '../../utils/EIP5792Utils' import { W3mFrameProvider } from '@reown/appkit-wallet' - -type Provider = W3mFrameProvider | Awaited> +type Provider = W3mFrameProvider | Awaited> export function EthersSendCallsTest() { const [loading, setLoading] = useState(false) @@ -33,7 +32,7 @@ export function EthersSendCallsTest() { if (address && walletProvider) { getCapabilitySupportedChainInfo( WALLET_CAPABILITIES.ATOMIC_BATCH, - walletProvider as Provider, + walletProvider as unknown as Provider, address ).then(capabilities => setAtomicBatchSupportedChains(capabilities)) } else { @@ -100,9 +99,9 @@ export function EthersSendCallsTest() { if (walletProvider instanceof W3mFrameProvider) { return true } - if (walletProvider instanceof EthereumProvider) { + if (walletProvider instanceof UniversalProvider) { return Boolean( - walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes( + walletProvider?.session?.namespaces?.['eip155']?.methods?.includes( EIP_5792_RPC_METHODS.WALLET_SEND_CALLS ) ) diff --git a/apps/laboratory/src/components/Ethers/EthersSendCallsWithPaymasterServiceTest.tsx b/apps/laboratory/src/components/Ethers/EthersSendCallsWithPaymasterServiceTest.tsx index 28ed229523..9f62e80215 100644 --- a/apps/laboratory/src/components/Ethers/EthersSendCallsWithPaymasterServiceTest.tsx +++ b/apps/laboratory/src/components/Ethers/EthersSendCallsWithPaymasterServiceTest.tsx @@ -1,7 +1,7 @@ import { Button, Stack, Text, Input, Tooltip } from '@chakra-ui/react' import { useState, useEffect } from 'react' import { useAppKitAccount, useAppKitNetwork, useAppKitProvider } from '@reown/appkit/react' -import { EthereumProvider } from '@walletconnect/ethereum-provider' +import { UniversalProvider } from '@walletconnect/universal-provider' import { useChakraToast } from '../Toast' import { parseGwei } from 'viem' import { vitalikEthAddress } from '../../utils/DataUtil' @@ -29,7 +29,7 @@ export function EthersSendCallsWithPaymasterServiceTest() { useEffect(() => { if ( address && - (walletProvider instanceof EthereumProvider || walletProvider instanceof W3mFrameProvider) + (walletProvider instanceof UniversalProvider || walletProvider instanceof W3mFrameProvider) ) { getCapabilitySupportedChainInfo( WALLET_CAPABILITIES.PAYMASTER_SERVICE, @@ -106,9 +106,9 @@ export function EthersSendCallsWithPaymasterServiceTest() { function isSendCallsSupported(): boolean { // We are currently checking capabilities above. We should use those capabilities instead of this check. - if (walletProvider instanceof EthereumProvider) { + if (walletProvider instanceof UniversalProvider) { return Boolean( - walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes( + walletProvider?.session?.namespaces?.['eip155']?.methods?.includes( EIP_5792_RPC_METHODS.WALLET_SEND_CALLS ) ) diff --git a/apps/laboratory/src/components/Solana/SolanaSendTransactionTest.tsx b/apps/laboratory/src/components/Solana/SolanaSendTransactionTest.tsx index 898e60c6ed..514847980e 100644 --- a/apps/laboratory/src/components/Solana/SolanaSendTransactionTest.tsx +++ b/apps/laboratory/src/components/Solana/SolanaSendTransactionTest.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' -import { Button, Stack, Text, Spacer, Link } from '@chakra-ui/react' -import { useAppKitAccount, useAppKitNetwork, useAppKitProvider } from '@reown/appkit/react' +import { Button, Stack, Spacer, Link } from '@chakra-ui/react' +import { useAppKitAccount, useAppKitProvider } from '@reown/appkit/react' import { PublicKey, Transaction, @@ -9,7 +9,6 @@ import { SystemProgram } from '@solana/web3.js' -import { solana } from '@reown/appkit/networks' import { useChakraToast } from '../Toast' import { type Provider, useAppKitConnection } from '@reown/appkit-adapter-solana/react' @@ -20,7 +19,6 @@ const amountInLamports = 10_000_000 export function SolanaSendTransactionTest() { const toast = useChakraToast() const { address } = useAppKitAccount() - const { caipNetwork } = useAppKitNetwork() const { walletProvider } = useAppKitProvider('solana') const { connection } = useAppKitConnection() const [loading, setLoading] = useState(false) @@ -131,14 +129,6 @@ export function SolanaSendTransactionTest() { return null } - if (caipNetwork?.chainId === solana.chainId) { - return ( - - Switch to Solana Devnet or Testnet to test this feature - - ) - } - return (