Skip to content

Commit

Permalink
🔵 Add Base chain (#131)
Browse files Browse the repository at this point in the history
* 🔵 Add Base chain

* Update options description

* Decrease statements
  • Loading branch information
JustynaBroniszewska committed Mar 15, 2024
1 parent b37a1f1 commit 9ed6037
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/source/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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/...`` |
+-----------------+-------+------+----------------+--------------------+-----------------------------------------------------------------+
Expand Down
4 changes: 2 additions & 2 deletions packages/mars/.nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"check-coverage": true,
"branches": 63,
"lines": 69,
"lines": 65,
"functions": 45,
"statements": 69
"statements": 65
}
21 changes: 21 additions & 0 deletions packages/mars/src/options/chain/base.ts
Original file line number Diff line number Diff line change
@@ -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',
}
3 changes: 2 additions & 1 deletion packages/mars/src/options/chain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion packages/mars/src/options/usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9ed6037

Please sign in to comment.