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

Avalanche Mainnet/Fuji Infura support #3641

Open
charlie-kim opened this issue Jan 17, 2023 · 6 comments
Open

Avalanche Mainnet/Fuji Infura support #3641

charlie-kim opened this issue Jan 17, 2023 · 6 comments
Labels
enhancement New feature or improvement.

Comments

@charlie-kim
Copy link

Describe the Feature

Similar to #3323, creating a InfuraProvider instance with chain ID 43114(mainnet), 43113(fuji testnet) generates unsupported network error.

{
  reason: 'unsupported network',
  code: 'INVALID_ARGUMENT',
  argument: 'network',
  value: { chainId: 43114, name: 'unknown' }
}

Code Example

new ethers.providers.InfuraProvider(43114, {
  projectId: infuraProjectId,
  projectSecret: infuraProjectSecret,
})
@charlie-kim charlie-kim added the enhancement New feature or improvement. label Jan 17, 2023
@woosal1337
Copy link

This is still WIP. Any estimated time for it to be completed?

@0x7An
Copy link

0x7An commented Mar 28, 2024

@charlie-kim @woosal1337 To bypass the 'unsupported network' error with Avalanche networks, switch to using ethers.JsonRpcProvider with your network's RPC URL.

@ricmoo
Copy link
Member

ricmoo commented Mar 28, 2024

Is Avalanche json-rpc compatible with Ethereum?

For some reason I thought it wasn’t. But if it is, I can add it to the InfuraProvider.

@0x7An
Copy link

0x7An commented Mar 28, 2024

@ricmoo Looks like only C-Chain is compatible.

https://docs.infura.io/api/networks/avalanche-c-chain/json-rpc-methods

@charlie-kim
Copy link
Author

@charlie-kim @woosal1337 To bypass the 'unsupported network' error with Avalanche networks, switch to using ethers.JsonRpcProvider with your network's RPC URL.

Thanks. But ethers.JsonRpcProvider makes extra request to get chain ID. It will be better to use ethers. InfuraProvider.

@charlie-kim
Copy link
Author

@ricmoo any update on this, please?

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

No branches or pull requests

4 participants