@across-protocol/sdk 3.1.11 → 3.1.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.
- package/dist/cjs/clients/SpokePoolClient.d.ts +1 -0
- package/dist/cjs/clients/SpokePoolClient.js +4 -0
- package/dist/cjs/clients/SpokePoolClient.js.map +1 -1
- package/dist/cjs/coingecko/Coingecko.d.ts +1 -0
- package/dist/cjs/coingecko/Coingecko.js +25 -0
- package/dist/cjs/coingecko/Coingecko.js.map +1 -1
- package/dist/cjs/constants.d.ts +2 -1
- package/dist/cjs/constants.js +3 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/gasPriceOracle/oracle.js +1 -0
- package/dist/cjs/gasPriceOracle/oracle.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +21 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/polygon.d.ts +21 -0
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +21 -0
- package/dist/cjs/utils/BlockUtils.js +12 -13
- package/dist/cjs/utils/BlockUtils.js.map +1 -1
- package/dist/cjs/utils/NetworkUtils.d.ts +1 -0
- package/dist/cjs/utils/NetworkUtils.js +7 -13
- package/dist/cjs/utils/NetworkUtils.js.map +1 -1
- package/dist/cjs/utils/TokenUtils.d.ts +44 -0
- package/dist/cjs/utils/TokenUtils.js +13 -1
- package/dist/cjs/utils/TokenUtils.js.map +1 -1
- package/dist/esm/clients/SpokePoolClient.d.ts +6 -0
- package/dist/esm/clients/SpokePoolClient.js +9 -0
- package/dist/esm/clients/SpokePoolClient.js.map +1 -1
- package/dist/esm/coingecko/Coingecko.d.ts +9 -0
- package/dist/esm/coingecko/Coingecko.js +34 -1
- package/dist/esm/coingecko/Coingecko.js.map +1 -1
- package/dist/esm/constants.d.ts +2 -1
- package/dist/esm/constants.js +2 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/gasPriceOracle/oracle.js +1 -0
- package/dist/esm/gasPriceOracle/oracle.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +21 -0
- package/dist/esm/relayFeeCalculator/chain-queries/polygon.d.ts +21 -0
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +21 -0
- package/dist/esm/utils/BlockUtils.js +13 -14
- package/dist/esm/utils/BlockUtils.js.map +1 -1
- package/dist/esm/utils/NetworkUtils.d.ts +6 -0
- package/dist/esm/utils/NetworkUtils.js +11 -13
- package/dist/esm/utils/NetworkUtils.js.map +1 -1
- package/dist/esm/utils/TokenUtils.d.ts +58 -0
- package/dist/esm/utils/TokenUtils.js +10 -0
- package/dist/esm/utils/TokenUtils.js.map +1 -1
- package/dist/types/clients/SpokePoolClient.d.ts +6 -0
- package/dist/types/clients/SpokePoolClient.d.ts.map +1 -1
- package/dist/types/coingecko/Coingecko.d.ts +9 -0
- package/dist/types/coingecko/Coingecko.d.ts.map +1 -1
- package/dist/types/constants.d.ts +2 -1
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/oracle.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +21 -0
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts +21 -0
- package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +21 -0
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
- package/dist/types/utils/BlockUtils.d.ts.map +1 -1
- package/dist/types/utils/NetworkUtils.d.ts +6 -0
- package/dist/types/utils/NetworkUtils.d.ts.map +1 -1
- package/dist/types/utils/TokenUtils.d.ts +58 -0
- package/dist/types/utils/TokenUtils.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/clients/SpokePoolClient.ts +10 -0
- package/src/coingecko/Coingecko.ts +27 -1
- package/src/constants.ts +3 -1
- package/src/gasPriceOracle/oracle.ts +1 -0
- package/src/utils/BlockUtils.ts +9 -7
- package/src/utils/NetworkUtils.ts +11 -13
- package/src/utils/TokenUtils.ts +14 -0
|
@@ -125,6 +125,7 @@ export declare class RelayFeeCalculator {
|
|
|
125
125
|
addresses: {
|
|
126
126
|
[x: number]: string;
|
|
127
127
|
};
|
|
128
|
+
coingeckoId: string;
|
|
128
129
|
};
|
|
129
130
|
ARB: {
|
|
130
131
|
name: string;
|
|
@@ -133,6 +134,7 @@ export declare class RelayFeeCalculator {
|
|
|
133
134
|
addresses: {
|
|
134
135
|
[x: number]: string;
|
|
135
136
|
};
|
|
137
|
+
coingeckoId: string;
|
|
136
138
|
};
|
|
137
139
|
BAL: {
|
|
138
140
|
name: string;
|
|
@@ -141,6 +143,7 @@ export declare class RelayFeeCalculator {
|
|
|
141
143
|
addresses: {
|
|
142
144
|
[x: number]: string;
|
|
143
145
|
};
|
|
146
|
+
coingeckoId: string;
|
|
144
147
|
};
|
|
145
148
|
BADGER: {
|
|
146
149
|
name: string;
|
|
@@ -149,6 +152,7 @@ export declare class RelayFeeCalculator {
|
|
|
149
152
|
addresses: {
|
|
150
153
|
[x: number]: string;
|
|
151
154
|
};
|
|
155
|
+
coingeckoId: string;
|
|
152
156
|
};
|
|
153
157
|
BOBA: {
|
|
154
158
|
name: string;
|
|
@@ -157,6 +161,7 @@ export declare class RelayFeeCalculator {
|
|
|
157
161
|
addresses: {
|
|
158
162
|
[x: number]: string;
|
|
159
163
|
};
|
|
164
|
+
coingeckoId: string;
|
|
160
165
|
};
|
|
161
166
|
DAI: {
|
|
162
167
|
name: string;
|
|
@@ -165,6 +170,7 @@ export declare class RelayFeeCalculator {
|
|
|
165
170
|
addresses: {
|
|
166
171
|
[x: number]: string;
|
|
167
172
|
};
|
|
173
|
+
coingeckoId: string;
|
|
168
174
|
};
|
|
169
175
|
ETH: {
|
|
170
176
|
name: string;
|
|
@@ -173,6 +179,7 @@ export declare class RelayFeeCalculator {
|
|
|
173
179
|
addresses: {
|
|
174
180
|
[x: number]: string;
|
|
175
181
|
};
|
|
182
|
+
coingeckoId: string;
|
|
176
183
|
};
|
|
177
184
|
LSK: {
|
|
178
185
|
name: string;
|
|
@@ -181,6 +188,7 @@ export declare class RelayFeeCalculator {
|
|
|
181
188
|
addresses: {
|
|
182
189
|
[x: number]: string;
|
|
183
190
|
};
|
|
191
|
+
coingeckoId: string;
|
|
184
192
|
};
|
|
185
193
|
MATIC: {
|
|
186
194
|
name: string;
|
|
@@ -189,6 +197,7 @@ export declare class RelayFeeCalculator {
|
|
|
189
197
|
addresses: {
|
|
190
198
|
[x: number]: string;
|
|
191
199
|
};
|
|
200
|
+
coingeckoId: string;
|
|
192
201
|
};
|
|
193
202
|
OP: {
|
|
194
203
|
name: string;
|
|
@@ -197,6 +206,7 @@ export declare class RelayFeeCalculator {
|
|
|
197
206
|
addresses: {
|
|
198
207
|
[x: number]: string;
|
|
199
208
|
};
|
|
209
|
+
coingeckoId: string;
|
|
200
210
|
};
|
|
201
211
|
POOL: {
|
|
202
212
|
name: string;
|
|
@@ -205,6 +215,7 @@ export declare class RelayFeeCalculator {
|
|
|
205
215
|
addresses: {
|
|
206
216
|
[x: number]: string;
|
|
207
217
|
};
|
|
218
|
+
coingeckoId: string;
|
|
208
219
|
};
|
|
209
220
|
SNX: {
|
|
210
221
|
name: string;
|
|
@@ -213,6 +224,7 @@ export declare class RelayFeeCalculator {
|
|
|
213
224
|
addresses: {
|
|
214
225
|
[x: number]: string;
|
|
215
226
|
};
|
|
227
|
+
coingeckoId: string;
|
|
216
228
|
};
|
|
217
229
|
UMA: {
|
|
218
230
|
name: string;
|
|
@@ -221,6 +233,7 @@ export declare class RelayFeeCalculator {
|
|
|
221
233
|
addresses: {
|
|
222
234
|
[x: number]: string;
|
|
223
235
|
};
|
|
236
|
+
coingeckoId: string;
|
|
224
237
|
};
|
|
225
238
|
USDB: {
|
|
226
239
|
name: string;
|
|
@@ -229,6 +242,7 @@ export declare class RelayFeeCalculator {
|
|
|
229
242
|
addresses: {
|
|
230
243
|
[x: number]: string;
|
|
231
244
|
};
|
|
245
|
+
coingeckoId: string;
|
|
232
246
|
};
|
|
233
247
|
USDC: {
|
|
234
248
|
name: string;
|
|
@@ -237,6 +251,7 @@ export declare class RelayFeeCalculator {
|
|
|
237
251
|
addresses: {
|
|
238
252
|
[x: number]: string;
|
|
239
253
|
};
|
|
254
|
+
coingeckoId: string;
|
|
240
255
|
};
|
|
241
256
|
"USDC.e": {
|
|
242
257
|
name: string;
|
|
@@ -245,6 +260,7 @@ export declare class RelayFeeCalculator {
|
|
|
245
260
|
addresses: {
|
|
246
261
|
[x: number]: string;
|
|
247
262
|
};
|
|
263
|
+
coingeckoId: string;
|
|
248
264
|
};
|
|
249
265
|
USDbC: {
|
|
250
266
|
name: string;
|
|
@@ -253,6 +269,7 @@ export declare class RelayFeeCalculator {
|
|
|
253
269
|
addresses: {
|
|
254
270
|
[x: number]: string;
|
|
255
271
|
};
|
|
272
|
+
coingeckoId: string;
|
|
256
273
|
};
|
|
257
274
|
USDT: {
|
|
258
275
|
name: string;
|
|
@@ -261,6 +278,7 @@ export declare class RelayFeeCalculator {
|
|
|
261
278
|
addresses: {
|
|
262
279
|
[x: number]: string;
|
|
263
280
|
};
|
|
281
|
+
coingeckoId: string;
|
|
264
282
|
};
|
|
265
283
|
WBTC: {
|
|
266
284
|
name: string;
|
|
@@ -269,6 +287,7 @@ export declare class RelayFeeCalculator {
|
|
|
269
287
|
addresses: {
|
|
270
288
|
[x: number]: string;
|
|
271
289
|
};
|
|
290
|
+
coingeckoId: string;
|
|
272
291
|
};
|
|
273
292
|
WETH: {
|
|
274
293
|
name: string;
|
|
@@ -277,6 +296,7 @@ export declare class RelayFeeCalculator {
|
|
|
277
296
|
addresses: {
|
|
278
297
|
[x: number]: string;
|
|
279
298
|
};
|
|
299
|
+
coingeckoId: string;
|
|
280
300
|
};
|
|
281
301
|
WMATIC: {
|
|
282
302
|
name: string;
|
|
@@ -285,6 +305,7 @@ export declare class RelayFeeCalculator {
|
|
|
285
305
|
addresses: {
|
|
286
306
|
[x: number]: string;
|
|
287
307
|
};
|
|
308
|
+
coingeckoId: string;
|
|
288
309
|
};
|
|
289
310
|
}, gasPrice?: BigNumberish): Promise<BigNumber>;
|
|
290
311
|
capitalFeePercent(_amountToRelay: BigNumberish, _tokenSymbol: string, _originRoute?: ChainIdAsString, _destinationRoute?: ChainIdAsString): BigNumber;
|
|
@@ -2,7 +2,7 @@ var _a;
|
|
|
2
2
|
import { __awaiter, __generator } from "tslib";
|
|
3
3
|
import assert from "assert";
|
|
4
4
|
import { clamp, sortedIndexBy } from "lodash";
|
|
5
|
-
import { getNetworkName } from "./NetworkUtils";
|
|
5
|
+
import { chainIsOPStack, getNetworkName } from "./NetworkUtils";
|
|
6
6
|
import { isDefined } from "./TypeGuards";
|
|
7
7
|
import { getCurrentTime } from "./TimeUtils";
|
|
8
8
|
import { shouldCache } from "./CachingUtils";
|
|
@@ -19,12 +19,8 @@ var defaultHighBlockOffset = 10;
|
|
|
19
19
|
var cacheTTL = 60 * 15;
|
|
20
20
|
var now = getCurrentTime(); // Seed the cache with initial values.
|
|
21
21
|
var blockTimes = (_a = {},
|
|
22
|
-
_a[CHAIN_IDs.BASE] = { average: 2, timestamp: now, blockRange: 1 },
|
|
23
|
-
_a[CHAIN_IDs.BLAST] = { average: 2, timestamp: now, blockRange: 1 },
|
|
24
22
|
_a[CHAIN_IDs.LINEA] = { average: 3, timestamp: now, blockRange: 1 },
|
|
25
|
-
_a[CHAIN_IDs.LISK] = { average: 2, timestamp: now, blockRange: 1 },
|
|
26
23
|
_a[CHAIN_IDs.MAINNET] = { average: 12.5, timestamp: now, blockRange: 1 },
|
|
27
|
-
_a[CHAIN_IDs.MODE] = { average: 2, timestamp: now, blockRange: 1 },
|
|
28
24
|
_a[CHAIN_IDs.OPTIMISM] = { average: 2, timestamp: now, blockRange: 1 },
|
|
29
25
|
_a);
|
|
30
26
|
/**
|
|
@@ -32,15 +28,18 @@ var blockTimes = (_a = {},
|
|
|
32
28
|
* @returns Average number of seconds per block.
|
|
33
29
|
*/
|
|
34
30
|
export function averageBlockTime(provider, _a) {
|
|
35
|
-
var _b
|
|
31
|
+
var _b;
|
|
32
|
+
var _c = _a === void 0 ? {} : _a, highBlock = _c.highBlock, highBlockOffset = _c.highBlockOffset, blockRange = _c.blockRange;
|
|
36
33
|
return __awaiter(this, void 0, void 0, function () {
|
|
37
|
-
var chainId, cache, now, earliestBlockNumber,
|
|
38
|
-
return __generator(this, function (
|
|
39
|
-
switch (
|
|
34
|
+
var chainId, cache, now, earliestBlockNumber, _d, firstBlock, lastBlock, average;
|
|
35
|
+
return __generator(this, function (_e) {
|
|
36
|
+
switch (_e.label) {
|
|
40
37
|
case 0: return [4 /*yield*/, provider.getNetwork()];
|
|
41
38
|
case 1:
|
|
42
|
-
chainId = (
|
|
43
|
-
cache = blockTimes[chainId]
|
|
39
|
+
chainId = (_e.sent()).chainId;
|
|
40
|
+
cache = ((_b = blockTimes[chainId]) !== null && _b !== void 0 ? _b : chainIsOPStack(chainId))
|
|
41
|
+
? blockTimes[CHAIN_IDs.OPTIMISM]
|
|
42
|
+
: undefined;
|
|
44
43
|
now = getCurrentTime();
|
|
45
44
|
if (isDefined(cache) && now < cache.timestamp + cacheTTL) {
|
|
46
45
|
return [2 /*return*/, { average: cache.average, blockRange: cache.blockRange }];
|
|
@@ -48,9 +47,9 @@ export function averageBlockTime(provider, _a) {
|
|
|
48
47
|
if (!!isDefined(highBlock)) return [3 /*break*/, 3];
|
|
49
48
|
return [4 /*yield*/, provider.getBlockNumber()];
|
|
50
49
|
case 2:
|
|
51
|
-
highBlock =
|
|
50
|
+
highBlock = _e.sent();
|
|
52
51
|
highBlock -= highBlockOffset !== null && highBlockOffset !== void 0 ? highBlockOffset : defaultHighBlockOffset;
|
|
53
|
-
|
|
52
|
+
_e.label = 3;
|
|
54
53
|
case 3:
|
|
55
54
|
blockRange !== null && blockRange !== void 0 ? blockRange : (blockRange = defaultBlockRange);
|
|
56
55
|
earliestBlockNumber = highBlock - blockRange;
|
|
@@ -59,7 +58,7 @@ export function averageBlockTime(provider, _a) {
|
|
|
59
58
|
provider.getBlock(highBlock),
|
|
60
59
|
])];
|
|
61
60
|
case 4:
|
|
62
|
-
|
|
61
|
+
_d = _e.sent(), firstBlock = _d[0], lastBlock = _d[1];
|
|
63
62
|
[firstBlock, lastBlock].forEach(function (block) {
|
|
64
63
|
if (!isDefined(block === null || block === void 0 ? void 0 : block.timestamp)) {
|
|
65
64
|
var network = getNetworkName(chainId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockUtils.js","sourceRoot":"","sources":["../../../src/utils/BlockUtils.ts"],"names":[],"mappings":";;AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"BlockUtils.js","sourceRoot":"","sources":["../../../src/utils/BlockUtils.ts"],"names":[],"mappings":";;AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAcnE,gFAAgF;AAChF,qEAAqE;AACrE,IAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,sGAAsG;AACtG,uGAAuG;AACvG,uGAAuG;AACvG,2FAA2F;AAC3F,IAAM,sBAAsB,GA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AAG,EAAE,CAAC,EAAA;;oBAD/D,4BAA4B;oBAC5B,SAA+D,CAAC,CAAC,UAAU;oBAC3E,sBAAO,WAAW,EAAC;;wBAKrB,sBAAO,QAAQ,EAAE,EAAC;;;;;CAErB"}
|
|
@@ -46,6 +46,12 @@ export declare function chainIsArbitrum(chainId: number): boolean;
|
|
|
46
46
|
* @returns True if chainId is a Linea chain, otherwise false.
|
|
47
47
|
*/
|
|
48
48
|
export declare function chainIsLinea(chainId: number): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Determines whether a chain ID has a corresponding hub pool contract.
|
|
51
|
+
* @param chainId Chain ID to evaluate.
|
|
52
|
+
* @returns True if chain corresponding to chainId has a hub pool implementation.
|
|
53
|
+
*/
|
|
54
|
+
export declare function chainIsL1(chainId: number): boolean;
|
|
49
55
|
/**
|
|
50
56
|
* Determines whether a chain ID has the capacity for having its USDC bridged via CCTP.
|
|
51
57
|
* @param chainId Chain ID to evaluate.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CHAIN_IDs, MAINNET_CHAIN_IDs, PUBLIC_NETWORKS, TESTNET_CHAIN_IDs } from "../constants";
|
|
1
|
+
import { ChainFamily, CHAIN_IDs, MAINNET_CHAIN_IDs, PUBLIC_NETWORKS, TESTNET_CHAIN_IDs } from "../constants";
|
|
2
2
|
var hreNetworks = {
|
|
3
3
|
666: "Hardhat1",
|
|
4
4
|
1337: "Hardhat2",
|
|
@@ -52,18 +52,8 @@ export function chainIsMatic(chainId) {
|
|
|
52
52
|
* @returns True if chainId is an OP stack, otherwise false.
|
|
53
53
|
*/
|
|
54
54
|
export function chainIsOPStack(chainId) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
CHAIN_IDs.BASE,
|
|
58
|
-
CHAIN_IDs.BLAST,
|
|
59
|
-
CHAIN_IDs.LISK,
|
|
60
|
-
CHAIN_IDs.MODE,
|
|
61
|
-
CHAIN_IDs.OPTIMISM_SEPOLIA,
|
|
62
|
-
CHAIN_IDs.BASE_SEPOLIA,
|
|
63
|
-
CHAIN_IDs.BLAST_SEPOLIA,
|
|
64
|
-
CHAIN_IDs.LISK_SEPOLIA,
|
|
65
|
-
CHAIN_IDs.MODE_SEPOLIA,
|
|
66
|
-
].includes(chainId);
|
|
55
|
+
var _a, _b;
|
|
56
|
+
return (_b = ((_a = PUBLIC_NETWORKS[chainId]) === null || _a === void 0 ? void 0 : _a.family) === ChainFamily.OP_STACK) !== null && _b !== void 0 ? _b : false;
|
|
67
57
|
}
|
|
68
58
|
/**
|
|
69
59
|
* Determines whether a chain ID is an Arbitrum implementation.
|
|
@@ -81,6 +71,14 @@ export function chainIsArbitrum(chainId) {
|
|
|
81
71
|
export function chainIsLinea(chainId) {
|
|
82
72
|
return [CHAIN_IDs.LINEA].includes(chainId);
|
|
83
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Determines whether a chain ID has a corresponding hub pool contract.
|
|
76
|
+
* @param chainId Chain ID to evaluate.
|
|
77
|
+
* @returns True if chain corresponding to chainId has a hub pool implementation.
|
|
78
|
+
*/
|
|
79
|
+
export function chainIsL1(chainId) {
|
|
80
|
+
return [CHAIN_IDs.MAINNET, CHAIN_IDs.SEPOLIA].includes(chainId);
|
|
81
|
+
}
|
|
84
82
|
/**
|
|
85
83
|
* Determines whether a chain ID has the capacity for having its USDC bridged via CCTP.
|
|
86
84
|
* @param chainId Chain ID to evaluate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkUtils.js","sourceRoot":"","sources":["../../../src/utils/NetworkUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"NetworkUtils.js","sourceRoot":"","sources":["../../../src/utils/NetworkUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,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C,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAClE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,OAAO;QACL,WAAW;QACX,SAAS,CAAC,IAAI;QACd,SAAS,CAAC,QAAQ;QAClB,SAAS,CAAC,QAAQ;QAClB,SAAS,CAAC,OAAO;QACjB,WAAW;QACX,SAAS,CAAC,YAAY;QACtB,SAAS,CAAC,gBAAgB;QAC1B,SAAS,CAAC,gBAAgB;QAC1B,SAAS,CAAC,YAAY;KACvB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAAC,OAAe;IAC7D,OAAO,kBAAkB,CAAC,OAAO,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -29,6 +29,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
29
29
|
addresses: {
|
|
30
30
|
[x: number]: string;
|
|
31
31
|
};
|
|
32
|
+
coingeckoId: string;
|
|
32
33
|
};
|
|
33
34
|
ARB: {
|
|
34
35
|
name: string;
|
|
@@ -37,6 +38,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
37
38
|
addresses: {
|
|
38
39
|
[x: number]: string;
|
|
39
40
|
};
|
|
41
|
+
coingeckoId: string;
|
|
40
42
|
};
|
|
41
43
|
BAL: {
|
|
42
44
|
name: string;
|
|
@@ -45,6 +47,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
45
47
|
addresses: {
|
|
46
48
|
[x: number]: string;
|
|
47
49
|
};
|
|
50
|
+
coingeckoId: string;
|
|
48
51
|
};
|
|
49
52
|
BADGER: {
|
|
50
53
|
name: string;
|
|
@@ -53,6 +56,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
53
56
|
addresses: {
|
|
54
57
|
[x: number]: string;
|
|
55
58
|
};
|
|
59
|
+
coingeckoId: string;
|
|
56
60
|
};
|
|
57
61
|
BOBA: {
|
|
58
62
|
name: string;
|
|
@@ -61,6 +65,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
61
65
|
addresses: {
|
|
62
66
|
[x: number]: string;
|
|
63
67
|
};
|
|
68
|
+
coingeckoId: string;
|
|
64
69
|
};
|
|
65
70
|
DAI: {
|
|
66
71
|
name: string;
|
|
@@ -69,6 +74,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
69
74
|
addresses: {
|
|
70
75
|
[x: number]: string;
|
|
71
76
|
};
|
|
77
|
+
coingeckoId: string;
|
|
72
78
|
};
|
|
73
79
|
ETH: {
|
|
74
80
|
name: string;
|
|
@@ -77,6 +83,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
77
83
|
addresses: {
|
|
78
84
|
[x: number]: string;
|
|
79
85
|
};
|
|
86
|
+
coingeckoId: string;
|
|
80
87
|
};
|
|
81
88
|
LSK: {
|
|
82
89
|
name: string;
|
|
@@ -85,6 +92,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
85
92
|
addresses: {
|
|
86
93
|
[x: number]: string;
|
|
87
94
|
};
|
|
95
|
+
coingeckoId: string;
|
|
88
96
|
};
|
|
89
97
|
MATIC: {
|
|
90
98
|
name: string;
|
|
@@ -93,6 +101,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
93
101
|
addresses: {
|
|
94
102
|
[x: number]: string;
|
|
95
103
|
};
|
|
104
|
+
coingeckoId: string;
|
|
96
105
|
};
|
|
97
106
|
OP: {
|
|
98
107
|
name: string;
|
|
@@ -101,14 +110,23 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
101
110
|
addresses: {
|
|
102
111
|
[x: number]: string;
|
|
103
112
|
};
|
|
113
|
+
coingeckoId: string;
|
|
104
114
|
};
|
|
105
115
|
POOL: {
|
|
106
116
|
name: string;
|
|
107
117
|
symbol: string;
|
|
108
118
|
decimals: number;
|
|
119
|
+
/**
|
|
120
|
+
* Returns the contract address for a given token symbol and chainId.
|
|
121
|
+
* @param symbol A case-insensitive token symbol.
|
|
122
|
+
* @param chainId The chainId to resolve the contract address for.
|
|
123
|
+
* @param tokenMapping A parameter to determine where to source token information. Defaults to the constants variant.
|
|
124
|
+
* @returns The contract address for the given token symbol and chainId, or undefined if the token symbol is not supported.
|
|
125
|
+
*/
|
|
109
126
|
addresses: {
|
|
110
127
|
[x: number]: string;
|
|
111
128
|
};
|
|
129
|
+
coingeckoId: string;
|
|
112
130
|
};
|
|
113
131
|
SNX: {
|
|
114
132
|
name: string;
|
|
@@ -117,6 +135,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
117
135
|
addresses: {
|
|
118
136
|
[x: number]: string;
|
|
119
137
|
};
|
|
138
|
+
coingeckoId: string;
|
|
120
139
|
};
|
|
121
140
|
UMA: {
|
|
122
141
|
name: string;
|
|
@@ -125,6 +144,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
125
144
|
addresses: {
|
|
126
145
|
[x: number]: string;
|
|
127
146
|
};
|
|
147
|
+
coingeckoId: string;
|
|
128
148
|
};
|
|
129
149
|
USDB: {
|
|
130
150
|
name: string;
|
|
@@ -133,6 +153,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
133
153
|
addresses: {
|
|
134
154
|
[x: number]: string;
|
|
135
155
|
};
|
|
156
|
+
coingeckoId: string;
|
|
136
157
|
};
|
|
137
158
|
USDC: {
|
|
138
159
|
name: string;
|
|
@@ -141,6 +162,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
141
162
|
addresses: {
|
|
142
163
|
[x: number]: string;
|
|
143
164
|
};
|
|
165
|
+
coingeckoId: string;
|
|
144
166
|
};
|
|
145
167
|
"USDC.e": {
|
|
146
168
|
name: string;
|
|
@@ -149,6 +171,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
149
171
|
addresses: {
|
|
150
172
|
[x: number]: string;
|
|
151
173
|
};
|
|
174
|
+
coingeckoId: string;
|
|
152
175
|
};
|
|
153
176
|
USDbC: {
|
|
154
177
|
name: string;
|
|
@@ -157,6 +180,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
157
180
|
addresses: {
|
|
158
181
|
[x: number]: string;
|
|
159
182
|
};
|
|
183
|
+
coingeckoId: string;
|
|
160
184
|
};
|
|
161
185
|
USDT: {
|
|
162
186
|
name: string;
|
|
@@ -165,6 +189,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
165
189
|
addresses: {
|
|
166
190
|
[x: number]: string;
|
|
167
191
|
};
|
|
192
|
+
coingeckoId: string;
|
|
168
193
|
};
|
|
169
194
|
WBTC: {
|
|
170
195
|
name: string;
|
|
@@ -173,6 +198,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
173
198
|
addresses: {
|
|
174
199
|
[x: number]: string;
|
|
175
200
|
};
|
|
201
|
+
coingeckoId: string;
|
|
176
202
|
};
|
|
177
203
|
WETH: {
|
|
178
204
|
name: string;
|
|
@@ -181,6 +207,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
181
207
|
addresses: {
|
|
182
208
|
[x: number]: string;
|
|
183
209
|
};
|
|
210
|
+
coingeckoId: string;
|
|
184
211
|
};
|
|
185
212
|
WMATIC: {
|
|
186
213
|
name: string;
|
|
@@ -189,6 +216,7 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
189
216
|
addresses: {
|
|
190
217
|
[x: number]: string;
|
|
191
218
|
};
|
|
219
|
+
coingeckoId: string;
|
|
192
220
|
};
|
|
193
221
|
}) => string | undefined;
|
|
194
222
|
export declare function getTokenInformationFromAddress(address: string, tokenMapping?: {
|
|
@@ -199,6 +227,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
199
227
|
addresses: {
|
|
200
228
|
[x: number]: string;
|
|
201
229
|
};
|
|
230
|
+
coingeckoId: string;
|
|
202
231
|
};
|
|
203
232
|
ARB: {
|
|
204
233
|
name: string;
|
|
@@ -207,6 +236,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
207
236
|
addresses: {
|
|
208
237
|
[x: number]: string;
|
|
209
238
|
};
|
|
239
|
+
coingeckoId: string;
|
|
210
240
|
};
|
|
211
241
|
BAL: {
|
|
212
242
|
name: string;
|
|
@@ -215,6 +245,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
215
245
|
addresses: {
|
|
216
246
|
[x: number]: string;
|
|
217
247
|
};
|
|
248
|
+
coingeckoId: string;
|
|
218
249
|
};
|
|
219
250
|
BADGER: {
|
|
220
251
|
name: string;
|
|
@@ -223,6 +254,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
223
254
|
addresses: {
|
|
224
255
|
[x: number]: string;
|
|
225
256
|
};
|
|
257
|
+
coingeckoId: string;
|
|
226
258
|
};
|
|
227
259
|
BOBA: {
|
|
228
260
|
name: string;
|
|
@@ -231,6 +263,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
231
263
|
addresses: {
|
|
232
264
|
[x: number]: string;
|
|
233
265
|
};
|
|
266
|
+
coingeckoId: string;
|
|
234
267
|
};
|
|
235
268
|
DAI: {
|
|
236
269
|
name: string;
|
|
@@ -239,6 +272,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
239
272
|
addresses: {
|
|
240
273
|
[x: number]: string;
|
|
241
274
|
};
|
|
275
|
+
coingeckoId: string;
|
|
242
276
|
};
|
|
243
277
|
ETH: {
|
|
244
278
|
name: string;
|
|
@@ -247,6 +281,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
247
281
|
addresses: {
|
|
248
282
|
[x: number]: string;
|
|
249
283
|
};
|
|
284
|
+
coingeckoId: string;
|
|
250
285
|
};
|
|
251
286
|
LSK: {
|
|
252
287
|
name: string;
|
|
@@ -255,6 +290,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
255
290
|
addresses: {
|
|
256
291
|
[x: number]: string;
|
|
257
292
|
};
|
|
293
|
+
coingeckoId: string;
|
|
258
294
|
};
|
|
259
295
|
MATIC: {
|
|
260
296
|
name: string;
|
|
@@ -263,6 +299,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
263
299
|
addresses: {
|
|
264
300
|
[x: number]: string;
|
|
265
301
|
};
|
|
302
|
+
coingeckoId: string;
|
|
266
303
|
};
|
|
267
304
|
OP: {
|
|
268
305
|
name: string;
|
|
@@ -271,14 +308,23 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
271
308
|
addresses: {
|
|
272
309
|
[x: number]: string;
|
|
273
310
|
};
|
|
311
|
+
coingeckoId: string;
|
|
274
312
|
};
|
|
275
313
|
POOL: {
|
|
276
314
|
name: string;
|
|
277
315
|
symbol: string;
|
|
278
316
|
decimals: number;
|
|
317
|
+
/**
|
|
318
|
+
* Returns the contract address for a given token symbol and chainId.
|
|
319
|
+
* @param symbol A case-insensitive token symbol.
|
|
320
|
+
* @param chainId The chainId to resolve the contract address for.
|
|
321
|
+
* @param tokenMapping A parameter to determine where to source token information. Defaults to the constants variant.
|
|
322
|
+
* @returns The contract address for the given token symbol and chainId, or undefined if the token symbol is not supported.
|
|
323
|
+
*/
|
|
279
324
|
addresses: {
|
|
280
325
|
[x: number]: string;
|
|
281
326
|
};
|
|
327
|
+
coingeckoId: string;
|
|
282
328
|
};
|
|
283
329
|
SNX: {
|
|
284
330
|
name: string;
|
|
@@ -287,6 +333,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
287
333
|
addresses: {
|
|
288
334
|
[x: number]: string;
|
|
289
335
|
};
|
|
336
|
+
coingeckoId: string;
|
|
290
337
|
};
|
|
291
338
|
UMA: {
|
|
292
339
|
name: string;
|
|
@@ -295,6 +342,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
295
342
|
addresses: {
|
|
296
343
|
[x: number]: string;
|
|
297
344
|
};
|
|
345
|
+
coingeckoId: string;
|
|
298
346
|
};
|
|
299
347
|
USDB: {
|
|
300
348
|
name: string;
|
|
@@ -303,6 +351,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
303
351
|
addresses: {
|
|
304
352
|
[x: number]: string;
|
|
305
353
|
};
|
|
354
|
+
coingeckoId: string;
|
|
306
355
|
};
|
|
307
356
|
USDC: {
|
|
308
357
|
name: string;
|
|
@@ -311,6 +360,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
311
360
|
addresses: {
|
|
312
361
|
[x: number]: string;
|
|
313
362
|
};
|
|
363
|
+
coingeckoId: string;
|
|
314
364
|
};
|
|
315
365
|
"USDC.e": {
|
|
316
366
|
name: string;
|
|
@@ -319,6 +369,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
319
369
|
addresses: {
|
|
320
370
|
[x: number]: string;
|
|
321
371
|
};
|
|
372
|
+
coingeckoId: string;
|
|
322
373
|
};
|
|
323
374
|
USDbC: {
|
|
324
375
|
name: string;
|
|
@@ -327,6 +378,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
327
378
|
addresses: {
|
|
328
379
|
[x: number]: string;
|
|
329
380
|
};
|
|
381
|
+
coingeckoId: string;
|
|
330
382
|
};
|
|
331
383
|
USDT: {
|
|
332
384
|
name: string;
|
|
@@ -335,6 +387,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
335
387
|
addresses: {
|
|
336
388
|
[x: number]: string;
|
|
337
389
|
};
|
|
390
|
+
coingeckoId: string;
|
|
338
391
|
};
|
|
339
392
|
WBTC: {
|
|
340
393
|
name: string;
|
|
@@ -343,6 +396,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
343
396
|
addresses: {
|
|
344
397
|
[x: number]: string;
|
|
345
398
|
};
|
|
399
|
+
coingeckoId: string;
|
|
346
400
|
};
|
|
347
401
|
WETH: {
|
|
348
402
|
name: string;
|
|
@@ -351,6 +405,7 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
351
405
|
addresses: {
|
|
352
406
|
[x: number]: string;
|
|
353
407
|
};
|
|
408
|
+
coingeckoId: string;
|
|
354
409
|
};
|
|
355
410
|
WMATIC: {
|
|
356
411
|
name: string;
|
|
@@ -359,8 +414,10 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
359
414
|
addresses: {
|
|
360
415
|
[x: number]: string;
|
|
361
416
|
};
|
|
417
|
+
coingeckoId: string;
|
|
362
418
|
};
|
|
363
419
|
}): L1Token | undefined;
|
|
420
|
+
export declare function getCoingeckoTokenIdByAddress(contractAddress: string): string;
|
|
364
421
|
/**
|
|
365
422
|
* Retrieves the ERC20 balance for a given address and token address.
|
|
366
423
|
* @param address The address to retrieve the balance for.
|
|
@@ -370,4 +427,5 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
370
427
|
* @returns The balance of the given address for the given token address.
|
|
371
428
|
*/
|
|
372
429
|
export declare function getTokenBalance(address: string, tokenAddress: string, signerOrProvider: SignerOrProvider, blockTag?: BlockTag): Promise<BigNumber>;
|
|
430
|
+
export declare function isBridgedUsdc(tokenSymbol: string): boolean;
|
|
373
431
|
export {};
|