Any way to use the HTTP provider for Infura connections? #4195
Answered
by
glitch-txs
milaabl
asked this question in
Developer Support
-
I'm troubleshooting an Infura-specific problem, and as Infura's support suggested, I should try connecting to an HTTP endpoint. Currently a WebSocket connection is automatically established with the following config: const provider = await EthereumProvider.init({
projectId: process.env.NEXT_PUBLIC_INFURA_ID!,
showQrModal: true,
optionalChains: [1, 5, 11155111],
});
await provider.enable(); Is there any option I can pass to the EthereumProvider in order to connect via HTTP instead? Resources: |
Beta Was this translation helpful? Give feedback.
Answered by
glitch-txs
Feb 2, 2024
Replies: 1 comment 1 reply
-
Hi Mila! You can use the rpcMap: {
1: "yourRpcUrl...",
} The key must be the chain ID you want to target and then value the RPC URL you want to assign to it |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
milaabl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Mila! You can use the
rpcMap
option in theinit
function :)The key must be the chain ID you want to target and then value the RPC URL you want to assign to it