@curvefi/api 2.66.30 → 2.67.0

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 (94) hide show
  1. package/lib/boosting.d.ts +33 -32
  2. package/lib/boosting.js +320 -252
  3. package/lib/cached.d.ts +4 -3
  4. package/lib/cached.js +63 -19
  5. package/lib/constants/coins/hyperliquid.d.ts +2 -0
  6. package/lib/constants/coins/hyperliquid.js +5 -0
  7. package/lib/constants/coins/index.d.ts +2 -1
  8. package/lib/constants/coins/index.js +2 -1
  9. package/lib/constants/factory/crypto.d.ts +5 -0
  10. package/lib/constants/factory/crypto.js +8 -0
  11. package/lib/constants/factory/stable.js +3 -0
  12. package/lib/constants/network_constants.js +37 -11
  13. package/lib/constants/pools/hyperliquid.d.ts +2 -0
  14. package/lib/constants/pools/hyperliquid.js +2 -0
  15. package/lib/constants/pools/index.d.ts +2 -1
  16. package/lib/constants/pools/index.js +2 -1
  17. package/lib/constants/utils.d.ts +14 -1
  18. package/lib/constants/utils.js +21 -6
  19. package/lib/constants/volumeNetworks.js +1 -1
  20. package/lib/curve.d.ts +5 -5
  21. package/lib/curve.js +21 -38
  22. package/lib/dao.d.ts +32 -31
  23. package/lib/dao.js +420 -350
  24. package/lib/external-api.d.ts +1 -1
  25. package/lib/external-api.js +2 -2
  26. package/lib/factory/common.d.ts +2 -1
  27. package/lib/factory/common.js +1 -1
  28. package/lib/factory/deploy.d.ts +46 -45
  29. package/lib/factory/deploy.js +630 -551
  30. package/lib/factory/factory-api.d.ts +3 -2
  31. package/lib/factory/factory-api.js +22 -23
  32. package/lib/factory/factory-crypto.d.ts +1 -1
  33. package/lib/factory/factory-crypto.js +12 -15
  34. package/lib/factory/factory-tricrypto.d.ts +1 -1
  35. package/lib/factory/factory-tricrypto.js +14 -15
  36. package/lib/factory/factory-twocrypto.d.ts +1 -1
  37. package/lib/factory/factory-twocrypto.js +12 -13
  38. package/lib/factory/factory.d.ts +4 -3
  39. package/lib/factory/factory.js +21 -24
  40. package/lib/index.d.ts +413 -104
  41. package/lib/index.js +253 -257
  42. package/lib/interfaces.d.ts +2 -0
  43. package/lib/pools/PoolTemplate.d.ts +13 -12
  44. package/lib/pools/PoolTemplate.js +279 -285
  45. package/lib/pools/mixins/common.js +2 -2
  46. package/lib/pools/mixins/depositBalancedAmountsMixins.d.ts +12 -4
  47. package/lib/pools/mixins/depositBalancedAmountsMixins.js +1 -15
  48. package/lib/pools/mixins/depositMixins.d.ts +25 -5
  49. package/lib/pools/mixins/depositMixins.js +38 -76
  50. package/lib/pools/mixins/depositWrappedMixins.d.ts +10 -2
  51. package/lib/pools/mixins/depositWrappedMixins.js +17 -33
  52. package/lib/pools/mixins/poolBalancesMixin.d.ts +6 -2
  53. package/lib/pools/mixins/poolBalancesMixin.js +3 -5
  54. package/lib/pools/mixins/swapMixins.d.ts +20 -4
  55. package/lib/pools/mixins/swapMixins.js +36 -70
  56. package/lib/pools/mixins/swapWrappedMixins.d.ts +19 -4
  57. package/lib/pools/mixins/swapWrappedMixins.js +32 -60
  58. package/lib/pools/mixins/withdrawExpectedMixins.d.ts +12 -4
  59. package/lib/pools/mixins/withdrawExpectedMixins.js +6 -11
  60. package/lib/pools/mixins/withdrawImbalanceMixins.d.ts +20 -4
  61. package/lib/pools/mixins/withdrawImbalanceMixins.js +26 -53
  62. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.d.ts +10 -2
  63. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +12 -27
  64. package/lib/pools/mixins/withdrawMixins.d.ts +25 -5
  65. package/lib/pools/mixins/withdrawMixins.js +33 -67
  66. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.d.ts +12 -4
  67. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +8 -13
  68. package/lib/pools/mixins/withdrawOneCoinMixins.d.ts +25 -5
  69. package/lib/pools/mixins/withdrawOneCoinMixins.js +32 -66
  70. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.d.ts +6 -2
  71. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +4 -7
  72. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.d.ts +10 -2
  73. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +13 -29
  74. package/lib/pools/mixins/withdrawWrappedMixins.d.ts +10 -2
  75. package/lib/pools/mixins/withdrawWrappedMixins.js +14 -28
  76. package/lib/pools/poolConstructor.d.ts +2 -1
  77. package/lib/pools/poolConstructor.js +27 -28
  78. package/lib/pools/subClasses/corePool.d.ts +4 -1
  79. package/lib/pools/subClasses/corePool.js +5 -7
  80. package/lib/pools/subClasses/gaugePool.d.ts +5 -3
  81. package/lib/pools/subClasses/gaugePool.js +19 -18
  82. package/lib/pools/subClasses/statsPool.d.ts +2 -0
  83. package/lib/pools/subClasses/statsPool.js +22 -10
  84. package/lib/pools/subClasses/walletPool.d.ts +2 -1
  85. package/lib/pools/subClasses/walletPool.js +6 -6
  86. package/lib/pools/utils.d.ts +7 -6
  87. package/lib/pools/utils.js +316 -297
  88. package/lib/route-graph.worker.d.ts +2 -2
  89. package/lib/route-graph.worker.js +4 -6
  90. package/lib/router.d.ts +12 -11
  91. package/lib/router.js +331 -295
  92. package/lib/utils.d.ts +34 -33
  93. package/lib/utils.js +483 -435
  94. package/package.json +2 -2
package/lib/cached.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { IDict, IExtendedPoolDataFromApi, INetworkName, IPoolType } from "./interfaces.js";
2
2
  export declare const _getPoolsFromApi: (network: INetworkName, poolType: IPoolType, isLiteChain?: boolean) => Promise<IExtendedPoolDataFromApi>;
3
- export declare const _getAllPoolsFromApi: (network: INetworkName, isLiteChain?: boolean) => Promise<IExtendedPoolDataFromApi[]>;
4
- export declare const _getUsdPricesFromApi: () => Promise<IDict<number>>;
5
- export declare const _getCrvApyFromApi: () => Promise<IDict<[number, number]>>;
3
+ export declare const _setPoolsFromApi: (network: INetworkName, isLiteChain: boolean, data: Record<IPoolType, IExtendedPoolDataFromApi>) => void;
4
+ export declare const _getAllPoolsFromApi: (network: INetworkName, isLiteChain: boolean) => Promise<IExtendedPoolDataFromApi[]>;
5
+ export declare const _getUsdPricesFromApi: (network: INetworkName, isLiteChain: boolean) => Promise<IDict<number>>;
6
+ export declare const _getCrvApyFromApi: (network: INetworkName, isLiteChain: boolean) => Promise<IDict<[number, number]>>;
package/lib/cached.js CHANGED
@@ -7,39 +7,83 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import memoize from "memoizee";
11
- import { uncached_getAllPoolsFromApi, createCrvApyDict, createUsdPricesDict } from './external-api.js';
12
- import { curve } from "./curve";
10
+ import { createCrvApyDict, createUsdPricesDict, uncached_getAllPoolsFromApi } from './external-api.js';
13
11
  /**
14
- * This function is used to cache the data fetched from the API and the data derived from it.
15
- * Note: do not expose this function to the outside world, instead encapsulate it in a function that returns the data you need.
12
+ * Memoizes a function that returns a promise.
13
+ * Custom function instead of `memoizee` because we want to be able to set the cache manually based on server data.
14
+ * @param fn The function that returns a promise and will be memoized
15
+ * @param maxAge The maximum age of the cache in milliseconds
16
+ * @param createKey A function that creates a key for the cache based on the arguments passed to the function
17
+ * @returns A memoized `fn` function that includes a `set` method to set the cache manually
16
18
  */
17
- const _getCachedData = memoize((network, isLiteChain) => __awaiter(void 0, void 0, void 0, function* () {
18
- const poolsDict = yield uncached_getAllPoolsFromApi(network, isLiteChain);
19
+ const memoize = (fn, { maxAge, createKey = (list) => list.toString(), }) => {
20
+ const cache = {};
21
+ const timeouts = {};
22
+ const setCache = (key, promise) => {
23
+ if (promise) {
24
+ cache[key] = promise;
25
+ }
26
+ else if (key in cache) {
27
+ delete cache[key];
28
+ }
29
+ if (key in timeouts) {
30
+ clearTimeout(timeouts[key]);
31
+ delete timeouts[key];
32
+ }
33
+ };
34
+ const scheduleCleanup = (key) => timeouts[key] = setTimeout(() => {
35
+ delete timeouts[key];
36
+ delete cache[key];
37
+ }, maxAge);
38
+ const cachedFn = (...args) => __awaiter(void 0, void 0, void 0, function* () {
39
+ const key = createKey(args);
40
+ if (key in cache) {
41
+ return cache[key];
42
+ }
43
+ const promise = fn(...args);
44
+ setCache(key, promise);
45
+ try {
46
+ const result = yield promise;
47
+ scheduleCleanup(key);
48
+ return result;
49
+ }
50
+ catch (e) {
51
+ delete cache[key];
52
+ throw e;
53
+ }
54
+ });
55
+ cachedFn.set = (result, ...args) => {
56
+ const key = createKey(args);
57
+ setCache(key, Promise.resolve(result));
58
+ scheduleCleanup(key);
59
+ };
60
+ return cachedFn;
61
+ };
62
+ const createCache = (poolsDict) => {
19
63
  const poolLists = Object.values(poolsDict);
20
64
  const usdPrices = createUsdPricesDict(poolLists);
21
65
  const crvApy = createCrvApyDict(poolLists);
22
66
  return { poolsDict, poolLists, usdPrices, crvApy };
23
- }), {
24
- promise: true,
25
- maxAge: 5 * 60 * 1000, // 5m
26
- primitive: true,
27
- });
67
+ };
68
+ /**
69
+ * This function is used to cache the data fetched from the API and the data derived from it.
70
+ * Note: do not expose this function to the outside world, instead encapsulate it in a function that returns the data you need.
71
+ */
72
+ const _getCachedData = memoize((network, isLiteChain) => __awaiter(void 0, void 0, void 0, function* () { return createCache(yield uncached_getAllPoolsFromApi(network, isLiteChain)); }), { maxAge: 1000 * 60 * 5 /* 5 minutes */ });
28
73
  export const _getPoolsFromApi = (network_1, poolType_1, ...args_1) => __awaiter(void 0, [network_1, poolType_1, ...args_1], void 0, function* (network, poolType, isLiteChain = false) {
29
74
  const { poolsDict } = yield _getCachedData(network, isLiteChain);
30
75
  return poolsDict[poolType];
31
76
  });
32
- export const _getAllPoolsFromApi = (network_1, ...args_1) => __awaiter(void 0, [network_1, ...args_1], void 0, function* (network, isLiteChain = false) {
77
+ export const _setPoolsFromApi = (network, isLiteChain, data) => _getCachedData.set(createCache(data), network, isLiteChain);
78
+ export const _getAllPoolsFromApi = (network, isLiteChain) => __awaiter(void 0, void 0, void 0, function* () {
33
79
  const { poolLists } = yield _getCachedData(network, isLiteChain);
34
80
  return poolLists;
35
81
  });
36
- export const _getUsdPricesFromApi = () => __awaiter(void 0, void 0, void 0, function* () {
37
- const network = curve.constants.NETWORK_NAME;
38
- const { usdPrices } = yield _getCachedData(network, curve.isLiteChain);
82
+ export const _getUsdPricesFromApi = (network, isLiteChain) => __awaiter(void 0, void 0, void 0, function* () {
83
+ const { usdPrices } = yield _getCachedData(network, isLiteChain);
39
84
  return usdPrices;
40
85
  });
41
- export const _getCrvApyFromApi = () => __awaiter(void 0, void 0, void 0, function* () {
42
- const network = curve.constants.NETWORK_NAME;
43
- const { crvApy } = yield _getCachedData(network, curve.isLiteChain);
86
+ export const _getCrvApyFromApi = (network, isLiteChain) => __awaiter(void 0, void 0, void 0, function* () {
87
+ const { crvApy } = yield _getCachedData(network, isLiteChain);
44
88
  return crvApy;
45
89
  });
@@ -0,0 +1,2 @@
1
+ import { IDict } from "../../interfaces.js";
2
+ export declare const COINS_HYPERLIQUID: IDict<string>;
@@ -0,0 +1,5 @@
1
+ import { lowerCaseValues } from "../utils.js";
2
+ export const COINS_HYPERLIQUID = lowerCaseValues({
3
+ crv: '0x5af79133999f7908953e94b7a5cf367740ebee35',
4
+ s: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
5
+ });
@@ -16,4 +16,5 @@ import { COINS_FRAXTAL } from "./fraxtal.js";
16
16
  import { COINS_XLAYER } from "./xlayer.js";
17
17
  import { COINS_MANTLE } from "./mantle.js";
18
18
  import { COINS_SONIC } from "./sonic.js";
19
- export { COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum, COINS_POLYGON, aTokensPolygon, COINS_FANTOM, cTokensFantom, aTokensFantom, COINS_AVALANCHE, aTokensAvalanche, COINS_ARBITRUM, COINS_OPTIMISM, COINS_XDAI, COINS_MOONBEAM, COINS_AURORA, COINS_KAVA, COINS_CELO, COINS_ZKSYNC, COINS_BASE, COINS_BSC, COINS_FRAXTAL, COINS_XLAYER, COINS_MANTLE, COINS_SONIC, };
19
+ import { COINS_HYPERLIQUID } from "./hyperliquid.js";
20
+ export { COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum, COINS_POLYGON, aTokensPolygon, COINS_FANTOM, cTokensFantom, aTokensFantom, COINS_AVALANCHE, aTokensAvalanche, COINS_ARBITRUM, COINS_OPTIMISM, COINS_XDAI, COINS_MOONBEAM, COINS_AURORA, COINS_KAVA, COINS_CELO, COINS_ZKSYNC, COINS_BASE, COINS_BSC, COINS_FRAXTAL, COINS_XLAYER, COINS_MANTLE, COINS_SONIC, COINS_HYPERLIQUID, };
@@ -16,4 +16,5 @@ import { COINS_FRAXTAL } from "./fraxtal.js";
16
16
  import { COINS_XLAYER } from "./xlayer.js";
17
17
  import { COINS_MANTLE } from "./mantle.js";
18
18
  import { COINS_SONIC } from "./sonic.js";
19
- export { COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum, COINS_POLYGON, aTokensPolygon, COINS_FANTOM, cTokensFantom, aTokensFantom, COINS_AVALANCHE, aTokensAvalanche, COINS_ARBITRUM, COINS_OPTIMISM, COINS_XDAI, COINS_MOONBEAM, COINS_AURORA, COINS_KAVA, COINS_CELO, COINS_ZKSYNC, COINS_BASE, COINS_BSC, COINS_FRAXTAL, COINS_XLAYER, COINS_MANTLE, COINS_SONIC, };
19
+ import { COINS_HYPERLIQUID } from "./hyperliquid.js";
20
+ export { COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum, COINS_POLYGON, aTokensPolygon, COINS_FANTOM, cTokensFantom, aTokensFantom, COINS_AVALANCHE, aTokensAvalanche, COINS_ARBITRUM, COINS_OPTIMISM, COINS_XDAI, COINS_MOONBEAM, COINS_AURORA, COINS_KAVA, COINS_CELO, COINS_ZKSYNC, COINS_BASE, COINS_BSC, COINS_FRAXTAL, COINS_XLAYER, COINS_MANTLE, COINS_SONIC, COINS_HYPERLIQUID, };
@@ -60,6 +60,11 @@ export declare const tricryptoDeployImplementations: {
60
60
  amm_native_transfers_enabled: string;
61
61
  implementationIdx: number;
62
62
  };
63
+ 999: {
64
+ amm_native_transfers_disabled: string;
65
+ amm_native_transfers_enabled: string;
66
+ implementationIdx: number;
67
+ };
63
68
  1284: {
64
69
  amm_native_transfers_disabled: string;
65
70
  amm_native_transfers_enabled: string;
@@ -77,6 +77,11 @@ export const tricryptoDeployImplementations = {
77
77
  amm_native_transfers_enabled: '0x18d01726FeDaBd91579A9368DFB2F8A24f905280'.toLowerCase(),
78
78
  implementationIdx: 0,
79
79
  },
80
+ 999: {
81
+ amm_native_transfers_disabled: '0x635742dCC8313DCf8c904206037d962c042EAfBd'.toLowerCase(), // 1
82
+ amm_native_transfers_enabled: '0x0000000000000000000000000000000000000000'.toLowerCase(), // 0
83
+ implementationIdx: 1,
84
+ },
80
85
  1284: {
81
86
  amm_native_transfers_disabled: '0x0000000000000000000000000000000000000000'.toLowerCase(),
82
87
  amm_native_transfers_enabled: '0x0000000000000000000000000000000000000000'.toLowerCase(),
@@ -153,6 +158,9 @@ export const CRYPTO_FACTORY_CONSTANTS = {
153
158
  324: {
154
159
  tricryptoDeployImplementations: tricryptoDeployImplementations[324],
155
160
  },
161
+ 999: {
162
+ tricryptoDeployImplementations: tricryptoDeployImplementations[999],
163
+ },
156
164
  1284: {
157
165
  tricryptoDeployImplementations: tricryptoDeployImplementations[1284],
158
166
  },
@@ -395,6 +395,9 @@ export const STABLE_FACTORY_CONSTANTS = {
395
395
  324: {
396
396
  stableNgBasePoolZap: stableNgBasePoolZap,
397
397
  },
398
+ 999: {
399
+ stableNgBasePoolZap: stableNgBasePoolZap,
400
+ },
398
401
  1284: {
399
402
  implementationABIDict: implementationABIDictMoonbeam,
400
403
  },
@@ -1,6 +1,6 @@
1
1
  import { lowerCaseValues } from "./utils.js";
2
- import { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, POOLS_DATA_FRAXTAL, POOLS_DATA_XLAYER, POOLS_DATA_MANTLE, POOLS_DATA_SONIC, } from './pools/index.js';
3
- import { COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum, COINS_OPTIMISM, COINS_POLYGON, aTokensPolygon, COINS_FANTOM, cTokensFantom, aTokensFantom, COINS_AVALANCHE, aTokensAvalanche, COINS_ARBITRUM, COINS_XDAI, COINS_MOONBEAM, COINS_AURORA, COINS_KAVA, COINS_CELO, COINS_ZKSYNC, COINS_BASE, COINS_BSC, COINS_FRAXTAL, COINS_XLAYER, COINS_MANTLE, COINS_SONIC, } from "./coins/index.js";
2
+ import { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, POOLS_DATA_FRAXTAL, POOLS_DATA_XLAYER, POOLS_DATA_MANTLE, POOLS_DATA_SONIC, POOLS_DATA_HYPERLIQUID, } from './pools/index.js';
3
+ import { COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum, COINS_OPTIMISM, COINS_POLYGON, aTokensPolygon, COINS_FANTOM, cTokensFantom, aTokensFantom, COINS_AVALANCHE, aTokensAvalanche, COINS_ARBITRUM, COINS_XDAI, COINS_MOONBEAM, COINS_AURORA, COINS_KAVA, COINS_CELO, COINS_ZKSYNC, COINS_BASE, COINS_BSC, COINS_FRAXTAL, COINS_XLAYER, COINS_MANTLE, COINS_SONIC, COINS_HYPERLIQUID, } from "./coins/index.js";
4
4
  const ALIASES_ETHEREUM = lowerCaseValues({
5
5
  "crv": "0xD533a949740bb3306d119CC777fa900bA034cd52", // <--- CHANGE
6
6
  "minter": '0xd061D61a4d941c39E5453435B6345Dc261C2fcE0', // <--- RECOVERED
@@ -306,18 +306,32 @@ const ALIASES_MANTLE = lowerCaseValues({
306
306
  "factory_admin": '0x0000000000000000000000000000000000000000',
307
307
  });
308
308
  const ALIASES_SONIC = lowerCaseValues({
309
- "crv": "0x5af79133999f7908953e94b7a5cf367740ebee35", //
310
- "child_gauge_factory": "0xf3A431008396df8A8b2DF492C913706BDB0874ef", //
309
+ "crv": "0x5af79133999f7908953e94b7a5cf367740ebee35",
310
+ "child_gauge_factory": "0xf3A431008396df8A8b2DF492C913706BDB0874ef",
311
311
  "voting_escrow": "0x0000000000000000000000000000000000000000",
312
312
  "fee_distributor": "0x0000000000000000000000000000000000000000",
313
313
  "gauge_controller": "0x0000000000000000000000000000000000000000",
314
- "address_provider": "0x87FE17697D0f14A222e8bEf386a0860eCffDD617", //
315
- "router": "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", //
316
- "deposit_and_stake": "0x505d666E4DD174DcDD7FA090ed95554486d2Be44", //
317
- "stable_ng_factory": '0x7C2085419BE6a04f4ad88ea91bC9F5C6E6C463D8', //
318
- "twocrypto_factory": '0x1A83348F9cCFD3Fe1A8C0adBa580Ac4e267Fe495', //
319
- "tricrypto_factory": '0x635742dCC8313DCf8c904206037d962c042EAfBd', //
320
- "factory_admin": '0x0000000000000000000000000000000000000000', //
314
+ "address_provider": "0x87FE17697D0f14A222e8bEf386a0860eCffDD617",
315
+ "router": "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E",
316
+ "deposit_and_stake": "0x505d666E4DD174DcDD7FA090ed95554486d2Be44",
317
+ "stable_ng_factory": '0x7C2085419BE6a04f4ad88ea91bC9F5C6E6C463D8',
318
+ "twocrypto_factory": '0x1A83348F9cCFD3Fe1A8C0adBa580Ac4e267Fe495',
319
+ "tricrypto_factory": '0x635742dCC8313DCf8c904206037d962c042EAfBd',
320
+ "factory_admin": '0x0000000000000000000000000000000000000000',
321
+ });
322
+ const ALIASES_HYPERLIQUID = lowerCaseValues({
323
+ "crv": "0x0000000000000000000000000000000000000000", //
324
+ "child_gauge_factory": "0x8b3EFBEfa6eD222077455d6f0DCdA3bF4f3F57A6", //
325
+ "voting_escrow": "0x0000000000000000000000000000000000000000",
326
+ "fee_distributor": "0x0000000000000000000000000000000000000000",
327
+ "gauge_controller": "0x0000000000000000000000000000000000000000",
328
+ "address_provider": "0x87FE17697D0f14A222e8bEf386a0860eCffDD617",
329
+ "router": "0xd2002373543Ce3527023C75e7518C274A51ce712", //
330
+ "deposit_and_stake": "0x5a8C93EE12a8Df4455BA111647AdA41f29D5CfcC", //
331
+ "stable_ng_factory": '0x604388Bb1159AFd21eB5191cE22b4DeCdEE2Ae22', //
332
+ "twocrypto_factory": '0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F', //
333
+ "tricrypto_factory": '0x5702BDB1Ec244704E3cBBaAE11a0275aE5b07499', //
334
+ "factory_admin": '0x0000000000000000000000000000000000000000',
321
335
  });
322
336
  export const NETWORK_CONSTANTS = {
323
337
  1: {
@@ -448,6 +462,18 @@ export const NETWORK_CONSTANTS = {
448
462
  wrappedAddress: '0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91'.toLowerCase(),
449
463
  },
450
464
  },
465
+ 999: {
466
+ NAME: 'hyperliquid',
467
+ ALIASES: ALIASES_HYPERLIQUID,
468
+ POOLS_DATA: POOLS_DATA_HYPERLIQUID,
469
+ COINS: COINS_HYPERLIQUID,
470
+ NATIVE_COIN: {
471
+ symbol: 'HYPE',
472
+ wrappedSymbol: 'WHYPE',
473
+ address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
474
+ wrappedAddress: '0x5555555555555555555555555555555555555555'.toLowerCase(),
475
+ },
476
+ },
451
477
  1284: {
452
478
  NAME: 'moonbeam',
453
479
  ALIASES: ALIASES_MOONBEAM,
@@ -0,0 +1,2 @@
1
+ import { IPoolData, IDict } from "../../interfaces.js";
2
+ export declare const POOLS_DATA_HYPERLIQUID: IDict<IPoolData>;
@@ -0,0 +1,2 @@
1
+ import { lowerCasePoolDataAddresses } from "../utils.js";
2
+ export const POOLS_DATA_HYPERLIQUID = lowerCasePoolDataAddresses({});
@@ -17,4 +17,5 @@ import { POOLS_DATA_FRAXTAL } from "./fraxtal.js";
17
17
  import { POOLS_DATA_XLAYER } from "./xlayer.js";
18
18
  import { POOLS_DATA_MANTLE } from "./mantle.js";
19
19
  import { POOLS_DATA_SONIC } from "./sonic.js";
20
- export { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, POOLS_DATA_FRAXTAL, POOLS_DATA_XLAYER, POOLS_DATA_MANTLE, POOLS_DATA_SONIC, };
20
+ import { POOLS_DATA_HYPERLIQUID } from "./hyperliquid.js";
21
+ export { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, POOLS_DATA_FRAXTAL, POOLS_DATA_XLAYER, POOLS_DATA_MANTLE, POOLS_DATA_SONIC, POOLS_DATA_HYPERLIQUID, };
@@ -17,4 +17,5 @@ import { POOLS_DATA_FRAXTAL } from "./fraxtal.js";
17
17
  import { POOLS_DATA_XLAYER } from "./xlayer.js";
18
18
  import { POOLS_DATA_MANTLE } from "./mantle.js";
19
19
  import { POOLS_DATA_SONIC } from "./sonic.js";
20
- export { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, POOLS_DATA_FRAXTAL, POOLS_DATA_XLAYER, POOLS_DATA_MANTLE, POOLS_DATA_SONIC, };
20
+ import { POOLS_DATA_HYPERLIQUID } from "./hyperliquid.js";
21
+ export { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, POOLS_DATA_FRAXTAL, POOLS_DATA_XLAYER, POOLS_DATA_MANTLE, POOLS_DATA_SONIC, POOLS_DATA_HYPERLIQUID, };
@@ -1,6 +1,19 @@
1
1
  import { IDict, IPoolData } from "../interfaces.js";
2
+ import { BigNumberish, Numeric } from "ethers";
3
+ import { Curve } from "../curve";
4
+ export declare const formatUnits: (value: BigNumberish, unit?: string | Numeric) => string;
5
+ export declare const parseUnits: (value: string, unit?: string | Numeric) => bigint;
2
6
  export declare const lowerCasePoolDataAddresses: (poolsData: IDict<IPoolData>) => IDict<IPoolData>;
3
7
  export declare const extractDecimals: (poolsData: IDict<IPoolData>) => IDict<number>;
4
- export declare const extractGauges: (poolsData: IDict<IPoolData>) => string[];
8
+ export declare function extractGauges(this: Curve, poolsData: IDict<IPoolData>): string[];
5
9
  export declare const lowerCaseValues: (dict: IDict<string>) => IDict<string>;
6
10
  export declare const lowerCaseKeys: (dict: IDict<any>) => IDict<any>;
11
+ /**
12
+ * Memoizes a method of an object by binding it to this when needed.
13
+ * The memoized method will cache the result for 5 minutes.
14
+ * @param obj The object to which the method belongs.
15
+ * @param name The name of the method to memoize. It must be unique within the object.
16
+ * @param method The method to memoize. It must be a function that returns a Promise.
17
+ * @returns The memoized method.
18
+ */
19
+ export declare const memoizeMethod: <Obj extends object, Method extends (this: Obj, ...params: any[]) => Promise<unknown>>(obj: Obj, name: string, method: Method) => Method;
@@ -1,4 +1,7 @@
1
- import { curve } from "../curve.js";
1
+ import { ethers } from "ethers";
2
+ import memoize from "memoizee";
3
+ export const formatUnits = (value, unit) => ethers.formatUnits(value, unit);
4
+ export const parseUnits = (value, unit) => ethers.parseUnits(value, unit);
2
5
  export const lowerCasePoolDataAddresses = (poolsData) => {
3
6
  for (const poolId in poolsData) {
4
7
  if (!Object.prototype.hasOwnProperty.call(poolsData, poolId))
@@ -37,20 +40,32 @@ export const extractDecimals = (poolsData) => {
37
40
  }
38
41
  return DECIMALS;
39
42
  };
40
- export const extractGauges = (poolsData) => {
43
+ export function extractGauges(poolsData) {
41
44
  const GAUGES = [];
42
45
  for (const poolData of Object.values(poolsData)) {
43
- if (poolData.gauge_address === curve.constants.ZERO_ADDRESS)
46
+ if (poolData.gauge_address === this.constants.ZERO_ADDRESS)
44
47
  continue;
45
48
  GAUGES.push(poolData.gauge_address);
46
49
  }
47
50
  return GAUGES;
48
- };
51
+ }
49
52
  export const lowerCaseValues = (dict) => {
50
- // @ts-ignore
51
53
  return Object.fromEntries(Object.entries(dict).map((entry) => [entry[0], entry[1].toLowerCase()]));
52
54
  };
53
55
  export const lowerCaseKeys = (dict) => {
54
- // @ts-ignore
55
56
  return Object.fromEntries(Object.entries(dict).map((entry) => [entry[0].toLowerCase(), entry[1]]));
56
57
  };
58
+ /**
59
+ * Memoizes a method of an object by binding it to this when needed.
60
+ * The memoized method will cache the result for 5 minutes.
61
+ * @param obj The object to which the method belongs.
62
+ * @param name The name of the method to memoize. It must be unique within the object.
63
+ * @param method The method to memoize. It must be a function that returns a Promise.
64
+ * @returns The memoized method.
65
+ */
66
+ export const memoizeMethod = (obj, name, method) => {
67
+ if (!(name in obj)) {
68
+ obj[name] = memoize(method.bind(obj), { promise: true, maxAge: 5 * 60 * 1000 /* 5m */ });
69
+ }
70
+ return obj[name];
71
+ };
@@ -1,5 +1,5 @@
1
1
  export const volumeNetworks = {
2
- getVolumes: [1, 10, 100, 137, 250, 252, 8453, 42161, 146],
2
+ getVolumes: [1, 10, 100, 137, 250, 252, 999, 8453, 42161, 146],
3
3
  getSubgraphData: [43114],
4
4
  getFactoryAPYs: [56, 196, 324, 1284, 2222, 5000, 42220, 1313161554],
5
5
  };
package/lib/curve.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ethers, Contract, Networkish, BigNumberish, Numeric, BrowserProvider, JsonRpcProvider, Signer } from "ethers";
2
- import { Provider as MulticallProvider, Contract as MulticallContract } from "@curvefi/ethcall";
3
- import { IPoolData, IDict, ICurve, IChainId, IFactoryPoolType, Abi, INetworkConstants } from "./interfaces";
1
+ import { BigNumberish, BrowserProvider, Contract, ethers, JsonRpcProvider, Networkish, Numeric, Signer } from "ethers";
2
+ import { Contract as MulticallContract, Provider as MulticallProvider } from "@curvefi/ethcall";
3
+ import { IPoolData, IDict, ICurve, IChainId, IFactoryPoolType, Abi, INetworkConstants, IPoolType, IExtendedPoolDataFromApi } from "./interfaces";
4
4
  export declare const OLD_CHAINS: number[];
5
5
  export declare const memoizedContract: () => (address: string, abi: any, provider: BrowserProvider | JsonRpcProvider | Signer) => Contract;
6
6
  export declare const memoizedMulticallContract: () => (address: string, abi: any) => MulticallContract;
@@ -9,7 +9,7 @@ export type ContractItem = {
9
9
  multicallContract: MulticallContract;
10
10
  abi: Abi;
11
11
  };
12
- declare class Curve implements ICurve {
12
+ export declare class Curve implements ICurve {
13
13
  provider: ethers.BrowserProvider | ethers.JsonRpcProvider;
14
14
  isNoRPC: boolean;
15
15
  multicallProvider: MulticallProvider;
@@ -50,6 +50,7 @@ declare class Curve implements ICurve {
50
50
  maxFeePerGas?: number;
51
51
  maxPriorityFeePerGas?: number;
52
52
  chainId?: number;
53
+ poolsData?: Record<IPoolType, IExtendedPoolDataFromApi>;
53
54
  }): Promise<void>;
54
55
  initContract: (address: string, abi: any, provider: BrowserProvider | JsonRpcProvider | Signer) => Contract;
55
56
  initMulticallContract: (address: string, abi: any) => MulticallContract;
@@ -96,4 +97,3 @@ declare class Curve implements ICurve {
96
97
  getIsLiteChain: () => boolean;
97
98
  }
98
99
  export declare const curve: Curve;
99
- export {};
package/lib/curve.js CHANGED
@@ -7,10 +7,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { ethers, Contract, AbstractProvider, } from "ethers";
11
- import { Provider as MulticallProvider, Contract as MulticallContract } from "@curvefi/ethcall";
10
+ import { AbstractProvider, Contract, ethers, } from "ethers";
11
+ import { Contract as MulticallContract, Provider as MulticallProvider } from "@curvefi/ethcall";
12
12
  import { NETWORK_CONSTANTS } from "./constants/network_constants.js";
13
- import { STABLE_FACTORY_CONSTANTS, CRYPTO_FACTORY_CONSTANTS } from "./constants/factory/index.js";
13
+ import { CRYPTO_FACTORY_CONSTANTS, STABLE_FACTORY_CONSTANTS } from "./constants/factory/index.js";
14
14
  import { getFactoryPoolData } from "./factory/factory.js";
15
15
  import { getFactoryPoolsDataFromApi } from "./factory/factory-api.js";
16
16
  import { getCryptoFactoryPoolData } from "./factory/factory-crypto.js";
@@ -47,12 +47,13 @@ import gasOracleABI from './constants/abis/gas_oracle_optimism.json' with { type
47
47
  import gasOracleBlobABI from './constants/abis/gas_oracle_optimism_blob.json' with { type: 'json' };
48
48
  import votingProposalABI from './constants/abis/voting_proposal.json' with { type: 'json' };
49
49
  import circulatingSupplyABI from './constants/abis/circulating_supply.json' with { type: 'json' };
50
- import rootGaugeFactoryABI from "./constants/abis/gauge_factory/root_gauge_factory.json" with { type: 'json' };
51
- import { lowerCasePoolDataAddresses, extractDecimals, extractGauges } from "./constants/utils.js";
50
+ import rootGaugeFactoryABI from "./constants/abis/gauge_factory/root_gauge_factory.json" with { type: "json" };
51
+ import { extractDecimals, extractGauges, formatUnits, lowerCasePoolDataAddresses, parseUnits, } from "./constants/utils.js";
52
52
  import { _getHiddenPools } from "./external-api.js";
53
53
  import { L2Networks } from "./constants/L2Networks.js";
54
54
  import { getTwocryptoFactoryPoolData } from "./factory/factory-twocrypto.js";
55
55
  import { getNetworkConstants } from "./utils.js";
56
+ import { _setPoolsFromApi } from "./cached";
56
57
  export const OLD_CHAINS = [1, 10, 56, 100, 137, 250, 1284, 2222, 8453, 42161, 42220, 43114, 1313161554]; // these chains have non-ng pools
57
58
  export const memoizedContract = () => {
58
59
  const cache = {};
@@ -80,7 +81,7 @@ export const memoizedMulticallContract = () => {
80
81
  }
81
82
  };
82
83
  };
83
- class Curve {
84
+ export class Curve {
84
85
  constructor() {
85
86
  this.initContract = memoizedContract();
86
87
  this.initMulticallContract = memoizedMulticallContract();
@@ -322,15 +323,12 @@ class Curve {
322
323
  this.getIsLiteChain = () => {
323
324
  return this.isLiteChain;
324
325
  };
325
- // @ts-ignore
326
326
  this.provider = null;
327
- // @ts-ignore
328
327
  this.signer = null;
329
328
  this.isNoRPC = false;
330
329
  this.signerAddress = '';
331
330
  this.chainId = 1;
332
331
  this.isLiteChain = false;
333
- // @ts-ignore
334
332
  this.multicallProvider = null;
335
333
  this.contracts = {};
336
334
  this.feeData = {};
@@ -363,14 +361,11 @@ class Curve {
363
361
  return __awaiter(this, arguments, void 0, function* (providerType, providerSettings, options = {} // gasPrice in Gwei
364
362
  ) {
365
363
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
366
- // @ts-ignore
367
364
  this.provider = null;
368
- // @ts-ignore
369
365
  this.signer = null;
370
366
  this.isNoRPC = false;
371
367
  this.signerAddress = '';
372
368
  this.chainId = 1;
373
- // @ts-ignore
374
369
  this.multicallProvider = null;
375
370
  this.contracts = {};
376
371
  this.feeData = {};
@@ -422,7 +417,7 @@ class Curve {
422
417
  try {
423
418
  this.signer = yield this.provider.getSigner();
424
419
  }
425
- catch (e) {
420
+ catch (_l) {
426
421
  this.signer = null;
427
422
  }
428
423
  }
@@ -459,7 +454,7 @@ class Curve {
459
454
  console.log("CURVE-JS IS CONNECTED TO NETWORK:", { name: network.name.toUpperCase(), chainId: Number(network.chainId) });
460
455
  this.chainId = Number(network.chainId) === 133 || Number(network.chainId) === 31337 ? 1 : Number(network.chainId);
461
456
  this.isLiteChain = !(this.chainId in NETWORK_CONSTANTS);
462
- const network_constants = yield getNetworkConstants(this.chainId);
457
+ const network_constants = yield getNetworkConstants.call(this, this.chainId);
463
458
  this.constants.NATIVE_TOKEN = network_constants.NATIVE_COIN;
464
459
  this.constants.NETWORK_NAME = network_constants.NAME;
465
460
  this.constants.ALIASES = network_constants.ALIASES;
@@ -473,7 +468,7 @@ class Curve {
473
468
  this.constants.DECIMALS = extractDecimals(Object.assign(Object.assign({}, this.constants.POOLS_DATA), this.constants.LLAMMAS_DATA));
474
469
  this.constants.DECIMALS[this.constants.NATIVE_TOKEN.address] = 18;
475
470
  this.constants.DECIMALS[this.constants.NATIVE_TOKEN.wrappedAddress] = 18;
476
- this.constants.GAUGES = extractGauges(this.constants.POOLS_DATA);
471
+ this.constants.GAUGES = extractGauges.call(this, this.constants.POOLS_DATA);
477
472
  if (this.isLiteChain) {
478
473
  this.constants.API_CONSTANTS = network_constants.API_CONSTANTS;
479
474
  }
@@ -499,7 +494,7 @@ class Curve {
499
494
  try {
500
495
  this.signerAddress = yield this.signer.getAddress();
501
496
  }
502
- catch (err) {
497
+ catch (_m) {
503
498
  this.signer = null;
504
499
  }
505
500
  }
@@ -507,6 +502,9 @@ class Curve {
507
502
  this.signerAddress = '';
508
503
  }
509
504
  this.feeData = { gasPrice: options.gasPrice, maxFeePerGas: options.maxFeePerGas, maxPriorityFeePerGas: options.maxPriorityFeePerGas };
505
+ if (options.poolsData) {
506
+ _setPoolsFromApi(this.constants.NETWORK_NAME, this.isLiteChain, options.poolsData);
507
+ }
510
508
  yield this.updateFeeData();
511
509
  for (const pool of Object.values(Object.assign(Object.assign({}, this.constants.POOLS_DATA), this.constants.LLAMMAS_DATA))) {
512
510
  this.setContract(pool.swap_address, pool.swap_abi);
@@ -619,25 +617,15 @@ class Curve {
619
617
  const curveInstance = this;
620
618
  curveInstance.setContract(curveInstance.constants.ALIASES.gas_oracle, gasOracleABI);
621
619
  curveInstance.setContract(curveInstance.constants.ALIASES.gas_oracle_blob, gasOracleBlobABI);
622
- // @ts-ignore
623
- if (AbstractProvider.prototype.originalEstimate) {
624
- // @ts-ignore
620
+ if ('originalEstimate' in AbstractProvider.prototype) {
625
621
  AbstractProvider.prototype.estimateGas = AbstractProvider.prototype.originalEstimate;
626
622
  }
627
623
  const originalEstimate = AbstractProvider.prototype.estimateGas;
628
- const oldEstimate = function (arg) {
629
- return __awaiter(this, void 0, void 0, function* () {
630
- // @ts-ignore
631
- const originalEstimateFunc = originalEstimate.bind(this);
632
- const gas = yield originalEstimateFunc(arg);
633
- return gas;
634
- });
635
- };
624
+ const oldEstimate = originalEstimate.bind(this);
636
625
  //Override
637
626
  const newEstimate = function (arg) {
638
627
  return __awaiter(this, void 0, void 0, function* () {
639
- // @ts-ignore
640
- const L2EstimateGas = originalEstimate.bind(this);
628
+ const L2EstimateGas = oldEstimate;
641
629
  const L1GasUsed = yield curveInstance.contracts[curveInstance.constants.ALIASES.gas_oracle_blob].contract.getL1GasUsed(arg.data);
642
630
  const L1Fee = yield curveInstance.contracts[curveInstance.constants.ALIASES.gas_oracle_blob].contract.getL1Fee(arg.data);
643
631
  curveInstance.L1WeightedGasPrice = Number(L1Fee) / Number(L1GasUsed);
@@ -645,15 +633,11 @@ class Curve {
645
633
  return [L2GasUsed, L1GasUsed];
646
634
  });
647
635
  };
648
- // @ts-ignore
649
636
  AbstractProvider.prototype.estimateGas = newEstimate;
650
- // @ts-ignore
651
637
  AbstractProvider.prototype.originalEstimate = oldEstimate;
652
638
  }
653
639
  else {
654
- // @ts-ignore
655
- if (AbstractProvider.prototype.originalEstimate) {
656
- // @ts-ignore
640
+ if ('originalEstimate' in AbstractProvider.prototype) {
657
641
  AbstractProvider.prototype.estimateGas = AbstractProvider.prototype.originalEstimate;
658
642
  }
659
643
  }
@@ -686,22 +670,21 @@ class Curve {
686
670
  _filterHiddenPools(pools) {
687
671
  return __awaiter(this, void 0, void 0, function* () {
688
672
  const hiddenPools = (yield _getHiddenPools())[this.constants.NETWORK_NAME] || [];
689
- // @ts-ignore
690
673
  return Object.fromEntries(Object.entries(pools).filter(([id]) => !hiddenPools.includes(id)));
691
674
  });
692
675
  }
693
676
  _updateDecimalsAndGauges(pools) {
694
677
  this.constants.DECIMALS = Object.assign(Object.assign({}, this.constants.DECIMALS), extractDecimals(pools));
695
- this.constants.GAUGES = [...this.constants.GAUGES, ...extractGauges(pools)];
678
+ this.constants.GAUGES = [...this.constants.GAUGES, ...extractGauges.call(this, pools)];
696
679
  }
697
680
  setCustomFeeData(customFeeData) {
698
681
  this.feeData = Object.assign(Object.assign({}, this.feeData), customFeeData);
699
682
  }
700
683
  formatUnits(value, unit) {
701
- return ethers.formatUnits(value, unit);
684
+ return formatUnits(value, unit);
702
685
  }
703
686
  parseUnits(value, unit) {
704
- return ethers.parseUnits(value, unit);
687
+ return parseUnits(value, unit);
705
688
  }
706
689
  updateFeeData() {
707
690
  return __awaiter(this, void 0, void 0, function* () {