diff --git a/lib/eth/chain.rb b/lib/eth/chain.rb index 7243bcb0..a591b089 100644 --- a/lib/eth/chain.rb +++ b/lib/eth/chain.rb @@ -32,6 +32,15 @@ class ReplayProtectionError < StandardError; end # Chain ID for Optimistic Ethereum mainnet. OPTIMISM = 10.freeze + # Chain ID for Cronos mainnet. + CRONOS = 25.freeze + + # Chain ID for Rootstock mainnet. + RSK = 30.freeze + + # Chain ID for BNB Smart Chain mainnet. + BNB = 56.freeze + # Chain ID for Ethereum Classic mainnet. CLASSIC = 61.freeze @@ -50,9 +59,24 @@ class ReplayProtectionError < StandardError; end # Chain ID for the Polygon mainnet (formerly Matic). POLYGON = MATIC.freeze - # Chain ID for Arbitrum mainnet. + # Chain ID for Filecoin mainnet. + FILECOIN = 314.freeze + + # Chain ID for Moonbeam + MOONBEAM = 1284.freeze + + # Chain ID for Base mainnet. + BASE = 8453.freeze + + # Chain ID for Arbitrum One mainnet. ARBITRUM = 42161.freeze + # Chain ID for Avalance C-Chain mainnet. + AVALANCHE = 43114.freeze + + # Chain ID for Linea mainnet. + LINEA = 59144.freeze + # Chain ID for Morden (Ethereum) testnet. MORDEN = 2.freeze @@ -77,7 +101,7 @@ class ReplayProtectionError < StandardError; end # Chain ID for Mordor testnet. MORDOR = 63.freeze - # Chain ID for Optimistik Kovan testnet. + # Chain ID for Optimistm Kovan testnet. KOVAN_OPTIMISM = 69.freeze # Chain ID for Arbitrum xDAI testnet. @@ -86,6 +110,12 @@ class ReplayProtectionError < StandardError; end # Chain ID for Optimistic Goerli testnet. GOERLI_OPTIMISM = 420.freeze + # Chain ID for Moonriver testnet + MOONRIVER = 1285.freeze + + # Chain ID for Moonbase alpha + MOONBASE = 1287.freeze + # Chain ID for the Polygon Mumbai testnet. MUMBAI = 80001.freeze @@ -104,15 +134,6 @@ class ReplayProtectionError < StandardError; end # Chain ID for the geth private network preset. PRIVATE_GETH = 1337.freeze - # Chain ID for Moonbase - MOONBASE = 1287.freeze - - # Chain ID for Moonriver - MOONRIVER = 1285.freeze - - # Chain ID for Moonbeam - MOONBEAM = 1284.freeze - # Indicates wether the given `v` indicates a legacy chain value # used by ledger wallets without EIP-155 replay protection. # diff --git a/spec/eth/chain_spec.rb b/spec/eth/chain_spec.rb index 997e596b..683ba57a 100644 --- a/spec/eth/chain_spec.rb +++ b/spec/eth/chain_spec.rb @@ -8,13 +8,20 @@ expect(Chain::EXPANSE).to eq 2 expect(Chain::OPTIMISM).to eq 10 expect(Chain::CLASSIC).to eq 61 + expect(Chain::CRONOS).to eq 25 + expect(Chain::RSK).to eq 30 + expect(Chain::BNB).to eq 56 expect(Chain::POA_NET).to eq 99 expect(Chain::XDAI).to eq 100 expect(Chain::GNOSIS).to eq 100 expect(Chain::MATIC).to eq 137 expect(Chain::POLYGON).to eq 137 - expect(Chain::ARBITRUM).to eq 42161 + expect(Chain::FILECOIN).to eq 314 expect(Chain::MOONBEAM).to eq 1284 + expect(Chain::BASE).to eq 8453 + expect(Chain::ARBITRUM).to eq 42161 + expect(Chain::AVALANCHE).to eq 43114 + expect(Chain::LINEA).to eq 59144 # Chain IDs for selected testnets expect(Chain::MORDEN).to eq 2 @@ -28,15 +35,14 @@ expect(Chain::KOVAN_OPTIMISM).to eq 69 expect(Chain::XDAI_ARBITRUM).to eq 200 expect(Chain::GOERLI_OPTIMISM).to eq 420 + expect(Chain::MOONRIVER).to eq 1285 + expect(Chain::MOONBASE).to eq 1287 expect(Chain::MUMBAI).to eq 80001 expect(Chain::RINKEBY_ARBITRUM).to eq 421611 expect(Chain::GOERLI_ARBITRUM).to eq 421613 expect(Chain::SEPOLIA).to eq 11155111 expect(Chain::HOLESOVICE).to eq 11166111 - expect(Chain::MOONRIVER).to eq 1285 - expect(Chain::MOONBASE).to eq 1287 - # Chain IDs for selected private networks expect(Chain::PRIVATE_GETH).to eq 1337 end