Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch network with trust wallet provider in pancakeswap #391

Open
Imdavyking opened this issue Mar 20, 2023 · 3 comments
Open

switch network with trust wallet provider in pancakeswap #391

Imdavyking opened this issue Mar 20, 2023 · 3 comments

Comments

@Imdavyking
Copy link

Imdavyking commented Mar 20, 2023

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 Imdavyking changed the title switch network with trust wallet provider switch network with trust wallet provider in pancakeswap Mar 20, 2023
@hoanganhtuan95ptit
Copy link
Contributor

hoanganhtuan95ptit commented Mar 28, 2023

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)

@Imdavyking
Copy link
Author

thank you very much

@Alkhatri77
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@hoanganhtuan95ptit @Imdavyking @Alkhatri77 and others