@across-protocol/sdk 3.2.9 → 3.2.11-beta.1
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/gasPriceOracle/oracle.js +1 -0
- package/dist/cjs/gasPriceOracle/oracle.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/alephZero.d.ts +233 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/alephZero.js +46 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/alephZero.js.map +1 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +27 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +4 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/polygon.d.ts +27 -0
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +27 -0
- package/dist/cjs/utils/NetworkUtils.d.ts +2 -0
- package/dist/cjs/utils/NetworkUtils.js +12 -3
- package/dist/cjs/utils/NetworkUtils.js.map +1 -1
- package/dist/cjs/utils/TokenUtils.d.ts +54 -0
- package/dist/esm/gasPriceOracle/oracle.js +1 -0
- package/dist/esm/gasPriceOracle/oracle.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/alephZero.d.ts +233 -0
- package/dist/esm/relayFeeCalculator/chain-queries/alephZero.js +43 -0
- package/dist/esm/relayFeeCalculator/chain-queries/alephZero.js.map +1 -0
- package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +27 -0
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js +5 -2
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/polygon.d.ts +27 -0
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +27 -0
- package/dist/esm/utils/NetworkUtils.d.ts +12 -0
- package/dist/esm/utils/NetworkUtils.js +19 -2
- package/dist/esm/utils/NetworkUtils.js.map +1 -1
- package/dist/esm/utils/TokenUtils.d.ts +72 -30
- package/dist/types/gasPriceOracle/oracle.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/alephZero.d.ts +234 -0
- package/dist/types/relayFeeCalculator/chain-queries/alephZero.d.ts.map +1 -0
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +27 -0
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts +27 -0
- package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +27 -0
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
- package/dist/types/utils/NetworkUtils.d.ts +12 -0
- package/dist/types/utils/NetworkUtils.d.ts.map +1 -1
- package/dist/types/utils/TokenUtils.d.ts +72 -30
- package/dist/types/utils/TokenUtils.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/gasPriceOracle/oracle.ts +1 -0
- package/src/relayFeeCalculator/chain-queries/alephZero.ts +48 -0
- package/src/relayFeeCalculator/chain-queries/factory.ts +15 -2
- package/src/utils/NetworkUtils.ts +19 -1
|
@@ -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: {
|
|
@@ -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,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAY7E;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,WAC5B,MAAM,WACL,MAAM
|
|
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,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAY7E;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,WAC5B,MAAM,WACL,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA6BjB;;;;;;;WAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAlCA,MAAM,GAAG,SAIX,CAAC;AAEF,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqB5E;;;;;;;WAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA5B6F,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": "3.2.
|
|
4
|
+
"version": "3.2.11-beta.1",
|
|
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.
|
|
103
|
-
"@across-protocol/contracts": "^3.0.
|
|
102
|
+
"@across-protocol/constants": "^3.1.18",
|
|
103
|
+
"@across-protocol/contracts": "^3.0.12-beta.3",
|
|
104
104
|
"@eth-optimism/sdk": "^3.3.1",
|
|
105
105
|
"@ethersproject/bignumber": "^5.7.0",
|
|
106
106
|
"@pinata/sdk": "^2.1.0",
|
|
@@ -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,
|
|
@@ -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
|
|
|
@@ -57,7 +57,16 @@ export function chainIsMatic(chainId: number): boolean {
|
|
|
57
57
|
* @returns True if chainId is an OP stack, otherwise false.
|
|
58
58
|
*/
|
|
59
59
|
export function chainIsOPStack(chainId: number): boolean {
|
|
60
|
-
return PUBLIC_NETWORKS[chainId]?.family === ChainFamily.OP_STACK
|
|
60
|
+
return PUBLIC_NETWORKS[chainId]?.family === ChainFamily.OP_STACK;
|
|
61
|
+
}
|
|
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;
|
|
61
70
|
}
|
|
62
71
|
|
|
63
72
|
/**
|
|
@@ -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.
|