trust-web3-provider icon indicating copy to clipboard operation
trust-web3-provider copied to clipboard

switch network with trust wallet provider in pancakeswap

Open Imdavyking opened this issue 1 year ago • 4 comments

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" } } )

Imdavyking avatar Mar 20 '23 15:03 Imdavyking

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)

hoanganhtuan95ptit avatar Mar 28 '23 12:03 hoanganhtuan95ptit

thank you very much

Imdavyking avatar Apr 24 '23 18:04 Imdavyking

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" } } )

Alkhatri77 avatar Mar 05 '24 19:03 Alkhatri77