Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
fix: add support for Sepolia testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
danijelTxFusion authored and danijelTxFusion committed Dec 1, 2023
1 parent d1523fb commit cfcd9db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function JsonRpcApiProvider<TBase extends Constructor<ethers.JsonRpcApiPr
override async getTransactionReceipt(txHash: string): Promise<TransactionReceipt> {
while (true) {
const receipt = (await super.getTransactionReceipt(txHash)) as TransactionReceipt;
if (receipt.blockNumber) {
if (receipt && receipt.blockNumber) {
return receipt;
}
await sleep(500);
Expand Down Expand Up @@ -600,8 +600,10 @@ export class Provider extends JsonRpcApiProvider(ethers.JsonRpcProvider) {
return new Provider("http://localhost:3050");
case ZkSyncNetwork.Goerli:
return new Provider("https://zksync2-testnet.zksync.dev");
case ZkSyncNetwork.Sepolia:
return new Provider("https://sepolia.era.zksync.dev");
case ZkSyncNetwork.Mainnet:
return new Provider("https://zksync2-mainnet.zksync.io/");
return new Provider("https://mainnet.era.zksync.io");
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export enum Network {
Ropsten = 3,
Rinkeby = 4,
Goerli = 5,
Sepolia = 6,
Localhost = 9,
}

Expand Down Expand Up @@ -99,7 +100,7 @@ export class TransactionResponse extends ethers.TransactionResponse {
override async wait(confirmations?: number): Promise<TransactionReceipt> {
while (true) {
const receipt = (await super.wait(confirmations)) as TransactionReceipt;
if (receipt.blockNumber) {
if (receipt && receipt.blockNumber) {
return receipt;
}
await sleep(500);
Expand Down

0 comments on commit cfcd9db

Please sign in to comment.