How to use custom rpc while configuring Web3Modal? #144
-
I am working on a Dapp and by default, I am using infura. How can I use custom RPC? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I don't know, but I recommend posting the same question on StackExchange or the Web3Modal Discord server. |
Beta Was this translation helpful? Give feedback.
-
Hey @Gajesh2007, in web3modal we describe each provider to be configured with its own set of options, here is how it would look like for WalletConnect: https://github.com/Web3Modal/web3modal/blob/master/docs/providers/walletconnect.md const providerOptions = {
walletconnect: {
package: WalletConnectProvider, // required
options: {
infuraId: "INFURA_ID" // required
}
}
}; The example shows how you would include the infuraId for the WalletConnectProvider, however this can be replaced with a map of custom RPC urls as follows: const providerOptions = {
walletconnect: {
package: WalletConnectProvider, // required
options: {
rpc: {
1: "https://mainnet.mycustomnode.com",
3: "https://ropsten.mycustomnode.com",
100: "https://dai.poa.network",
}
}
}
}; |
Beta Was this translation helpful? Give feedback.
Hey @Gajesh2007,
in web3modal we describe each provider to be configured with its own set of options, here is how it would look like for WalletConnect: https://github.com/Web3Modal/web3modal/blob/master/docs/providers/walletconnect.md
The example shows how you would include the infuraId for the WalletConnectProvider, however this can be replaced with a map of custom RPC urls as follows: