From 28711781339cd2726fbe2389672ef28e9d82076c Mon Sep 17 00:00:00 2001 From: Patrick Niemeyer Date: Wed, 24 Jul 2024 21:31:42 -0500 Subject: [PATCH] app, dapp: Add Coinbase Base. --- gui-orchid/lib/api/orchid_eth/chains.dart | 15 ++++++++++++++- gui-orchid/lib/api/orchid_eth/tokens.dart | 11 +++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gui-orchid/lib/api/orchid_eth/chains.dart b/gui-orchid/lib/api/orchid_eth/chains.dart index 866dd6206..38242b515 100644 --- a/gui-orchid/lib/api/orchid_eth/chains.dart +++ b/gui-orchid/lib/api/orchid_eth/chains.dart @@ -198,7 +198,7 @@ class Chains { blocktime: 0.5, ); -// RSK (BTC) + // RSK (BTC) static const int RSK_CHAINID = 30; static Chain RSK = Chain( chainId: RSK_CHAINID, @@ -223,6 +223,18 @@ class Chains { blocktime: 5, ); + // Coinbase Base (BASE_ETH) + static const int BASE_CHAINID = 8453; + static Chain Base = Chain( + chainId: BASE_CHAINID, + name: 'Base', + nativeCurrency: Tokens.BASE_ETH, + defaultProviderUrl: 'https://mainnet.base.org', + iconPath: OrchidAssetSvgChain.unknown_chain_path, + explorerUrl: 'https://basescan.org', + blocktime: 0, + ); + static Map _map = [ Aurora, Avalanche, @@ -234,6 +246,7 @@ class Chains { Gnosis, Optimism, Polygon, + Base, // ArbitrumOne, // RSK, // Telos, diff --git a/gui-orchid/lib/api/orchid_eth/tokens.dart b/gui-orchid/lib/api/orchid_eth/tokens.dart index 194f67034..28af80e24 100644 --- a/gui-orchid/lib/api/orchid_eth/tokens.dart +++ b/gui-orchid/lib/api/orchid_eth/tokens.dart @@ -10,7 +10,6 @@ import 'token_type.dart'; export 'tokens_legacy.dart'; class Tokens { - static const ETHPriceSource = const UniswapETHPriceSource( // USDC / ETH 0.3% dollarTokenVsETHPoolAddress: USDCVsETHPoolAddress, @@ -146,6 +145,14 @@ class Tokens { iconPath: OrchidAssetSvgToken.celo_token_path, ); + static const TokenType BASE_ETH = TokenType( + symbol: 'ETH', + // BASE ETH is ETH on L2 + exchangeRateSource: ETHPriceSource, + chainId: Chains.BASE_CHAINID, + iconPath: OrchidAssetSvgToken.ethereum_eth_token_path, + ); + static const USDCVsETHPoolAddress = '0x8ad599c3A0ff1De082011EFDDc58f1908eb6e6D8'; static const USDC_DECIMALS = 6; @@ -171,9 +178,9 @@ class Tokens { AURORA_ETH, FTM, CELO, + BASE_ETH, // ARBITRUM_ETH, // RBTC, // TLOS, ]; } -