@curvefi/api 2.46.1 → 2.46.3
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 +17 -1
- package/lib/constants/abis/gauge_factory.json +1 -879
- package/lib/constants/abis/{minter_child.json → gauge_factory_sidechain.json} +0 -21
- package/lib/constants/aliases.js +13 -13
- package/lib/curve.js +6 -6
- package/lib/factory/deploy.d.ts +4 -0
- package/lib/factory/deploy.js +73 -1
- package/lib/factory/factory-crypto.js +64 -9
- package/lib/factory/factory-tricrypto.js +32 -4
- package/lib/factory/factory.js +33 -10
- package/lib/index.d.ts +12 -0
- package/lib/index.js +37 -1
- package/lib/pools/PoolTemplate.js +2 -1
- package/lib/pools/utils.js +2 -0
- package/lib/utils.js +2 -1
- package/package.json +1 -1
- package/lib/constants/abis/minter.json +0 -165
package/lib/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import { getBestRouteAndOutput, swapExpected, swapPriceImpact, swapIsApproved, s
|
|
|
40
40
|
import { curve as _curve } from "./curve.js";
|
|
41
41
|
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, } from "./boosting.js";
|
|
42
42
|
import { getBalances, getAllowance, hasAllowance, ensureAllowanceEstimateGas, ensureAllowance, getUsdRate, getTVL, getCoinsData, getVolume, } from "./utils.js";
|
|
43
|
-
import { deployStablePlainPool, deployStablePlainPoolEstimateGas, getDeployedStablePlainPoolAddress, setOracle, setOracleEstimateGas, deployStableMetaPool, deployStableMetaPoolEstimateGas, getDeployedStableMetaPoolAddress, deployCryptoPool, deployCryptoPoolEstimateGas, getDeployedCryptoPoolAddress, deployTricryptoPool, deployTricryptoPoolEstimateGas, getDeployedTricryptoPoolAddress, deployGauge, deployGaugeEstimateGas, getDeployedGaugeAddress, } from './factory/deploy.js';
|
|
43
|
+
import { deployStablePlainPool, deployStablePlainPoolEstimateGas, getDeployedStablePlainPoolAddress, setOracle, setOracleEstimateGas, deployStableMetaPool, deployStableMetaPoolEstimateGas, getDeployedStableMetaPoolAddress, deployCryptoPool, deployCryptoPoolEstimateGas, getDeployedCryptoPoolAddress, deployTricryptoPool, deployTricryptoPoolEstimateGas, getDeployedTricryptoPoolAddress, deployGauge, deployGaugeEstimateGas, getDeployedGaugeAddress, deployGaugeSidechain, deployGaugeSidechainEstimateGas, deployGaugeMirror, deployGaugeMirrorEstimateGas, } from './factory/deploy.js';
|
|
44
44
|
function init(providerType, providerSettings, options) {
|
|
45
45
|
if (options === void 0) { options = {}; }
|
|
46
46
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -93,6 +93,12 @@ var curve = {
|
|
|
93
93
|
deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
94
94
|
return [2 /*return*/, deployGauge(poolAddress, _curve.constants.ALIASES.factory)];
|
|
95
95
|
}); }); },
|
|
96
|
+
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
97
|
+
return [2 /*return*/, deployGaugeSidechain(poolAddress, salt)];
|
|
98
|
+
}); }); },
|
|
99
|
+
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
100
|
+
return [2 /*return*/, deployGaugeMirror(chainId, salt)];
|
|
101
|
+
}); }); },
|
|
96
102
|
getDeployedPlainPoolAddress: getDeployedStablePlainPoolAddress,
|
|
97
103
|
getDeployedMetaPoolAddress: getDeployedStableMetaPoolAddress,
|
|
98
104
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
@@ -105,6 +111,12 @@ var curve = {
|
|
|
105
111
|
deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
106
112
|
return [2 /*return*/, deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.factory)];
|
|
107
113
|
}); }); },
|
|
114
|
+
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
115
|
+
return [2 /*return*/, deployGaugeSidechainEstimateGas(poolAddress, salt)];
|
|
116
|
+
}); }); },
|
|
117
|
+
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
118
|
+
return [2 /*return*/, deployGaugeMirrorEstimateGas(chainId, salt)];
|
|
119
|
+
}); }); },
|
|
108
120
|
},
|
|
109
121
|
},
|
|
110
122
|
crvUSDFactory: {
|
|
@@ -123,6 +135,12 @@ var curve = {
|
|
|
123
135
|
deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
124
136
|
return [2 /*return*/, deployGauge(poolAddress, _curve.constants.ALIASES.crypto_factory)];
|
|
125
137
|
}); }); },
|
|
138
|
+
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
139
|
+
return [2 /*return*/, deployGaugeSidechain(poolAddress, salt)];
|
|
140
|
+
}); }); },
|
|
141
|
+
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
142
|
+
return [2 /*return*/, deployGaugeMirror(chainId, salt)];
|
|
143
|
+
}); }); },
|
|
126
144
|
getDeployedPoolAddress: getDeployedCryptoPoolAddress,
|
|
127
145
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
128
146
|
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedCryptoFactoryPool,
|
|
@@ -132,6 +150,12 @@ var curve = {
|
|
|
132
150
|
deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
133
151
|
return [2 /*return*/, deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.crypto_factory)];
|
|
134
152
|
}); }); },
|
|
153
|
+
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
154
|
+
return [2 /*return*/, deployGaugeSidechainEstimateGas(poolAddress, salt)];
|
|
155
|
+
}); }); },
|
|
156
|
+
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
157
|
+
return [2 /*return*/, deployGaugeMirrorEstimateGas(chainId, salt)];
|
|
158
|
+
}); }); },
|
|
135
159
|
},
|
|
136
160
|
},
|
|
137
161
|
tricryptoFactory: {
|
|
@@ -142,6 +166,12 @@ var curve = {
|
|
|
142
166
|
deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
143
167
|
return [2 /*return*/, deployGauge(poolAddress, _curve.constants.ALIASES.tricrypto_factory)];
|
|
144
168
|
}); }); },
|
|
169
|
+
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
170
|
+
return [2 /*return*/, deployGaugeSidechain(poolAddress, salt)];
|
|
171
|
+
}); }); },
|
|
172
|
+
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
173
|
+
return [2 /*return*/, deployGaugeMirror(chainId, salt)];
|
|
174
|
+
}); }); },
|
|
145
175
|
getDeployedPoolAddress: getDeployedTricryptoPoolAddress,
|
|
146
176
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
147
177
|
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedTricryptoFactoryPool,
|
|
@@ -151,6 +181,12 @@ var curve = {
|
|
|
151
181
|
deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
152
182
|
return [2 /*return*/, deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.tricrypto_factory)];
|
|
153
183
|
}); }); },
|
|
184
|
+
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
185
|
+
return [2 /*return*/, deployGaugeSidechainEstimateGas(poolAddress, salt)];
|
|
186
|
+
}); }); },
|
|
187
|
+
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
188
|
+
return [2 /*return*/, deployGaugeMirrorEstimateGas(chainId, salt)];
|
|
189
|
+
}); }); },
|
|
154
190
|
},
|
|
155
191
|
},
|
|
156
192
|
estimateGas: {
|
|
@@ -730,7 +730,8 @@ var PoolTemplate = /** @class */ (function () {
|
|
|
730
730
|
case 5:
|
|
731
731
|
tokens = (_f.sent())
|
|
732
732
|
.filter(function (addr) { return addr !== curve.constants.ZERO_ADDRESS; })
|
|
733
|
-
.map(function (addr) { return addr.toLowerCase(); })
|
|
733
|
+
.map(function (addr) { return addr.toLowerCase(); })
|
|
734
|
+
.filter(function (addr) { return curve.chainId === 1 || addr !== curve.constants.COINS.crv; });
|
|
734
735
|
tokenInfoCalls = [];
|
|
735
736
|
for (_i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
|
|
736
737
|
token = tokens_1[_i];
|
package/lib/pools/utils.js
CHANGED
|
@@ -212,6 +212,8 @@ var _getUserClaimable = function (pools, address, useCache) { return __awaiter(v
|
|
|
212
212
|
rewardAddress = rawRewardTokens.shift();
|
|
213
213
|
if (rewardAddress === curve.constants.ZERO_ADDRESS)
|
|
214
214
|
continue;
|
|
215
|
+
if (curve.chainId !== 1 && rewardAddress === curve.constants.COINS.crv)
|
|
216
|
+
continue;
|
|
215
217
|
// REYIELD shitcoin which breaks things, because symbol() throws an error
|
|
216
218
|
if (rewardAddress === "0xf228ec3476318aCB4E719D2b290bb2ef8B34DFfA".toLowerCase())
|
|
217
219
|
continue;
|
package/lib/utils.js
CHANGED
|
@@ -485,7 +485,8 @@ export var _getRewardsFromApi = function () { return __awaiter(void 0, void 0, v
|
|
|
485
485
|
for (_a = 0, _b = extendedPoolData.poolData; _a < _b.length; _a++) {
|
|
486
486
|
pool = _b[_a];
|
|
487
487
|
if (pool.gaugeAddress) {
|
|
488
|
-
rewardsDict[pool.gaugeAddress.toLowerCase()] = pool.gaugeRewards
|
|
488
|
+
rewardsDict[pool.gaugeAddress.toLowerCase()] = pool.gaugeRewards
|
|
489
|
+
.filter(function (r) { return curve.chainId === 1 || r.tokenAddress.toLowerCase() !== curve.constants.COINS.crv; });
|
|
489
490
|
}
|
|
490
491
|
}
|
|
491
492
|
}
|
package/package.json
CHANGED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"name": "Minted",
|
|
4
|
-
"inputs": [
|
|
5
|
-
{
|
|
6
|
-
"type": "address",
|
|
7
|
-
"name": "recipient",
|
|
8
|
-
"indexed": true
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"type": "address",
|
|
12
|
-
"name": "gauge",
|
|
13
|
-
"indexed": false
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"type": "uint256",
|
|
17
|
-
"name": "minted",
|
|
18
|
-
"indexed": false
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"anonymous": false,
|
|
22
|
-
"type": "event"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"outputs": [],
|
|
26
|
-
"inputs": [
|
|
27
|
-
{
|
|
28
|
-
"type": "address",
|
|
29
|
-
"name": "_token"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"type": "address",
|
|
33
|
-
"name": "_controller"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"stateMutability": "nonpayable",
|
|
37
|
-
"type": "constructor"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "mint",
|
|
41
|
-
"outputs": [],
|
|
42
|
-
"inputs": [
|
|
43
|
-
{
|
|
44
|
-
"type": "address",
|
|
45
|
-
"name": "gauge_addr"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"stateMutability": "nonpayable",
|
|
49
|
-
"type": "function",
|
|
50
|
-
"gas": "2006304"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"name": "mint_many",
|
|
54
|
-
"outputs": [],
|
|
55
|
-
"inputs": [
|
|
56
|
-
{
|
|
57
|
-
"type": "address[8]",
|
|
58
|
-
"name": "gauge_addrs"
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
"stateMutability": "nonpayable",
|
|
62
|
-
"type": "function",
|
|
63
|
-
"gas": "408502"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"name": "mint_for",
|
|
67
|
-
"outputs": [],
|
|
68
|
-
"inputs": [
|
|
69
|
-
{
|
|
70
|
-
"type": "address",
|
|
71
|
-
"name": "gauge_addr"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"type": "address",
|
|
75
|
-
"name": "_for"
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
"stateMutability": "nonpayable",
|
|
79
|
-
"type": "function",
|
|
80
|
-
"gas": "101219"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"name": "toggle_approve_mint",
|
|
84
|
-
"outputs": [],
|
|
85
|
-
"inputs": [
|
|
86
|
-
{
|
|
87
|
-
"type": "address",
|
|
88
|
-
"name": "minting_user"
|
|
89
|
-
}
|
|
90
|
-
],
|
|
91
|
-
"stateMutability": "nonpayable",
|
|
92
|
-
"type": "function",
|
|
93
|
-
"gas": "36726"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"name": "token",
|
|
97
|
-
"outputs": [
|
|
98
|
-
{
|
|
99
|
-
"type": "address",
|
|
100
|
-
"name": ""
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
"inputs": [],
|
|
104
|
-
"stateMutability": "view",
|
|
105
|
-
"type": "function",
|
|
106
|
-
"gas": "1301"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"name": "controller",
|
|
110
|
-
"outputs": [
|
|
111
|
-
{
|
|
112
|
-
"type": "address",
|
|
113
|
-
"name": ""
|
|
114
|
-
}
|
|
115
|
-
],
|
|
116
|
-
"inputs": [],
|
|
117
|
-
"stateMutability": "view",
|
|
118
|
-
"type": "function",
|
|
119
|
-
"gas": "1331"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"name": "minted",
|
|
123
|
-
"outputs": [
|
|
124
|
-
{
|
|
125
|
-
"type": "uint256",
|
|
126
|
-
"name": ""
|
|
127
|
-
}
|
|
128
|
-
],
|
|
129
|
-
"inputs": [
|
|
130
|
-
{
|
|
131
|
-
"type": "address",
|
|
132
|
-
"name": "arg0"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"type": "address",
|
|
136
|
-
"name": "arg1"
|
|
137
|
-
}
|
|
138
|
-
],
|
|
139
|
-
"stateMutability": "view",
|
|
140
|
-
"type": "function",
|
|
141
|
-
"gas": "1669"
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"name": "allowed_to_mint_for",
|
|
145
|
-
"outputs": [
|
|
146
|
-
{
|
|
147
|
-
"type": "bool",
|
|
148
|
-
"name": ""
|
|
149
|
-
}
|
|
150
|
-
],
|
|
151
|
-
"inputs": [
|
|
152
|
-
{
|
|
153
|
-
"type": "address",
|
|
154
|
-
"name": "arg0"
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"type": "address",
|
|
158
|
-
"name": "arg1"
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
"stateMutability": "view",
|
|
162
|
-
"type": "function",
|
|
163
|
-
"gas": "1699"
|
|
164
|
-
}
|
|
165
|
-
]
|