Skip to content

Commit

Permalink
Merge pull request joshstevens19#86 from Dr-Maxwell/master
Browse files Browse the repository at this point in the history
Added starknet to list of networks
  • Loading branch information
joshstevens19 authored Feb 24, 2024
2 parents 4182e2f + 79aed7a commit 4551e17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ The below networks are supported by default, and custom networks can be supporte
| Zora Testnet | 999 |
| Flare Mainnet | 14 |
| Pulsechain Mainnet | 369 |
| Starknet | 300 |
| starknet testnet | 301 |

## Installation

Expand Down
2 changes: 2 additions & 0 deletions src/enums/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export enum Networks {
zkSyncEra = 324,
zkSyncEraTestnet = 280,
zkSyncEraSepoliaTestnet = 300,
starknet=300,
starknetTestnet=301,
shibarium = 109,
mantle = 5000,
mantleTestnet = 5001,
Expand Down
16 changes: 10 additions & 6 deletions src/multicall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,12 @@ export class Multicall {
calls: AggregateCallContext[],
options: ContractCallOptions
): Promise<AggregateResponse> {
let ethersProvider = this.getTypedOptions<MulticallOptionsEthers>()
.ethersProvider;
let ethersProvider =
this.getTypedOptions<MulticallOptionsEthers>().ethersProvider;

if (!ethersProvider) {
const customProvider = this.getTypedOptions<
MulticallOptionsCustomJsonRpcProvider
>();
const customProvider =
this.getTypedOptions<MulticallOptionsCustomJsonRpcProvider>();
if (customProvider.nodeUrl) {
ethersProvider = new ethers.providers.JsonRpcProvider(
customProvider.nodeUrl
Expand Down Expand Up @@ -531,7 +530,7 @@ export class Multicall {
* Get typed options
*/
private getTypedOptions<T>(): T {
return (this._options as unknown) as T;
return this._options as unknown as T;
}

/**
Expand Down Expand Up @@ -621,6 +620,11 @@ export class Multicall {
return '0xF9cda624FBC7e059355ce98a31693d299FACd963';
case Networks.shibarium:
return '0xd1727fC8F78aBA7DD6294f6033D74c72Ccd3D3B0';
case Networks.starknet:
return '0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4';
case Networks.starknetTestnet:
return '0xde29d060D45901Fb19ED6C6e959EB22d8626708e';

default:
throw new Error(
`Network - ${network} doesn't have a multicall contract address defined. Please check your network or deploy your own contract on it.`
Expand Down

0 comments on commit 4551e17

Please sign in to comment.