trust-web3-provider
trust-web3-provider copied to clipboard
switch network with trust wallet provider in pancakeswap
this code base can not switch network in pancakeswap
window.ethereum.sendResponse($methodId, "137") window.ethereum.emitChainChanged("0x89") window.ethereum.setConfig({ ethereum:{ chainId: $chainId, rpcUrl: "$rpcUrl", address: "$address" } } )
Looks like pancakeswap site doesn't support Polygon chain (137).
If you want to switch Chain, you need to call this function
window.ethereum.setConfig({
ethereum:{
chainId: $chainId,
rpcUrl: "$rpcUrl",
address: "$address"
}
})
Then
window.ethereum.emitChainChanged($chainId)
thank you very much
this code base can not switch network in pancakeswap
window.ethereum.sendResponse($methodId, "137") window.ethereum.emitChainChanged("0x89") window.ethereum.setConfig({ ethereum:{ chainId: $chainId, rpcUrl: "$rpcUrl", address: "$address" } } )