@curvefi/api 2.69.6 → 2.69.8
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/constants/factory/crypto.js +1 -1
- package/lib/constants/network_constants.js +2 -2
- 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
|
|
|
@@ -39,7 +39,7 @@ export const tricryptoDeployImplementations = {
|
|
|
39
39
|
},
|
|
40
40
|
56: {
|
|
41
41
|
amm_native_transfers_disabled: '0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf'.toLowerCase(), //1
|
|
42
|
-
amm_native_transfers_enabled: '
|
|
42
|
+
amm_native_transfers_enabled: '0xc6C09471Ee39C7E30a067952FcC89c8922f9Ab53'.toLowerCase(), //0
|
|
43
43
|
implementationIdx: 1,
|
|
44
44
|
},
|
|
45
45
|
100: {
|
|
@@ -244,7 +244,7 @@ const ALIASES_BASE = lowerCaseValues({
|
|
|
244
244
|
"gas_oracle_blob": '0x420000000000000000000000000000000000000f',
|
|
245
245
|
});
|
|
246
246
|
const ALIASES_BSC = lowerCaseValues({
|
|
247
|
-
"crv": "
|
|
247
|
+
"crv": "0x9996D0276612d23b35f90C51EE935520B3d7355B",
|
|
248
248
|
"child_gauge_factory": "0xe35A879E5EfB4F1Bb7F70dCF3250f2e19f096bd8",
|
|
249
249
|
"child_gauge_factory_old": "0xDb205f215f568ADf21b9573b62566f6d9a40bed6",
|
|
250
250
|
"voting_escrow": "0x0000000000000000000000000000000000000000", // <-- TODO CHANGE
|
|
@@ -259,7 +259,7 @@ const ALIASES_BSC = lowerCaseValues({
|
|
|
259
259
|
"crypto_factory": '0xBd5fBd2FA58cB15228a9Abdac9ec994f79E3483C',
|
|
260
260
|
"stable_ng_factory": '0xd7E72f3615aa65b92A4DBdC211E296a35512988B',
|
|
261
261
|
"twocrypto_factory": '0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F',
|
|
262
|
-
"tricrypto_factory": '
|
|
262
|
+
"tricrypto_factory": '0x38f8D93406fA2d9924DcFcB67dB5B0521Fb20F7D',
|
|
263
263
|
"factory_admin": '0x0000000000000000000000000000000000000000',
|
|
264
264
|
});
|
|
265
265
|
const ALIASES_FRAXTAL = lowerCaseValues({
|
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,
|