ethers.js
ethers.js copied to clipboard
Avalanche Mainnet/Fuji Infura support
Describe the Feature
Similar to https://github.com/ethers-io/ethers.js/issues/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,
})
This is still WIP. Any estimated time for it to be completed?
@charlie-kim @woosal1337 To bypass the 'unsupported network' error with Avalanche networks, switch to using ethers.JsonRpcProvider with your network's RPC URL.
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.
@ricmoo Looks like only C-Chain is compatible.
https://docs.infura.io/api/networks/avalanche-c-chain/json-rpc-methods
@charlie-kim @woosal1337 To bypass the 'unsupported network' error with Avalanche networks, switch to using
ethers.JsonRpcProviderwith your network's RPC URL.
Thanks. But ethers.JsonRpcProvider makes extra request to get chain ID. It will be better to use ethers. InfuraProvider.
@ricmoo any update on this, please?