@curvefi/api 2.52.5 → 2.53.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 +424 -2
- package/lib/constants/abis/circulating_supply.json +114 -0
- package/lib/constants/abis/voting_proposal.json +1086 -0
- package/lib/constants/aliases.js +3 -0
- package/lib/curve.js +7 -0
- package/lib/dao.d.ts +44 -0
- package/lib/dao.js +675 -0
- package/lib/external-api.d.ts +4 -10
- package/lib/external-api.js +33 -0
- package/lib/index.d.ts +47 -0
- package/lib/index.js +45 -0
- package/lib/interfaces.d.ts +66 -0
- package/lib/pools/PoolTemplate.d.ts +5 -1
- package/lib/pools/PoolTemplate.js +140 -47
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +26 -10
- package/package.json +1 -1
package/lib/constants/aliases.js
CHANGED
|
@@ -18,6 +18,9 @@ export var ALIASES_ETHEREUM = lowerCaseValues({
|
|
|
18
18
|
"tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
|
|
19
19
|
"stable_ng_factory": '0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf',
|
|
20
20
|
"factory_admin": "",
|
|
21
|
+
"voting_parameter": '0xBCfF8B0b9419b9A88c44546519b1e909cF330399',
|
|
22
|
+
"voting_ownership": '0xE478de485ad2fe566d49342Cbd03E49ed7DB3356',
|
|
23
|
+
"circulating_supply": '0x14139EB676342b6bC8E41E0d419969f23A49881e',
|
|
21
24
|
});
|
|
22
25
|
export var ALIASES_POLYGON = lowerCaseValues({
|
|
23
26
|
"crv": "0x172370d5cd63279efa6d502dab29171933a610af",
|
package/lib/curve.js
CHANGED
|
@@ -86,6 +86,8 @@ import cryptoFactoryABI from './constants/abis/factory-crypto.json' assert { typ
|
|
|
86
86
|
import tricryptoFactoryABI from './constants/abis/factory-tricrypto.json' assert { type: 'json' };
|
|
87
87
|
import stableNgFactoryABI from './constants/abis/factory-stable-ng.json' assert { type: 'json' };
|
|
88
88
|
import gasOracleABI from './constants/abis/gas_oracle_optimism.json' assert { type: 'json' };
|
|
89
|
+
import votingProposalABI from './constants/abis/voting_proposal.json' assert { type: 'json' };
|
|
90
|
+
import circulatingSupplyABI from './constants/abis/circulating_supply.json' assert { type: 'json' };
|
|
89
91
|
import { POOLS_DATA_ETHEREUM, LLAMMAS_DATA_ETHEREUM, POOLS_DATA_POLYGON, POOLS_DATA_FANTOM, POOLS_DATA_AVALANCHE, POOLS_DATA_ARBITRUM, POOLS_DATA_OPTIMISM, POOLS_DATA_XDAI, POOLS_DATA_MOONBEAM, POOLS_DATA_AURORA, POOLS_DATA_KAVA, POOLS_DATA_CELO, POOLS_DATA_ZKSYNC, POOLS_DATA_BASE, POOLS_DATA_BSC, } from './constants/pools/index.js';
|
|
90
92
|
import { ALIASES_ETHEREUM, ALIASES_OPTIMISM, ALIASES_POLYGON, ALIASES_FANTOM, ALIASES_AVALANCHE, ALIASES_ARBITRUM, ALIASES_XDAI, ALIASES_MOONBEAM, ALIASES_AURORA, ALIASES_KAVA, ALIASES_CELO, ALIASES_ZKSYNC, ALIASES_BASE, ALIASES_BSC, } from "./constants/aliases.js";
|
|
91
93
|
import { COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum } from "./constants/coins/ethereum.js";
|
|
@@ -1031,6 +1033,11 @@ var Curve = /** @class */ (function () {
|
|
|
1031
1033
|
this.setContract(this.constants.ALIASES.stable_ng_factory, stableNgFactoryABI);
|
|
1032
1034
|
this.setContract(this.constants.ALIASES.anycall, anycallABI);
|
|
1033
1035
|
this.setContract(this.constants.ALIASES.voting_escrow_oracle, this.chainId === 1 ? votingEscrowOracleEthABI : votingEscrowOracleABI);
|
|
1036
|
+
if (this.chainId === 1) {
|
|
1037
|
+
this.setContract(this.constants.ALIASES.voting_parameter, votingProposalABI);
|
|
1038
|
+
this.setContract(this.constants.ALIASES.voting_ownership, votingProposalABI);
|
|
1039
|
+
this.setContract(this.constants.ALIASES.circulating_supply, circulatingSupplyABI);
|
|
1040
|
+
}
|
|
1034
1041
|
if (L2Networks.includes(this.chainId)) {
|
|
1035
1042
|
curveInstance_1 = this;
|
|
1036
1043
|
curveInstance_1.setContract(curveInstance_1.constants.ALIASES.gas_oracle, gasOracleABI);
|
package/lib/dao.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IGaugeUserVote, IVotingGauge, IDaoProposalListItem, IDaoProposalUserListItem, IDaoProposal } from './interfaces';
|
|
2
|
+
export declare const crvSupplyStats: () => Promise<{
|
|
3
|
+
circulating: string;
|
|
4
|
+
locked: string;
|
|
5
|
+
total: string;
|
|
6
|
+
veCrv: string;
|
|
7
|
+
averageLockTime: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const userCrv: (address?: string) => Promise<string>;
|
|
10
|
+
export declare const userVeCrv: (address?: string) => Promise<{
|
|
11
|
+
veCrv: string;
|
|
12
|
+
veCrvPct: string;
|
|
13
|
+
lockedCrv: string;
|
|
14
|
+
unlockTime: number;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const crvLockIsApproved: (amount: number | string) => Promise<boolean>;
|
|
17
|
+
export declare const crvLockApproveEstimateGas: (amount: number | string) => Promise<number | number[]>;
|
|
18
|
+
export declare const crvLockApprove: (amount: number | string) => Promise<string[]>;
|
|
19
|
+
export declare const calcCrvUnlockTime: (days: number | string, start?: number | string) => number;
|
|
20
|
+
export declare const createCrvLockEstimateGas: (amount: number | string, days: number | string) => Promise<number | number[]>;
|
|
21
|
+
export declare const createCrvLock: (amount: number | string, days: number | string) => Promise<string>;
|
|
22
|
+
export declare const increaseCrvLockedAmountEstimateGas: (amount: number | string) => Promise<number | number[]>;
|
|
23
|
+
export declare const increaseCrvLockedAmount: (amount: number | string) => Promise<string>;
|
|
24
|
+
export declare const increaseCrvUnlockTimeEstimateGas: (days: number | string) => Promise<number | number[]>;
|
|
25
|
+
export declare const increaseCrvUnlockTime: (days: number | string) => Promise<string>;
|
|
26
|
+
export declare const withdrawLockedCrvEstimateGas: () => Promise<number | number[]>;
|
|
27
|
+
export declare const withdrawLockedCrv: () => Promise<string>;
|
|
28
|
+
export declare const claimableFees: (address?: string) => Promise<string>;
|
|
29
|
+
export declare const claimFeesEstimateGas: (address?: string) => Promise<number | number[]>;
|
|
30
|
+
export declare const claimFees: (address?: string) => Promise<string>;
|
|
31
|
+
export declare const getVotingGaugeList: () => Promise<IVotingGauge[]>;
|
|
32
|
+
export declare const userGaugeVotes: (address?: string) => Promise<{
|
|
33
|
+
gauges: IGaugeUserVote[];
|
|
34
|
+
powerUsed: string;
|
|
35
|
+
veCrvUsed: string;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const voteForGaugeNextTime: (gauge: string) => Promise<number>;
|
|
38
|
+
export declare const voteForGaugeEstimateGas: (gauge: string, power: number | string) => Promise<number | number[]>;
|
|
39
|
+
export declare const voteForGauge: (gauge: string, power: number | string) => Promise<string>;
|
|
40
|
+
export declare const getProposalList: () => Promise<IDaoProposalListItem[]>;
|
|
41
|
+
export declare const getProposal: (type: "PARAMETER" | "OWNERSHIP", id: number) => Promise<IDaoProposal>;
|
|
42
|
+
export declare const userProposalVotes: (address?: string) => Promise<IDaoProposalUserListItem[]>;
|
|
43
|
+
export declare const voteForProposalEstimateGas: (type: "PARAMETER" | "OWNERSHIP", id: number, support: boolean) => Promise<number | number[]>;
|
|
44
|
+
export declare const voteForProposal: (type: "PARAMETER" | "OWNERSHIP", id: number, support: boolean) => Promise<string>;
|