From 9c7177471ad749f90dd541f8625c900ade49fb60 Mon Sep 17 00:00:00 2001 From: Ashutosh Varma Date: Fri, 4 Oct 2024 13:04:36 +0530 Subject: [PATCH] feat: add soneium minato testnet (#95) Adding Soneium Minato Testnet - https://docs.soneium.org/docs/builders/overview --- assets/chains.json | 12 ++++++++++++ src/named.rs | 23 +++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/assets/chains.json b/assets/chains.json index 8821285..fd5f09b 100644 --- a/assets/chains.json +++ b/assets/chains.json @@ -672,6 +672,18 @@ "etherscanBaseUrl": "https://explorer.gravity.xyz", "etherscanApiKeyName": null }, + "1946": { + "internalId": "SoneiumMinatoTestnet", + "name": "soneium-minato-testnet", + "averageBlocktimeHint": 2000, + "isLegacy": false, + "supportsShanghai": true, + "isTestnet": true, + "nativeCurrencySymbol": null, + "etherscanApiUrl": "https://explorer-testnet.soneium.org/api", + "etherscanBaseUrl": "https://explorer-testnet.soneium.org", + "etherscanApiKeyName": "BLOCKSCOUT_API_KEY" + }, "2020": { "internalId": "Ronin", "name": "ronin", diff --git a/src/named.rs b/src/named.rs index 113048e..b6563cd 100644 --- a/src/named.rs +++ b/src/named.rs @@ -353,6 +353,10 @@ pub enum NamedChain { #[strum(to_string = "immutable-testnet")] #[cfg_attr(feature = "serde", serde(alias = "immutable-testnet"))] ImmutableTestnet = 13473, + + #[strum(to_string = "soneium-minato-testnet")] + #[cfg_attr(feature = "serde", serde(alias = "soneium-minato-testnet"))] + SoneiumMinatoTestnet = 1946, } // This must be implemented manually so we avoid a conflict with `TryFromPrimitive` where it treats @@ -497,6 +501,7 @@ impl NamedChain { | BlastSepolia | OpBNBMainnet | OpBNBTestnet + | SoneiumMinatoTestnet ) } @@ -538,7 +543,8 @@ impl NamedChain { Optimism | OptimismGoerli | OptimismSepolia | Base | BaseGoerli | BaseSepolia | Blast | BlastSepolia | Fraxtal | FraxtalTestnet | Zora | ZoraGoerli | ZoraSepolia - | Mantle | MantleSepolia | Mode | ModeSepolia | Pgn | PgnSepolia => 2_000, + | Mantle | MantleSepolia | Mode | ModeSepolia | Pgn | PgnSepolia + | SoneiumMinatoTestnet => 2_000, Alphanet => 1_000, @@ -719,7 +725,8 @@ impl NamedChain { | PulsechainTestnet | Koi | Immutable - | ImmutableTestnet => false, + | ImmutableTestnet + | SoneiumMinatoTestnet => false, // Unknown / not applicable, default to false for backwards compatibility. Dev | AnvilHardhat | Morden | Ropsten | Rinkeby | Cronos | CronosTestnet | Kovan @@ -796,6 +803,7 @@ impl NamedChain { | Koi | Immutable | ImmutableTestnet + | SoneiumMinatoTestnet ) } @@ -865,7 +873,8 @@ impl NamedChain { | GravityAlphaTestnetSepolia | XaiSepolia | Koi - | ImmutableTestnet => true, + | ImmutableTestnet + | SoneiumMinatoTestnet => true, // Dev chains. Dev | AnvilHardhat => true, @@ -1226,6 +1235,9 @@ impl NamedChain { "https://explorer.testnet.immutable.com/api", "https://explorer.testnet.immutable.com", ), + SoneiumMinatoTestnet => { + ("https://explorer-testnet.soneium.org/api", "https://explorer-testnet.soneium.org") + } }) } @@ -1304,7 +1316,9 @@ impl NamedChain { Acala | AcalaMandalaTestnet | AcalaTestnet | Canto | CantoTestnet | Etherlink | EtherlinkTestnet | Flare | FlareCoston2 | KakarotSepolia | Karura | KaruraTestnet | Mode | ModeSepolia | Pgn | PgnSepolia | Shimmer | Zora | ZoraGoerli | ZoraSepolia - | Darwinia | Crab | Koi | Immutable | ImmutableTestnet => "BLOCKSCOUT_API_KEY", + | Darwinia | Crab | Koi | Immutable | ImmutableTestnet | SoneiumMinatoTestnet => { + "BLOCKSCOUT_API_KEY" + } Boba => "BOBASCAN_API_KEY", @@ -1466,6 +1480,7 @@ mod tests { (AutonomysNovaTestnet, &["autonomys-nova-testnet"]), (Immutable, &["immutable"]), (ImmutableTestnet, &["immutable-testnet"]), + (SoneiumMinatoTestnet, &["soneium-minato-testnet"]), ]; for &(chain, aliases) in ALIASES {