@curvefi/api 1.17.0 → 1.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/pools.js +9 -18
- package/package.json +1 -1
package/lib/pools.js
CHANGED
|
@@ -409,34 +409,25 @@ var Pool = /** @class */ (function () {
|
|
|
409
409
|
});
|
|
410
410
|
}); };
|
|
411
411
|
this.addLiquidityIsApproved = function (amounts) { return __awaiter(_this, void 0, void 0, function () {
|
|
412
|
-
var spender;
|
|
413
412
|
return __generator(this, function (_a) {
|
|
414
413
|
switch (_a.label) {
|
|
415
|
-
case 0:
|
|
416
|
-
spender = (['compound', 'usdt', 'y', 'busd', 'pax'].includes(this.name) || this.isMeta) ? this.zap : this.swap;
|
|
417
|
-
return [4 /*yield*/, (0, utils_1.hasAllowance)(this.underlyingCoinAddresses, amounts, curve_1.curve.signerAddress, spender)];
|
|
414
|
+
case 0: return [4 /*yield*/, (0, utils_1.hasAllowance)(this.underlyingCoinAddresses, amounts, curve_1.curve.signerAddress, this.zap || this.swap)];
|
|
418
415
|
case 1: return [2 /*return*/, _a.sent()];
|
|
419
416
|
}
|
|
420
417
|
});
|
|
421
418
|
}); };
|
|
422
419
|
this.addLiquidityApproveEstimateGas = function (amounts) { return __awaiter(_this, void 0, void 0, function () {
|
|
423
|
-
var spender;
|
|
424
420
|
return __generator(this, function (_a) {
|
|
425
421
|
switch (_a.label) {
|
|
426
|
-
case 0:
|
|
427
|
-
spender = (['compound', 'usdt', 'y', 'busd', 'pax'].includes(this.name) || this.isMeta) ? this.zap : this.swap;
|
|
428
|
-
return [4 /*yield*/, (0, utils_1.ensureAllowanceEstimateGas)(this.underlyingCoinAddresses, amounts, spender)];
|
|
422
|
+
case 0: return [4 /*yield*/, (0, utils_1.ensureAllowanceEstimateGas)(this.underlyingCoinAddresses, amounts, this.zap || this.swap)];
|
|
429
423
|
case 1: return [2 /*return*/, _a.sent()];
|
|
430
424
|
}
|
|
431
425
|
});
|
|
432
426
|
}); };
|
|
433
427
|
this.addLiquidityApprove = function (amounts) { return __awaiter(_this, void 0, void 0, function () {
|
|
434
|
-
var spender;
|
|
435
428
|
return __generator(this, function (_a) {
|
|
436
429
|
switch (_a.label) {
|
|
437
|
-
case 0:
|
|
438
|
-
spender = (['compound', 'usdt', 'y', 'busd', 'pax'].includes(this.name) || this.isMeta) ? this.zap : this.swap;
|
|
439
|
-
return [4 /*yield*/, (0, utils_1.ensureAllowance)(this.underlyingCoinAddresses, amounts, spender)];
|
|
430
|
+
case 0: return [4 /*yield*/, (0, utils_1.ensureAllowance)(this.underlyingCoinAddresses, amounts, this.zap || this.swap)];
|
|
440
431
|
case 1: return [2 /*return*/, _a.sent()];
|
|
441
432
|
}
|
|
442
433
|
});
|
|
@@ -1056,7 +1047,7 @@ var Pool = /** @class */ (function () {
|
|
|
1056
1047
|
return __generator(this, function (_a) {
|
|
1057
1048
|
switch (_a.label) {
|
|
1058
1049
|
case 0:
|
|
1059
|
-
if (!
|
|
1050
|
+
if (!this.zap)
|
|
1060
1051
|
return [2 /*return*/, true];
|
|
1061
1052
|
return [4 /*yield*/, (0, utils_1.hasAllowance)([this.lpToken], [lpTokenAmount], curve_1.curve.signerAddress, this.zap)];
|
|
1062
1053
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -1067,7 +1058,7 @@ var Pool = /** @class */ (function () {
|
|
|
1067
1058
|
return __generator(this, function (_a) {
|
|
1068
1059
|
switch (_a.label) {
|
|
1069
1060
|
case 0:
|
|
1070
|
-
if (!
|
|
1061
|
+
if (!this.zap)
|
|
1071
1062
|
return [2 /*return*/, 0];
|
|
1072
1063
|
return [4 /*yield*/, (0, utils_1.ensureAllowanceEstimateGas)([this.lpToken], [lpTokenAmount], this.zap)];
|
|
1073
1064
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -1078,7 +1069,7 @@ var Pool = /** @class */ (function () {
|
|
|
1078
1069
|
return __generator(this, function (_a) {
|
|
1079
1070
|
switch (_a.label) {
|
|
1080
1071
|
case 0:
|
|
1081
|
-
if (!
|
|
1072
|
+
if (!this.zap)
|
|
1082
1073
|
return [2 /*return*/, []];
|
|
1083
1074
|
return [4 /*yield*/, (0, utils_1.ensureAllowance)([this.lpToken], [lpTokenAmount], this.zap)];
|
|
1084
1075
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -1527,7 +1518,7 @@ var Pool = /** @class */ (function () {
|
|
|
1527
1518
|
return __generator(this, function (_a) {
|
|
1528
1519
|
switch (_a.label) {
|
|
1529
1520
|
case 0:
|
|
1530
|
-
if (!
|
|
1521
|
+
if (!this.zap)
|
|
1531
1522
|
return [2 /*return*/, true];
|
|
1532
1523
|
return [4 /*yield*/, (0, utils_1.hasAllowance)([this.lpToken], [lpTokenAmount], curve_1.curve.signerAddress, this.zap)];
|
|
1533
1524
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -1538,7 +1529,7 @@ var Pool = /** @class */ (function () {
|
|
|
1538
1529
|
return __generator(this, function (_a) {
|
|
1539
1530
|
switch (_a.label) {
|
|
1540
1531
|
case 0:
|
|
1541
|
-
if (!
|
|
1532
|
+
if (!this.zap)
|
|
1542
1533
|
return [2 /*return*/, 0];
|
|
1543
1534
|
return [4 /*yield*/, (0, utils_1.ensureAllowanceEstimateGas)([this.lpToken], [lpTokenAmount], this.zap)];
|
|
1544
1535
|
case 1: return [2 /*return*/, _a.sent()];
|
|
@@ -1549,7 +1540,7 @@ var Pool = /** @class */ (function () {
|
|
|
1549
1540
|
return __generator(this, function (_a) {
|
|
1550
1541
|
switch (_a.label) {
|
|
1551
1542
|
case 0:
|
|
1552
|
-
if (!
|
|
1543
|
+
if (!this.zap)
|
|
1553
1544
|
return [2 /*return*/, []];
|
|
1554
1545
|
return [4 /*yield*/, (0, utils_1.ensureAllowance)([this.lpToken], [lpTokenAmount], this.zap)];
|
|
1555
1546
|
case 1: return [2 /*return*/, _a.sent()];
|