From 6040f2d44a198e7e4282f17687d7ecc9971b861f Mon Sep 17 00:00:00 2001 From: Misha Date: Tue, 25 Jun 2024 16:59:59 +0700 Subject: [PATCH] Shimmer network support (#70) Adds support for shimmer network https://shimmer.network/ Marked as a legacy because of this issue: https://github.com/iotaledger/wasp/issues/3392 --- assets/chains.json | 12 ++++++++++++ src/chain.rs | 6 ++++++ src/named.rs | 14 ++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/assets/chains.json b/assets/chains.json index 37d7947..283746b 100644 --- a/assets/chains.json +++ b/assets/chains.json @@ -216,6 +216,18 @@ "etherscanBaseUrl": "https://polygonscan.com", "etherscanApiKeyName": "POLYGONSCAN_API_KEY" }, + "148": { + "internalId": "Shimmer", + "name": "shimmer", + "averageBlocktimeHint": 5000, + "isLegacy": true, + "supportsShanghai": true, + "isTestnet": true, + "nativeCurrencySymbol": "SMR", + "etherscanApiUrl": "https://explorer.evm.shimmer.network/api", + "etherscanBaseUrl": "https://explorer.evm.shimmer.network", + "etherscanApiKeyName": null + }, "204": { "internalId": "OpBNBMainnet", "name": "opbnb-mainnet", diff --git a/src/chain.rs b/src/chain.rs index ac4ed76..a1db4df 100644 --- a/src/chain.rs +++ b/src/chain.rs @@ -414,6 +414,12 @@ impl Chain { Self::from_named(NamedChain::TaikoHekla) } + /// Returns the shimmer testnet chain. + #[inline] + pub const fn shimmer() -> Self { + Self::from_named(NamedChain::Shimmer) + } + /// Returns the kind of this chain. #[inline] pub const fn kind(&self) -> &ChainKind { diff --git a/src/named.rs b/src/named.rs index 250bd29..14b0ea3 100644 --- a/src/named.rs +++ b/src/named.rs @@ -181,6 +181,8 @@ pub enum NamedChain { #[cfg_attr(feature = "serde", serde(alias = "syndr-sepolia"))] SyndrSepolia = 444444, + Shimmer = 148, + #[strum(to_string = "fraxtal")] #[cfg_attr(feature = "serde", serde(alias = "fraxtal"))] Fraxtal = 252, @@ -453,6 +455,8 @@ impl NamedChain { C::Scroll | C::ScrollSepolia => 3_000, + C::Shimmer => 5_000, + C::Gnosis | C::Chiado => 5_000, C::Elastos => 5_000, @@ -530,6 +534,7 @@ impl NamedChain { | C::PolygonZkEvmTestnet | C::Scroll | C::ScrollSepolia + | C::Shimmer | C::Metis | C::Viction | C::Elastos @@ -643,6 +648,7 @@ impl NamedChain { | C::EtherlinkTestnet | C::Scroll | C::ScrollSepolia + | C::Shimmer | C::OpBNBMainnet | C::OpBNBTestnet | C::KakarotSepolia @@ -703,6 +709,7 @@ impl NamedChain { | C::PolygonAmoy | C::PolygonZkEvmTestnet | C::ScrollSepolia + | C::Shimmer | C::ZkSyncTestnet | C::ZoraGoerli | C::ZoraSepolia @@ -794,6 +801,8 @@ impl NamedChain { C::Ronin => "RON", + C::Shimmer => "SMR", + _ => return None, }) } @@ -918,6 +927,10 @@ impl NamedChain { ("https://api-sepolia.scrollscan.com/api", "https://sepolia.scrollscan.com") } + C::Shimmer => { + ("https://explorer.evm.shimmer.network/api", "https://explorer.evm.shimmer.network") + } + C::Metis => { ("https://andromeda-explorer.metis.io/api", "https://andromeda-explorer.metis.io") } @@ -1148,6 +1161,7 @@ impl NamedChain { C::Metis | C::Chiado | C::Sepolia + | C::Shimmer | C::Rsk | C::Sokol | C::Poa