@curvefi/api 2.16.2 → 2.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.
@@ -528,76 +528,6 @@
528
528
  ],
529
529
  "gas": "5480"
530
530
  },
531
- {
532
- "stateMutability": "nonpayable",
533
- "type": "function",
534
- "name": "deploy_plain_pool",
535
- "inputs": [
536
- {
537
- "name": "_name",
538
- "type": "string"
539
- },
540
- {
541
- "name": "_symbol",
542
- "type": "string"
543
- },
544
- {
545
- "name": "_coins",
546
- "type": "address[4]"
547
- },
548
- {
549
- "name": "_A",
550
- "type": "uint256"
551
- },
552
- {
553
- "name": "_fee",
554
- "type": "uint256"
555
- }
556
- ],
557
- "outputs": [
558
- {
559
- "name": "",
560
- "type": "address"
561
- }
562
- ]
563
- },
564
- {
565
- "stateMutability": "nonpayable",
566
- "type": "function",
567
- "name": "deploy_plain_pool",
568
- "inputs": [
569
- {
570
- "name": "_name",
571
- "type": "string"
572
- },
573
- {
574
- "name": "_symbol",
575
- "type": "string"
576
- },
577
- {
578
- "name": "_coins",
579
- "type": "address[4]"
580
- },
581
- {
582
- "name": "_A",
583
- "type": "uint256"
584
- },
585
- {
586
- "name": "_fee",
587
- "type": "uint256"
588
- },
589
- {
590
- "name": "_asset_type",
591
- "type": "uint256"
592
- }
593
- ],
594
- "outputs": [
595
- {
596
- "name": "",
597
- "type": "address"
598
- }
599
- ]
600
- },
601
531
  {
602
532
  "stateMutability": "nonpayable",
603
533
  "type": "function",
@@ -639,43 +569,6 @@
639
569
  }
640
570
  ]
641
571
  },
642
- {
643
- "stateMutability": "nonpayable",
644
- "type": "function",
645
- "name": "deploy_metapool",
646
- "inputs": [
647
- {
648
- "name": "_base_pool",
649
- "type": "address"
650
- },
651
- {
652
- "name": "_name",
653
- "type": "string"
654
- },
655
- {
656
- "name": "_symbol",
657
- "type": "string"
658
- },
659
- {
660
- "name": "_coin",
661
- "type": "address"
662
- },
663
- {
664
- "name": "_A",
665
- "type": "uint256"
666
- },
667
- {
668
- "name": "_fee",
669
- "type": "uint256"
670
- }
671
- ],
672
- "outputs": [
673
- {
674
- "name": "",
675
- "type": "address"
676
- }
677
- ]
678
- },
679
572
  {
680
573
  "stateMutability": "nonpayable",
681
574
  "type": "function",
@@ -0,0 +1,195 @@
1
+ [
2
+ {
3
+ "stateMutability": "nonpayable",
4
+ "type": "constructor",
5
+ "inputs": [
6
+ {
7
+ "name": "_base_pool",
8
+ "type": "address"
9
+ },
10
+ {
11
+ "name": "_base_token",
12
+ "type": "address"
13
+ }
14
+ ],
15
+ "outputs": []
16
+ },
17
+ {
18
+ "stateMutability": "nonpayable",
19
+ "type": "function",
20
+ "name": "add_liquidity",
21
+ "inputs": [
22
+ {
23
+ "name": "_pool",
24
+ "type": "address"
25
+ },
26
+ {
27
+ "name": "_deposit_amounts",
28
+ "type": "uint256[3]"
29
+ },
30
+ {
31
+ "name": "_min_mint_amount",
32
+ "type": "uint256"
33
+ }
34
+ ],
35
+ "outputs": [
36
+ {
37
+ "name": "",
38
+ "type": "uint256"
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ "stateMutability": "nonpayable",
44
+ "type": "function",
45
+ "name": "remove_liquidity",
46
+ "inputs": [
47
+ {
48
+ "name": "_pool",
49
+ "type": "address"
50
+ },
51
+ {
52
+ "name": "_burn_amount",
53
+ "type": "uint256"
54
+ },
55
+ {
56
+ "name": "_min_amounts",
57
+ "type": "uint256[3]"
58
+ }
59
+ ],
60
+ "outputs": [
61
+ {
62
+ "name": "",
63
+ "type": "uint256[3]"
64
+ }
65
+ ]
66
+ },
67
+ {
68
+ "stateMutability": "nonpayable",
69
+ "type": "function",
70
+ "name": "remove_liquidity_one_coin",
71
+ "inputs": [
72
+ {
73
+ "name": "_pool",
74
+ "type": "address"
75
+ },
76
+ {
77
+ "name": "_burn_amount",
78
+ "type": "uint256"
79
+ },
80
+ {
81
+ "name": "i",
82
+ "type": "int128"
83
+ },
84
+ {
85
+ "name": "_min_amount",
86
+ "type": "uint256"
87
+ }
88
+ ],
89
+ "outputs": [
90
+ {
91
+ "name": "",
92
+ "type": "uint256"
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "stateMutability": "nonpayable",
98
+ "type": "function",
99
+ "name": "remove_liquidity_imbalance",
100
+ "inputs": [
101
+ {
102
+ "name": "_pool",
103
+ "type": "address"
104
+ },
105
+ {
106
+ "name": "_amounts",
107
+ "type": "uint256[3]"
108
+ },
109
+ {
110
+ "name": "_max_burn_amount",
111
+ "type": "uint256"
112
+ }
113
+ ],
114
+ "outputs": [
115
+ {
116
+ "name": "",
117
+ "type": "uint256"
118
+ }
119
+ ]
120
+ },
121
+ {
122
+ "stateMutability": "view",
123
+ "type": "function",
124
+ "name": "calc_withdraw_one_coin",
125
+ "inputs": [
126
+ {
127
+ "name": "_pool",
128
+ "type": "address"
129
+ },
130
+ {
131
+ "name": "_token_amount",
132
+ "type": "uint256"
133
+ },
134
+ {
135
+ "name": "i",
136
+ "type": "int128"
137
+ }
138
+ ],
139
+ "outputs": [
140
+ {
141
+ "name": "",
142
+ "type": "uint256"
143
+ }
144
+ ]
145
+ },
146
+ {
147
+ "stateMutability": "view",
148
+ "type": "function",
149
+ "name": "calc_token_amount",
150
+ "inputs": [
151
+ {
152
+ "name": "_pool",
153
+ "type": "address"
154
+ },
155
+ {
156
+ "name": "_amounts",
157
+ "type": "uint256[3]"
158
+ },
159
+ {
160
+ "name": "_is_deposit",
161
+ "type": "bool"
162
+ }
163
+ ],
164
+ "outputs": [
165
+ {
166
+ "name": "",
167
+ "type": "uint256"
168
+ }
169
+ ]
170
+ },
171
+ {
172
+ "stateMutability": "view",
173
+ "type": "function",
174
+ "name": "BASE_POOL",
175
+ "inputs": [],
176
+ "outputs": [
177
+ {
178
+ "name": "",
179
+ "type": "address"
180
+ }
181
+ ]
182
+ },
183
+ {
184
+ "stateMutability": "view",
185
+ "type": "function",
186
+ "name": "BASE_LP_TOKEN",
187
+ "inputs": [],
188
+ "outputs": [
189
+ {
190
+ "name": "",
191
+ "type": "address"
192
+ }
193
+ ]
194
+ }
195
+ ]
@@ -55,9 +55,9 @@ exports.USD_COINS_ETHEREUM = {
55
55
  asusd: "0x6c5024cd4f8a59110119c56f8933403a539555eb",
56
56
  cdai: "0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643",
57
57
  cusdc: "0x39AA39c021dfbaE8faC545936693aC917d5E7563",
58
- idai: "0x8e595470ed749b85c6f7669de83eae304c2ec68f",
59
- iusdc: "0x76eb2fe28b36b3ee97f3adae0c69606eedb2a37c",
60
- iusdt: "0x48759f220ed983db51fa7a8c0d2aab8f3ce4166a",
58
+ cydai: "0x8e595470ed749b85c6f7669de83eae304c2ec68f",
59
+ cyusdc: "0x76eb2fe28b36b3ee97f3adae0c69606eedb2a37c",
60
+ cyusdt: "0x48759f220ed983db51fa7a8c0d2aab8f3ce4166a",
61
61
  bydai: "0xC2cB1040220768554cf699b0d863A3cd4324ce32",
62
62
  byusdc: "0x26EA744E5B887E5205727f55dFBE8685e3b21951",
63
63
  byusdt: "0xE6354ed5bC4b393a5Aad09f21c46E101e692d447",
@@ -182,7 +182,7 @@ exports.cTokensEthereum = [
182
182
  '0x39AA39c021dfbaE8faC545936693aC917d5E7563',
183
183
  "0x8e595470ed749b85c6f7669de83eae304c2ec68f",
184
184
  "0x48759f220ed983db51fa7a8c0d2aab8f3ce4166a",
185
- "0x76eb2fe28b36b3ee97f3adae0c69606eedb2a37c", // iUSDC
185
+ "0x76eb2fe28b36b3ee97f3adae0c69606eedb2a37c", // cyUSDC
186
186
  ].map(function (a) { return a.toLowerCase(); });
187
187
  exports.yTokensEthereum = [
188
188
  "0xC2cB1040220768554cf699b0d863A3cd4324ce32",
@@ -925,8 +925,8 @@ exports.POOLS_DATA_ETHEREUM = (0, utils_1.lowerCasePoolDataAddresses)({
925
925
  deposit_abi: deposit_json_19.default,
926
926
  },
927
927
  ib: {
928
- name: "ib",
929
- full_name: "ib",
928
+ name: "ironbank",
929
+ full_name: "ironbank",
930
930
  symbol: "ib",
931
931
  reference_asset: 'USD',
932
932
  swap_address: '0x2dded6Da1BF5DBdF597C45fcFaa3194e53EcfeAF',
@@ -934,7 +934,7 @@ exports.POOLS_DATA_ETHEREUM = (0, utils_1.lowerCasePoolDataAddresses)({
934
934
  gauge_address: '0xF5194c3325202F456c95c1Cf0cA36f8475C1949F',
935
935
  is_lending: true,
936
936
  underlying_coins: ['DAI', 'USDC', 'USDT'],
937
- wrapped_coins: ['iDAI', 'iUSDC', 'iUSDT'],
937
+ wrapped_coins: ['cyDAI', 'cyUSDC', 'cyUSDT'],
938
938
  underlying_coin_addresses: [
939
939
  '0x6B175474E89094C44Da98b954EedeAC495271d0F',
940
940
  '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
@@ -129,8 +129,8 @@ exports.POOLS_DATA_FANTOM = (0, utils_1.lowerCasePoolDataAddresses)({
129
129
  gauge_abi: gauge_child_json_1.default,
130
130
  },
131
131
  ib: {
132
- name: "ib",
133
- full_name: "ib",
132
+ name: "ironbank",
133
+ full_name: "ironbank",
134
134
  symbol: "ib",
135
135
  reference_asset: "USD",
136
136
  swap_address: '0x4FC8D635c3cB1d0aa123859e2B2587d0FF2707b1',
package/lib/curve.d.ts CHANGED
@@ -72,6 +72,8 @@ declare class Curve implements ICurve {
72
72
  setContract(address: string, abi: any): void;
73
73
  fetchFactoryPools(useApi?: boolean): Promise<void>;
74
74
  fetchCryptoFactoryPools(useApi?: boolean): Promise<void>;
75
+ fetchRecentlyDeployedFactoryPool(poolAddress: string): Promise<string>;
76
+ fetchRecentlyDeployedCryptoFactoryPool(poolAddress: string): Promise<string>;
75
77
  setCustomFeeData(customFeeData: {
76
78
  gasPrice?: number;
77
79
  maxFeePerGas?: number;
package/lib/curve.js CHANGED
@@ -640,6 +640,46 @@ var Curve = /** @class */ (function () {
640
640
  });
641
641
  });
642
642
  };
643
+ Curve.prototype.fetchRecentlyDeployedFactoryPool = function (poolAddress) {
644
+ return __awaiter(this, void 0, void 0, function () {
645
+ var poolData, _a;
646
+ return __generator(this, function (_b) {
647
+ switch (_b.label) {
648
+ case 0:
649
+ if (this.chainId === 1313161554)
650
+ return [2 /*return*/, ''];
651
+ _a = utils_1.lowerCasePoolDataAddresses;
652
+ return [4 /*yield*/, factory_1.getFactoryPoolData.call(this, poolAddress)];
653
+ case 1:
654
+ poolData = _a.apply(void 0, [_b.sent()]);
655
+ this.constants.FACTORY_POOLS_DATA = __assign(__assign({}, this.constants.FACTORY_POOLS_DATA), poolData);
656
+ this.constants.DECIMALS = __assign(__assign({}, this.constants.DECIMALS), (0, utils_1.extractDecimals)(this.constants.FACTORY_POOLS_DATA));
657
+ this.constants.GAUGES = __spreadArray(__spreadArray([], this.constants.GAUGES, true), (0, utils_1.extractGauges)(this.constants.FACTORY_POOLS_DATA), true);
658
+ return [2 /*return*/, Object.keys(poolData)[0]]; // id
659
+ }
660
+ });
661
+ });
662
+ };
663
+ Curve.prototype.fetchRecentlyDeployedCryptoFactoryPool = function (poolAddress) {
664
+ return __awaiter(this, void 0, void 0, function () {
665
+ var poolData, _a;
666
+ return __generator(this, function (_b) {
667
+ switch (_b.label) {
668
+ case 0:
669
+ if (![1, 137, 250].includes(this.chainId))
670
+ return [2 /*return*/, ''];
671
+ _a = utils_1.lowerCasePoolDataAddresses;
672
+ return [4 /*yield*/, factory_crypto_1.getCryptoFactoryPoolData.call(this, poolAddress)];
673
+ case 1:
674
+ poolData = _a.apply(void 0, [_b.sent()]);
675
+ this.constants.FACTORY_POOLS_DATA = __assign(__assign({}, this.constants.FACTORY_POOLS_DATA), poolData);
676
+ this.constants.DECIMALS = __assign(__assign({}, this.constants.DECIMALS), (0, utils_1.extractDecimals)(this.constants.FACTORY_POOLS_DATA));
677
+ this.constants.GAUGES = __spreadArray(__spreadArray([], this.constants.GAUGES, true), (0, utils_1.extractGauges)(this.constants.FACTORY_POOLS_DATA), true);
678
+ return [2 /*return*/, Object.keys(poolData)[0]]; // id
679
+ }
680
+ });
681
+ });
682
+ };
643
683
  Curve.prototype.setCustomFeeData = function (customFeeData) {
644
684
  this.feeData = __assign(__assign({}, this.feeData), customFeeData);
645
685
  };
@@ -33,6 +33,7 @@ var DepositZapMetaUsdPolygon_json_1 = __importDefault(require("../constants/abis
33
33
  var DepositZapMetaBtcPolygon_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaBtcPolygon.json"));
34
34
  var DepositZapFantom_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapFantom.json"));
35
35
  var DepositZapMetaUsd2Fantom_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaUsd2Fantom.json"));
36
+ var meta_zap_json_2 = __importDefault(require("../constants/abis/ren/meta_zap.json"));
36
37
  exports.implementationABIDictEthereum = {
37
38
  "0x5F890841f657d90E081bAbdB532A05996Af79Fe6": swap_json_1.default,
38
39
  "0x213be373FDff327658139C7df330817DAD2d5bBE": MetaUSD_json_1.default,
@@ -260,9 +261,9 @@ exports.basePoolIdZapDictEthereum = {
260
261
  ABI: deposit_json_1.default,
261
262
  },
262
263
  ren: {
263
- address: "0x7abdbaf29929e7f8621b757d2a7c04d78d633834".toLowerCase(),
264
- ABI: deposit_json_1.default,
265
- }, // TODO MUST BE CHANGED!!!
264
+ address: "0x8Fb3Ec8f2d1Dc089E70CD61f1E49496d443B2124".toLowerCase(),
265
+ ABI: meta_zap_json_2.default,
266
+ },
266
267
  };
267
268
  exports.basePoolIdZapDictPolygon = {
268
269
  aave: {
@@ -0,0 +1,13 @@
1
+ import { ethers } from "ethers";
2
+ export declare const deployStablePlainPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number, fee: number, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3) => Promise<number>;
3
+ export declare const deployStablePlainPool: (name: string, symbol: string, coins: string[], A: number, fee: number, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3) => Promise<ethers.ContractTransaction>;
4
+ export declare const getDeployedStablePlainPoolAddress: (tx: ethers.ContractTransaction) => Promise<string>;
5
+ export declare const deployStableMetaPoolEstimateGas: (basePool: string, name: string, symbol: string, coin: string, A: number, fee: number, implementationIdx: 0 | 1) => Promise<number>;
6
+ export declare const deployStableMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number, fee: number, implementationIdx: 0 | 1) => Promise<ethers.ContractTransaction>;
7
+ export declare const getDeployedStableMetaPoolAddress: (tx: ethers.ContractTransaction) => Promise<string>;
8
+ export declare const deployCryptoPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number, gamma: number, midFee: number, outFee: number, allowedExtraProfit: number, feeGamma: number, adjustmentStep: number, maHalfTime: number, initialPrice: number) => Promise<number>;
9
+ export declare const deployCryptoPool: (name: string, symbol: string, coins: string[], A: number, gamma: number, midFee: number, outFee: number, allowedExtraProfit: number, feeGamma: number, adjustmentStep: number, maHalfTime: number, initialPrice: number) => Promise<ethers.ContractTransaction>;
10
+ export declare const getDeployedCryptoPoolAddress: (tx: ethers.ContractTransaction) => Promise<string>;
11
+ export declare const deployGaugeEstimateGas: (pool: string, isCrypto: boolean) => Promise<number>;
12
+ export declare const deployGauge: (pool: string, isCrypto: boolean) => Promise<ethers.ContractTransaction>;
13
+ export declare const getDeployedGaugeAddress: (tx: ethers.ContractTransaction) => Promise<string>;