@across-protocol/sdk 4.1.22 → 4.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/clients/SpokePoolClient.js +18 -12
- package/dist/cjs/clients/SpokePoolClient.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +20 -0
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +20 -0
- package/dist/cjs/utils/AddressUtils.d.ts +33 -0
- package/dist/cjs/utils/AddressUtils.js +132 -4
- package/dist/cjs/utils/AddressUtils.js.map +1 -1
- package/dist/cjs/utils/Multicall.d.ts +4 -0
- package/dist/cjs/utils/Multicall.js +33 -4
- package/dist/cjs/utils/Multicall.js.map +1 -1
- package/dist/cjs/utils/NetworkUtils.d.ts +2 -0
- package/dist/cjs/utils/NetworkUtils.js +11 -5
- package/dist/cjs/utils/NetworkUtils.js.map +1 -1
- package/dist/cjs/utils/SpokeUtils.d.ts +1 -0
- package/dist/cjs/utils/SpokeUtils.js +52 -1
- package/dist/cjs/utils/SpokeUtils.js.map +1 -1
- package/dist/cjs/utils/TokenUtils.d.ts +40 -0
- package/dist/esm/clients/SpokePoolClient.js +19 -13
- package/dist/esm/clients/SpokePoolClient.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +20 -0
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +20 -0
- package/dist/esm/utils/AddressUtils.d.ts +40 -0
- package/dist/esm/utils/AddressUtils.js +174 -2
- package/dist/esm/utils/AddressUtils.js.map +1 -1
- package/dist/esm/utils/Multicall.d.ts +4 -0
- package/dist/esm/utils/Multicall.js +33 -5
- package/dist/esm/utils/Multicall.js.map +1 -1
- package/dist/esm/utils/NetworkUtils.d.ts +7 -0
- package/dist/esm/utils/NetworkUtils.js +14 -4
- package/dist/esm/utils/NetworkUtils.js.map +1 -1
- package/dist/esm/utils/SpokeUtils.d.ts +1 -0
- package/dist/esm/utils/SpokeUtils.js +51 -0
- package/dist/esm/utils/SpokeUtils.js.map +1 -1
- package/dist/esm/utils/TokenUtils.d.ts +40 -0
- package/dist/types/clients/SpokePoolClient.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +20 -0
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +20 -0
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
- package/dist/types/utils/AddressUtils.d.ts +40 -0
- package/dist/types/utils/AddressUtils.d.ts.map +1 -1
- package/dist/types/utils/Multicall.d.ts +4 -0
- package/dist/types/utils/Multicall.d.ts.map +1 -1
- package/dist/types/utils/NetworkUtils.d.ts +7 -0
- package/dist/types/utils/NetworkUtils.d.ts.map +1 -1
- package/dist/types/utils/SpokeUtils.d.ts +1 -0
- package/dist/types/utils/SpokeUtils.d.ts.map +1 -1
- package/dist/types/utils/TokenUtils.d.ts +40 -0
- package/dist/types/utils/TokenUtils.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/clients/SpokePoolClient.ts +11 -18
- package/src/utils/AddressUtils.ts +179 -1
- package/src/utils/Multicall.ts +29 -1
- package/src/utils/NetworkUtils.ts +13 -4
- package/src/utils/SpokeUtils.ts +48 -1
|
@@ -269,6 +269,16 @@ export declare class RelayFeeCalculator {
|
|
|
269
269
|
};
|
|
270
270
|
coingeckoId: string;
|
|
271
271
|
};
|
|
272
|
+
SOL: {
|
|
273
|
+
name: string;
|
|
274
|
+
symbol: string;
|
|
275
|
+
decimals: number;
|
|
276
|
+
addresses: {
|
|
277
|
+
[x: number]: string;
|
|
278
|
+
133268194659241: string;
|
|
279
|
+
};
|
|
280
|
+
coingeckoId: string;
|
|
281
|
+
};
|
|
272
282
|
UMA: {
|
|
273
283
|
name: string;
|
|
274
284
|
symbol: string;
|
|
@@ -378,6 +388,16 @@ export declare class RelayFeeCalculator {
|
|
|
378
388
|
};
|
|
379
389
|
coingeckoId: string;
|
|
380
390
|
};
|
|
391
|
+
WSOL: {
|
|
392
|
+
name: string;
|
|
393
|
+
symbol: string;
|
|
394
|
+
decimals: number;
|
|
395
|
+
addresses: {
|
|
396
|
+
[x: number]: string;
|
|
397
|
+
133268194659241: string;
|
|
398
|
+
};
|
|
399
|
+
coingeckoId: string;
|
|
400
|
+
};
|
|
381
401
|
}, gasPrice?: BigNumberish, gasLimit?: BigNumberish, _tokenGasCost?: BigNumberish, transport?: Transport): Promise<BigNumber>;
|
|
382
402
|
capitalFeePercent(_amountToRelay: BigNumberish, _tokenSymbol: string, _originRoute?: ChainIdAsString, _destinationRoute?: ChainIdAsString): BigNumber;
|
|
383
403
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relayFeeCalculator.d.ts","sourceRoot":"","sources":["../../../src/relayFeeCalculator/relayFeeCalculator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,SAAS,EACT,YAAY,EAEZ,uBAAuB,EAWxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAGjC,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,CACX,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,EACrC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,OAAO,CAAC;QAChB,QAAQ,EAAE,YAAY,CAAC;QACvB,QAAQ,EAAE,YAAY,CAAC;QACvB,iBAAiB,EAAE,SAAS,CAAC;QAC7B,qBAAqB,EAAE,SAAS,CAAC;QACjC,0BAA0B,EAAE,SAAS,CAAC;QACtC,SAAS,EAAE,SAAS,CAAC;KACtB,CAAC,KACC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,gBA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address The ETH address to check
|
|
@@ -11,4 +12,43 @@ export declare function compareAddressesSimple(addressA?: string, addressB?: str
|
|
|
11
12
|
export declare function toBytes32(address: string): string;
|
|
12
13
|
export declare function toAddress(hexString: string): string;
|
|
13
14
|
export declare function isValidEvmAddress(address: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Creates the proper address type given the input chain ID corresponding to the address's origin network.
|
|
17
|
+
* @param address Stringified address type to convert. Can be either hex encoded or base58 encoded.
|
|
18
|
+
* @param chainId Network ID corresponding to the input address, used to determine which address type to output.
|
|
19
|
+
* @returns a child `Address` type most fitting for the chain ID.
|
|
20
|
+
* @todo: Change this to `toAddress` once we remove the other `toAddress` function.
|
|
21
|
+
*/
|
|
22
|
+
export declare function toAddressType(address: string, chainId: number): Address | EvmAddress | SvmAddress;
|
|
23
|
+
export declare class Address {
|
|
24
|
+
readonly rawAddress: Uint8Array;
|
|
25
|
+
evmAddress: string | undefined;
|
|
26
|
+
bytes32Address: string | undefined;
|
|
27
|
+
svmAddress: string | undefined;
|
|
28
|
+
bnAddress: BigNumber | undefined;
|
|
29
|
+
constructor(_rawAddress: Uint8Array);
|
|
30
|
+
toBytes32(): string;
|
|
31
|
+
toBase58(): string;
|
|
32
|
+
toBigNumber(): BigNumber;
|
|
33
|
+
toEvmAddress(): string;
|
|
34
|
+
toAddress(): string;
|
|
35
|
+
toHexString(): string;
|
|
36
|
+
isValidEvmAddress(): boolean;
|
|
37
|
+
isValidOn(chainId: number): boolean;
|
|
38
|
+
static isAddress(obj: unknown): boolean;
|
|
39
|
+
toString(): string;
|
|
40
|
+
isZeroAddress(): boolean;
|
|
41
|
+
eq(other: Address): boolean;
|
|
42
|
+
compare(otherAddress: Address): 1 | -1 | 0;
|
|
43
|
+
}
|
|
44
|
+
export declare class EvmAddress extends Address {
|
|
45
|
+
constructor(rawAddress: Uint8Array);
|
|
46
|
+
toAddress(): string;
|
|
47
|
+
static from(hexString: string): EvmAddress;
|
|
48
|
+
}
|
|
49
|
+
export declare class SvmAddress extends Address {
|
|
50
|
+
constructor(rawAddress: Uint8Array);
|
|
51
|
+
toAddress(): string;
|
|
52
|
+
static from(bs58Address: string): SvmAddress;
|
|
53
|
+
}
|
|
14
54
|
//# sourceMappingURL=AddressUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/AddressUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"AddressUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/AddressUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAS,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAc,MAAM,IAAI,CAAC;AAE3C;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CASjH;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAY/E;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAKpF;AAKD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAGD,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAInD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAc1D;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAWjG;AAID,qBAAa,OAAO;IAClB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAGhC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAa;IAC3C,cAAc,EAAE,MAAM,GAAG,SAAS,CAAa;IAC/C,UAAU,EAAE,MAAM,GAAG,SAAS,CAAa;IAC3C,SAAS,EAAE,SAAS,GAAG,SAAS,CAAa;gBAEjC,WAAW,EAAE,UAAU;IAanC,SAAS,IAAI,MAAM;IAMnB,QAAQ,IAAI,MAAM;IAKlB,WAAW,IAAI,SAAS;IAMxB,YAAY,IAAI,MAAM;IAWtB,SAAS,IAAI,MAAM;IAKnB,WAAW,IAAI,MAAM;IAKrB,iBAAiB,IAAI,OAAO;IAU5B,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IASnC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO;IAKvC,QAAQ,IAAI,MAAM;IAKlB,aAAa,IAAI,OAAO;IAKxB,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAK3B,OAAO,CAAC,YAAY,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;CAa3C;AAGD,qBAAa,UAAW,SAAQ,OAAO;gBAEzB,UAAU,EAAE,UAAU;IASzB,SAAS,IAAI,MAAM;IAK5B,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU;CAG3C;AAGD,qBAAa,UAAW,SAAQ,OAAO;gBAEzB,UAAU,EAAE,UAAU;IAMzB,SAAS,IAAI,MAAM;IAK5B,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU;CAG7C"}
|
|
@@ -11,5 +11,9 @@ export type Call3 = {
|
|
|
11
11
|
export declare function getMulticallAddress(chainId: number): string | undefined;
|
|
12
12
|
export declare function getMulticall3(chainId: number, signerOrProvider: Signer | Provider): Multicall3 | undefined;
|
|
13
13
|
export declare function aggregate(multicall3: Contract, calls: Call3[], blockTag?: BlockTag): Promise<Result[]>;
|
|
14
|
+
export declare function blockAndAggregate(multicall3: Contract, calls: Call3[], blockTag?: BlockTag): Promise<{
|
|
15
|
+
blockNumber: number;
|
|
16
|
+
returnData: Result[];
|
|
17
|
+
}>;
|
|
14
18
|
export {};
|
|
15
19
|
//# sourceMappingURL=Multicall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Multicall.d.ts","sourceRoot":"","sources":["../../../src/utils/Multicall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAI3E,OAAO,EAAE,UAAU,EAAuB,MAAM,iBAAiB,CAAC;AAElE,KAAK,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;AACnC,KAAK,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;AACnC,KAAK,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;AAEjC,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;CACd,CAAC;
|
|
1
|
+
{"version":3,"file":"Multicall.d.ts","sourceRoot":"","sources":["../../../src/utils/Multicall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAI3E,OAAO,EAAE,UAAU,EAAuB,MAAM,iBAAiB,CAAC;AAElE,KAAK,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;AACnC,KAAK,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;AACnC,KAAK,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;AAEjC,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;CACd,CAAC;AAyBF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKvE;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAO1G;AAED,wBAAsB,SAAS,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAY5G;AAED,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,QAAQ,EACpB,KAAK,EAAE,KAAK,EAAE,EACd,QAAQ,CAAC,EAAE,QAAQ,GAClB,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAqBxD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const hreNetworks: Record<number, string>;
|
|
1
2
|
/**
|
|
2
3
|
* Resolves a network name from a network id.
|
|
3
4
|
* @param networkId The network id to resolve the name for
|
|
@@ -82,6 +83,12 @@ export declare function chainIsL1(chainId: number): boolean;
|
|
|
82
83
|
* @returns True if chain corresponding to chainId has an EVM-like execution layer.
|
|
83
84
|
*/
|
|
84
85
|
export declare function chainIsEvm(chainId: number): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Determines whether a chain ID runs on an SVM-like execution layer.
|
|
88
|
+
* @param chainId Chain ID to evaluate.
|
|
89
|
+
* @returns True if chain corresponding to chainId has an SVM-like execution layer.
|
|
90
|
+
*/
|
|
91
|
+
export declare function chainIsSvm(chainId: number): boolean;
|
|
85
92
|
/**
|
|
86
93
|
* Determines whether a chain ID has the capacity for having its USDC bridged via CCTP.
|
|
87
94
|
* @param chainId Chain ID to evaluate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/NetworkUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NetworkUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/NetworkUtils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAI9C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAGjE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAErE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGnD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAc3D;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMpD"}
|
|
@@ -65,6 +65,7 @@ export declare function getRelayDataHash(relayData: RelayData, destinationChainI
|
|
|
65
65
|
export declare function getRelayHashFromEvent(e: RelayData & {
|
|
66
66
|
destinationChainId: number;
|
|
67
67
|
}): string;
|
|
68
|
+
export declare function findDepositBlock(spokePool: Contract, depositId: BigNumber, lowBlock: number, highBlock?: number): Promise<number | undefined>;
|
|
68
69
|
export declare function isUnsafeDepositId(depositId: BigNumber): boolean;
|
|
69
70
|
/**
|
|
70
71
|
* Find the amount filled for a deposit at a particular block.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/SpokeUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,QAAQ,EAAE,oBAAoB,EAAE,SAAS,EAAwB,MAAM,QAAQ,CAAC;AAEpG,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAuB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/SpokeUtils.ts"],"names":[],"mappings":"AACA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G,SAAS,CAAC,CAgD7B;AAED,wBAAsB,aAAa,CACjC,SAAS,EAAE,QAAQ,EACnB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,MAAM,EACtB,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAoCpC;AAGD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -167,6 +167,16 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
167
167
|
};
|
|
168
168
|
coingeckoId: string;
|
|
169
169
|
};
|
|
170
|
+
SOL: {
|
|
171
|
+
name: string;
|
|
172
|
+
symbol: string;
|
|
173
|
+
decimals: number;
|
|
174
|
+
addresses: {
|
|
175
|
+
[x: number]: string;
|
|
176
|
+
133268194659241: string;
|
|
177
|
+
};
|
|
178
|
+
coingeckoId: string;
|
|
179
|
+
};
|
|
170
180
|
UMA: {
|
|
171
181
|
name: string;
|
|
172
182
|
symbol: string;
|
|
@@ -276,6 +286,16 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
276
286
|
};
|
|
277
287
|
coingeckoId: string;
|
|
278
288
|
};
|
|
289
|
+
WSOL: {
|
|
290
|
+
name: string;
|
|
291
|
+
symbol: string;
|
|
292
|
+
decimals: number;
|
|
293
|
+
addresses: {
|
|
294
|
+
[x: number]: string;
|
|
295
|
+
133268194659241: string;
|
|
296
|
+
};
|
|
297
|
+
coingeckoId: string;
|
|
298
|
+
};
|
|
279
299
|
}) => string | undefined;
|
|
280
300
|
export declare function getTokenInformationFromAddress(address: string, tokenMapping?: {
|
|
281
301
|
ACX: {
|
|
@@ -422,6 +442,16 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
422
442
|
};
|
|
423
443
|
coingeckoId: string;
|
|
424
444
|
};
|
|
445
|
+
SOL: {
|
|
446
|
+
name: string;
|
|
447
|
+
symbol: string;
|
|
448
|
+
decimals: number;
|
|
449
|
+
addresses: {
|
|
450
|
+
[x: number]: string;
|
|
451
|
+
133268194659241: string;
|
|
452
|
+
};
|
|
453
|
+
coingeckoId: string;
|
|
454
|
+
};
|
|
425
455
|
UMA: {
|
|
426
456
|
name: string;
|
|
427
457
|
symbol: string;
|
|
@@ -531,6 +561,16 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
531
561
|
};
|
|
532
562
|
coingeckoId: string;
|
|
533
563
|
};
|
|
564
|
+
WSOL: {
|
|
565
|
+
name: string;
|
|
566
|
+
symbol: string;
|
|
567
|
+
decimals: number;
|
|
568
|
+
addresses: {
|
|
569
|
+
[x: number]: string;
|
|
570
|
+
133268194659241: string;
|
|
571
|
+
};
|
|
572
|
+
coingeckoId: string;
|
|
573
|
+
};
|
|
534
574
|
}): L1Token | undefined;
|
|
535
575
|
export declare function getCoingeckoTokenIdByAddress(contractAddress: string): string;
|
|
536
576
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/TokenUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAY,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAM7C,KAAK,gBAAgB,GAAG,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC;AAEpD,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAI1G;AAED,eAAO,MAAM,mBAAmB,mBACd,MAAM;;aAMvB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,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MAAM,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,GAAG,OAAO,GAAG,SAAS,CAWrH;AAED,wBAAgB,4BAA4B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAM5E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,GAAE,QAAmB,GAC5B,OAAO,CAAC,SAAS,CAAC,CAGpB;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAI1D;AAED,wBAAgB,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAc7E;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOlF;AAED,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAa/E"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@across-protocol/sdk",
|
|
3
3
|
"author": "UMA Team",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.24",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"homepage": "https://docs.across.to/reference/sdk",
|
|
7
7
|
"files": [
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"node": ">=20.18.0"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build-bigint-buffer": "
|
|
16
|
-
"postinstall": "
|
|
15
|
+
"build-bigint-buffer": "node scripts/build-bigint-buffer.js",
|
|
16
|
+
"postinstall": "node scripts/build-bigint-buffer.js",
|
|
17
17
|
"start": "yarn typechain && nodemon -e ts,tsx,json,js,jsx --watch ./src --ignore ./dist --exec 'yarn dev'",
|
|
18
18
|
"build": "yarn run clean && yarn typechain && yarn run build:cjs & yarn run build:esm & yarn run build:types; wait",
|
|
19
19
|
"dev": "yarn run build:cjs & yarn run build:esm & yarn run build:types; wait",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
104
|
"@across-protocol/across-token": "^1.0.0",
|
|
105
|
-
"@across-protocol/constants": "^3.1.
|
|
105
|
+
"@across-protocol/constants": "^3.1.39",
|
|
106
106
|
"@across-protocol/contracts": "4.0.3",
|
|
107
107
|
"@coral-xyz/anchor": "^0.30.1",
|
|
108
108
|
"@eth-optimism/sdk": "^3.3.1",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"async": "^3.2.5",
|
|
117
117
|
"axios": "^0.27.2",
|
|
118
118
|
"big-number": "^2.0.0",
|
|
119
|
+
"bs58": "^6.0.0",
|
|
119
120
|
"decimal.js": "^10.3.1",
|
|
120
121
|
"ethers": "^5.7.2",
|
|
121
122
|
"lodash": "^4.17.21",
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
} from "../interfaces";
|
|
48
48
|
import { SpokePool } from "../typechain";
|
|
49
49
|
import { getNetworkName } from "../utils/NetworkUtils";
|
|
50
|
-
import {
|
|
50
|
+
import { findDepositBlock, getDepositIdAtBlock, relayFillStatus } from "../utils/SpokeUtils";
|
|
51
51
|
import { BaseAbstractClient, isUpdateFailureReason, UpdateFailureReason } from "./BaseAbstractClient";
|
|
52
52
|
import { HubPoolClient } from "./HubPoolClient";
|
|
53
53
|
import { AcrossConfigStoreClient } from "./AcrossConfigStoreClient";
|
|
@@ -930,25 +930,18 @@ export class SpokePoolClient extends BaseAbstractClient {
|
|
|
930
930
|
}
|
|
931
931
|
|
|
932
932
|
async findDeposit(depositId: BigNumber, destinationChainId: number): Promise<DepositWithBlock> {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
const searchBounds = await getBlockRangeForDepositId(
|
|
942
|
-
depositId,
|
|
943
|
-
this.deploymentBlock,
|
|
944
|
-
this.latestBlockSearched,
|
|
945
|
-
7,
|
|
946
|
-
this
|
|
947
|
-
);
|
|
933
|
+
const upperBound = this.latestBlockSearched || undefined; // Don't permit block 0 as the high block.
|
|
934
|
+
const fromBlock = await findDepositBlock(this.spokePool, depositId, this.deploymentBlock, upperBound);
|
|
935
|
+
if (!fromBlock) {
|
|
936
|
+
const chain = getNetworkName(this.chainId);
|
|
937
|
+
throw new Error(
|
|
938
|
+
`Unable to find ${chain} depositId ${depositId} within blocks [${this.deploymentBlock}, ${upperBound}]`
|
|
939
|
+
);
|
|
940
|
+
}
|
|
948
941
|
|
|
942
|
+
const toBlock = fromBlock;
|
|
949
943
|
const tStart = Date.now();
|
|
950
944
|
// Check both V3FundsDeposited and FundsDeposited events to look for a specified depositId.
|
|
951
|
-
const [fromBlock, toBlock] = [searchBounds.low, searchBounds.high];
|
|
952
945
|
const { maxBlockLookBack } = this.eventSearchConfig;
|
|
953
946
|
const query = (
|
|
954
947
|
await Promise.all([
|
|
@@ -972,7 +965,7 @@ export class SpokePoolClient extends BaseAbstractClient {
|
|
|
972
965
|
const dstChain = getNetworkName(destinationChainId);
|
|
973
966
|
throw new Error(
|
|
974
967
|
`Could not find deposit ${depositId.toString()} for ${dstChain} fill` +
|
|
975
|
-
` between ${srcChain} blocks [${
|
|
968
|
+
` between ${srcChain} blocks [${fromBlock}, ${toBlock}]`
|
|
976
969
|
);
|
|
977
970
|
}
|
|
978
971
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { providers, utils } from "ethers";
|
|
2
|
-
import
|
|
2
|
+
import bs58 from "bs58";
|
|
3
|
+
import { BigNumber, chainIsEvm } from "./";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Checks if a contract is deployed at the given address
|
|
@@ -68,3 +69,180 @@ export function isValidEvmAddress(address: string): boolean {
|
|
|
68
69
|
return false;
|
|
69
70
|
}
|
|
70
71
|
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Creates the proper address type given the input chain ID corresponding to the address's origin network.
|
|
75
|
+
* @param address Stringified address type to convert. Can be either hex encoded or base58 encoded.
|
|
76
|
+
* @param chainId Network ID corresponding to the input address, used to determine which address type to output.
|
|
77
|
+
* @returns a child `Address` type most fitting for the chain ID.
|
|
78
|
+
* @todo: Change this to `toAddress` once we remove the other `toAddress` function.
|
|
79
|
+
*/
|
|
80
|
+
export function toAddressType(address: string, chainId: number): Address | EvmAddress | SvmAddress {
|
|
81
|
+
try {
|
|
82
|
+
if (chainIsEvm(chainId)) {
|
|
83
|
+
return EvmAddress.from(address);
|
|
84
|
+
}
|
|
85
|
+
return SvmAddress.from(address);
|
|
86
|
+
} catch (e) {
|
|
87
|
+
// If we hit this block, then the validation for one of the child address classes failed. We still may want to keep this address in our state, so
|
|
88
|
+
// return an unchecked address type.
|
|
89
|
+
return new Address(utils.arrayify(address));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// The Address class can contain any address type. It is up to the subclasses to determine how to format the address's internal representation,
|
|
94
|
+
// which for this class, is a bytes32 hex string.
|
|
95
|
+
export class Address {
|
|
96
|
+
readonly rawAddress: Uint8Array;
|
|
97
|
+
|
|
98
|
+
// Keep all address types in cache so that we may lazily evaluate them when necessary.
|
|
99
|
+
evmAddress: string | undefined = undefined;
|
|
100
|
+
bytes32Address: string | undefined = undefined;
|
|
101
|
+
svmAddress: string | undefined = undefined;
|
|
102
|
+
bnAddress: BigNumber | undefined = undefined;
|
|
103
|
+
|
|
104
|
+
constructor(_rawAddress: Uint8Array) {
|
|
105
|
+
// The only validation done here is checking that the address is at most a 32-byte address, which will be well-defined on any supported network.
|
|
106
|
+
// Further validation is done on the subclasses so that we can guarantee that, for example, an EvmAddress type will always contain a valid, 20-byte
|
|
107
|
+
// EVM address.
|
|
108
|
+
if (_rawAddress.length > 32) {
|
|
109
|
+
throw new Error(`Address ${utils.hexlify(_rawAddress)} cannot be longer than 32 bytes.`);
|
|
110
|
+
}
|
|
111
|
+
// Ensure all addresses in this class are internally stored as 32 bytes.
|
|
112
|
+
this.rawAddress = utils.zeroPad(_rawAddress, 32);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Converts the address into a bytes32 string. Note that the output bytes will be lowercase so that it matches ethers event data. This function will never
|
|
116
|
+
// throw since address length validation was done at construction time.
|
|
117
|
+
toBytes32(): string {
|
|
118
|
+
return (this.bytes32Address ??= utils.hexZeroPad(utils.hexlify(this.rawAddress), 32).toLowerCase());
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Converts the address (can be bytes32 or bytes20) to its base58 counterpart. This conversion will always succeed, even if the input address is not valid on Solana,
|
|
122
|
+
// as this address may be needed to represent an EVM address on Solana.
|
|
123
|
+
toBase58(): string {
|
|
124
|
+
return (this.svmAddress ??= bs58.encode(this.rawAddress));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Converts the address to a BigNumber type.
|
|
128
|
+
toBigNumber(): BigNumber {
|
|
129
|
+
return (this.bnAddress ??= BigNumber.from(this.toBytes32()));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Converts the address to a valid EVM address. If it is unable to convert the address to a valid EVM address for some reason, such as if this address
|
|
133
|
+
// is longer than 20 bytes, then this function will throw an error.
|
|
134
|
+
toEvmAddress(): string {
|
|
135
|
+
const parseRawAddress = () => {
|
|
136
|
+
const hexString = utils.hexlify(this.rawAddress);
|
|
137
|
+
const rawAddress = utils.hexZeroPad(utils.hexStripZeros(hexString), 20);
|
|
138
|
+
return utils.getAddress(rawAddress);
|
|
139
|
+
};
|
|
140
|
+
return (this.evmAddress ??= parseRawAddress());
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Converts the address to a hex string. This method should be overriden by subclasses to obtain more meaningful
|
|
144
|
+
// address representations for the target chain ID.
|
|
145
|
+
toAddress(): string {
|
|
146
|
+
return this.toBytes32();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Implements `Hexable` for `Address`. Needed for encoding purposes. This class is treated by default as a bytes32 primitive type, but can change for subclasses.
|
|
150
|
+
toHexString(): string {
|
|
151
|
+
return this.toBytes32();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Checks if this address can be coerced into a bytes20 evm address. Returns true if it is possible and false otherwise.
|
|
155
|
+
isValidEvmAddress(): boolean {
|
|
156
|
+
try {
|
|
157
|
+
this.toAddress();
|
|
158
|
+
return true;
|
|
159
|
+
} catch {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Checks if the address is valid on the given chain ID.
|
|
165
|
+
isValidOn(chainId: number): boolean {
|
|
166
|
+
if (chainIsEvm(chainId)) {
|
|
167
|
+
return this.isValidEvmAddress();
|
|
168
|
+
}
|
|
169
|
+
// Assume the address is always valid on Solana.
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Checks if the object is an address by looking at whether it has an Address constructor.
|
|
174
|
+
static isAddress(obj: unknown): boolean {
|
|
175
|
+
return obj instanceof this;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Converts the input address to a 32-byte hex data string.
|
|
179
|
+
toString(): string {
|
|
180
|
+
return this.toHexString();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Checks if the address is the zero address.
|
|
184
|
+
isZeroAddress(): boolean {
|
|
185
|
+
return utils.stripZeros(this.rawAddress).length === 0;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Checks if the other address is equivalent to this address.
|
|
189
|
+
eq(other: Address): boolean {
|
|
190
|
+
return this.toString() === other.toString();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Compares Addresses by first converting them to BigNumbers.
|
|
194
|
+
compare(otherAddress: Address): 1 | -1 | 0 {
|
|
195
|
+
// Convert address strings to BigNumbers and then sort numerical value of the BigNumber, which sorts the addresses
|
|
196
|
+
// effectively by their hex value.
|
|
197
|
+
const bnAddressA = this.toBigNumber();
|
|
198
|
+
const bnAddressB = otherAddress.toBigNumber();
|
|
199
|
+
if (bnAddressA.gt(bnAddressB)) {
|
|
200
|
+
return 1;
|
|
201
|
+
} else if (bnAddressA.lt(bnAddressB)) {
|
|
202
|
+
return -1;
|
|
203
|
+
} else {
|
|
204
|
+
return 0;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Subclass of address which strictly deals with 20-byte addresses. These addresses are guaranteed to be valid EVM addresses, so `toAddress` will always succeed.
|
|
210
|
+
export class EvmAddress extends Address {
|
|
211
|
+
// On construction, validate that the address can indeed be coerced into an EVM address. Throw immediately if it cannot.
|
|
212
|
+
constructor(rawAddress: Uint8Array) {
|
|
213
|
+
super(rawAddress);
|
|
214
|
+
const hexString = utils.hexlify(rawAddress);
|
|
215
|
+
if (!this.isValidEvmAddress()) {
|
|
216
|
+
throw new Error(`${hexString} is not a valid EVM address`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Override `toAddress` to return the 20-byte representation address.
|
|
221
|
+
override toAddress(): string {
|
|
222
|
+
return this.toEvmAddress();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Constructs a new EvmAddress type.
|
|
226
|
+
static from(hexString: string): EvmAddress {
|
|
227
|
+
return new this(utils.arrayify(hexString));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Subclass of address which strictly deals SVM addresses. These addresses are guaranteed to be valid SVM addresses, so `toBase58` will always produce a valid Solana address.
|
|
232
|
+
export class SvmAddress extends Address {
|
|
233
|
+
// On construction, validate that the address is a point on Curve25519. Throw immediately if it is not.
|
|
234
|
+
constructor(rawAddress: Uint8Array) {
|
|
235
|
+
super(rawAddress);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Override the toAddress function for SVM addresses only since while they will never have a defined 20-byte representation. The base58 encoded addresses are also the encodings
|
|
239
|
+
// used in TOKEN_SYMBOLS_MAP.
|
|
240
|
+
override toAddress(): string {
|
|
241
|
+
return this.toBase58();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Constructs a new SvmAddress type.
|
|
245
|
+
static from(bs58Address: string): SvmAddress {
|
|
246
|
+
return new this(bs58.decode(bs58Address));
|
|
247
|
+
}
|
|
248
|
+
}
|
package/src/utils/Multicall.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Contract, providers, Signer, utils as ethersUtils } from "ethers";
|
|
2
2
|
import { CHAIN_IDs } from "@across-protocol/constants";
|
|
3
|
-
import { chainIsOPStack } from "./NetworkUtils";
|
|
3
|
+
import { chainIsOPStack, hreNetworks } from "./NetworkUtils";
|
|
4
4
|
import { BigNumber } from "./BigNumberUtils";
|
|
5
5
|
import { Multicall3, Multicall3__factory } from "./abi/typechain";
|
|
6
6
|
|
|
@@ -35,6 +35,7 @@ const DETERMINISTIC_MULTICALL_CHAINS = [
|
|
|
35
35
|
CHAIN_IDs.SCROLL_SEPOLIA,
|
|
36
36
|
CHAIN_IDs.SEPOLIA,
|
|
37
37
|
CHAIN_IDs.ARBITRUM_SEPOLIA,
|
|
38
|
+
...Object.keys(hreNetworks).map(Number), // See test/utils/multicall.ts
|
|
38
39
|
];
|
|
39
40
|
|
|
40
41
|
export function getMulticallAddress(chainId: number): string | undefined {
|
|
@@ -66,3 +67,30 @@ export async function aggregate(multicall3: Contract, calls: Call3[], blockTag?:
|
|
|
66
67
|
return contract.interface.decodeFunctionResult(method, result);
|
|
67
68
|
});
|
|
68
69
|
}
|
|
70
|
+
|
|
71
|
+
export async function blockAndAggregate(
|
|
72
|
+
multicall3: Contract,
|
|
73
|
+
calls: Call3[],
|
|
74
|
+
blockTag?: BlockTag
|
|
75
|
+
): Promise<{ blockNumber: number; returnData: Result[] }> {
|
|
76
|
+
const inputs = calls.map(({ contract, method, args }) => ({
|
|
77
|
+
target: contract.address,
|
|
78
|
+
callData: contract.interface.encodeFunctionData(method, args),
|
|
79
|
+
}));
|
|
80
|
+
|
|
81
|
+
type blockAndAggregateResponse = Promise<{
|
|
82
|
+
blockNumber: BigNumber;
|
|
83
|
+
blockHash: string;
|
|
84
|
+
returnData: Multicall3.ResultStructOutput[];
|
|
85
|
+
}>;
|
|
86
|
+
const { blockNumber, returnData: _returnData } = await (multicall3.callStatic.blockAndAggregate(inputs, {
|
|
87
|
+
blockTag,
|
|
88
|
+
}) as blockAndAggregateResponse);
|
|
89
|
+
|
|
90
|
+
const returnData = _returnData.map(({ returnData }, idx) => {
|
|
91
|
+
const { contract, method } = calls[idx];
|
|
92
|
+
return contract.interface.decodeFunctionResult(method, returnData);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
return { blockNumber: blockNumber.toNumber(), returnData };
|
|
96
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ChainFamily, CHAIN_IDs, MAINNET_CHAIN_IDs, PUBLIC_NETWORKS, TESTNET_CHAIN_IDs } from "../constants";
|
|
2
2
|
|
|
3
|
-
const hreNetworks: Record<number, string> = {
|
|
3
|
+
export const hreNetworks: Record<number, string> = {
|
|
4
4
|
666: "Hardhat1",
|
|
5
5
|
1337: "Hardhat2",
|
|
6
|
+
31337: "HardhatNetwork",
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -129,9 +130,17 @@ export function chainIsL1(chainId: number): boolean {
|
|
|
129
130
|
* @returns True if chain corresponding to chainId has an EVM-like execution layer.
|
|
130
131
|
*/
|
|
131
132
|
export function chainIsEvm(chainId: number): boolean {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
// TODO: Update when additional execution layers beyond EVM and SVM are supported.
|
|
134
|
+
return PUBLIC_NETWORKS[chainId]?.family !== ChainFamily.SVM;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Determines whether a chain ID runs on an SVM-like execution layer.
|
|
139
|
+
* @param chainId Chain ID to evaluate.
|
|
140
|
+
* @returns True if chain corresponding to chainId has an SVM-like execution layer.
|
|
141
|
+
*/
|
|
142
|
+
export function chainIsSvm(chainId: number): boolean {
|
|
143
|
+
return PUBLIC_NETWORKS[chainId]?.family === ChainFamily.SVM;
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
/**
|