Skip to content

Commit

Permalink
Finish renaming all components
Browse files Browse the repository at this point in the history
Signed-off-by: deniallugo <[email protected]>
  • Loading branch information
Deniallugo committed Sep 2, 2022
1 parent c1de3c7 commit 7691bfc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions sdk/zksync.js/src/rest-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export async function getDefaultRestProvider(
): Promise<RestProvider> {
if (network === 'localhost') {
return await RestProvider.newProvider('http://127.0.0.1:3001/api/v0.2', pollIntervalMilliSecs, network);
} else if (network === 'ropsten') {
return await RestProvider.newProvider('https://ropsten-api.zksync.io/api/v0.2', pollIntervalMilliSecs, network);
} else if (network === 'rinkeby') {
return await RestProvider.newProvider('https://rinkeby-api.zksync.io/api/v0.2', pollIntervalMilliSecs, network);
} else if (network === 'goerli') {
return await RestProvider.newProvider('https://goerli-api.zksync.io/api/v0.2', pollIntervalMilliSecs, network);
} else if (network === 'sepolia') {
return await RestProvider.newProvider('https://sepolia-api.zksync.io/api/v0.2', pollIntervalMilliSecs, network);
} else if (network === 'goerli-beta') {
return await RestProvider.newProvider(
'https://goerli-beta-api.zksync.dev/api/v0.2',
Expand Down
12 changes: 6 additions & 6 deletions sdk/zksync.js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ export type Nonce = number | 'committed';
export type Network = 'localhost' | 'sepolia' | 'goerli' | 'mainnet' | 'rinkeby-beta' | 'goerli-beta';

const MAINNET_NETWORK_CHAIN_ID = 1;
const ROPSTEN_NETWORK_CHAIN_ID = 3;
const SEPOLIA_NETWORK_CHAIN_ID = 11155111;
const RINKEBY_NETWORK_CHAIN_ID = 4;
const GOERLI_NETWORK_CHAIN_ID = 5;
const LOCALHOST_NETWORK_CHAIN_ID = 9;

export function l1ChainId(network?: Network): number {
if (network === 'rinkeby' || network === 'rinkeby-beta') {
if (network === 'rinkeby-beta') {
return RINKEBY_NETWORK_CHAIN_ID;
}
if (network === 'ropsten') {
return ROPSTEN_NETWORK_CHAIN_ID;
}
if (network === 'goerli-beta') {
if (network === 'goerli' || network === 'goerli-beta') {
return GOERLI_NETWORK_CHAIN_ID;
}
if (network === 'sepolia') {
return SEPOLIA_NETWORK_CHAIN_ID;
}
if (network === 'mainnet') {
return MAINNET_NETWORK_CHAIN_ID;
}
Expand Down
5 changes: 2 additions & 3 deletions sdk/zksync.js/src/withdraw-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ function checkEthProvider(ethersWallet: ethers.Signer) {
// https://github.com/makerdao/multicall
function getMulticallAddressByNetwork(network: Network) {
switch (network) {
case 'rinkeby':
case 'sepolia':
case 'rinkeby-beta':
return '0x42ad527de7d4e9d9d011ac45b31d8551f8fe9821';
case 'ropsten':
return '0x53c43764255c17bd724f74c4ef150724ac50a3ed';
case 'goerli':
case 'goerli-beta':
return '0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e';
case 'mainnet':
Expand Down

0 comments on commit 7691bfc

Please sign in to comment.