@curvefi/api 2.44.0 → 2.45.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.
- package/lib/constants/aliases.js +1 -1
- package/lib/curve.js +27 -16
- package/package.json +2 -2
package/lib/constants/aliases.js
CHANGED
|
@@ -90,7 +90,7 @@ export var ALIASES_ARBITRUM = lowerCaseValues({
|
|
|
90
90
|
"crvusd_factory": '0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d',
|
|
91
91
|
"eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
|
|
92
92
|
"crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
|
|
93
|
-
"tricrypto_factory": '
|
|
93
|
+
"tricrypto_factory": '0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8',
|
|
94
94
|
"registry_exchange": "",
|
|
95
95
|
"factory_admin": "",
|
|
96
96
|
});
|
package/lib/curve.js
CHANGED
|
@@ -482,41 +482,52 @@ var Curve = /** @class */ (function () {
|
|
|
482
482
|
this.fetchTricryptoFactoryPools = function (useApi) {
|
|
483
483
|
if (useApi === void 0) { useApi = true; }
|
|
484
484
|
return __awaiter(_this, void 0, void 0, function () {
|
|
485
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
486
|
-
return __generator(this, function (
|
|
487
|
-
switch (
|
|
485
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
486
|
+
return __generator(this, function (_k) {
|
|
487
|
+
switch (_k.label) {
|
|
488
488
|
case 0:
|
|
489
|
-
if (![1].includes(this.chainId))
|
|
490
|
-
return [2 /*return*/];
|
|
489
|
+
if (![1, 42161].includes(this.chainId))
|
|
490
|
+
return [2 /*return*/]; // Ethereum, Arbitrum
|
|
491
491
|
if (!useApi) return [3 /*break*/, 2];
|
|
492
492
|
_a = this.constants;
|
|
493
493
|
_b = lowerCasePoolDataAddresses;
|
|
494
494
|
return [4 /*yield*/, getFactoryPoolsDataFromApi.call(this, "factory-tricrypto")];
|
|
495
495
|
case 1:
|
|
496
|
-
_a.TRICRYPTO_FACTORY_POOLS_DATA = _b.apply(void 0, [
|
|
496
|
+
_a.TRICRYPTO_FACTORY_POOLS_DATA = _b.apply(void 0, [_k.sent()]);
|
|
497
497
|
return [3 /*break*/, 4];
|
|
498
498
|
case 2:
|
|
499
499
|
_c = this.constants;
|
|
500
500
|
_d = lowerCasePoolDataAddresses;
|
|
501
501
|
return [4 /*yield*/, getTricryptoFactoryPoolData.call(this)];
|
|
502
502
|
case 3:
|
|
503
|
-
_c.TRICRYPTO_FACTORY_POOLS_DATA = _d.apply(void 0, [
|
|
504
|
-
|
|
503
|
+
_c.TRICRYPTO_FACTORY_POOLS_DATA = _d.apply(void 0, [_k.sent()]);
|
|
504
|
+
_k.label = 4;
|
|
505
505
|
case 4:
|
|
506
506
|
_e = this.constants;
|
|
507
507
|
return [4 /*yield*/, this._filterHiddenPools(this.constants.TRICRYPTO_FACTORY_POOLS_DATA)];
|
|
508
508
|
case 5:
|
|
509
|
-
_e.TRICRYPTO_FACTORY_POOLS_DATA =
|
|
509
|
+
_e.TRICRYPTO_FACTORY_POOLS_DATA = _k.sent();
|
|
510
510
|
this._updateDecimalsAndGauges(this.constants.TRICRYPTO_FACTORY_POOLS_DATA);
|
|
511
511
|
return [4 /*yield*/, _killGauges(this.constants.TRICRYPTO_FACTORY_POOLS_DATA)];
|
|
512
512
|
case 6:
|
|
513
|
-
|
|
513
|
+
_k.sent();
|
|
514
|
+
if (!(this.chainId === 1)) return [3 /*break*/, 8];
|
|
514
515
|
_f = this.constants.FACTORY_GAUGE_IMPLEMENTATIONS;
|
|
515
516
|
_g = "factory-tricrypto";
|
|
516
517
|
return [4 /*yield*/, this.contracts[this.constants.ALIASES.tricrypto_factory].contract.gauge_implementation(this.constantOptions)];
|
|
517
518
|
case 7:
|
|
518
|
-
_f[_g] =
|
|
519
|
-
|
|
519
|
+
_f[_g] =
|
|
520
|
+
_k.sent();
|
|
521
|
+
return [3 /*break*/, 10];
|
|
522
|
+
case 8:
|
|
523
|
+
_h = this.constants.FACTORY_GAUGE_IMPLEMENTATIONS;
|
|
524
|
+
_j = "factory-tricrypto";
|
|
525
|
+
return [4 /*yield*/, this.contracts[this.constants.ALIASES.minter].contract.get_implementation(this.constantOptions)];
|
|
526
|
+
case 9:
|
|
527
|
+
_h[_j] =
|
|
528
|
+
_k.sent();
|
|
529
|
+
_k.label = 10;
|
|
530
|
+
case 10: return [2 /*return*/];
|
|
520
531
|
}
|
|
521
532
|
});
|
|
522
533
|
});
|
|
@@ -564,8 +575,8 @@ var Curve = /** @class */ (function () {
|
|
|
564
575
|
return __generator(this, function (_b) {
|
|
565
576
|
switch (_b.label) {
|
|
566
577
|
case 0:
|
|
567
|
-
if (![1].includes(this.chainId))
|
|
568
|
-
return [2 /*return*/, []];
|
|
578
|
+
if (![1, 42161].includes(this.chainId))
|
|
579
|
+
return [2 /*return*/, []]; // Ethereum, Arbitrum
|
|
569
580
|
currentPoolIds = Object.keys(this.constants.TRICRYPTO_FACTORY_POOLS_DATA);
|
|
570
581
|
lastPoolIdx = Number(currentPoolIds[currentPoolIds.length - 1].split("-")[2]);
|
|
571
582
|
_a = lowerCasePoolDataAddresses;
|
|
@@ -617,8 +628,8 @@ var Curve = /** @class */ (function () {
|
|
|
617
628
|
return __generator(this, function (_b) {
|
|
618
629
|
switch (_b.label) {
|
|
619
630
|
case 0:
|
|
620
|
-
if (![1].includes(this.chainId))
|
|
621
|
-
return [2 /*return*/, ''];
|
|
631
|
+
if (![1, 42161].includes(this.chainId))
|
|
632
|
+
return [2 /*return*/, '']; // Ethereum, Arbitrum
|
|
622
633
|
_a = lowerCasePoolDataAddresses;
|
|
623
634
|
return [4 /*yield*/, getTricryptoFactoryPoolData.call(this, 0, poolAddress)];
|
|
624
635
|
case 1:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@curvefi/api",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.45.0",
|
|
4
4
|
"description": "JavaScript library for curve.fi",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Macket",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"axios": "^0.21.1",
|
|
36
36
|
"bignumber.js": "^9.0.1",
|
|
37
37
|
"ethcall": "^6.0.1",
|
|
38
|
-
"ethers": "^6.
|
|
38
|
+
"ethers": "^6.7.0",
|
|
39
39
|
"memoizee": "^0.4.15"
|
|
40
40
|
}
|
|
41
41
|
}
|