@curvefi/api 2.61.1 → 2.61.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.
- package/lib/router.js +3 -0
- package/lib/utils.js +18 -6
- package/package.json +1 -1
package/lib/router.js
CHANGED
|
@@ -401,6 +401,9 @@ var _buildRouteGraph = memoize(function () { return __awaiter(void 0, void 0, vo
|
|
|
401
401
|
// Don't swap metacoins since they can be swapped directly in base pool
|
|
402
402
|
if (metaCoinAddresses.includes(underlyingCoinAddresses[i]) && metaCoinAddresses.includes(underlyingCoinAddresses[j]))
|
|
403
403
|
continue;
|
|
404
|
+
// avWBTC is frozen by Aave on Avalanche, deposits are not working
|
|
405
|
+
if (curve.chainId === 43114 && poolId === "atricrypto" && i === 3)
|
|
406
|
+
continue;
|
|
404
407
|
hasEth = underlyingCoinAddresses.includes(curve.constants.NATIVE_TOKEN.address);
|
|
405
408
|
swapType = (poolData.is_crypto && poolData.is_meta && poolData.is_factory) || ((basePool === null || basePool === void 0 ? void 0 : basePool.is_lending) && poolData.is_factory) ? 3
|
|
406
409
|
: hasEth && poolId !== 'avaxcrypto' ? 1 : 2;
|
package/lib/utils.js
CHANGED
|
@@ -768,17 +768,21 @@ export var getGasPriceFromL2 = function () { return __awaiter(void 0, void 0, vo
|
|
|
768
768
|
return [4 /*yield*/, getGasPrice()]; // gwei
|
|
769
769
|
case 3: return [2 /*return*/, _a.sent()]; // gwei
|
|
770
770
|
case 4:
|
|
771
|
-
if (!
|
|
771
|
+
if (!(curve.chainId === 5000)) return [3 /*break*/, 6];
|
|
772
|
+
return [4 /*yield*/, getGasPrice()]; // gwei
|
|
773
|
+
case 5: return [2 /*return*/, _a.sent()]; // gwei
|
|
774
|
+
case 6:
|
|
775
|
+
if (!L2Networks.includes(curve.chainId)) return [3 /*break*/, 8];
|
|
772
776
|
return [4 /*yield*/, curve.contracts[curve.constants.ALIASES.gas_oracle_blob].contract.gasPrice({ "gasPrice": "0x2000000" })];
|
|
773
|
-
case
|
|
777
|
+
case 7:
|
|
774
778
|
gasPrice = _a.sent();
|
|
775
779
|
return [2 /*return*/, Number(gasPrice)];
|
|
776
|
-
case
|
|
780
|
+
case 8: throw Error("This method exists only for L2 networks");
|
|
777
781
|
}
|
|
778
782
|
});
|
|
779
783
|
}); };
|
|
780
784
|
export var getGasInfoForL2 = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
781
|
-
var baseFee, gasPrice;
|
|
785
|
+
var baseFee, gasPrice, gasPrice;
|
|
782
786
|
return __generator(this, function (_a) {
|
|
783
787
|
switch (_a.label) {
|
|
784
788
|
case 0:
|
|
@@ -798,7 +802,15 @@ export var getGasInfoForL2 = function () { return __awaiter(void 0, void 0, void
|
|
|
798
802
|
return [2 /*return*/, {
|
|
799
803
|
gasPrice: gasPrice,
|
|
800
804
|
}];
|
|
801
|
-
case 4:
|
|
805
|
+
case 4:
|
|
806
|
+
if (!(curve.chainId === 5000)) return [3 /*break*/, 6];
|
|
807
|
+
return [4 /*yield*/, getGasPrice()];
|
|
808
|
+
case 5:
|
|
809
|
+
gasPrice = _a.sent();
|
|
810
|
+
return [2 /*return*/, {
|
|
811
|
+
gasPrice: gasPrice,
|
|
812
|
+
}];
|
|
813
|
+
case 6: throw Error("This method exists only for L2 networks");
|
|
802
814
|
}
|
|
803
815
|
});
|
|
804
816
|
}); };
|
|
@@ -1008,7 +1020,7 @@ export var getBasePools = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
1008
1020
|
factoryMulticallContract = curve.contracts[curve.constants.ALIASES['stable_ng_factory']].multicallContract;
|
|
1009
1021
|
_a = Number;
|
|
1010
1022
|
_c = (_b = curve).formatUnits;
|
|
1011
|
-
return [4 /*yield*/, factoryContract.base_pool_count()];
|
|
1023
|
+
return [4 /*yield*/, factoryContract.base_pool_count(curve.constantOptions)];
|
|
1012
1024
|
case 1:
|
|
1013
1025
|
basePoolCount = _a.apply(void 0, [_c.apply(_b, [_d.sent(), 0])]);
|
|
1014
1026
|
calls = [];
|