From c2f5a87b63a3c72bf8372cc8710fa1d270c77109 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 21 Jun 2022 19:44:42 +0200 Subject: [PATCH] chore: add moonbase chain id (#1397) --- ethers-core/src/types/chain.rs | 4 +++- ethers-etherscan/src/lib.rs | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ethers-core/src/types/chain.rs b/ethers-core/src/types/chain.rs index ad9e0806..103eacc0 100644 --- a/ethers-core/src/types/chain.rs +++ b/ethers-core/src/types/chain.rs @@ -33,7 +33,8 @@ pub enum Chain { Avalanche = 43114, AvalancheFuji = 43113, Sepolia = 11155111, - Moonbeam = 1287, + Moonbeam = 1284, + Moonbase = 1287, MoonbeamDev = 1281, Moonriver = 1285, Optimism = 10, @@ -69,6 +70,7 @@ impl fmt::Display for Chain { Chain::AvalancheFuji => "avalanche-fuji", Chain::Sepolia => "sepolia", Chain::Moonbeam => "moonbeam", + Chain::Moonbase => "moonbase", Chain::MoonbeamDev => "moonbeam-dev", Chain::Moonriver => "moonriver", Chain::Optimism => "optimism", diff --git a/ethers-etherscan/src/lib.rs b/ethers-etherscan/src/lib.rs index cc800719..c6005c64 100644 --- a/ethers-etherscan/src/lib.rs +++ b/ethers-etherscan/src/lib.rs @@ -102,7 +102,7 @@ impl Client { Chain::Oasis | Chain::Emerald | Chain::EmeraldTestnet => String::default(), - Chain::Moonbeam | Chain::MoonbeamDev | Chain::Moonriver => { + Chain::Moonbeam | Chain::Moonbase | Chain::MoonbeamDev | Chain::Moonriver => { std::env::var("MOONSCAN_API_KEY")? } Chain::AnvilHardhat | Chain::Dev => { @@ -270,6 +270,9 @@ impl ClientBuilder { Chain::Moonbeam => { urls("https://api-moonbeam.moonscan.io/api", "https://moonbeam.moonscan.io/") } + Chain::Moonbase => { + urls("https://api-moonbase.moonscan.io/api", "https://moonbase.moonscan.io/") + } Chain::Moonriver => { urls("https://api-moonriver.moonscan.io/api", "https://moonriver.moonscan.io") }