Closed econiche closed 2 years ago
tp.getWallet({ switch: true, walletTypes: ['eth'] }).then(res => { alert(res.data[0].blockchain) }
try to add walletTypes
walletTypes
It can run after adding this parameter.
But because of the addition of this parameter, you can only see several networks pre-configured, I can't switch to custom networks.
What should I do?
If the custom network is an EVM compatible chain using wallet_switchEthereumChain
instead: https://docs.metamask.io/guide/rpc-api.html#usage-with-wallet-switchethereumchain
Get it! Thanks.
tp.getWallet({ switch: true }).then(res => { alert(res.data[0].blockchain) }