-
Notifications
You must be signed in to change notification settings - Fork 541
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Current Behavior
In onboard.setChain, when the user doesn't have that chain in their wallet, onboard suggests to add it.
To achieve that, it passes the app's provider configuration to the wallet.
In a typical web3 app, that uses a custom Infura endpoint with an individual project id, it's not desirable that the user has this custom RPC URL in their wallet.
Expected Behavior
There should be a way to specify an RPC URL to give to the wallet when adding a new chain. That would typically be a public RPC.
Steps To Reproduce
- Use MetaMask
- Remove Polygon if you have it in your MetaMask already
- Initialize onboard with a custom Polygon RPC
- Call
onboard.setChain({ chainId: 137 }) - Observe that it offers the user to install Polygon with that RPC
Onboard Version
2
Node Version
16
What browsers are you seeing the problem on?
No response
Relevant log output
No response
Anything else?
I would suggest to add a new field in the Chain configuration, publicRpc, and use that when calling wallet_addEthereumChain. Or maybe just a new param for the setChain method.
0x3dev and lianqiang
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working