From 2f39844a8b669425583a50d1b5cd95279b199d93 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 28 Feb 2024 22:20:47 +0100 Subject: [PATCH] feat: add blast --- assets/chains.json | 12 ++++++++++++ src/chain.rs | 6 ++++++ src/named.rs | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/assets/chains.json b/assets/chains.json index bbdf142..9cfc7d6 100644 --- a/assets/chains.json +++ b/assets/chains.json @@ -768,6 +768,18 @@ "etherscanBaseUrl": "https://www.oklink.com/amoy", "etherscanApiKeyName": "POLYGONSCAN_API_KEY" }, + "81457": { + "internalId": "Blast", + "name": "blast", + "averageBlocktimeHint": 2000, + "isLegacy": false, + "supportsShanghai": true, + "isTestnet": false, + "nativeCurrencySymbol": null, + "etherscanApiUrl": "https://api.routescan.io/v2/network/evm/81457/etherscan", + "etherscanBaseUrl": "https://blastscan.io", + "etherscanApiKeyName": "ETHERSCAN_API_KEY" + }, "84531": { "internalId": "BaseGoerli", "name": "base-goerli", diff --git a/src/chain.rs b/src/chain.rs index 5c819d2..dcdb34e 100644 --- a/src/chain.rs +++ b/src/chain.rs @@ -310,6 +310,12 @@ impl Chain { Self::from_named(NamedChain::FraxtalTestnet) } + /// Returns the blast chain. + #[inline] + pub const fn blast() -> Self { + Self::from_named(NamedChain::Blast) + } + /// Returns the blast sepolia chain. #[inline] pub const fn blast_sepolia() -> Self { diff --git a/src/named.rs b/src/named.rs index 3d96397..8657d83 100644 --- a/src/named.rs +++ b/src/named.rs @@ -185,6 +185,7 @@ pub enum NamedChain { #[cfg_attr(feature = "serde", serde(alias = "fraxtal-testnet"))] FraxtalTestnet = 2522, + Blast = 81457, #[cfg_attr(feature = "serde", serde(alias = "blast-sepolia"))] BlastSepolia = 168587773, @@ -373,6 +374,7 @@ impl NamedChain { | C::Base | C::BaseGoerli | C::BaseSepolia + | C::Blast | C::BlastSepolia | C::Fraxtal | C::FraxtalTestnet @@ -492,6 +494,7 @@ impl NamedChain { | C::Base | C::BaseGoerli | C::BaseSepolia + | C::Blast | C::BlastSepolia | C::Fraxtal | C::FraxtalTestnet @@ -565,6 +568,7 @@ impl NamedChain { | C::Base | C::BaseGoerli | C::BaseSepolia + | C::Blast | C::BlastSepolia | C::Fraxtal | C::FraxtalTestnet @@ -645,6 +649,7 @@ impl NamedChain { | C::Optimism | C::Arbitrum | C::ArbitrumNova + | C::Blast | C::Cronos | C::Rsk | C::BinanceSmartChain @@ -886,6 +891,9 @@ impl NamedChain { ("https://api-holesky.fraxscan.com/api", "https://holesky.fraxscan.com") } + C::Blast => { + ("https://api.routescan.io/v2/network/evm/81457/etherscan", "https://blastscan.io") + } C::BlastSepolia => ( "https://api.routescan.io/v2/network/testnet/evm/168587773/etherscan", "https://testnet.blastscan.io", @@ -990,6 +998,7 @@ impl NamedChain { | C::BaseSepolia | C::Fraxtal | C::FraxtalTestnet + | C::Blast | C::BlastSepolia | C::Gnosis | C::Scroll