@curvefi/api 2.69.6 → 2.69.7
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 +7 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -1
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -535,6 +535,13 @@ import curve from "@curvefi/api";
|
|
|
535
535
|
await steth.stats.volume();
|
|
536
536
|
// 174737430.35185483
|
|
537
537
|
|
|
538
|
+
await curve.getPoolVolumes();
|
|
539
|
+
// {
|
|
540
|
+
// '0xa2b47e3d5c44877cca798226b7b8118f9bfb7a56': '123456789.123',
|
|
541
|
+
// '0xdc24316b9ae028f1497c275eb9192a3ea0f67022': '174737430.35185483',
|
|
542
|
+
// ...
|
|
543
|
+
// }
|
|
544
|
+
|
|
538
545
|
await steth.stats.baseApy();
|
|
539
546
|
// { day: '3.1587592896017647', week: '2.6522145719060752' } (as %)
|
|
540
547
|
|
package/lib/index.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export declare const createCurve: () => {
|
|
|
65
65
|
cryptoVolume: number;
|
|
66
66
|
cryptoShare: number;
|
|
67
67
|
}>;
|
|
68
|
+
getPoolVolumes: () => Promise<Record<`0x${string}`, `${number}`>>;
|
|
68
69
|
hasDepositAndStake: () => boolean;
|
|
69
70
|
hasRouter: () => boolean;
|
|
70
71
|
getCurveLiteNetworks: () => Promise<import("./interfaces.js").ICurveLiteNetwork[]>;
|
|
@@ -398,6 +399,7 @@ declare const _default: {
|
|
|
398
399
|
cryptoVolume: number;
|
|
399
400
|
cryptoShare: number;
|
|
400
401
|
}>;
|
|
402
|
+
getPoolVolumes: () => Promise<Record<`0x${string}`, `${number}`>>;
|
|
401
403
|
hasDepositAndStake: () => boolean;
|
|
402
404
|
hasRouter: () => boolean;
|
|
403
405
|
getCurveLiteNetworks: () => Promise<import("./interfaces.js").ICurveLiteNetwork[]>;
|
package/lib/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { getBestRouteAndOutput, getArgs, swapExpected, swapRequired, swapPriceIm
|
|
|
13
13
|
import { isSupported, assertIsSupported, allowedToBridge, bridgeCost, bridgeIsApproved, bridgeApproveEstimateGas, bridgeApprove, bridgeEstimateGas, bridge, getSupportedNetworks, } from "./bridge.js";
|
|
14
14
|
import { Curve } from "./curve.js";
|
|
15
15
|
import { getCrv, getLockedAmountAndUnlockTime, getVeCrv, getVeCrvPct, calcUnlockTime, createLockEstimateGas, createLock, isApproved, approveEstimateGas, approve, increaseAmountEstimateGas, increaseAmount, increaseUnlockTimeEstimateGas, increaseUnlockTime, withdrawLockedCrvEstimateGas, withdrawLockedCrv, claimableFees, claimFeesEstimateGas, claimFees, lastEthBlock, getAnycallBalance, topUpAnycall, topUpAnycallEstimateGas, lastBlockSent, blockToSend, sendBlockhash, sendBlockhashEstimateGas, submitProof, submitProofEstimateGas, claimFeesCrvUSDEstimateGas, claimableFeesCrvUSD, claimFeesCrvUSD, calculateVeCrv, } from "./boosting.js";
|
|
16
|
-
import { getBalances, getAllowance, hasAllowance, ensureAllowanceEstimateGas, ensureAllowance, populateApprove, getUsdRate, getGasPriceFromL1, getGasPriceFromL2, getGasInfoForL2, getTVL, getCoinsData, getVolume, hasDepositAndStake, hasRouter, getBasePools, getGasPrice, getCurveLiteNetworks, } from "./utils.js";
|
|
16
|
+
import { getBalances, getAllowance, hasAllowance, ensureAllowanceEstimateGas, ensureAllowance, populateApprove, getUsdRate, getGasPriceFromL1, getGasPriceFromL2, getGasInfoForL2, getTVL, getCoinsData, getVolume, getPoolVolumes, hasDepositAndStake, hasRouter, getBasePools, getGasPrice, getCurveLiteNetworks, } from "./utils.js";
|
|
17
17
|
import { deployStablePlainPool, deployStablePlainPoolEstimateGas, getDeployedStablePlainPoolAddress, setOracle, setOracleEstimateGas, deployStableMetaPool, deployStableMetaPoolEstimateGas, getDeployedStableMetaPoolAddress, deployCryptoPool, deployCryptoPoolEstimateGas, getDeployedCryptoPoolAddress, deployTricryptoPool, deployTricryptoPoolEstimateGas, getDeployedTricryptoPoolAddress, deployGauge, deployGaugeEstimateGas, getDeployedGaugeAddress, deployGaugeSidechain, deployGaugeSidechainEstimateGas, deployGaugeMirror, deployGaugeMirrorEstimateGas, getDeployedGaugeMirrorAddress, getDeployedGaugeMirrorAddressByTx, deployStableNgPlainPool, deployStableNgPlainPoolEstimateGas, deployStableNgMetaPool, deployStableNgMetaPoolEstimateGas, deployTwocryptoPool, deployTwocryptoPoolEstimateGas, getDeployedTwocryptoPoolAddress, } from './factory/deploy.js';
|
|
18
18
|
import { getTwoCryptoImplementations } from './constants/twoCryptoImplementations.js';
|
|
19
19
|
import { crvSupplyStats, userCrv, userVeCrv, crvLockIsApproved, crvLockApproveEstimateGas, crvLockApprove, calcCrvUnlockTime, createCrvLockEstimateGas, createCrvLock, increaseCrvLockedAmountEstimateGas, increaseCrvLockedAmount, increaseCrvUnlockTimeEstimateGas, increaseCrvUnlockTime, withdrawLockedCrvEstimateGas as daoWithdrawLockedCrvEstimateGas, withdrawLockedCrv as daoWithdrawLockedCrv, claimableFees as daoClaimableFees, claimFeesEstimateGas as daoClaimFeesEstimateGas, claimFees as daoClaimFees, getVotingGaugeList, userGaugeVotes, voteForGaugeNextTime, voteForGaugeEstimateGas, voteForGauge, getProposalList, getProposal, userProposalVotes, voteForProposalEstimateGas, voteForProposal, executeVote, executeVoteEstimateGas, isCanVoteExecute, } from "./dao.js";
|
|
@@ -56,6 +56,7 @@ export const createCurve = () => {
|
|
|
56
56
|
populateApprove: populateApprove.bind(_curve),
|
|
57
57
|
getCoinsData: getCoinsData.bind(_curve),
|
|
58
58
|
getVolume: getVolume.bind(_curve),
|
|
59
|
+
getPoolVolumes: getPoolVolumes.bind(_curve),
|
|
59
60
|
hasDepositAndStake: hasDepositAndStake.bind(_curve),
|
|
60
61
|
hasRouter: hasRouter.bind(_curve),
|
|
61
62
|
getCurveLiteNetworks: getCurveLiteNetworks.bind(_curve),
|
package/lib/utils.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export declare function getVolume(this: Curve, chainId?: number): Promise<{
|
|
|
83
83
|
cryptoVolume: number;
|
|
84
84
|
cryptoShare: number;
|
|
85
85
|
}>;
|
|
86
|
+
export declare function getPoolVolumes(this: Curve): Promise<Record<`0x${string}`, `${number}`>>;
|
|
86
87
|
export declare function _setContracts(this: Curve, address: string, abi: any): {
|
|
87
88
|
abi: any;
|
|
88
89
|
contract: Contract;
|
package/lib/utils.js
CHANGED
|
@@ -702,6 +702,13 @@ export function getVolume() {
|
|
|
702
702
|
return { totalVolume, cryptoVolume, cryptoShare };
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
+
export function getPoolVolumes() {
|
|
706
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
707
|
+
const { poolsData } = yield getVolumeApiController.call(this, this.constants.NETWORK_NAME);
|
|
708
|
+
const entries = poolsData.map(({ address, volumeUSD }) => [address.toLowerCase(), `${volumeUSD}`]);
|
|
709
|
+
return Object.fromEntries(entries);
|
|
710
|
+
});
|
|
711
|
+
}
|
|
705
712
|
export function _setContracts(address, abi) {
|
|
706
713
|
const contracts = {
|
|
707
714
|
abi,
|