From 7691bfcbc8cf867039fb3daacf6cbcaa345e0430 Mon Sep 17 00:00:00 2001 From: deniallugo Date: Tue, 2 Aug 2022 11:09:51 +0200 Subject: [PATCH] Finish renaming all components Signed-off-by: deniallugo --- sdk/zksync.js/src/rest-provider.ts | 8 ++++---- sdk/zksync.js/src/types.ts | 12 ++++++------ sdk/zksync.js/src/withdraw-helpers.ts | 5 ++--- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/sdk/zksync.js/src/rest-provider.ts b/sdk/zksync.js/src/rest-provider.ts index 5e6852f65..820413ba0 100644 --- a/sdk/zksync.js/src/rest-provider.ts +++ b/sdk/zksync.js/src/rest-provider.ts @@ -11,10 +11,10 @@ export async function getDefaultRestProvider( ): Promise { 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', diff --git a/sdk/zksync.js/src/types.ts b/sdk/zksync.js/src/types.ts index 84f97e2b8..afd14ab12 100644 --- a/sdk/zksync.js/src/types.ts +++ b/sdk/zksync.js/src/types.ts @@ -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; } diff --git a/sdk/zksync.js/src/withdraw-helpers.ts b/sdk/zksync.js/src/withdraw-helpers.ts index d42958bc8..7c0913d56 100644 --- a/sdk/zksync.js/src/withdraw-helpers.ts +++ b/sdk/zksync.js/src/withdraw-helpers.ts @@ -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':