Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔵 Add Base chain #131

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading