diff --git a/docs/source/cli.rst b/docs/source/cli.rst index fa896a7..d920973 100644 --- a/docs/source/cli.rst +++ b/docs/source/cli.rst @@ -63,6 +63,7 @@ CLI flags | | | | | | mainnet, development, kovan, ropsten, goerli, rinkeby, | | | | | | | arbitrum, arbitrum_rinkeby, | | | | | | | optimism, optimism_kovan, sepolia, optimism_sepolia, | +| | | | | | base, optimism_base | | | | | | | | | | | | | | or RPC URL e.g. ``https://infura.io/...`` | +-----------------+-------+------+----------------+--------------------+-----------------------------------------------------------------+ diff --git a/packages/mars/.nycrc b/packages/mars/.nycrc index 98d8f00..7bf279c 100644 --- a/packages/mars/.nycrc +++ b/packages/mars/.nycrc @@ -9,7 +9,7 @@ ], "check-coverage": true, "branches": 63, - "lines": 69, + "lines": 65, "functions": 45, - "statements": 69 + "statements": 65 } diff --git a/packages/mars/src/options/chain/base.ts b/packages/mars/src/options/chain/base.ts new file mode 100644 index 0000000..cc0cc1d --- /dev/null +++ b/packages/mars/src/options/chain/base.ts @@ -0,0 +1,21 @@ +import { Chain } from './model' + +export const base: Chain = { + chainId: 8453, + chainName: 'Base', + getPublicRpc: () => 'https://mainnet.base.org', + getInfuraRpc: (infuraApiKey) => `https://base-mainnet.infura.io/v3/${infuraApiKey}`, + getAlchemyRpc: (alchemyApiKey) => `https://base-mainnet.g.alchemy.com/v2/${alchemyApiKey}`, + getBlockExplorerContractAddress: (contractAddress) => `https://basescan.org/address/${contractAddress}`, + getEtherscanVerifierApi: () => 'https://api.basescan.org/api', +} + +export const base_sepolia: Chain = { + chainId: 84532, + chainName: 'Base Sepolia', + getPublicRpc: () => 'https://sepolia.base.org', + getInfuraRpc: (infuraApiKey) => `https://base-sepolia.infura.io/v3/${infuraApiKey}`, + getAlchemyRpc: (alchemyApiKey) => `https://base-sepolia.g.alchemy.com/v2/${alchemyApiKey}`, + getBlockExplorerContractAddress: (contractAddress) => `https://sepolia.basescan.org/address/${contractAddress}`, + getEtherscanVerifierApi: () => 'https://api-sepolia.basescan.org/api', +} diff --git a/packages/mars/src/options/chain/index.ts b/packages/mars/src/options/chain/index.ts index c5a5bdc..695c4d7 100644 --- a/packages/mars/src/options/chain/index.ts +++ b/packages/mars/src/options/chain/index.ts @@ -2,5 +2,6 @@ import { ChainSet } from './model' import * as ethereumChains from './ethereum' import * as arbitrumChains from './arbitrum' import * as optimismChains from './optimism' +import * as baseChains from './base' -export const chains = { ...ethereumChains, ...arbitrumChains, ...optimismChains } as ChainSet +export const chains = { ...ethereumChains, ...arbitrumChains, ...optimismChains, ...baseChains } as ChainSet diff --git a/packages/mars/src/options/usage.ts b/packages/mars/src/options/usage.ts index 3e798fe..0a5a89e 100644 --- a/packages/mars/src/options/usage.ts +++ b/packages/mars/src/options/usage.ts @@ -11,7 +11,8 @@ Options: either an Ethereum JSON-RPC url or one of: development, kovan, ropsten, goerli, rinkeby, mainnet, arbitrum, arbitrum_rinkeby, - optimism or optimism_kovan. Default: mainnet. + sepolia, optimism, optimism_sepolia, optimism_kovan + base or sepolia_base. Default: mainnet. -i, --infura-key [key] The Infura api key to use for JSON-RPC. You can also use the env variable INFURA_KEY. -a, --alchemy-key [key] The Alchemy api key to use for JSON-RPC. You can