-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🌚 Add chain configuration * Squash config into one constant * Lowercase network variable * Remove hardcoded network names * Rename network to chains * Distinguish block explorer from contract verifier * Adjust typings * Adjust coverage * Move types to one model file * Split ethereum and arbitrum chain configs * Rename contrat verifier api to etherscan verifier api * Lowercase RPC * Change error message * Update changeset
- Loading branch information
Showing
11 changed files
with
125 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'ethereum-mars': major | ||
--- | ||
|
||
This update extracts RPC setup to dedicated configuration files for every chain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
"check-coverage": true, | ||
"branches": 63, | ||
"lines": 69, | ||
"functions": 58, | ||
"functions": 55, | ||
"statements": 69 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Chain } from './model' | ||
|
||
export const arbitrum: Chain = { | ||
chainId: 42161, | ||
chainName: 'Arbitrum', | ||
getPublicRpc: () => 'https://arb1.arbitrum.io/rpc', | ||
getInfuraRpc: (infuraApiKey) => `https://arbitrum-mainnet.infura.io/v3/${infuraApiKey}`, | ||
getAlchemyRpc: (alchemyApiKey) => `https://arb-mainnet.g.alchemy.com/v2/${alchemyApiKey}`, | ||
getBlockExplorerContractAddress: (contractAddress) => `https://arbiscan.io/address/${contractAddress}`, | ||
getEtherscanVerifierApi: () => 'https://api.arbiscan.io/api', | ||
} | ||
|
||
export const arbitrum_rinkeby: Chain = { | ||
chainId: 421611, | ||
chainName: 'Arbitrum Testnet', | ||
getPublicRpc: () => 'https://rinkeby.arbitrum.io/rpc', | ||
getInfuraRpc: (infuraApiKey) => `https://arbitrum-rinkeby.infura.io/v3/${infuraApiKey}`, | ||
getAlchemyRpc: (alchemyApiKey) => `https://arb-rinkeby.g.alchemy.com/v2/${alchemyApiKey}`, | ||
getBlockExplorerContractAddress: (contractAddress) => `https://testnet.arbiscan.io/address/${contractAddress}`, | ||
getEtherscanVerifierApi: () => 'https://api-testnet.arbiscan.io/api', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Chain } from './model' | ||
|
||
export const mainnet: Chain = { | ||
chainId: 1, | ||
chainName: 'Mainnet', | ||
getPublicRpc: () => 'https://main-light.eth.linkpool.io/', | ||
getInfuraRpc: (infuraApiKey) => `https://mainnet.infura.io/v3/${infuraApiKey}`, | ||
getAlchemyRpc: (alchemyApiKey) => `https://eth-mainnet.alchemyapi.io/v2/${alchemyApiKey}`, | ||
getBlockExplorerContractAddress: (contractAddress) => `https://etherscan.io/address/${contractAddress}`, | ||
getEtherscanVerifierApi: () => 'https://api.etherscan.io/api', | ||
} | ||
|
||
export const ropsten: Chain = { | ||
chainId: 3, | ||
chainName: 'Ropsten', | ||
getPublicRpc: () => 'https://ropsten.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161', | ||
getInfuraRpc: (infuraApiKey) => `https://ropsten.infura.io/v3/${infuraApiKey}`, | ||
getAlchemyRpc: (alchemyApiKey) => `https://eth-ropsten.alchemyapi.io/v2/${alchemyApiKey}`, | ||
getBlockExplorerContractAddress: (contractAddress) => `https://ropsten.etherscan.io/address/${contractAddress}`, | ||
getEtherscanVerifierApi: () => 'https://api-ropsten.etherscan.io/api', | ||
} | ||
|
||
export const rinkeby: Chain = { | ||
chainId: 4, | ||
chainName: 'Rinkeby', | ||
getPublicRpc: () => 'https://rinkeby-light.eth.linkpool.io/', | ||
getInfuraRpc: (infuraApiKey) => `https://rinkeby.infura.io/v3/${infuraApiKey}`, | ||
getAlchemyRpc: (alchemyApiKey) => `https://eth-rinkeby.alchemyapi.io/v2/${alchemyApiKey}`, | ||
getBlockExplorerContractAddress: (contractAddress) => `https://rinkeby.etherscan.io/address/${contractAddress}`, | ||
getEtherscanVerifierApi: () => 'https://api-rinkeby.etherscan.io/api', | ||
} | ||
|
||
export const goerli: Chain = { | ||
chainId: 5, | ||
chainName: 'Goerli', | ||
getPublicRpc: () => 'https://goerli-light.eth.linkpool.io/', | ||
getInfuraRpc: (infuraApiKey) => `https://goerli.infura.io/v3/${infuraApiKey}`, | ||
getAlchemyRpc: (alchemyApiKey) => `https://eth-goerli.alchemyapi.io/v2/${alchemyApiKey}`, | ||
getBlockExplorerContractAddress: (contractAddress) => `https://goerli.etherscan.io/address/${contractAddress}`, | ||
getEtherscanVerifierApi: () => 'https://api-goerli.etherscan.io/api', | ||
} | ||
|
||
export const kovan: Chain = { | ||
chainId: 42, | ||
chainName: 'Kovan', | ||
getPublicRpc: () => 'https://kovan.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161', | ||
getInfuraRpc: (infuraApiKey) => `https://kovan.infura.io/v3/${infuraApiKey}`, | ||
getAlchemyRpc: (alchemyApiKey) => `https://eth-kovan.alchemyapi.io/v2/${alchemyApiKey}`, | ||
getBlockExplorerContractAddress: (contractAddress) => `https://kovan.etherscan.io/address/${contractAddress}`, | ||
getEtherscanVerifierApi: () => 'https://api-kovan.etherscan.io/api', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ChainSet } from './model' | ||
import * as ethereumChains from './ethereum' | ||
import * as arbitrumChains from './arbitrum' | ||
|
||
export const chains = { ...ethereumChains, ...arbitrumChains } as ChainSet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export type Chain = { | ||
chainId: number | ||
chainName: string | ||
getPublicRpc: () => string | ||
getInfuraRpc: (infuraApiKey: string) => string | ||
getAlchemyRpc: (alchemyApiKey: string) => string | ||
getBlockExplorerContractAddress: (contractAddress: string) => string | ||
getEtherscanVerifierApi: () => string | ||
} | ||
|
||
export type ChainSet = { | ||
[chainName: string]: Chain | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters