@curvefi/api 1.15.0 → 1.17.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/README.md +110 -20
- package/lib/constants/abis/abis-ethereum.js +95 -0
- package/lib/constants/abis/json/deposit_and_stake.json +51 -0
- package/lib/constants/aliases.d.ts +2 -0
- package/lib/constants/aliases.js +3 -1
- package/lib/constants/coins-ethereum.js +7 -3
- package/lib/curve.d.ts +1 -0
- package/lib/curve.js +10 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/pools.d.ts +29 -1
- package/lib/pools.js +586 -72
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +5 -3
- package/package.json +1 -1
package/lib/utils.d.ts
CHANGED
|
@@ -22,3 +22,4 @@ export declare const ensureAllowance: (coins: string[], amounts: string[], spend
|
|
|
22
22
|
export declare const getPoolNameBySwapAddress: (swapAddress: string) => string;
|
|
23
23
|
export declare const _getUsdRate: (assetId: string) => Promise<number>;
|
|
24
24
|
export declare const _getStatsUrl: (isCrypto?: boolean) => string;
|
|
25
|
+
export declare const getPoolList: () => string[];
|
package/lib/utils.js
CHANGED
|
@@ -59,7 +59,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
59
59
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
60
|
};
|
|
61
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports._getStatsUrl = exports._getUsdRate = exports.getPoolNameBySwapAddress = exports.ensureAllowance = exports.ensureAllowanceEstimateGas = exports._ensureAllowance = exports.hasAllowance = exports.getAllowance = exports._getAllowance = exports.getBalances = exports._prepareAddresses = exports._getBalances = exports._getCoinDecimals = exports._getCoinAddresses = exports.getEthIndex = exports.isEth = exports.fromBN = exports.toStringFromBN = exports.toBN = exports.BN = exports.MAX_ALLOWANCE = void 0;
|
|
62
|
+
exports.getPoolList = exports._getStatsUrl = exports._getUsdRate = exports.getPoolNameBySwapAddress = exports.ensureAllowance = exports.ensureAllowanceEstimateGas = exports._ensureAllowance = exports.hasAllowance = exports.getAllowance = exports._getAllowance = exports.getBalances = exports._prepareAddresses = exports._getBalances = exports._getCoinDecimals = exports._getCoinAddresses = exports.getEthIndex = exports.isEth = exports.fromBN = exports.toStringFromBN = exports.toBN = exports.BN = exports.MAX_ALLOWANCE = void 0;
|
|
63
63
|
var axios_1 = __importDefault(require("axios"));
|
|
64
64
|
var ethers_1 = require("ethers");
|
|
65
65
|
var bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
@@ -419,13 +419,15 @@ exports._getUsdRate = _getUsdRate;
|
|
|
419
419
|
var _getStatsUrl = function (isCrypto) {
|
|
420
420
|
if (isCrypto === void 0) { isCrypto = false; }
|
|
421
421
|
if (curve_1.curve.chainId === 1 || curve_1.curve.chainId === 1337) {
|
|
422
|
-
return isCrypto ? "
|
|
422
|
+
return isCrypto ? "https://stats.curve.fi/raw-stats-crypto/apys.json" : "https://stats.curve.fi/raw-stats/apys.json";
|
|
423
423
|
}
|
|
424
424
|
else if (curve_1.curve.chainId === 137) {
|
|
425
|
-
return "
|
|
425
|
+
return "https://stats.curve.fi/raw-stats-polygon/apys.json";
|
|
426
426
|
}
|
|
427
427
|
else {
|
|
428
428
|
throw Error("Unsupported network id".concat(curve_1.curve.chainId));
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
431
|
exports._getStatsUrl = _getStatsUrl;
|
|
432
|
+
var getPoolList = function () { return Object.keys(curve_1.POOLS_DATA); };
|
|
433
|
+
exports.getPoolList = getPoolList;
|