From c112082f57bfd5c7c5ac0b0d22ada8bf083eec1e Mon Sep 17 00:00:00 2001 From: Arthur Abeilice Date: Tue, 1 Aug 2023 09:40:07 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=A5=20Adding=20base=20(#1131)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/add_Base.md | 6 ++++++ packages/core/src/constants/chainId.ts | 3 +++ packages/core/src/hooks/useConfig.test.tsx | 2 +- packages/core/src/model/chain/base.ts | 24 +++++++++++++++++++++- 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .changeset/add_Base.md diff --git a/.changeset/add_Base.md b/.changeset/add_Base.md new file mode 100644 index 000000000..a9444edc5 --- /dev/null +++ b/.changeset/add_Base.md @@ -0,0 +1,6 @@ +@@ -0,0 +1,5 @@ +--- +"@usedapp/core": patch +--- + +⛓ Add Base Mainnet to chain ID \ No newline at end of file diff --git a/packages/core/src/constants/chainId.ts b/packages/core/src/constants/chainId.ts index 3018cc6e7..69a356606 100644 --- a/packages/core/src/constants/chainId.ts +++ b/packages/core/src/constants/chainId.ts @@ -52,6 +52,7 @@ import { Velas, VelasTestnet, BaseGoerli, + Base, ZkSync, ZkSyncTestnet, ArbitrumRedditTestnet, @@ -127,6 +128,7 @@ export const DEFAULT_SUPPORTED_CHAINS = [ KlaytnTestnet, Klaytn, BaseGoerli, + Base, ScrollAlphaTestnet, LineaTestnet, MantleTestnet, @@ -192,6 +194,7 @@ export enum ChainId { KlaytnTestnet = 1001, Klaytn = 8217, BaseGoerli = 84531, + Base = 8453, ScrollAlpha = 534353, LineaTestnet = 59140, ArbitrumNova = 42170, diff --git a/packages/core/src/hooks/useConfig.test.tsx b/packages/core/src/hooks/useConfig.test.tsx index a525cac79..fb814dbc1 100644 --- a/packages/core/src/hooks/useConfig.test.tsx +++ b/packages/core/src/hooks/useConfig.test.tsx @@ -26,7 +26,7 @@ describe('useConfig', () => { const { result, waitForCurrent } = await renderDAppHook(() => useConfig(), { config: setup.config }) await waitForCurrent((val) => val !== undefined) expect(result.error).to.be.undefined - expect(result.current.networks?.length).to.eq(63) + expect(result.current.networks?.length).to.eq(64) expect(result.current.notifications?.checkInterval).to.eq(500) expect(result.current.notifications?.expirationPeriod).to.eq(5000) }) diff --git a/packages/core/src/model/chain/base.ts b/packages/core/src/model/chain/base.ts index e0ac3edd0..249173e1d 100644 --- a/packages/core/src/model/chain/base.ts +++ b/packages/core/src/model/chain/base.ts @@ -20,4 +20,26 @@ export const BaseGoerli: Chain = { getExplorerTransactionLink: getTransactionLink(baseGoerliUrl), } -export default { BaseGoerli } +const baseUrl = 'https://basescan.org' + +export const Base: Chain = { + chainId: 8453, + chainName: 'Base', + isTestChain: false, + isLocalChain: false, + multicallAddress: '0x38641b7a50CDcfde75a7A83eB7c02581F3279362', + rpcUrl: 'https://base.org', + nativeCurrency: { + name: 'Ether', + symbol: 'ETH', + decimals: 18, + }, + blockExplorerUrl: baseUrl, + getExplorerAddressLink: getAddressLink(baseUrl), + getExplorerTransactionLink: getTransactionLink(baseUrl), +} + +export default { + BaseGoerli, + Base, +}