@curvefi/api 2.21.1 → 2.21.3

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 (36) hide show
  1. package/lib/boosting.js +1 -1
  2. package/lib/constants/coins/fantom.js +1 -1
  3. package/lib/constants/pools/fantom.js +4 -4
  4. package/lib/curve.js +47 -16
  5. package/lib/external-api.d.ts +7 -0
  6. package/lib/external-api.js +18 -2
  7. package/lib/factory/deploy.js +1 -1
  8. package/lib/factory/factory-api.js +1 -1
  9. package/lib/factory/factory-crypto.js +1 -1
  10. package/lib/factory/factory.js +1 -1
  11. package/lib/index.js +1 -1
  12. package/lib/interfaces.d.ts +2 -2
  13. package/lib/pools/PoolTemplate.d.ts +3 -0
  14. package/lib/pools/PoolTemplate.js +84 -42
  15. package/lib/pools/mixins/common.js +1 -1
  16. package/lib/pools/mixins/depositBalancedAmountsMixins.js +1 -1
  17. package/lib/pools/mixins/depositBonusMixins.js +1 -1
  18. package/lib/pools/mixins/depositMixins.js +1 -1
  19. package/lib/pools/mixins/depositWrappedMixins.js +1 -1
  20. package/lib/pools/mixins/poolBalancesMixin.js +1 -1
  21. package/lib/pools/mixins/swapMixins.js +1 -1
  22. package/lib/pools/mixins/swapWrappedMixins.js +1 -1
  23. package/lib/pools/mixins/withdrawBonusMixins.js +1 -1
  24. package/lib/pools/mixins/withdrawExpectedMixins.js +1 -1
  25. package/lib/pools/mixins/withdrawImbalanceMixins.js +1 -1
  26. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +1 -1
  27. package/lib/pools/mixins/withdrawMixins.js +1 -1
  28. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +1 -1
  29. package/lib/pools/mixins/withdrawOneCoinMixins.js +1 -1
  30. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +1 -1
  31. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +1 -1
  32. package/lib/pools/mixins/withdrawWrappedMixins.js +1 -1
  33. package/lib/pools/utils.js +1 -1
  34. package/lib/router.js +1 -1
  35. package/lib/utils.js +1 -1
  36. package/package.json +1 -1
package/lib/boosting.js CHANGED
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -17,7 +17,7 @@ exports.COINS_FANTOM = (0, utils_1.lowerCaseValues)({
17
17
  'dai+usdc': '0x27e611fd27b276acbd5ffd632e5eaebec9761e40',
18
18
  'frax': '0xdc301622e621166bd8e82f2ca0a26c13ad0be355',
19
19
  // --- BTC ---
20
- 'btc': '0x321162Cd933E2Be498Cd2267a90534A804051b11',
20
+ 'wbtc': '0x321162Cd933E2Be498Cd2267a90534A804051b11',
21
21
  'renbtc': '0xDBf31dF14B66535aF65AaC99C32e9eA844e14501',
22
22
  // --- ETH ---
23
23
  'eth': '0x74b23882a30290451A17c44f4F05243b6b58C76d',
@@ -85,8 +85,8 @@ exports.POOLS_DATA_FANTOM = (0, utils_1.lowerCasePoolDataAddresses)({
85
85
  // old_gauge: '0x6600e98b71dabfD4A8Cac03b302B0189Adb86Afb',
86
86
  // gauge_address: '0xBdFF0C27dd073C119ebcb1299a68A6A92aE607F0',
87
87
  gauge_address: '0xbC38bD19227F91424eD4132F630f51C9A42Fa338',
88
- underlying_coins: ['BTC', 'renBTC'],
89
- wrapped_coins: ['BTC', 'renBTC'],
88
+ underlying_coins: ['WBTC', 'renBTC'],
89
+ wrapped_coins: ['WBTC', 'renBTC'],
90
90
  underlying_coin_addresses: [
91
91
  '0x321162Cd933E2Be498Cd2267a90534A804051b11',
92
92
  '0xDBf31dF14B66535aF65AaC99C32e9eA844e14501',
@@ -111,8 +111,8 @@ exports.POOLS_DATA_FANTOM = (0, utils_1.lowerCasePoolDataAddresses)({
111
111
  gauge_address: '0x319E268f0A4C85D404734ee7958857F5891506d7',
112
112
  is_crypto: true,
113
113
  is_plain: true,
114
- underlying_coins: ['fUSDT', 'BTC', 'ETH'],
115
- wrapped_coins: ['fUSDT', 'BTC', 'ETH'],
114
+ underlying_coins: ['fUSDT', 'WBTC', 'ETH'],
115
+ wrapped_coins: ['fUSDT', 'WBTC', 'ETH'],
116
116
  underlying_coin_addresses: [
117
117
  '0x049d68029688eAbF473097a2fC38ef61633A3C7A',
118
118
  '0x321162Cd933E2Be498Cd2267a90534A804051b11',
package/lib/curve.js CHANGED
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -94,6 +94,28 @@ var aurora_1 = require("./constants/coins/aurora");
94
94
  var kava_1 = require("./constants/coins/kava");
95
95
  var celo_1 = require("./constants/coins/celo");
96
96
  var utils_1 = require("./constants/utils");
97
+ var external_api_1 = require("./external-api");
98
+ var _killGauges = function (poolsData) { return __awaiter(void 0, void 0, void 0, function () {
99
+ var gaugeData, isKilled, poolId;
100
+ return __generator(this, function (_a) {
101
+ switch (_a.label) {
102
+ case 0: return [4 /*yield*/, (0, external_api_1._getAllGauges)()];
103
+ case 1:
104
+ gaugeData = _a.sent();
105
+ isKilled = {};
106
+ Object.values(gaugeData).forEach(function (d) {
107
+ var _a;
108
+ isKilled[d.gauge.toLowerCase()] = (_a = d.is_killed) !== null && _a !== void 0 ? _a : false;
109
+ });
110
+ for (poolId in poolsData) {
111
+ if (isKilled[poolsData[poolId].gauge_address]) {
112
+ poolsData[poolId].gauge_address = ethers_1.ethers.constants.AddressZero;
113
+ }
114
+ }
115
+ return [2 /*return*/];
116
+ }
117
+ });
118
+ }); };
97
119
  exports.NATIVE_TOKENS = {
98
120
  1: {
99
121
  symbol: 'ETH',
@@ -393,31 +415,34 @@ var Curve = /** @class */ (function () {
393
415
  exports.NETWORK_CONSTANTS[this.chainId].aTokens,
394
416
  ], cTokens = _c[0], yTokens = _c[1], ycTokens = _c[2], aTokens = _c[3];
395
417
  customAbiTokens = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], cTokens, true), yTokens, true), ycTokens, true), aTokens, true);
396
- this.multicallProvider = new ethcall_1.Provider();
397
- return [4 /*yield*/, this.multicallProvider.init(this.provider)];
418
+ return [4 /*yield*/, _killGauges(this.constants.POOLS_DATA)];
398
419
  case 3:
399
420
  _o.sent();
400
- if (!this.signer) return [3 /*break*/, 8];
401
- _o.label = 4;
421
+ this.multicallProvider = new ethcall_1.Provider();
422
+ return [4 /*yield*/, this.multicallProvider.init(this.provider)];
402
423
  case 4:
403
- _o.trys.push([4, 6, , 7]);
424
+ _o.sent();
425
+ if (!this.signer) return [3 /*break*/, 9];
426
+ _o.label = 5;
427
+ case 5:
428
+ _o.trys.push([5, 7, , 8]);
404
429
  _d = this;
405
430
  return [4 /*yield*/, this.signer.getAddress()];
406
- case 5:
407
- _d.signerAddress = _o.sent();
408
- return [3 /*break*/, 7];
409
431
  case 6:
432
+ _d.signerAddress = _o.sent();
433
+ return [3 /*break*/, 8];
434
+ case 7:
410
435
  err_1 = _o.sent();
411
436
  this.signer = null;
412
- return [3 /*break*/, 7];
413
- case 7: return [3 /*break*/, 9];
414
- case 8:
415
- this.signerAddress = '';
416
- _o.label = 9;
437
+ return [3 /*break*/, 8];
438
+ case 8: return [3 /*break*/, 10];
417
439
  case 9:
440
+ this.signerAddress = '';
441
+ _o.label = 10;
442
+ case 10:
418
443
  this.feeData = { gasPrice: options.gasPrice, maxFeePerGas: options.maxFeePerGas, maxPriorityFeePerGas: options.maxPriorityFeePerGas };
419
444
  return [4 /*yield*/, this.updateFeeData()];
420
- case 10:
445
+ case 11:
421
446
  _o.sent();
422
447
  for (_i = 0, _e = Object.values(this.constants.POOLS_DATA); _i < _e.length; _i++) {
423
448
  pool = _e[_i];
@@ -534,7 +559,7 @@ var Curve = /** @class */ (function () {
534
559
  addressProviderContract = this.contracts[this.constants.ALIASES.address_provider].contract;
535
560
  _m = this.constants.ALIASES;
536
561
  return [4 /*yield*/, addressProviderContract.get_address(2, this.constantOptions)];
537
- case 11:
562
+ case 12:
538
563
  _m.registry_exchange = _o.sent();
539
564
  this.contracts[this.constants.ALIASES.registry_exchange] = {
540
565
  contract: new ethers_1.Contract(this.constants.ALIASES.registry_exchange, registry_exchange_json_1.default, this.signer || this.provider),
@@ -621,6 +646,9 @@ var Curve = /** @class */ (function () {
621
646
  case 4:
622
647
  this.constants.DECIMALS = __assign(__assign({}, this.constants.DECIMALS), (0, utils_1.extractDecimals)(this.constants.FACTORY_POOLS_DATA));
623
648
  this.constants.GAUGES = __spreadArray(__spreadArray([], this.constants.GAUGES, true), (0, utils_1.extractGauges)(this.constants.FACTORY_POOLS_DATA), true);
649
+ return [4 /*yield*/, _killGauges(this.constants.FACTORY_POOLS_DATA)];
650
+ case 5:
651
+ _e.sent();
624
652
  return [2 /*return*/];
625
653
  }
626
654
  });
@@ -652,6 +680,9 @@ var Curve = /** @class */ (function () {
652
680
  case 4:
653
681
  this.constants.DECIMALS = __assign(__assign({}, this.constants.DECIMALS), (0, utils_1.extractDecimals)(this.constants.CRYPTO_FACTORY_POOLS_DATA));
654
682
  this.constants.GAUGES = __spreadArray(__spreadArray([], this.constants.GAUGES, true), (0, utils_1.extractGauges)(this.constants.CRYPTO_FACTORY_POOLS_DATA), true);
683
+ return [4 /*yield*/, _killGauges(this.constants.CRYPTO_FACTORY_POOLS_DATA)];
684
+ case 5:
685
+ _e.sent();
655
686
  return [2 /*return*/];
656
687
  }
657
688
  });
@@ -25,3 +25,10 @@ export declare const _getFactoryAPYsAndVolumes: ((network: string) => Promise<{
25
25
  apy: number;
26
26
  volume: number;
27
27
  }[]>>;
28
+ export declare const _getAllGauges: (() => Promise<IDict<{
29
+ gauge: string;
30
+ is_killed?: boolean;
31
+ }>>) & memoize.Memoized<() => Promise<IDict<{
32
+ gauge: string;
33
+ is_killed?: boolean;
34
+ }>>>;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports._getFactoryAPYsAndVolumes = exports._getLegacyAPYsAndVolumes = exports._getMainPoolsGaugeRewards = exports._getSubgraphData = exports._getPoolsFromApi = void 0;
42
+ exports._getAllGauges = exports._getFactoryAPYsAndVolumes = exports._getLegacyAPYsAndVolumes = exports._getMainPoolsGaugeRewards = exports._getSubgraphData = exports._getPoolsFromApi = void 0;
43
43
  var axios_1 = __importDefault(require("axios"));
44
44
  var memoizee_1 = __importDefault(require("memoizee"));
45
45
  var curve_1 = require("./curve");
@@ -139,3 +139,19 @@ exports._getFactoryAPYsAndVolumes = (0, memoizee_1.default)(function (network) {
139
139
  promise: true,
140
140
  maxAge: 5 * 60 * 1000, // 5m
141
141
  });
142
+ exports._getAllGauges = (0, memoizee_1.default)(function () { return __awaiter(void 0, void 0, void 0, function () {
143
+ var url, response;
144
+ return __generator(this, function (_a) {
145
+ switch (_a.label) {
146
+ case 0:
147
+ url = "https://api.curve.fi/api/getAllGauges";
148
+ return [4 /*yield*/, axios_1.default.get(url, { validateStatus: function () { return true; } })];
149
+ case 1:
150
+ response = _a.sent();
151
+ return [2 /*return*/, response.data.data];
152
+ }
153
+ });
154
+ }); }, {
155
+ promise: true,
156
+ maxAge: 5 * 60 * 1000, // 5m
157
+ });
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
package/lib/index.js CHANGED
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -3,8 +3,8 @@ import { Contract as MulticallContract, Provider as MulticallProvider } from "et
3
3
  export interface IDict<T> {
4
4
  [index: string]: T;
5
5
  }
6
- export declare type INetworkName = "ethereum" | "polygon" | "avalanche";
7
- export declare type REFERENCE_ASSET = 'USD' | 'EUR' | 'BTC' | 'ETH' | 'LINK' | 'CRYPTO' | 'OTHER';
6
+ export type INetworkName = "ethereum" | "polygon" | "avalanche";
7
+ export type REFERENCE_ASSET = 'USD' | 'EUR' | 'BTC' | 'ETH' | 'LINK' | 'CRYPTO' | 'OTHER';
8
8
  export interface IPoolData {
9
9
  name: string;
10
10
  full_name: string;
@@ -57,6 +57,7 @@ export declare class PoolTemplate {
57
57
  };
58
58
  stats: {
59
59
  parameters: () => Promise<{
60
+ lpTokenSupply: string;
60
61
  virtualPrice: string;
61
62
  fee: string;
62
63
  adminFee: string;
@@ -66,6 +67,8 @@ export declare class PoolTemplate {
66
67
  future_A_time?: number;
67
68
  initial_A_time?: number;
68
69
  gamma?: string;
70
+ price_oracle?: string[];
71
+ price_scale?: string[];
69
72
  }>;
70
73
  underlyingBalances: () => Promise<string[]>;
71
74
  wrappedBalances: () => Promise<string[]>;
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -74,47 +74,89 @@ var PoolTemplate = /** @class */ (function () {
74
74
  function PoolTemplate(id) {
75
75
  var _this = this;
76
76
  this.statsParameters = function () { return __awaiter(_this, void 0, void 0, function () {
77
- var multicallContract, lpMulticallContract, calls, additionalCalls, _c, _lpTokenSupply, _virtualPrice, _fee, _adminFee, _A, _gamma, _d, lpTokenSupply, virtualPrice, fee, adminFee, A, gamma, A_PRECISION, _e, _future_A, _initial_A, _future_A_time, _initial_A_time, _f, future_A, initial_A, future_A_time, initial_A_time;
78
- return __generator(this, function (_g) {
79
- switch (_g.label) {
77
+ var multicallContract, lpMulticallContract, calls, i, additionalCalls, _virtualPrice, _fee, _prices, _adminFee, _A, _lpTokenSupply, _gamma, e_1, _c, virtualPrice, fee, adminFee, A, lpTokenSupply, gamma, priceOracle, priceScale, prices, i, A_PRECISION, _d, _future_A, _initial_A, _future_A_time, _initial_A_time, _e, future_A, initial_A, future_A_time, initial_A_time;
78
+ var _f, _g, _h;
79
+ return __generator(this, function (_j) {
80
+ switch (_j.label) {
80
81
  case 0:
81
82
  multicallContract = curve_1.curve.contracts[this.address].multicallContract;
82
83
  lpMulticallContract = curve_1.curve.contracts[this.lpToken].multicallContract;
83
84
  calls = [
84
- lpMulticallContract.totalSupply(),
85
85
  multicallContract.get_virtual_price(),
86
86
  multicallContract.fee(),
87
87
  multicallContract.admin_fee(),
88
88
  multicallContract.A(),
89
+ lpMulticallContract.totalSupply(),
89
90
  ];
90
- if (this.isCrypto)
91
+ if (this.isCrypto) {
91
92
  calls.push(multicallContract.gamma());
93
+ if (this.wrappedCoins.length === 2) {
94
+ calls.push(multicallContract.price_oracle());
95
+ calls.push(multicallContract.price_scale());
96
+ }
97
+ else {
98
+ for (i = 0; i < this.wrappedCoins.length - 1; i++) {
99
+ calls.push(multicallContract.price_oracle(i));
100
+ calls.push(multicallContract.price_scale(i));
101
+ }
102
+ }
103
+ }
92
104
  additionalCalls = this.isCrypto ? [] : [multicallContract.future_A()];
93
105
  if ('initial_A' in multicallContract) {
94
106
  additionalCalls.push(multicallContract.initial_A(), multicallContract.future_A_time(), multicallContract.initial_A_time());
95
107
  }
96
- return [4 /*yield*/, curve_1.curve.multicallProvider.all(calls)];
108
+ _virtualPrice = ethers_1.ethers.BigNumber.from(0);
109
+ _fee = ethers_1.ethers.BigNumber.from(0);
110
+ _j.label = 1;
97
111
  case 1:
98
- _c = _g.sent(), _lpTokenSupply = _c[0], _virtualPrice = _c[1], _fee = _c[2], _adminFee = _c[3], _A = _c[4], _gamma = _c[5];
99
- _d = [
100
- ethers_1.ethers.utils.formatUnits(_lpTokenSupply),
112
+ _j.trys.push([1, 3, , 8]);
113
+ return [4 /*yield*/, curve_1.curve.multicallProvider.all(calls)];
114
+ case 2:
115
+ _f = (_j.sent()), _virtualPrice = _f[0], _fee = _f[1], _adminFee = _f[2], _A = _f[3], _lpTokenSupply = _f[4], _gamma = _f[5], _prices = _f.slice(6);
116
+ return [3 /*break*/, 8];
117
+ case 3:
118
+ e_1 = _j.sent();
119
+ calls.shift();
120
+ if (!this.isCrypto) return [3 /*break*/, 5];
121
+ calls.shift();
122
+ return [4 /*yield*/, curve_1.curve.multicallProvider.all(calls)];
123
+ case 4:
124
+ _g = (_j.sent()), _adminFee = _g[0], _A = _g[1], _lpTokenSupply = _g[2], _gamma = _g[3], _prices = _g.slice(4);
125
+ return [3 /*break*/, 7];
126
+ case 5: return [4 /*yield*/, curve_1.curve.multicallProvider.all(calls)];
127
+ case 6:
128
+ _h = (_j.sent()), _fee = _h[0], _adminFee = _h[1], _A = _h[2], _lpTokenSupply = _h[3], _gamma = _h[4], _prices = _h.slice(5);
129
+ _j.label = 7;
130
+ case 7: return [3 /*break*/, 8];
131
+ case 8:
132
+ _c = [
101
133
  ethers_1.ethers.utils.formatUnits(_virtualPrice),
102
134
  ethers_1.ethers.utils.formatUnits(_fee, 8),
103
135
  ethers_1.ethers.utils.formatUnits(_adminFee.mul(_fee)),
104
136
  ethers_1.ethers.utils.formatUnits(_A, 0),
137
+ ethers_1.ethers.utils.formatUnits(_lpTokenSupply),
105
138
  _gamma ? ethers_1.ethers.utils.formatUnits(_gamma) : _gamma,
106
- ], lpTokenSupply = _d[0], virtualPrice = _d[1], fee = _d[2], adminFee = _d[3], A = _d[4], gamma = _d[5];
139
+ ], virtualPrice = _c[0], fee = _c[1], adminFee = _c[2], A = _c[3], lpTokenSupply = _c[4], gamma = _c[5];
140
+ if (this.isCrypto) {
141
+ prices = _prices.map(function (_p) { return ethers_1.ethers.utils.formatUnits(_p); });
142
+ priceOracle = [];
143
+ priceScale = [];
144
+ for (i = 0; i < this.wrappedCoins.length - 1; i++) {
145
+ priceOracle.push(prices.shift());
146
+ priceScale.push(prices.shift());
147
+ }
148
+ }
107
149
  A_PRECISION = curve_1.curve.chainId === 1 && ['compound', 'usdt', 'y', 'busd', 'susd', 'pax', 'ren', 'sbtc', 'hbtc', '3pool'].includes(this.id) ? 1 : 100;
108
150
  return [4 /*yield*/, curve_1.curve.multicallProvider.all(additionalCalls)];
109
- case 2:
110
- _e = _g.sent(), _future_A = _e[0], _initial_A = _e[1], _future_A_time = _e[2], _initial_A_time = _e[3];
111
- _f = [
151
+ case 9:
152
+ _d = _j.sent(), _future_A = _d[0], _initial_A = _d[1], _future_A_time = _d[2], _initial_A_time = _d[3];
153
+ _e = [
112
154
  _future_A ? String(Number(ethers_1.ethers.utils.formatUnits(_future_A, 0)) / A_PRECISION) : undefined,
113
155
  _initial_A ? String(Number(ethers_1.ethers.utils.formatUnits(_initial_A, 0)) / A_PRECISION) : undefined,
114
156
  _future_A_time ? Number(ethers_1.ethers.utils.formatUnits(_future_A_time, 0)) * 1000 : undefined,
115
157
  _initial_A_time ? Number(ethers_1.ethers.utils.formatUnits(_initial_A_time, 0)) * 1000 : undefined,
116
- ], future_A = _f[0], initial_A = _f[1], future_A_time = _f[2], initial_A_time = _f[3];
117
- return [2 /*return*/, { lpTokenSupply: lpTokenSupply, virtualPrice: virtualPrice, fee: fee, adminFee: adminFee, A: A, future_A: future_A, initial_A: initial_A, future_A_time: future_A_time, initial_A_time: initial_A_time, gamma: gamma }];
158
+ ], future_A = _e[0], initial_A = _e[1], future_A_time = _e[2], initial_A_time = _e[3];
159
+ return [2 /*return*/, { lpTokenSupply: lpTokenSupply, virtualPrice: virtualPrice, fee: fee, adminFee: adminFee, A: A, future_A: future_A, initial_A: initial_A, future_A_time: future_A_time, initial_A_time: initial_A_time, gamma: gamma, priceOracle: priceOracle, priceScale: priceScale }];
118
160
  }
119
161
  });
120
162
  }); };
@@ -365,7 +407,7 @@ var PoolTemplate = /** @class */ (function () {
365
407
  if (isDeposit === void 0) { isDeposit = true; }
366
408
  if (useUnderlying === void 0) { useUnderlying = true; }
367
409
  return __awaiter(_this, void 0, void 0, function () {
368
- var _rates, e_1, lpContract, _lpTotalSupply, decimals_1, amounts, seedAmounts_1, N_coins, decimals_2, calcContractAddress, calcContract, poolContract, lpContract, calls, res, _c, _totalSupply, _fee, _lpTokenAmount, balances, _d, totalSupplyBN, feeBN, lpTokenAmountBN, balancesBN, amountsBN, feesBN, i, _fees, _lpTokenFee, e_2, lpContract, _lpTotalSupply, decimals_3, amounts_1, _amounts18Decimals;
410
+ var _rates, e_2, lpContract, _lpTotalSupply, decimals_1, amounts, seedAmounts_1, N_coins, decimals_2, calcContractAddress, calcContract, poolContract, lpContract, calls, res, _c, _totalSupply, _fee, _lpTokenAmount, balances, _d, totalSupplyBN, feeBN, lpTokenAmountBN, balancesBN, amountsBN, feesBN, i, _fees, _lpTokenFee, e_3, lpContract, _lpTotalSupply, decimals_3, amounts_1, _amounts18Decimals;
369
411
  return __generator(this, function (_e) {
370
412
  switch (_e.label) {
371
413
  case 0:
@@ -387,13 +429,13 @@ var PoolTemplate = /** @class */ (function () {
387
429
  return [4 /*yield*/, this._pureCalcLpTokenAmount(_amounts, isDeposit, useUnderlying)];
388
430
  case 4: return [2 /*return*/, _e.sent()];
389
431
  case 5:
390
- e_1 = _e.sent();
432
+ e_2 = _e.sent();
391
433
  lpContract = curve_1.curve.contracts[this.lpToken].contract;
392
434
  return [4 /*yield*/, lpContract.totalSupply(curve_1.curve.constantOptions)];
393
435
  case 6:
394
436
  _lpTotalSupply = _e.sent();
395
437
  if (_lpTotalSupply.gt(0))
396
- throw e_1; // Already seeded
438
+ throw e_2; // Already seeded
397
439
  if (this.isMeta && useUnderlying)
398
440
  throw Error("Initial deposit for crypto meta pools must be in wrapped coins");
399
441
  decimals_1 = useUnderlying ? this.underlyingDecimals : this.wrappedDecimals;
@@ -452,15 +494,15 @@ var PoolTemplate = /** @class */ (function () {
452
494
  _lpTokenFee = _lpTokenFee.mul(-1);
453
495
  return [2 /*return*/, _lpTokenAmount.add(_lpTokenFee)];
454
496
  case 11:
455
- e_2 = _e.sent();
497
+ e_3 = _e.sent();
456
498
  if (!isDeposit)
457
- throw e_2; // Seeding is only for deposit
499
+ throw e_3; // Seeding is only for deposit
458
500
  lpContract = curve_1.curve.contracts[this.lpToken].contract;
459
501
  return [4 /*yield*/, lpContract.totalSupply(curve_1.curve.constantOptions)];
460
502
  case 12:
461
503
  _lpTotalSupply = _e.sent();
462
504
  if (_lpTotalSupply.gt(0))
463
- throw e_2; // Already seeded
505
+ throw e_3; // Already seeded
464
506
  decimals_3 = useUnderlying ? this.underlyingDecimals : this.wrappedDecimals;
465
507
  amounts_1 = _amounts.map(function (_a, i) { return ethers_1.ethers.utils.formatUnits(_a, decimals_3[i]); });
466
508
  amounts_1.forEach(function (a) {
@@ -1955,8 +1997,8 @@ var PoolTemplate = /** @class */ (function () {
1955
1997
  PoolTemplate.prototype._depositAndStake = function (amounts, isUnderlying, estimateGas) {
1956
1998
  return __awaiter(this, void 0, void 0, function () {
1957
1999
  var coinAddresses, coins, decimals, depositAddress, balances, _c, _d, _e, _f, _g, i, allowance, _h, _amounts, contract, useUnderlying, _minMintAmount, _j, _k, _l, _m, _o, ethIndex, value, i, _gas, gasLimit;
1958
- return __generator(this, function (_p) {
1959
- switch (_p.label) {
2000
+ return __generator(this, function (_q) {
2001
+ switch (_q.label) {
1960
2002
  case 0:
1961
2003
  coinAddresses = isUnderlying ? __spreadArray([], this.underlyingCoinAddresses, true) : __spreadArray([], this.wrappedCoinAddresses, true);
1962
2004
  coins = isUnderlying ? this.underlyingCoins : this.wrappedCoinAddresses;
@@ -1969,14 +2011,14 @@ var PoolTemplate = /** @class */ (function () {
1969
2011
  _e = (_d = Object).values;
1970
2012
  return [4 /*yield*/, this.walletUnderlyingCoinBalances()];
1971
2013
  case 1:
1972
- _c = _e.apply(_d, [_p.sent()]);
2014
+ _c = _e.apply(_d, [_q.sent()]);
1973
2015
  return [3 /*break*/, 4];
1974
2016
  case 2:
1975
2017
  _g = (_f = Object).values;
1976
2018
  return [4 /*yield*/, this.walletWrappedCoinBalances()];
1977
2019
  case 3:
1978
- _c = _g.apply(_f, [_p.sent()]);
1979
- _p.label = 4;
2020
+ _c = _g.apply(_f, [_q.sent()]);
2021
+ _q.label = 4;
1980
2022
  case 4:
1981
2023
  balances = _c;
1982
2024
  for (i = 0; i < balances.length; i++) {
@@ -1987,12 +2029,12 @@ var PoolTemplate = /** @class */ (function () {
1987
2029
  if (!isUnderlying) return [3 /*break*/, 6];
1988
2030
  return [4 /*yield*/, this.depositAndStakeIsApproved(amounts)];
1989
2031
  case 5:
1990
- _h = _p.sent();
2032
+ _h = _q.sent();
1991
2033
  return [3 /*break*/, 8];
1992
2034
  case 6: return [4 /*yield*/, this.depositAndStakeWrappedIsApproved(amounts)];
1993
2035
  case 7:
1994
- _h = _p.sent();
1995
- _p.label = 8;
2036
+ _h = _q.sent();
2037
+ _q.label = 8;
1996
2038
  case 8:
1997
2039
  allowance = _h;
1998
2040
  if (estimateGas && !allowance) {
@@ -2002,12 +2044,12 @@ var PoolTemplate = /** @class */ (function () {
2002
2044
  if (!isUnderlying) return [3 /*break*/, 10];
2003
2045
  return [4 /*yield*/, this.depositAndStakeApprove(amounts)];
2004
2046
  case 9:
2005
- _p.sent();
2047
+ _q.sent();
2006
2048
  return [3 /*break*/, 12];
2007
2049
  case 10: return [4 /*yield*/, this.depositAndStakeWrappedApprove(amounts)];
2008
2050
  case 11:
2009
- _p.sent();
2010
- _p.label = 12;
2051
+ _q.sent();
2052
+ _q.label = 12;
2011
2053
  case 12:
2012
2054
  _amounts = amounts.map(function (amount, i) { return (0, utils_1.parseUnits)(amount, decimals[i]); });
2013
2055
  contract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.deposit_and_stake].contract;
@@ -2016,14 +2058,14 @@ var PoolTemplate = /** @class */ (function () {
2016
2058
  _l = (_k = ethers_1.ethers.utils).parseUnits;
2017
2059
  return [4 /*yield*/, this.depositAndStakeExpected(amounts)];
2018
2060
  case 13:
2019
- _j = _l.apply(_k, [_p.sent()]).mul(99).div(100);
2061
+ _j = _l.apply(_k, [_q.sent()]).mul(99).div(100);
2020
2062
  return [3 /*break*/, 16];
2021
2063
  case 14:
2022
2064
  _o = (_m = ethers_1.ethers.utils).parseUnits;
2023
2065
  return [4 /*yield*/, this.depositAndStakeWrappedExpected(amounts)];
2024
2066
  case 15:
2025
- _j = _o.apply(_m, [_p.sent()]).mul(99).div(100);
2026
- _p.label = 16;
2067
+ _j = _o.apply(_m, [_q.sent()]).mul(99).div(100);
2068
+ _q.label = 16;
2027
2069
  case 16:
2028
2070
  _minMintAmount = _j;
2029
2071
  ethIndex = (0, utils_1.getEthIndex)(coinAddresses);
@@ -2034,15 +2076,15 @@ var PoolTemplate = /** @class */ (function () {
2034
2076
  }
2035
2077
  return [4 /*yield*/, contract.estimateGas.deposit_and_stake(depositAddress, this.lpToken, this.gauge, coins.length, coinAddresses, _amounts, _minMintAmount, useUnderlying, this.isMetaFactory && isUnderlying ? this.address : ethers_1.ethers.constants.AddressZero, __assign(__assign({}, curve_1.curve.constantOptions), { value: value }))];
2036
2078
  case 17:
2037
- _gas = (_p.sent());
2079
+ _gas = (_q.sent());
2038
2080
  if (estimateGas)
2039
2081
  return [2 /*return*/, _gas.toNumber()];
2040
2082
  return [4 /*yield*/, curve_1.curve.updateFeeData()];
2041
2083
  case 18:
2042
- _p.sent();
2084
+ _q.sent();
2043
2085
  gasLimit = _gas.mul(200).div(100);
2044
2086
  return [4 /*yield*/, contract.deposit_and_stake(depositAddress, this.lpToken, this.gauge, coins.length, coinAddresses, _amounts, _minMintAmount, useUnderlying, this.isMetaFactory && isUnderlying ? this.address : ethers_1.ethers.constants.AddressZero, __assign(__assign({}, curve_1.curve.options), { gasLimit: gasLimit, value: value }))];
2045
- case 19: return [2 /*return*/, (_p.sent()).hash];
2087
+ case 19: return [2 /*return*/, (_q.sent()).hash];
2046
2088
  }
2047
2089
  });
2048
2090
  });
@@ -2631,17 +2673,17 @@ var PoolTemplate = /** @class */ (function () {
2631
2673
  return [3 /*break*/, 5];
2632
2674
  case 3:
2633
2675
  _d = (_c = ethers_1.ethers.utils).formatUnits;
2634
- return [4 /*yield*/, curve_1.curve.contracts[this.lpToken].contract.totalSupply()];
2676
+ return [4 /*yield*/, curve_1.curve.contracts[this.lpToken].contract.totalSupply(curve_1.curve.constantOptions)];
2635
2677
  case 4:
2636
2678
  totalLp = _d.apply(_c, [_f.sent()]);
2637
2679
  _f.label = 5;
2638
2680
  case 5: return [2 /*return*/, {
2639
2681
  lpUser: userLpTotalBalanceBN.toString(),
2640
2682
  lpTotal: totalLp,
2641
- lpShare: userLpTotalBalanceBN.div(totalLp).times(100).toString(),
2683
+ lpShare: (0, utils_1.BN)(totalLp).gt(0) ? userLpTotalBalanceBN.div(totalLp).times(100).toString() : '0',
2642
2684
  gaugeUser: userLpBalance.gauge,
2643
2685
  gaugeTotal: gaugeLp,
2644
- gaugeShare: withGauge ? (0, utils_1.BN)(userLpBalance.gauge).div((0, utils_1.BN)(gaugeLp)).times(100).toString() : undefined,
2686
+ gaugeShare: !withGauge ? undefined : (0, utils_1.BN)(gaugeLp).gt(0) ? (0, utils_1.BN)(userLpBalance.gauge).div(gaugeLp).times(100).toString() : '0',
2645
2687
  }];
2646
2688
  }
2647
2689
  });
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
package/lib/router.js CHANGED
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
package/lib/utils.js CHANGED
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.21.1",
3
+ "version": "2.21.3",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",