Skip to content

Commit

Permalink
feat(chain): add elastos networks (#2750)
Browse files Browse the repository at this point in the history
Co-authored-by: tian zhou <zhoutian@storswift.com>
  • Loading branch information
anynya and sunday527 committed Mar 1, 2024
1 parent f86ab1f commit 7e8c167
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ethers-core/src/types/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ pub enum Chain {

Mode = 34443,
ModeSepolia = 919,

Elastos = 20,
}

// === impl Chain ===
Expand Down Expand Up @@ -329,6 +331,7 @@ impl Chain {
Gnosis | Chiado => 5_000,
Viction => 2_000,
Mode | ModeSepolia => 2_000,
Elastos => 5_000,
// Explicitly exhaustive. See NB above.
Morden | Ropsten | Rinkeby | Goerli | Kovan | Sepolia | Holesky | Moonbase |
MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet | Boba | Base |
Expand Down Expand Up @@ -378,7 +381,8 @@ impl Chain {
Metis |
Viction |
Scroll |
ScrollSepolia => true,
ScrollSepolia |
Elastos => true,

// Known EIP-1559 chains
Mainnet |
Expand Down Expand Up @@ -636,6 +640,7 @@ impl Chain {
"https://sepolia.explorer.mode.network/api",
"https://sepolia.explorer.mode.network",
),
Elastos => ("https://api.elastos.io/eth", "https://esc.elastos.io/"),
};

Some(urls)
Expand Down Expand Up @@ -727,7 +732,8 @@ impl Chain {
FilecoinMainnet |
LineaTestnet |
Viction |
FilecoinCalibrationTestnet => return None,
FilecoinCalibrationTestnet |
Elastos => return None,
};

Some(api_key_name)
Expand Down

0 comments on commit 7e8c167

Please sign in to comment.