Skip to content

feat: add Avalanche C-Chain network support#275

Draft
MiltonTulli wants to merge 2 commits intoopenscan-explorer:devfrom
MiltonTulli:MiltonTulli/add-avalanche-network
Draft

feat: add Avalanche C-Chain network support#275
MiltonTulli wants to merge 2 commits intoopenscan-explorer:devfrom
MiltonTulli:MiltonTulli/add-avalanche-network

Conversation

@MiltonTulli
Copy link
Contributor

@MiltonTulli MiltonTulli commented Mar 4, 2026

Description

Add support for Avalanche C-Chain (chain ID 43114), an EVM-compatible smart contract platform with high throughput. This implementation includes network configuration, RPC client initialization, and adapter routing to support block, transaction, and address queries on Avalanche.

Note: This PR depends on explorer-metadata#12 to include the Avalanche RPC endpoints in the metadata package. Without it, the user will need to manually configure the RPC endpoint in Settings for Avalanche to work.

Related Issue

Closes #113

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Performance improvement

Changes Made

  • Added Avalanche C-Chain entry to networks.json with network metadata (name, currency, logo, links)
  • Updated DataService to create EthereumClient directly for chains not registered in ClientFactory (Avalanche is standard EVM-compatible)
  • Updated AdapterFactory to route chain 43114 to EVMAdapter
  • Updated type unions in NetworkAdapter and EVMAdapter to include 43114
  • All validation passed: typecheck, format, lint

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

Avalanche C-Chain uses the standard EVM adapter (same as Ethereum, Sepolia, localhost) since it's fully EVM-compatible. Network logo is served from CDN. RPC endpoints will be fetched automatically from the metadata service.

Add support for Avalanche C-Chain, a standard EVM-compatible chain with high throughput. Implements network configuration, RPC client initialization (via direct EthereumClient instantiation since not in ClientFactory), and adapter routing. Closes openscan-explorer#113.

- Add Avalanche C-Chain entry to networks.json with CAIP-2 identifier and metadata
- Update DataService to create EthereumClient for unsupported chains
- Update AdapterFactory and NetworkAdapter to handle chain 43114
- Route to EVMAdapter (standard EVM implementation)
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

🚀 Preview: https://pr-275--openscan.netlify.app
📝 Commit: c448dad6485132fda16a8378a1f96600161e4ac7

Consolidate scattered union types (SupportedChainId | 11155111 | 97 | 31337 | 43114)
into a single AppChainId type, making it easier to add new networks.
@MiltonTulli MiltonTulli marked this pull request as draft March 4, 2026 02:52
@MiltonTulli MiltonTulli marked this pull request as ready for review March 4, 2026 13:54
@MatiasOS
Copy link
Member

MatiasOS commented Mar 6, 2026

@AugustoL Do we need to update Metadata repo before merge this?

@MatiasOS MatiasOS requested review from AugustoL and MatiasOS March 6, 2026 13:58
@AugustoL
Copy link
Collaborator

AugustoL commented Mar 6, 2026

@AugustoL Do we need to update Metadata repo before merge this?

PR merged and we have 1.1.2-alpha.0 on metadata ready to be used for this PR

@MatiasOS
Copy link
Member

MatiasOS commented Mar 6, 2026

Just review the avax docs, and there are non standard methods. I'll create a new Issue to add it to network-connectos.

Aside the standard/similar methods (eth_callDetailed, eth_getChainConfig), theere is a bunch of specific ones (warp_, avax_)

https://build.avax.network/docs/rpcs/c-chain

Copy link
Member

@MatiasOS MatiasOS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Work is needed

@AugustoL
Copy link
Collaborator

AugustoL commented Mar 6, 2026

Just review the avax docs, and there are non standard methods. I'll create a new Issue to add it to network-connectos.

Aside the standard/similar methods (eth_callDetailed, eth_getChainConfig), theere is a bunch of specific ones (warp_, avax_)

https://build.avax.network/docs/rpcs/c-chain

great, lets do it.

@MiltonTulli
Copy link
Contributor Author

Just review the avax docs, and there are non standard methods. I'll create a new Issue to add it to network-connectos.
Aside the standard/similar methods (eth_callDetailed, eth_getChainConfig), theere is a bunch of specific ones (warp_, avax_)
https://build.avax.network/docs/rpcs/c-chain

great, lets do it.

Marking this PR as draft until openscan-explorer/network-connectors#19 (or similar) is merged and a new tag/version of network-connectors is released. This PR depends on changes introduced there.

@MiltonTulli MiltonTulli marked this pull request as draft March 8, 2026 06:17
@MatiasOS
Copy link
Member

Hola @MiltonTulli , network connectors v1.4.0 is here (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants