Hello, I encountered the following problems when using Walletconnect.
Walletconnect version V2.0
When I use the wallet link of the document to scan the QR code for testing, the App reports an error 'Code: 1601, message:' session not approved '.
The code is as follows:
const client = await WalletConnectClient.init({ relayProvider: "wss://relay.walletconnect.org", metadata: { name: "grid Dapp", description: "grid Dapp", url: "https://walletconnect.org/", icons: ["https://walletconnect.org/walletconnect-logo.png"], }, }); client.on( CLIENT_EVENTS.pairing.proposal, async (proposal) => { // uri should be shared with the Wallet either through QR Code scanning or mobile deep linking const { uri } = proposal.signal.params; QRCodeModal.open(uri, () => { console.log("EVENT", "QR Code Modal closed"); }); } ); const session = await client.connect({ permissions: { blockchain: { chains: ["eip155:1"], }, jsonrpc: { methods: ["eth_sendTransaction", "personal_sign", "eth_signTypedData"], }, }, });
Can you tell me the reason for the error and the solution
If you need futher information, please feel free to contact with me, and look forward to your feedback. Thanks for your help!
Hello, I encountered the following problems when using Walletconnect. Walletconnect version V2.0 When I use the wallet link of the document to scan the QR code for testing, the App reports an error 'Code: 1601, message:' session not approved '. The code is as follows:
const client = await WalletConnectClient.init({ relayProvider: "wss://relay.walletconnect.org", metadata: { name: "grid Dapp", description: "grid Dapp", url: "https://walletconnect.org/", icons: ["https://walletconnect.org/walletconnect-logo.png"], }, }); client.on( CLIENT_EVENTS.pairing.proposal, async (proposal) => { // uri should be shared with the Wallet either through QR Code scanning or mobile deep linking const { uri } = proposal.signal.params; QRCodeModal.open(uri, () => { console.log("EVENT", "QR Code Modal closed"); }); } ); const session = await client.connect({ permissions: { blockchain: { chains: ["eip155:1"], }, jsonrpc: { methods: ["eth_sendTransaction", "personal_sign", "eth_signTypedData"], }, }, });
Can you tell me the reason for the error and the solution If you need futher information, please feel free to contact with me, and look forward to your feedback. Thanks for your help!