@across-protocol/sdk 3.2.11 → 3.2.13

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.
Files changed (80) hide show
  1. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +1 -1
  2. package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  3. package/dist/cjs/gasPriceOracle/oracle.js +1 -0
  4. package/dist/cjs/gasPriceOracle/oracle.js.map +1 -1
  5. package/dist/cjs/interfaces/SpokePool.d.ts +2 -2
  6. package/dist/cjs/providers/drpc.js +1 -0
  7. package/dist/cjs/providers/drpc.js.map +1 -1
  8. package/dist/cjs/relayFeeCalculator/chain-queries/alephZero.d.ts +233 -0
  9. package/dist/cjs/relayFeeCalculator/chain-queries/alephZero.js +46 -0
  10. package/dist/cjs/relayFeeCalculator/chain-queries/alephZero.js.map +1 -0
  11. package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +27 -0
  12. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +4 -0
  13. package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  14. package/dist/cjs/relayFeeCalculator/chain-queries/polygon.d.ts +27 -0
  15. package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +27 -0
  16. package/dist/cjs/typechain.d.ts +1 -1
  17. package/dist/cjs/utils/BlockUtils.js +1 -3
  18. package/dist/cjs/utils/BlockUtils.js.map +1 -1
  19. package/dist/cjs/utils/Multicall.js +1 -0
  20. package/dist/cjs/utils/Multicall.js.map +1 -1
  21. package/dist/cjs/utils/NetworkUtils.d.ts +2 -0
  22. package/dist/cjs/utils/NetworkUtils.js +10 -1
  23. package/dist/cjs/utils/NetworkUtils.js.map +1 -1
  24. package/dist/cjs/utils/TokenUtils.d.ts +54 -0
  25. package/dist/esm/clients/BundleDataClient/BundleDataClient.js +1 -1
  26. package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
  27. package/dist/esm/gasPriceOracle/oracle.js +1 -0
  28. package/dist/esm/gasPriceOracle/oracle.js.map +1 -1
  29. package/dist/esm/interfaces/SpokePool.d.ts +2 -2
  30. package/dist/esm/providers/drpc.js +1 -0
  31. package/dist/esm/providers/drpc.js.map +1 -1
  32. package/dist/esm/relayFeeCalculator/chain-queries/alephZero.d.ts +233 -0
  33. package/dist/esm/relayFeeCalculator/chain-queries/alephZero.js +43 -0
  34. package/dist/esm/relayFeeCalculator/chain-queries/alephZero.js.map +1 -0
  35. package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +27 -0
  36. package/dist/esm/relayFeeCalculator/chain-queries/factory.js +5 -2
  37. package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -1
  38. package/dist/esm/relayFeeCalculator/chain-queries/polygon.d.ts +27 -0
  39. package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +27 -0
  40. package/dist/esm/typechain.d.ts +1 -1
  41. package/dist/esm/utils/BlockUtils.js +1 -3
  42. package/dist/esm/utils/BlockUtils.js.map +1 -1
  43. package/dist/esm/utils/Multicall.js +1 -0
  44. package/dist/esm/utils/Multicall.js.map +1 -1
  45. package/dist/esm/utils/NetworkUtils.d.ts +12 -0
  46. package/dist/esm/utils/NetworkUtils.js +17 -0
  47. package/dist/esm/utils/NetworkUtils.js.map +1 -1
  48. package/dist/esm/utils/TokenUtils.d.ts +72 -30
  49. package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
  50. package/dist/types/gasPriceOracle/oracle.d.ts.map +1 -1
  51. package/dist/types/interfaces/SpokePool.d.ts +2 -2
  52. package/dist/types/interfaces/SpokePool.d.ts.map +1 -1
  53. package/dist/types/providers/drpc.d.ts.map +1 -1
  54. package/dist/types/relayFeeCalculator/chain-queries/alephZero.d.ts +234 -0
  55. package/dist/types/relayFeeCalculator/chain-queries/alephZero.d.ts.map +1 -0
  56. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +27 -0
  57. package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
  58. package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts +27 -0
  59. package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts.map +1 -1
  60. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +27 -0
  61. package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
  62. package/dist/types/typechain.d.ts +1 -1
  63. package/dist/types/typechain.d.ts.map +1 -1
  64. package/dist/types/utils/BlockUtils.d.ts.map +1 -1
  65. package/dist/types/utils/Multicall.d.ts.map +1 -1
  66. package/dist/types/utils/NetworkUtils.d.ts +12 -0
  67. package/dist/types/utils/NetworkUtils.d.ts.map +1 -1
  68. package/dist/types/utils/TokenUtils.d.ts +72 -30
  69. package/dist/types/utils/TokenUtils.d.ts.map +1 -1
  70. package/package.json +3 -3
  71. package/src/clients/BundleDataClient/BundleDataClient.ts +4 -1
  72. package/src/gasPriceOracle/oracle.ts +1 -0
  73. package/src/interfaces/SpokePool.ts +2 -2
  74. package/src/providers/drpc.ts +1 -0
  75. package/src/relayFeeCalculator/chain-queries/alephZero.ts +48 -0
  76. package/src/relayFeeCalculator/chain-queries/factory.ts +15 -2
  77. package/src/typechain.ts +0 -3
  78. package/src/utils/BlockUtils.ts +1 -5
  79. package/src/utils/Multicall.ts +1 -0
  80. package/src/utils/NetworkUtils.ts +18 -0
@@ -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;AAG3E,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,CA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,wBAAsB,SAAS,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAY5G"}
@@ -34,12 +34,24 @@ export declare function chainIsMatic(chainId: number): boolean;
34
34
  * @returns True if chainId is an OP stack, otherwise false.
35
35
  */
36
36
  export declare function chainIsOPStack(chainId: number): boolean;
37
+ /**
38
+ * Determines whether a chain ID is an Arbitrum Orbit implementation.
39
+ * @param chainId Chain ID to evaluate.
40
+ * @returns True if chainId is an Orbit chain, otherwise false.
41
+ */
42
+ export declare function chainIsOrbit(chainId: number): boolean;
37
43
  /**
38
44
  * Determines whether a chain ID is an Arbitrum implementation.
39
45
  * @param chainId Chain ID to evaluate.
40
46
  * @returns True if chainId is an Arbitrum chain, otherwise false.
41
47
  */
42
48
  export declare function chainIsArbitrum(chainId: number): boolean;
49
+ /**
50
+ * Determines whether a chain ID is an Aleph0 implementation
51
+ * @param chainId Chain ID to evaluate
52
+ * @returns True if chainId is an Aleph0 chain, otherwise false.
53
+ */
54
+ export declare function chainIsAlephZero(chainId: number): boolean;
43
55
  /**
44
56
  * Determines whether a chain ID is a Linea implementation.
45
57
  * @param chainId Chain ID to evaluate.
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/NetworkUtils.ts"],"names":[],"mappings":"AAOA;;;;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;;;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AAE,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,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAa3D;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"}
@@ -41,6 +41,15 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
41
41
  };
42
42
  coingeckoId: string;
43
43
  };
44
+ AZERO: {
45
+ name: string;
46
+ symbol: string;
47
+ decimals: number;
48
+ addresses: {
49
+ [x: number]: string;
50
+ };
51
+ coingeckoId: string;
52
+ };
44
53
  BAL: {
45
54
  name: string;
46
55
  symbol: string;
@@ -76,13 +85,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
76
85
  [x: number]: string;
77
86
  };
78
87
  coingeckoId: string;
79
- }; /**
80
- * Resolve a token symbol to an L1Token description on a particular chain ID.
81
- * @notice Not to be confused with the HubPool's internal view on the supported origin/destination token for a chain.
82
- * @param symbol Symbol to query.
83
- * @param chainId Chain ID to query on.
84
- * @returns Symbol, decimals and contract address on the requested chain.
85
- */
88
+ };
86
89
  ETH: {
87
90
  name: string;
88
91
  symbol: string;
@@ -92,6 +95,15 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
92
95
  };
93
96
  coingeckoId: string;
94
97
  };
98
+ GHO: {
99
+ name: string;
100
+ symbol: string;
101
+ decimals: number;
102
+ addresses: {
103
+ [x: number]: string;
104
+ };
105
+ coingeckoId: string;
106
+ };
95
107
  LSK: {
96
108
  name: string;
97
109
  symbol: string;
@@ -184,6 +196,14 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
184
196
  };
185
197
  USDzC: {
186
198
  name: string;
199
+ /**
200
+ * Retrieves the ERC20 balance for a given address and token address.
201
+ * @param address The address to retrieve the balance for.
202
+ * @param tokenAddress The token address
203
+ * @param signerOrProvider A valid ethers.js Signer or Provider object.
204
+ * @param blockTag The block tag to retrieve the balance at.
205
+ * @returns The balance of the given address for the given token address.
206
+ */
187
207
  symbol: string;
188
208
  decimals: number;
189
209
  addresses: {
@@ -200,16 +220,17 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
200
220
  };
201
221
  coingeckoId: string;
202
222
  };
223
+ WAZERO: {
224
+ name: string;
225
+ symbol: string;
226
+ decimals: number;
227
+ addresses: {
228
+ [x: number]: string;
229
+ };
230
+ coingeckoId: string;
231
+ };
203
232
  WBTC: {
204
233
  name: string;
205
- /**
206
- * Retrieves the ERC20 balance for a given address and token address.
207
- * @param address The address to retrieve the balance for.
208
- * @param tokenAddress The token address
209
- * @param signerOrProvider A valid ethers.js Signer or Provider object.
210
- * @param blockTag The block tag to retrieve the balance at.
211
- * @returns The balance of the given address for the given token address.
212
- */
213
234
  symbol: string;
214
235
  decimals: number;
215
236
  addresses: {
@@ -255,6 +276,15 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
255
276
  };
256
277
  coingeckoId: string;
257
278
  };
279
+ AZERO: {
280
+ name: string;
281
+ symbol: string;
282
+ decimals: number;
283
+ addresses: {
284
+ [x: number]: string;
285
+ };
286
+ coingeckoId: string;
287
+ };
258
288
  BAL: {
259
289
  name: string;
260
290
  symbol: string;
@@ -290,13 +320,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
290
320
  [x: number]: string;
291
321
  };
292
322
  coingeckoId: string;
293
- }; /**
294
- * Resolve a token symbol to an L1Token description on a particular chain ID.
295
- * @notice Not to be confused with the HubPool's internal view on the supported origin/destination token for a chain.
296
- * @param symbol Symbol to query.
297
- * @param chainId Chain ID to query on.
298
- * @returns Symbol, decimals and contract address on the requested chain.
299
- */
323
+ };
300
324
  ETH: {
301
325
  name: string;
302
326
  symbol: string;
@@ -306,6 +330,15 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
306
330
  };
307
331
  coingeckoId: string;
308
332
  };
333
+ GHO: {
334
+ name: string;
335
+ symbol: string;
336
+ decimals: number;
337
+ addresses: {
338
+ [x: number]: string;
339
+ };
340
+ coingeckoId: string;
341
+ };
309
342
  LSK: {
310
343
  name: string;
311
344
  symbol: string;
@@ -398,6 +431,14 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
398
431
  };
399
432
  USDzC: {
400
433
  name: string;
434
+ /**
435
+ * Retrieves the ERC20 balance for a given address and token address.
436
+ * @param address The address to retrieve the balance for.
437
+ * @param tokenAddress The token address
438
+ * @param signerOrProvider A valid ethers.js Signer or Provider object.
439
+ * @param blockTag The block tag to retrieve the balance at.
440
+ * @returns The balance of the given address for the given token address.
441
+ */
401
442
  symbol: string;
402
443
  decimals: number;
403
444
  addresses: {
@@ -414,16 +455,17 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
414
455
  };
415
456
  coingeckoId: string;
416
457
  };
458
+ WAZERO: {
459
+ name: string;
460
+ symbol: string;
461
+ decimals: number;
462
+ addresses: {
463
+ [x: number]: string;
464
+ };
465
+ coingeckoId: string;
466
+ };
417
467
  WBTC: {
418
468
  name: string;
419
- /**
420
- * Retrieves the ERC20 balance for a given address and token address.
421
- * @param address The address to retrieve the balance for.
422
- * @param tokenAddress The token address
423
- * @param signerOrProvider A valid ethers.js Signer or Provider object.
424
- * @param blockTag The block tag to retrieve the balance at.
425
- * @returns The balance of the given address for the given token address.
426
- */
427
469
  symbol: string;
428
470
  decimals: number;
429
471
  addresses: {
@@ -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AAO,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": "3.2.11",
4
+ "version": "3.2.13",
5
5
  "license": "AGPL-3.0",
6
6
  "homepage": "https://docs.across.to/reference/sdk",
7
7
  "files": [
@@ -99,8 +99,8 @@
99
99
  },
100
100
  "dependencies": {
101
101
  "@across-protocol/across-token": "^1.0.0",
102
- "@across-protocol/constants": "^3.1.16",
103
- "@across-protocol/contracts": "^3.0.11",
102
+ "@across-protocol/constants": "^3.1.19",
103
+ "@across-protocol/contracts": "^3.0.16",
104
104
  "@eth-optimism/sdk": "^3.3.1",
105
105
  "@ethersproject/bignumber": "^5.7.0",
106
106
  "@pinata/sdk": "^2.1.0",
@@ -1316,7 +1316,10 @@ export class BundleDataClient {
1316
1316
  ];
1317
1317
  // Sanity checks:
1318
1318
  assert(endTime >= startTime, "End time should be greater than start time.");
1319
- assert(startTime > 0, "Start time should be greater than 0.");
1319
+ assert(
1320
+ startBlockForChain === 0 || startTime > 0,
1321
+ "Start timestamp must be greater than 0 if the start block is greater than 0."
1322
+ );
1320
1323
  return [chainId, [startTime, endTime]];
1321
1324
  })
1322
1325
  ).filter(isDefined)
@@ -24,6 +24,7 @@ export async function getGasPriceEstimate(
24
24
  }
25
25
 
26
26
  const gasPriceFeeds: { [chainId: number]: GasPriceFeed } = {
27
+ [CHAIN_IDs.ALEPH_ZERO]: arbitrum.eip1559,
27
28
  [CHAIN_IDs.ARBITRUM]: arbitrum.eip1559,
28
29
  [CHAIN_IDs.BASE]: ethereum.eip1559,
29
30
  [CHAIN_IDs.BOBA]: ethereum.legacy,
@@ -1,10 +1,10 @@
1
1
  import { SortableEvent } from "./Common";
2
- import { FilledRelayEvent, FilledV3RelayEvent, FundsDepositedEvent, V3FundsDepositedEvent } from "../typechain";
2
+ import { FilledV3RelayEvent, V3FundsDepositedEvent } from "../typechain";
3
3
  import { SpokePoolClient } from "../clients";
4
4
  import { BigNumber } from "../utils";
5
5
  import { RelayerRefundLeaf } from "./HubPool";
6
6
 
7
- export type { FilledRelayEvent, FilledV3RelayEvent, FundsDepositedEvent, V3FundsDepositedEvent };
7
+ export type { FilledV3RelayEvent, V3FundsDepositedEvent };
8
8
 
9
9
  export interface RelayData {
10
10
  originChainId: number;
@@ -3,6 +3,7 @@ import { RPCTransport } from "./types";
3
3
 
4
4
  // Chain-specific overrides for when the endpoint name does not match the canonical chain name.
5
5
  const endpoints: { [chainId: string]: string } = {
6
+ [CHAIN_IDs.ALEPH_ZERO]: "alephzero",
6
7
  [CHAIN_IDs.ARBITRUM]: "arbitrum",
7
8
  [CHAIN_IDs.MAINNET]: "ethereum",
8
9
  };
@@ -0,0 +1,48 @@
1
+ import assert from "assert";
2
+ import { getDeployedAddress } from "../../utils/DeploymentUtils";
3
+ import { DEFAULT_LOGGER, Logger } from "../relayFeeCalculator";
4
+ import { providers } from "ethers";
5
+ import { CHAIN_IDs, DEFAULT_SIMULATED_RELAYER_ADDRESS, TOKEN_SYMBOLS_MAP } from "../../constants";
6
+ import { Coingecko } from "../../coingecko/Coingecko";
7
+ import { isDefined } from "../../utils";
8
+ import { QueryBase } from "./baseQuery";
9
+
10
+ export class AlephZeroQueries extends QueryBase {
11
+ constructor(
12
+ provider: providers.Provider,
13
+ symbolMapping = TOKEN_SYMBOLS_MAP,
14
+ spokePoolAddress = getDeployedAddress("SpokePool", CHAIN_IDs.ALEPH_ZERO),
15
+ simulatedRelayerAddress = DEFAULT_SIMULATED_RELAYER_ADDRESS,
16
+ coingeckoProApiKey?: string,
17
+ logger: Logger = DEFAULT_LOGGER,
18
+ gasMarkup = 0
19
+ ) {
20
+ assert(isDefined(spokePoolAddress));
21
+ super(
22
+ provider,
23
+ symbolMapping,
24
+ spokePoolAddress,
25
+ simulatedRelayerAddress,
26
+ gasMarkup,
27
+ logger,
28
+ coingeckoProApiKey,
29
+ undefined,
30
+ "usd"
31
+ );
32
+ }
33
+
34
+ override async getTokenPrice(tokenSymbol: string): Promise<number> {
35
+ if (!this.symbolMapping[tokenSymbol]) throw new Error(`${tokenSymbol} does not exist in mapping`);
36
+ const coingeckoInstance = Coingecko.get(this.logger, this.coingeckoProApiKey);
37
+ const [, tokenPrice] = await coingeckoInstance.getCurrentPriceByContract(
38
+ this.symbolMapping[tokenSymbol].addresses[CHAIN_IDs.MAINNET],
39
+ "usd"
40
+ );
41
+
42
+ const [, alephZeroPrice] = await coingeckoInstance.getCurrentPriceByContract(
43
+ this.symbolMapping["AZERO"].addresses[CHAIN_IDs.MAINNET],
44
+ "usd"
45
+ );
46
+ return Number((tokenPrice / alephZeroPrice).toFixed(this.symbolMapping["AZERO"].decimals));
47
+ }
48
+ }
@@ -4,10 +4,11 @@ import { getDeployedAddress } from "@across-protocol/contracts";
4
4
  import { asL2Provider } from "@eth-optimism/sdk";
5
5
  import { providers } from "ethers";
6
6
  import { DEFAULT_SIMULATED_RELAYER_ADDRESS } from "../../constants";
7
- import { chainIsMatic, chainIsOPStack, isDefined } from "../../utils";
7
+ import { chainIsAlephZero, chainIsMatic, chainIsOPStack, isDefined } from "../../utils";
8
8
  import { QueryBase } from "./baseQuery";
9
9
  import { PolygonQueries } from "./polygon";
10
10
  import { DEFAULT_LOGGER, Logger } from "../relayFeeCalculator";
11
+ import { AlephZeroQueries } from "./alephZero";
11
12
 
12
13
  /**
13
14
  * Some chains have a fixed gas price that is applied to the gas estimates. We should override
@@ -31,7 +32,6 @@ export class QueryBase__factory {
31
32
  ): QueryBase {
32
33
  assert(isDefined(spokePoolAddress));
33
34
 
34
- // Currently the only chain that has a custom query class is Polygon
35
35
  if (chainIsMatic(chainId)) {
36
36
  return new PolygonQueries(
37
37
  provider,
@@ -43,6 +43,19 @@ export class QueryBase__factory {
43
43
  gasMarkup
44
44
  );
45
45
  }
46
+
47
+ if (chainIsAlephZero(chainId)) {
48
+ return new AlephZeroQueries(
49
+ provider,
50
+ symbolMapping,
51
+ spokePoolAddress,
52
+ simulatedRelayerAddress,
53
+ coingeckoProApiKey,
54
+ logger,
55
+ gasMarkup
56
+ );
57
+ }
58
+
46
59
  // For OPStack chains, we need to wrap the provider in an L2Provider
47
60
  provider = chainIsOPStack(chainId) ? asL2Provider(provider) : provider;
48
61
 
package/src/typechain.ts CHANGED
@@ -28,9 +28,6 @@ export type { HubPool, HubPoolInterface } from "@across-protocol/contracts/dist/
28
28
  export type {
29
29
  SpokePool,
30
30
  SpokePoolInterface,
31
- FundsDepositedEvent,
32
- FilledRelayEvent,
33
- RequestedSpeedUpDepositEvent,
34
31
  V3FundsDepositedEvent,
35
32
  FilledV3RelayEvent,
36
33
  } from "@across-protocol/contracts/dist/typechain/contracts/SpokePool";
@@ -51,11 +51,7 @@ export async function averageBlockTime(
51
51
  const { chainId } = await provider.getNetwork();
52
52
 
53
53
  // OP stack chains inherit Optimism block times, but can be overridden.
54
- // prettier-ignore
55
- const cache = blockTimes[chainId]
56
- ?? chainIsOPStack(chainId)
57
- ? blockTimes[CHAIN_IDs.OPTIMISM]
58
- : undefined;
54
+ const cache = blockTimes[chainId] ?? (chainIsOPStack(chainId) ? blockTimes[CHAIN_IDs.OPTIMISM] : undefined);
59
55
 
60
56
  const now = getCurrentTime();
61
57
  if (isDefined(cache) && now < cache.timestamp + cacheTTL) {
@@ -17,6 +17,7 @@ export type Call3 = {
17
17
  const DETERMINISTIC_MULTICALL_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
18
18
 
19
19
  const NON_DETERMINISTIC_MULTICALL_ADDRESSES = {
20
+ [CHAIN_IDs.ALEPH_ZERO]: "0x3CA11702f7c0F28e0b4e03C31F7492969862C569",
20
21
  [CHAIN_IDs.ZK_SYNC]: "0xF9cda624FBC7e059355ce98a31693d299FACd963",
21
22
  };
22
23
 
@@ -60,6 +60,15 @@ export function chainIsOPStack(chainId: number): boolean {
60
60
  return PUBLIC_NETWORKS[chainId]?.family === ChainFamily.OP_STACK;
61
61
  }
62
62
 
63
+ /**
64
+ * Determines whether a chain ID is an Arbitrum Orbit implementation.
65
+ * @param chainId Chain ID to evaluate.
66
+ * @returns True if chainId is an Orbit chain, otherwise false.
67
+ */
68
+ export function chainIsOrbit(chainId: number): boolean {
69
+ return PUBLIC_NETWORKS[chainId]?.family === ChainFamily.ORBIT;
70
+ }
71
+
63
72
  /**
64
73
  * Determines whether a chain ID is an Arbitrum implementation.
65
74
  * @param chainId Chain ID to evaluate.
@@ -69,6 +78,15 @@ export function chainIsArbitrum(chainId: number): boolean {
69
78
  return [CHAIN_IDs.ARBITRUM, CHAIN_IDs.ARBITRUM_SEPOLIA].includes(chainId);
70
79
  }
71
80
 
81
+ /**
82
+ * Determines whether a chain ID is an Aleph0 implementation
83
+ * @param chainId Chain ID to evaluate
84
+ * @returns True if chainId is an Aleph0 chain, otherwise false.
85
+ */
86
+ export function chainIsAlephZero(chainId: number): boolean {
87
+ return [CHAIN_IDs.ALEPH_ZERO].includes(chainId);
88
+ }
89
+
72
90
  /**
73
91
  * Determines whether a chain ID is a Linea implementation.
74
92
  * @param chainId Chain ID to evaluate.