Closed hhun closed 1 year ago
@glitch-txs @ganchoradkov Is this project being maintained?
Hey @hhun, please remove these parameters from the namespaces
config
pairingTopic: '282f083a841ba42b28a126a61f60ba24d2dc0674255e9081271bc25c56f38495', // optional topic to connect to
skipPairing: false //
Your config should look like
await provider.connect({
namespaces: {
eip155: {
chains: ['eip155:1', 'eip155:80001'],
methods: ['eth_sendTransaction', 'eth_signTransaction', 'eth_sign', 'personal_sign', 'eth_signTypedData'],
events: ['chainChanged', 'accountsChanged'],
rpcMap: {
1: 'https://rpc.walletconnect.com?chainId=eip155:1&projectId=' + projectId,
80001: 'https://rpc.walletconnect.com?chainId=eip155:80001&projectId=' + projectId
}
},
tron: {
chains: ['tron:0x2b6653dc'],
methods: ['tron_signTransaction', 'tron_signMessage'],
events: [],
rpcMap: {
'0x2b6653dc': 'https://api.trongrid.io'
}
}
},
pairingTopic: '282f083a841ba42b28a126a61f60ba24d2dc0674255e9081271bc25c56f38495', // optional topic to connect to
skipPairing: false // optional to skip pairing ( later it can be resumed by invoking .pair())
})
@ganchoradkov
An error message appears after modifying the code:
Verify iframe failed to load: https://verify.walletconnect.org verify iframe load timeout
No matching key. pairing topic doesn't exist: 282f083a841ba42b28a126a61f60ba24d2dc0674255e9081271bc25c56f38495
And modal
will not pop up.
Please help me write a complete example of connecting to the TRON network
import { ethers } from 'ethers'
import UniversalProvider from '@walletconnect/universal-provider'
const projectId = WALLET_CONNECT_PROJECT_ID
// Initialize the provider
const provider = await UniversalProvider.init({
logger: 'info',
relayUrl: 'wss://relay.walletconnect.com',
projectId: projectId,
metadata: {
name: 'React App',
description: 'React App for WalletConnect',
url: 'https://walletconnect.com/',
icons: ['https://avatars.githubusercontent.com/u/37784886']
},
client: undefined // optional instance of @walletconnect/sign-client
})
// create sub providers for each namespace/chain
await provider.connect({
namespaces: {
eip155: {
chains: ['eip155:1', 'eip155:80001'],
methods: ['eth_sendTransaction', 'eth_signTransaction', 'eth_sign', 'personal_sign', 'eth_signTypedData'],
events: ['chainChanged', 'accountsChanged'],
rpcMap: {
1: 'https://rpc.walletconnect.com?chainId=eip155:1&projectId=' + projectId,
80001: 'https://rpc.walletconnect.com?chainId=eip155:80001&projectId=' + projectId
}
},
tron: {
chains: ['tron:0x2b6653dc'],
methods: ['tron_signTransaction', 'tron_signMessage'],
events: [],
rpcMap: {
'0x2b6653dc': 'https://api.trongrid.io'
}
}
},
pairingTopic: '282f083a841ba42b28a126a61f60ba24d2dc0674255e9081271bc25c56f38495', // optional topic to connect to
skipPairing: false // optional to skip pairing ( later it can be resumed by invoking .pair())
})
// Create Web3 Provider
const web3Provider = new ethers.providers.Web3Provider(provider)
@hhun please update to latest version, there shouldn't error log regarding, just warn, in which case you can ignore it as it don't prevent normal SDK usage.
Verify iframe failed to load: https://verify.walletconnect.org/
verify iframe load timeout
Please help me write a complete example of connecting to the TRON network
which parts are you having difficulties with? WalletConnect v2 is chain agnostic so connecting with any network is the same as say, ethereum(eip155). Are you getting any additional errors? We have web-examples that implement Tron
@ganchoradkov It is because the dapp-example is too complicated to understand, so I would like to trouble you to help me write a simple example of connecting to the TRON network.
@hhun any update? same issue
@glitch-txs
能不能帮我写一个
Web3Model V3
连接波场网络
的例子? Can you help me write an example of connectingWeb3Model V3
to theTRON network
?https://react-app.walletconnect.com/ 这个例子太复杂看不懂 https://react-app.walletconnect.com/ This example is too complicated to understand
code
Error reporting:
Unsupported chains. connect() requiredNamespaces, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }
How to solve this problem?
How to generate
client
andpairingTopic
?