chore: add moonbase chain id (#1397)

This commit is contained in:
Matthias Seitz 2022-06-21 19:44:42 +02:00 committed by GitHub
parent 77ca64d850
commit c2f5a87b63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -33,7 +33,8 @@ pub enum Chain {
Avalanche = 43114, Avalanche = 43114,
AvalancheFuji = 43113, AvalancheFuji = 43113,
Sepolia = 11155111, Sepolia = 11155111,
Moonbeam = 1287, Moonbeam = 1284,
Moonbase = 1287,
MoonbeamDev = 1281, MoonbeamDev = 1281,
Moonriver = 1285, Moonriver = 1285,
Optimism = 10, Optimism = 10,
@ -69,6 +70,7 @@ impl fmt::Display for Chain {
Chain::AvalancheFuji => "avalanche-fuji", Chain::AvalancheFuji => "avalanche-fuji",
Chain::Sepolia => "sepolia", Chain::Sepolia => "sepolia",
Chain::Moonbeam => "moonbeam", Chain::Moonbeam => "moonbeam",
Chain::Moonbase => "moonbase",
Chain::MoonbeamDev => "moonbeam-dev", Chain::MoonbeamDev => "moonbeam-dev",
Chain::Moonriver => "moonriver", Chain::Moonriver => "moonriver",
Chain::Optimism => "optimism", Chain::Optimism => "optimism",

View File

@ -102,7 +102,7 @@ impl Client {
Chain::Oasis | Chain::Oasis |
Chain::Emerald | Chain::Emerald |
Chain::EmeraldTestnet => String::default(), Chain::EmeraldTestnet => String::default(),
Chain::Moonbeam | Chain::MoonbeamDev | Chain::Moonriver => { Chain::Moonbeam | Chain::Moonbase | Chain::MoonbeamDev | Chain::Moonriver => {
std::env::var("MOONSCAN_API_KEY")? std::env::var("MOONSCAN_API_KEY")?
} }
Chain::AnvilHardhat | Chain::Dev => { Chain::AnvilHardhat | Chain::Dev => {
@ -270,6 +270,9 @@ impl ClientBuilder {
Chain::Moonbeam => { Chain::Moonbeam => {
urls("https://api-moonbeam.moonscan.io/api", "https://moonbeam.moonscan.io/") 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 => { Chain::Moonriver => {
urls("https://api-moonriver.moonscan.io/api", "https://moonriver.moonscan.io") urls("https://api-moonriver.moonscan.io/api", "https://moonriver.moonscan.io")
} }