From b18bb63c7903fed2015a2ed3e1c3e6e41a54dc6b Mon Sep 17 00:00:00 2001 From: hokk812 Date: Mon, 4 Nov 2024 01:31:03 +0300 Subject: [PATCH 1/2] feat: add sonic testnet --- src/named.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/named.rs b/src/named.rs index ae66e03..1471c90 100644 --- a/src/named.rs +++ b/src/named.rs @@ -384,6 +384,8 @@ pub enum NamedChain { #[strum(to_string = "curtis", serialize = "apechain-testnet")] #[cfg_attr(feature = "serde", serde(alias = "apechain-testnet", alias = "curtis"))] Curtis = 33111, + + SonicTestnet = 64165, } // This must be implemented manually so we avoid a conflict with `TryFromPrimitive` where it treats @@ -659,7 +661,7 @@ impl NamedChain { Morden | Ropsten | Rinkeby | Goerli | Kovan | Sepolia | Holesky | MantleTestnet | Moonbase | MoonbeamDev | OptimismKovan | Poa | Sokol | Rsk | EmeraldTestnet | Boba | ZkSync | ZkSyncTestnet | PolygonZkEvm | PolygonZkEvmTestnet | Metis - | Linea | LineaGoerli | LineaSepolia | KakarotSepolia => return None, + | Linea | LineaGoerli | LineaSepolia | KakarotSepolia | SonicTestnet => return None, })) } @@ -789,7 +791,7 @@ impl NamedChain { Dev | AnvilHardhat | Morden | Ropsten | Rinkeby | Cronos | CronosTestnet | Kovan | Sokol | Poa | Moonbeam | MoonbeamDev | Moonriver | Moonbase | Evmos | EvmosTestnet | Aurora | AuroraTestnet | Canto | CantoTestnet | Iotex | Core - | Merlin | Bitlayer => false, + | Merlin | Bitlayer | SonicTestnet => false, } } @@ -944,7 +946,8 @@ impl NamedChain { | SoneiumMinatoTestnet | WorldSepolia | UnichainSepolia - | Curtis => true, + | Curtis + | SonicTestnet => true, // Dev chains. Dev | AnvilHardhat => true, @@ -1346,6 +1349,10 @@ impl NamedChain { ApeChain => ("https://api.apescan.io/api", "https://apescan.io"), Curtis => ("https://curtis.explorer.caldera.xyz/api/v2", "https://curtis.apescan.io"), + SonicTestnet => ( + "https://api.routescan.io/v2/network/testnet/evm/64165/etherscan/api", + "https://scan.soniclabs.com", + ), }) } @@ -1468,7 +1475,8 @@ impl NamedChain { | Pulsechain | PulsechainTestnet | AutonomysNovaTestnet - | Iotex => return None, + | Iotex + | SonicTestnet => return None, }; Some(api_key_name) From a4e3082966ee13a6d9f485b8744d2e08b81de017 Mon Sep 17 00:00:00 2001 From: hokk812 Date: Mon, 4 Nov 2024 01:33:26 +0300 Subject: [PATCH 2/2] feat: add sonic testnet --- assets/chains.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assets/chains.json b/assets/chains.json index e042428..1b96b66 100644 --- a/assets/chains.json +++ b/assets/chains.json @@ -1176,6 +1176,18 @@ "etherscanBaseUrl": "https://explorer.celo.org/baklava", "etherscanApiKeyName": "BLOCKSCOUT_API_KEY" }, + "64165": { + "internalId": "SonicTestnet", + "name": "sonic-testnet", + "averageBlocktimeHint": null, + "isLegacy": false, + "supportsShanghai": false, + "isTestnet": true, + "nativeCurrencySymbol": null, + "etherscanApiUrl": "https://api.routescan.io/v2/network/testnet/evm/64165/etherscan/api", + "etherscanBaseUrl": "https://scan.soniclabs.com", + "etherscanApiKeyName": null + }, "80001": { "internalId": "PolygonMumbai", "name": "mumbai",