@curvefi/api 2.23.0 → 2.24.1
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/lib/constants/abis/factory-v2/MetaSbtc2.json +1011 -0
- package/lib/constants/abis/factory-v2/MetaSbtc2Balance.json +1024 -0
- package/lib/constants/abis/sbtc2/meta_zap.json +164 -0
- package/lib/constants/abis/sbtc2/swap.json +829 -0
- package/lib/constants/pools/ethereum.js +25 -0
- package/lib/factory/constants.js +49 -38
- package/lib/factory/factory-api.d.ts +2 -1
- package/lib/factory/factory-api.js +55 -31
- package/lib/factory/factory.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/interfaces.d.ts +1 -0
- package/lib/pools/PoolTemplate.d.ts +2 -2
- package/lib/pools/PoolTemplate.js +69 -59
- package/lib/router.js +48 -48
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +32 -1
- package/package.json +1 -1
|
@@ -90,6 +90,7 @@ var swap_json_40 = __importDefault(require("../abis/2pool/swap.json"));
|
|
|
90
90
|
var swap_json_41 = __importDefault(require("../abis/4pool/swap.json"));
|
|
91
91
|
var swap_json_42 = __importDefault(require("../abis/fraxusdc/swap.json"));
|
|
92
92
|
var swap_json_43 = __importDefault(require("../abis/frxeth/swap.json"));
|
|
93
|
+
var swap_json_44 = __importDefault(require("../abis/sbtc2/swap.json"));
|
|
93
94
|
var utils_1 = require("../utils");
|
|
94
95
|
exports.POOLS_DATA_ETHEREUM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
95
96
|
compound: {
|
|
@@ -1574,4 +1575,28 @@ exports.POOLS_DATA_ETHEREUM = (0, utils_1.lowerCasePoolDataAddresses)({
|
|
|
1574
1575
|
swap_abi: swap_json_43.default,
|
|
1575
1576
|
gauge_abi: gauge_v5_json_1.default,
|
|
1576
1577
|
},
|
|
1578
|
+
sbtc2: {
|
|
1579
|
+
name: "sbtc2",
|
|
1580
|
+
full_name: "sbtc2",
|
|
1581
|
+
symbol: "sbtc2",
|
|
1582
|
+
reference_asset: 'BTC',
|
|
1583
|
+
swap_address: "0xf253f83AcA21aAbD2A20553AE0BF7F65C755A07F",
|
|
1584
|
+
token_address: "0x051d7e5609917Bd9b73f04BAc0DED8Dd46a74301",
|
|
1585
|
+
gauge_address: "0x6D787113F23bED1D5e1530402B3f364D0A6e5Af3",
|
|
1586
|
+
is_plain: true,
|
|
1587
|
+
underlying_coins: ['WBTC', 'sBTC'],
|
|
1588
|
+
wrapped_coins: ['WBTC', 'sBTC'],
|
|
1589
|
+
underlying_coin_addresses: [
|
|
1590
|
+
'0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599',
|
|
1591
|
+
'0xfE18be6b3Bd88A2D2A7f928d00292E7a9963CfC6',
|
|
1592
|
+
],
|
|
1593
|
+
wrapped_coin_addresses: [
|
|
1594
|
+
'0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599',
|
|
1595
|
+
'0xfE18be6b3Bd88A2D2A7f928d00292E7a9963CfC6',
|
|
1596
|
+
],
|
|
1597
|
+
underlying_decimals: [8, 18],
|
|
1598
|
+
wrapped_decimals: [8, 18],
|
|
1599
|
+
swap_abi: swap_json_44.default,
|
|
1600
|
+
gauge_abi: gauge_v5_json_1.default,
|
|
1601
|
+
},
|
|
1577
1602
|
});
|
package/lib/factory/constants.js
CHANGED
|
@@ -13,6 +13,8 @@ var MetaBTC_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaB
|
|
|
13
13
|
var MetaBTCBalances_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaBTCBalances.json"));
|
|
14
14
|
var MetaBTCRen_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaBTCRen.json"));
|
|
15
15
|
var MetaBTCBalancesRen_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaBTCBalancesRen.json"));
|
|
16
|
+
var MetaSbtc2_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaSbtc2.json"));
|
|
17
|
+
var MetaSbtc2Balance_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaSbtc2Balance.json"));
|
|
16
18
|
var MetaUSDGeist_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaUSDGeist.json"));
|
|
17
19
|
var Plain2Basic_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain2Basic.json"));
|
|
18
20
|
var Plain2Balances_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain2Balances.json"));
|
|
@@ -34,7 +36,9 @@ var DepositZapMetaBtcPolygon_json_1 = __importDefault(require("../constants/abis
|
|
|
34
36
|
var DepositZapFantom_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapFantom.json"));
|
|
35
37
|
var DepositZapMetaUsd2Fantom_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaUsd2Fantom.json"));
|
|
36
38
|
var meta_zap_json_2 = __importDefault(require("../constants/abis/ren/meta_zap.json"));
|
|
37
|
-
|
|
39
|
+
var meta_zap_json_3 = __importDefault(require("../constants/abis/sbtc2/meta_zap.json"));
|
|
40
|
+
var utils_1 = require("../constants/utils");
|
|
41
|
+
exports.implementationABIDictEthereum = (0, utils_1.lowerCaseKeys)({
|
|
38
42
|
"0x5F890841f657d90E081bAbdB532A05996Af79Fe6": swap_json_1.default,
|
|
39
43
|
"0x213be373FDff327658139C7df330817DAD2d5bBE": MetaUSD_json_1.default,
|
|
40
44
|
"0x55Aa9BF126bCABF0bDC17Fa9E39Ec9239e1ce7A9": MetaUSDBalances_json_1.default,
|
|
@@ -44,6 +48,8 @@ exports.implementationABIDictEthereum = {
|
|
|
44
48
|
"0xc4C78b08fA0c3d0a312605634461A88184Ecd630": MetaBTCBalances_json_1.default,
|
|
45
49
|
"0xECAaecd9d2193900b424774133B1f51ae0F29d9E": MetaBTCRen_json_1.default,
|
|
46
50
|
"0x40fD58D44cFE63E8517c9Bb3ac98676838Ea56A8": MetaBTCBalancesRen_json_1.default,
|
|
51
|
+
"0x008CFa89df5B0c780cA3462fc2602D7F8c7Ac315": MetaSbtc2_json_1.default,
|
|
52
|
+
"0xAbc533EbCDdeD41215C46ee078C5818B5b0A252F": MetaSbtc2Balance_json_1.default,
|
|
47
53
|
"0x6523Ac15EC152Cb70a334230F6c5d62C5Bd963f1": Plain2Basic_json_1.default,
|
|
48
54
|
"0x24D937143d3F5cF04c72bA112735151A8CAE2262": Plain2Balances_json_1.default,
|
|
49
55
|
"0x6326DEbBAa15bCFE603d831e7D75f4fc10d9B43E": Plain2ETH_json_1.default,
|
|
@@ -56,8 +62,8 @@ exports.implementationABIDictEthereum = {
|
|
|
56
62
|
"0xd35B58386705CE75CE6d09842E38E9BE9CDe5bF6": Plain4Balances_json_1.default,
|
|
57
63
|
"0x88855cdF2b0A8413D470B86952E726684de915be": Plain4ETH_json_1.default,
|
|
58
64
|
"0xaD4753D045D3Aed5C1a6606dFb6a7D7AD67C1Ad7": Plain4Optimized_json_1.default,
|
|
59
|
-
};
|
|
60
|
-
exports.implementationABIDictPolygon = {
|
|
65
|
+
});
|
|
66
|
+
exports.implementationABIDictPolygon = (0, utils_1.lowerCaseKeys)({
|
|
61
67
|
"0x4fb93D7d320E8A263F22f62C2059dFC2A8bCbC4c": MetaUSD_json_1.default,
|
|
62
68
|
"0x39fE1824f98CD828050D7c51dA443E84121c7cf1": MetaUSDBalances_json_1.default,
|
|
63
69
|
"0xC05EB760A135d3D0c839f1141423002681157a17": MetaBTCRen_json_1.default,
|
|
@@ -74,8 +80,8 @@ exports.implementationABIDictPolygon = {
|
|
|
74
80
|
"0xC7c46488566b9ef9B981b87E328939CaA5ca152f": Plain4Balances_json_1.default,
|
|
75
81
|
"0xf31bcdf0B9a5eCD7AB463eB905551fBc32e51856": Plain4ETH_json_1.default,
|
|
76
82
|
"0xAc273d5b4FC06625d8b1abA3BE8De15bDFb8E39f": Plain4Optimized_json_1.default,
|
|
77
|
-
};
|
|
78
|
-
exports.implementationABIDictFantom = {
|
|
83
|
+
});
|
|
84
|
+
exports.implementationABIDictFantom = (0, utils_1.lowerCaseKeys)({
|
|
79
85
|
"0xfCE359115dFe1533a2458650123F86C454BC0213": MetaUSD_json_1.default,
|
|
80
86
|
"0x09C62ad0694e3f1ad8cF8876aaBe56138C586f5F": MetaUSDBalances_json_1.default,
|
|
81
87
|
"0xC9438d8928486bD9621D326002F4672bF684187A": MetaBTCRen_json_1.default,
|
|
@@ -94,8 +100,8 @@ exports.implementationABIDictFantom = {
|
|
|
94
100
|
"0x775A21E0dfE25aF30FF2FCAC37512EbD8fD36471": Plain4Balances_json_1.default,
|
|
95
101
|
"0xb11Dc44A9f981fAF1669dca6DD40c3cc2554A2ce": Plain4ETH_json_1.default,
|
|
96
102
|
"0x9D7C28226AA7142cBF234ab9aa9C203D095c528B": Plain4Optimized_json_1.default,
|
|
97
|
-
};
|
|
98
|
-
exports.implementationABIDictAvalanche = {
|
|
103
|
+
});
|
|
104
|
+
exports.implementationABIDictAvalanche = (0, utils_1.lowerCaseKeys)({
|
|
99
105
|
"0xA237034249290De2B07988Ac64b96f22c0E76fE0": MetaUSD_json_1.default,
|
|
100
106
|
"0xc50C05Ca1f8C2346664bd0d4a1eb6aC1Da38414f": MetaUSDBalances_json_1.default,
|
|
101
107
|
"0xa27f39E9C21b3376F43266E13Ad5A5d6E9BdB320": MetaBTCRen_json_1.default,
|
|
@@ -112,8 +118,8 @@ exports.implementationABIDictAvalanche = {
|
|
|
112
118
|
"0x7D86446dDb609eD0F5f8684AcF30380a356b2B4c": Plain4Balances_json_1.default,
|
|
113
119
|
"0x0eb0F1FaF5F509Ac53fA224477509EAD167cf410": Plain4ETH_json_1.default,
|
|
114
120
|
"0xCE94D3E5b0D80565D7B713A687b39a3Dc81780BA": Plain4Optimized_json_1.default,
|
|
115
|
-
};
|
|
116
|
-
exports.implementationABIDictArbitrum = {
|
|
121
|
+
});
|
|
122
|
+
exports.implementationABIDictArbitrum = (0, utils_1.lowerCaseKeys)({
|
|
117
123
|
"0x09672362833d8f703D5395ef3252D4Bfa51c15ca": MetaUSD_json_1.default,
|
|
118
124
|
"0xBE175115BF33E12348ff77CcfEE4726866A0Fbd5": MetaUSDBalances_json_1.default,
|
|
119
125
|
"0x094d12e5b541784701FD8d65F11fc0598FBC6332": MetaBTCRen_json_1.default,
|
|
@@ -132,8 +138,8 @@ exports.implementationABIDictArbitrum = {
|
|
|
132
138
|
"0x2ac56cEBc2D27c9bB51a11773355E44371Eb88D3": Plain4Balances_json_1.default,
|
|
133
139
|
"0x89287c32c2CAC1C76227F6d300B2DBbab6b75C08": Plain4ETH_json_1.default,
|
|
134
140
|
"0x06e3C4da96fd076b97b7ca3Ae23527314b6140dF": Plain4Optimized_json_1.default,
|
|
135
|
-
};
|
|
136
|
-
exports.implementationABIDictOptimism = {
|
|
141
|
+
});
|
|
142
|
+
exports.implementationABIDictOptimism = (0, utils_1.lowerCaseKeys)({
|
|
137
143
|
"0x78CF256256C8089d68Cde634Cf7cDEFb39286470": MetaUSD_json_1.default,
|
|
138
144
|
"0xADf698e4d8Df08b3E2c79682891636eF00F6e205": MetaUSDBalances_json_1.default,
|
|
139
145
|
"0xe8269B33E47761f552E1a3070119560d5fa8bBD6": MetaFraxUSD_json_1.default,
|
|
@@ -150,8 +156,8 @@ exports.implementationABIDictOptimism = {
|
|
|
150
156
|
"0xF6bDc2619FFDA72c537Cd9605e0A274Dc48cB1C9": Plain4Balances_json_1.default,
|
|
151
157
|
"0x1AEf73d49Dedc4b1778d0706583995958Dc862e6": Plain4ETH_json_1.default,
|
|
152
158
|
"0x8474DdbE98F5aA3179B3B3F5942D724aFcdec9f6": Plain4Optimized_json_1.default,
|
|
153
|
-
};
|
|
154
|
-
exports.implementationABIDictXDai = {
|
|
159
|
+
});
|
|
160
|
+
exports.implementationABIDictXDai = (0, utils_1.lowerCaseKeys)({
|
|
155
161
|
"0x4A5bF7Ab9A8202692051c19B102d3eDD62aaBAE6": MetaUSD_json_1.default,
|
|
156
162
|
"0x0B4dc7A945695D11FD83e40B2DfC2B896A02395F": MetaUSDBalances_json_1.default,
|
|
157
163
|
"0x04e39EF8332e979Cf8e4f8891E64934FF65F231b": Plain2Basic_json_1.default,
|
|
@@ -166,8 +172,8 @@ exports.implementationABIDictXDai = {
|
|
|
166
172
|
"0xcB4eB43E31C830e22baF764c64F11F32C280496c": Plain4Balances_json_1.default,
|
|
167
173
|
"0xc1C49622b63B961ce1D352ecb7D8261Ab5556695": Plain4ETH_json_1.default,
|
|
168
174
|
"0x0E2615ce69Cd3Dc3Ff6f66a975bEa0655F3bA7b9": Plain4Optimized_json_1.default,
|
|
169
|
-
};
|
|
170
|
-
exports.implementationABIDictMoonbeam = {
|
|
175
|
+
});
|
|
176
|
+
exports.implementationABIDictMoonbeam = (0, utils_1.lowerCaseKeys)({
|
|
171
177
|
"0x6842E0412AC1c00464dc48961330156a07268d14": Plain2Basic_json_1.default,
|
|
172
178
|
"0x9fAe78C4bBB649deB7b2295dDB8A03adA7eB660F": Plain2Balances_json_1.default,
|
|
173
179
|
"0xfCE359115dFe1533a2458650123F86C454BC0213": Plain2ETH_json_1.default,
|
|
@@ -180,14 +186,13 @@ exports.implementationABIDictMoonbeam = {
|
|
|
180
186
|
"0x7Bb707085905c9D80854652809A1ba8480C11789": Plain4Balances_json_1.default,
|
|
181
187
|
"0xec9cEBE650E181079576C1b6d0d2e092B1EdfF13": Plain4ETH_json_1.default,
|
|
182
188
|
"0xe8269B33E47761f552E1a3070119560d5fa8bBD6": Plain4Optimized_json_1.default,
|
|
183
|
-
};
|
|
184
|
-
exports.implementationABIDictKava = {
|
|
189
|
+
});
|
|
190
|
+
exports.implementationABIDictKava = (0, utils_1.lowerCaseKeys)({
|
|
185
191
|
"0x2632679f5ca396a1bd2647092d9dbf7ec5d7b263": Plain2Basic_json_1.default,
|
|
186
192
|
"0x12f196251efcaca0fd73d5b58132b16760ba96a8": Plain2Balances_json_1.default,
|
|
187
193
|
"0xafdab4f8f6e6992b16e3906295fba390aab59ca5": Plain2ETH_json_1.default,
|
|
188
194
|
"0x50d7a3e0d5350d52e9e08a1b58eefd1db8759d7d": Plain2Optimized_json_1.default,
|
|
189
195
|
"0xc8913d486a42459e6b34db33f0c660fca61306b9": Plain3Basic_json_1.default,
|
|
190
|
-
"0xc8913D486a42459e6B34db33F0C660FCa61306b9": Plain3Basic_json_1.default,
|
|
191
196
|
"0xc5ec776a55ea062fa3173c6c76703e9c9fa91c47": Plain3Balances_json_1.default,
|
|
192
197
|
"0xed2c5f2c4cab6e82630d5615ea15dd47d8b29983": Plain3ETH_json_1.default,
|
|
193
198
|
"0xe7d5293c01685a414ddde527eb5effbf92b52648": Plain3Optimized_json_1.default,
|
|
@@ -195,8 +200,8 @@ exports.implementationABIDictKava = {
|
|
|
195
200
|
"0xd59c875dccb6cdcb3a75b91b58a363b5e4b0ca9a": Plain4Balances_json_1.default,
|
|
196
201
|
"0x6378dd741b24bd884f3590d7bc7555fdb2f5b003": Plain4ETH_json_1.default,
|
|
197
202
|
"0x509495dfeec3a53acb2f60669985d868131ad9a5": Plain4Optimized_json_1.default,
|
|
198
|
-
};
|
|
199
|
-
exports.implementationABIDictCelo = {
|
|
203
|
+
});
|
|
204
|
+
exports.implementationABIDictCelo = (0, utils_1.lowerCaseKeys)({
|
|
200
205
|
"0xfEE7166C32Bdf6356Ef60636f43400AA55551A96": Plain2Basic_json_1.default,
|
|
201
206
|
"0x183Bb362aAa53f24BDF76a5E0FE11eEEce21F44d": Plain2Balances_json_1.default,
|
|
202
207
|
"0x469CF0874E62cfbaD342AE7e11aBCfC0F08dC17d": Plain2ETH_json_1.default,
|
|
@@ -209,8 +214,8 @@ exports.implementationABIDictCelo = {
|
|
|
209
214
|
"0x3730D8B82BF3fF6Cc6dFDBe2Fd7B2A655e74eAae": Plain4Balances_json_1.default,
|
|
210
215
|
"0x0F5390AB4C5456a769056C96E4D7C71770b52319": Plain4ETH_json_1.default,
|
|
211
216
|
"0xA73b02a97B45604cd9f0BBAA153eCfe01f409350": Plain4Optimized_json_1.default,
|
|
212
|
-
};
|
|
213
|
-
exports.implementationBasePoolIdDictEthereum = {
|
|
217
|
+
});
|
|
218
|
+
exports.implementationBasePoolIdDictEthereum = (0, utils_1.lowerCaseKeys)({
|
|
214
219
|
"0x5F890841f657d90E081bAbdB532A05996Af79Fe6": "3pool",
|
|
215
220
|
"0x213be373FDff327658139C7df330817DAD2d5bBE": "3pool",
|
|
216
221
|
"0x55Aa9BF126bCABF0bDC17Fa9E39Ec9239e1ce7A9": "3pool",
|
|
@@ -220,48 +225,50 @@ exports.implementationBasePoolIdDictEthereum = {
|
|
|
220
225
|
"0xc4C78b08fA0c3d0a312605634461A88184Ecd630": "sbtc",
|
|
221
226
|
"0xECAaecd9d2193900b424774133B1f51ae0F29d9E": "ren",
|
|
222
227
|
"0x40fD58D44cFE63E8517c9Bb3ac98676838Ea56A8": "ren",
|
|
223
|
-
|
|
224
|
-
|
|
228
|
+
"0x008CFa89df5B0c780cA3462fc2602D7F8c7Ac315": "sbtc2",
|
|
229
|
+
"0xAbc533EbCDdeD41215C46ee078C5818B5b0A252F": "sbtc2",
|
|
230
|
+
});
|
|
231
|
+
exports.implementationBasePoolIdDictPolygon = (0, utils_1.lowerCaseKeys)({
|
|
225
232
|
"0x4fb93D7d320E8A263F22f62C2059dFC2A8bCbC4c": "aave",
|
|
226
233
|
"0x39fE1824f98CD828050D7c51dA443E84121c7cf1": "aave",
|
|
227
234
|
"0xC05EB760A135d3D0c839f1141423002681157a17": "ren",
|
|
228
235
|
"0xD8336532f6ED7b94282fAF724fe41d6145E07Cfc": "ren",
|
|
229
|
-
};
|
|
230
|
-
exports.implementationBasePoolIdDictFantom = {
|
|
236
|
+
});
|
|
237
|
+
exports.implementationBasePoolIdDictFantom = (0, utils_1.lowerCaseKeys)({
|
|
231
238
|
"0xfCE359115dFe1533a2458650123F86C454BC0213": "2pool",
|
|
232
239
|
"0x09C62ad0694e3f1ad8cF8876aaBe56138C586f5F": "2pool",
|
|
233
240
|
"0xC9438d8928486bD9621D326002F4672bF684187A": "ren",
|
|
234
241
|
"0x2b70A5B878665FfDB4A06Ba40a264d6c70f68F4B": "ren",
|
|
235
242
|
"0x210C806F6AE850279f7E298dE749EC4B427d00DD": "geist",
|
|
236
243
|
"0xf82162bB68aD5a168345bb7EFb2faA0EDCCA5177": "geist",
|
|
237
|
-
};
|
|
238
|
-
exports.implementationBasePoolIdDictAvalanche = {
|
|
244
|
+
});
|
|
245
|
+
exports.implementationBasePoolIdDictAvalanche = (0, utils_1.lowerCaseKeys)({
|
|
239
246
|
"0xA237034249290De2B07988Ac64b96f22c0E76fE0": "aave",
|
|
240
247
|
"0xc50C05Ca1f8C2346664bd0d4a1eb6aC1Da38414f": "aave",
|
|
241
248
|
"0xa27f39E9C21b3376F43266E13Ad5A5d6E9BdB320": "ren",
|
|
242
249
|
"0x505C34ED8dBE96d2D5C7D83158aA844887770970": "ren",
|
|
243
|
-
};
|
|
244
|
-
exports.implementationBasePoolIdDictArbitrum = {
|
|
250
|
+
});
|
|
251
|
+
exports.implementationBasePoolIdDictArbitrum = (0, utils_1.lowerCaseKeys)({
|
|
245
252
|
"0x09672362833d8f703D5395ef3252D4Bfa51c15ca": "2pool",
|
|
246
253
|
"0xBE175115BF33E12348ff77CcfEE4726866A0Fbd5": "2pool",
|
|
247
254
|
"0x094d12e5b541784701FD8d65F11fc0598FBC6332": "ren",
|
|
248
255
|
"0xF1f85a74AD6c64315F85af52d3d46bF715236ADc": "ren",
|
|
249
256
|
"0x8DEb66a4A40E370355bEe35f12E55Fe9c755d686": "factory-v2-41",
|
|
250
257
|
"0x3edE9b145F82e9e46C03f8A8F67B77aEE847b632": "factory-v2-41", // fraxbp
|
|
251
|
-
};
|
|
252
|
-
exports.implementationBasePoolIdDictOptimism = {
|
|
258
|
+
});
|
|
259
|
+
exports.implementationBasePoolIdDictOptimism = (0, utils_1.lowerCaseKeys)({
|
|
253
260
|
"0x78CF256256C8089d68Cde634Cf7cDEFb39286470": "3pool",
|
|
254
261
|
"0xADf698e4d8Df08b3E2c79682891636eF00F6e205": "3pool",
|
|
255
262
|
"0xe8269B33E47761f552E1a3070119560d5fa8bBD6": "factory-v2-16",
|
|
256
263
|
"0x114C4042B11a2b16F58Fe1BFe847589a122F678a": "factory-v2-16", // fraxusdc
|
|
257
|
-
};
|
|
258
|
-
exports.implementationBasePoolIdDictXDai = {
|
|
264
|
+
});
|
|
265
|
+
exports.implementationBasePoolIdDictXDai = (0, utils_1.lowerCaseKeys)({
|
|
259
266
|
"0x4A5bF7Ab9A8202692051c19B102d3eDD62aaBAE6": "3pool",
|
|
260
267
|
"0x0B4dc7A945695D11FD83e40B2DfC2B896A02395F": "3pool",
|
|
261
|
-
};
|
|
262
|
-
exports.implementationBasePoolIdDictMoonbeam = {};
|
|
263
|
-
exports.implementationBasePoolIdDictKava = {};
|
|
264
|
-
exports.implementationBasePoolIdDictCelo = {};
|
|
268
|
+
});
|
|
269
|
+
exports.implementationBasePoolIdDictMoonbeam = (0, utils_1.lowerCaseKeys)({});
|
|
270
|
+
exports.implementationBasePoolIdDictKava = (0, utils_1.lowerCaseKeys)({});
|
|
271
|
+
exports.implementationBasePoolIdDictCelo = (0, utils_1.lowerCaseKeys)({});
|
|
265
272
|
exports.basePoolIdZapDictEthereum = {
|
|
266
273
|
'3pool': {
|
|
267
274
|
address: "0xA79828DF1850E8a3A3064576f380D90aECDD3359".toLowerCase(),
|
|
@@ -279,6 +286,10 @@ exports.basePoolIdZapDictEthereum = {
|
|
|
279
286
|
address: "0x8Fb3Ec8f2d1Dc089E70CD61f1E49496d443B2124".toLowerCase(),
|
|
280
287
|
ABI: meta_zap_json_2.default,
|
|
281
288
|
},
|
|
289
|
+
sbtc2: {
|
|
290
|
+
address: "0xA2d40Edbf76C6C0701BA8899e2d059798eBa628e".toLowerCase(),
|
|
291
|
+
ABI: meta_zap_json_3.default,
|
|
292
|
+
},
|
|
282
293
|
};
|
|
283
294
|
exports.basePoolIdZapDictPolygon = {
|
|
284
295
|
aave: {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { IDict, IPoolData, ICurve } from "../interfaces";
|
|
1
|
+
import { IDict, IPoolData, ICurve, IPoolDataFromApi } from "../interfaces";
|
|
2
|
+
export declare const lowerCasePoolDataAddresses: (poolsData: IPoolDataFromApi[]) => IPoolDataFromApi[];
|
|
2
3
|
export declare function getFactoryPoolsDataFromApi(this: ICurve, isCrypto: boolean): Promise<IDict<IPoolData>>;
|
|
@@ -59,7 +59,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
59
59
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
60
|
};
|
|
61
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports.getFactoryPoolsDataFromApi = void 0;
|
|
62
|
+
exports.getFactoryPoolsDataFromApi = exports.lowerCasePoolDataAddresses = void 0;
|
|
63
63
|
var axios_1 = __importDefault(require("axios"));
|
|
64
64
|
var ethers_1 = require("ethers");
|
|
65
65
|
var ethcall_1 = require("ethcall");
|
|
@@ -71,11 +71,34 @@ var constants_1 = require("./constants");
|
|
|
71
71
|
var constants_crypto_1 = require("./constants-crypto");
|
|
72
72
|
var common_1 = require("./common");
|
|
73
73
|
var external_api_1 = require("../external-api");
|
|
74
|
+
var lowerCasePoolDataAddresses = function (poolsData) {
|
|
75
|
+
var _a;
|
|
76
|
+
for (var _i = 0, poolsData_1 = poolsData; _i < poolsData_1.length; _i++) {
|
|
77
|
+
var poolData = poolsData_1[_i];
|
|
78
|
+
poolData.address = poolData.address.toLowerCase();
|
|
79
|
+
if (poolData.lpTokenAddress)
|
|
80
|
+
poolData.lpTokenAddress = poolData.lpTokenAddress.toLowerCase();
|
|
81
|
+
if (poolData.gaugeAddress)
|
|
82
|
+
poolData.gaugeAddress = poolData.gaugeAddress.toLowerCase();
|
|
83
|
+
poolData.implementationAddress = poolData.implementationAddress.toLowerCase();
|
|
84
|
+
for (var _b = 0, _c = poolData.coins; _b < _c.length; _b++) {
|
|
85
|
+
var coin = _c[_b];
|
|
86
|
+
coin.address = coin.address.toLowerCase();
|
|
87
|
+
}
|
|
88
|
+
for (var _d = 0, _e = (_a = poolData.gaugeRewards) !== null && _a !== void 0 ? _a : []; _d < _e.length; _d++) {
|
|
89
|
+
var reward = _e[_d];
|
|
90
|
+
reward.gaugeAddress = reward.gaugeAddress.toLowerCase();
|
|
91
|
+
reward.tokenAddress = reward.tokenAddress.toLowerCase();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return poolsData;
|
|
95
|
+
};
|
|
96
|
+
exports.lowerCasePoolDataAddresses = lowerCasePoolDataAddresses;
|
|
74
97
|
function setFactorySwapContracts(rawPoolList, isCrypto) {
|
|
75
98
|
var _this = this;
|
|
76
99
|
if (isCrypto) {
|
|
77
100
|
rawPoolList.forEach(function (pool) {
|
|
78
|
-
var addr = pool.address
|
|
101
|
+
var addr = pool.address;
|
|
79
102
|
_this.contracts[addr] = {
|
|
80
103
|
contract: new ethers_1.Contract(addr, factory_crypto_pool_2_json_1.default, _this.signer || _this.provider),
|
|
81
104
|
multicallContract: new ethcall_1.Contract(addr, factory_crypto_pool_2_json_1.default),
|
|
@@ -85,7 +108,7 @@ function setFactorySwapContracts(rawPoolList, isCrypto) {
|
|
|
85
108
|
else {
|
|
86
109
|
var implementationABIDict_1 = constants_1.FACTORY_CONSTANTS[this.chainId].implementationABIDict;
|
|
87
110
|
rawPoolList.forEach(function (pool) {
|
|
88
|
-
var addr = pool.address
|
|
111
|
+
var addr = pool.address;
|
|
89
112
|
_this.contracts[addr] = {
|
|
90
113
|
contract: new ethers_1.Contract(addr, implementationABIDict_1[pool.implementationAddress], _this.signer || _this.provider),
|
|
91
114
|
multicallContract: new ethcall_1.Contract(addr, implementationABIDict_1[pool.implementationAddress]),
|
|
@@ -96,7 +119,7 @@ function setFactorySwapContracts(rawPoolList, isCrypto) {
|
|
|
96
119
|
function setCryptoFactoryTokenContracts(rawPoolList) {
|
|
97
120
|
var _this = this;
|
|
98
121
|
rawPoolList.forEach(function (pool) {
|
|
99
|
-
var addr = pool.lpTokenAddress
|
|
122
|
+
var addr = pool.lpTokenAddress;
|
|
100
123
|
_this.contracts[addr] = {
|
|
101
124
|
contract: new ethers_1.Contract(addr, ERC20_json_1.default, _this.signer || _this.provider),
|
|
102
125
|
multicallContract: new ethcall_1.Contract(addr, ERC20_json_1.default),
|
|
@@ -107,7 +130,7 @@ function setFactoryGaugeContracts(rawPoolList) {
|
|
|
107
130
|
var _this = this;
|
|
108
131
|
rawPoolList.forEach(function (pool) {
|
|
109
132
|
if (pool.gaugeAddress) {
|
|
110
|
-
var addr = pool.gaugeAddress
|
|
133
|
+
var addr = pool.gaugeAddress;
|
|
111
134
|
_this.contracts[addr] = {
|
|
112
135
|
contract: new ethers_1.Contract(addr, _this.chainId === 1 ? gauge_factory_json_1.default : gauge_child_json_1.default, _this.signer || _this.provider),
|
|
113
136
|
multicallContract: new ethcall_1.Contract(addr, _this.chainId === 1 ? gauge_factory_json_1.default : gauge_child_json_1.default),
|
|
@@ -120,7 +143,7 @@ function setFactoryCoinsContracts(rawPoolList) {
|
|
|
120
143
|
var pool = rawPoolList_1[_i];
|
|
121
144
|
for (var _a = 0, _b = pool.coins; _a < _b.length; _a++) {
|
|
122
145
|
var coin = _b[_a];
|
|
123
|
-
var addr = coin.address
|
|
146
|
+
var addr = coin.address;
|
|
124
147
|
if (addr in this.contracts)
|
|
125
148
|
continue;
|
|
126
149
|
this.contracts[addr] = {
|
|
@@ -132,32 +155,33 @@ function setFactoryCoinsContracts(rawPoolList) {
|
|
|
132
155
|
}
|
|
133
156
|
function getFactoryPoolsDataFromApi(isCrypto) {
|
|
134
157
|
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
-
var network, factoryType, rawPoolList, mainAddresses, url, response, poolGaugeDict, _i,
|
|
158
|
+
var network, factoryType, rawPoolList, _a, mainAddresses, url, response, poolGaugeDict, _i, _b, gaugeData, i, FACTORY_POOLS_DATA;
|
|
136
159
|
var _this = this;
|
|
137
|
-
return __generator(this, function (
|
|
138
|
-
switch (
|
|
160
|
+
return __generator(this, function (_c) {
|
|
161
|
+
switch (_c.label) {
|
|
139
162
|
case 0:
|
|
140
163
|
network = this.constants.NETWORK_NAME;
|
|
141
164
|
factoryType = isCrypto ? "factory-crypto" : "factory";
|
|
165
|
+
_a = exports.lowerCasePoolDataAddresses;
|
|
142
166
|
return [4 /*yield*/, (0, external_api_1._getPoolsFromApi)(network, factoryType)];
|
|
143
167
|
case 1:
|
|
144
|
-
rawPoolList = (
|
|
145
|
-
mainAddresses = Object.values(this.constants.POOLS_DATA).map(function (pool) { return pool.swap_address
|
|
146
|
-
rawPoolList = rawPoolList.filter(function (p) { return !mainAddresses.includes(p.address
|
|
168
|
+
rawPoolList = _a.apply(void 0, [(_c.sent()).poolData]);
|
|
169
|
+
mainAddresses = Object.values(this.constants.POOLS_DATA).map(function (pool) { return pool.swap_address; });
|
|
170
|
+
rawPoolList = rawPoolList.filter(function (p) { return !mainAddresses.includes(p.address); });
|
|
147
171
|
if (!(this.chainId !== 1)) return [3 /*break*/, 3];
|
|
148
172
|
url = "https://api.curve.fi/api/getFactoGauges/".concat(network);
|
|
149
173
|
return [4 /*yield*/, axios_1.default.get(url)];
|
|
150
174
|
case 2:
|
|
151
|
-
response =
|
|
175
|
+
response = _c.sent();
|
|
152
176
|
poolGaugeDict = {};
|
|
153
|
-
for (_i = 0,
|
|
154
|
-
gaugeData =
|
|
155
|
-
poolGaugeDict[gaugeData.swap] = gaugeData.gauge;
|
|
177
|
+
for (_i = 0, _b = response.data.data.gauges; _i < _b.length; _i++) {
|
|
178
|
+
gaugeData = _b[_i];
|
|
179
|
+
poolGaugeDict[gaugeData.swap.toLowerCase()] = gaugeData.gauge.toLowerCase();
|
|
156
180
|
}
|
|
157
181
|
for (i = 0; i < rawPoolList.length; i++) {
|
|
158
182
|
rawPoolList[i].gaugeAddress = poolGaugeDict[rawPoolList[i].address];
|
|
159
183
|
}
|
|
160
|
-
|
|
184
|
+
_c.label = 3;
|
|
161
185
|
case 3:
|
|
162
186
|
setFactorySwapContracts.call(this, rawPoolList, isCrypto);
|
|
163
187
|
if (isCrypto)
|
|
@@ -167,7 +191,7 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
167
191
|
common_1.setFactoryZapContracts.call(this, isCrypto);
|
|
168
192
|
FACTORY_POOLS_DATA = {};
|
|
169
193
|
rawPoolList.forEach(function (pool) {
|
|
170
|
-
var coinAddresses = pool.coins.map(function (c) { return c.address
|
|
194
|
+
var coinAddresses = pool.coins.map(function (c) { return c.address; });
|
|
171
195
|
var coinNames = pool.coins.map(function (c) { return c.symbol; });
|
|
172
196
|
var coinDecimals = pool.coins.map(function (c) { return Number(c.decimals); });
|
|
173
197
|
var nativeToken = _this.constants.NATIVE_TOKEN;
|
|
@@ -178,7 +202,7 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
178
202
|
var isPlain = !coinAddresses.includes(nativeToken.wrappedAddress);
|
|
179
203
|
var lpTokenBasePoolIdDict = constants_crypto_1.CRYPTO_FACTORY_CONSTANTS[_this.chainId].lpTokenBasePoolIdDict;
|
|
180
204
|
var basePoolIdZapDict = constants_crypto_1.CRYPTO_FACTORY_CONSTANTS[_this.chainId].basePoolIdZapDict;
|
|
181
|
-
var basePoolId = lpTokenBasePoolIdDict[coinAddresses[1]
|
|
205
|
+
var basePoolId = lpTokenBasePoolIdDict[coinAddresses[1]];
|
|
182
206
|
if (basePoolId) { // isMeta
|
|
183
207
|
var allPoolsData = __assign(__assign({}, _this.constants.POOLS_DATA), FACTORY_POOLS_DATA);
|
|
184
208
|
var basePoolCoinNames = __spreadArray([], allPoolsData[basePoolId].underlying_coins, true);
|
|
@@ -190,9 +214,9 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
190
214
|
full_name: pool.name,
|
|
191
215
|
symbol: pool.symbol,
|
|
192
216
|
reference_asset: "CRYPTO",
|
|
193
|
-
swap_address: pool.address
|
|
194
|
-
token_address: pool.lpTokenAddress
|
|
195
|
-
gauge_address: pool.gaugeAddress ? pool.gaugeAddress
|
|
217
|
+
swap_address: pool.address,
|
|
218
|
+
token_address: pool.lpTokenAddress,
|
|
219
|
+
gauge_address: pool.gaugeAddress ? pool.gaugeAddress : ethers_1.ethers.constants.AddressZero,
|
|
196
220
|
deposit_address: basePoolZap.address,
|
|
197
221
|
is_meta: true,
|
|
198
222
|
is_crypto: true,
|
|
@@ -215,9 +239,9 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
215
239
|
full_name: pool.name,
|
|
216
240
|
symbol: pool.symbol,
|
|
217
241
|
reference_asset: "CRYPTO",
|
|
218
|
-
swap_address: pool.address
|
|
219
|
-
token_address: pool.lpTokenAddress
|
|
220
|
-
gauge_address: pool.gaugeAddress ? pool.gaugeAddress
|
|
242
|
+
swap_address: pool.address,
|
|
243
|
+
token_address: pool.lpTokenAddress,
|
|
244
|
+
gauge_address: pool.gaugeAddress ? pool.gaugeAddress : ethers_1.ethers.constants.AddressZero,
|
|
221
245
|
is_crypto: true,
|
|
222
246
|
is_plain: isPlain,
|
|
223
247
|
is_factory: true,
|
|
@@ -254,9 +278,9 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
254
278
|
full_name: pool.name,
|
|
255
279
|
symbol: pool.symbol,
|
|
256
280
|
reference_asset: pool.assetTypeName.toUpperCase(),
|
|
257
|
-
swap_address: pool.address
|
|
258
|
-
token_address: pool.address
|
|
259
|
-
gauge_address: pool.gaugeAddress ? pool.gaugeAddress
|
|
281
|
+
swap_address: pool.address,
|
|
282
|
+
token_address: pool.address,
|
|
283
|
+
gauge_address: pool.gaugeAddress ? pool.gaugeAddress : ethers_1.ethers.constants.AddressZero,
|
|
260
284
|
deposit_address: basePoolZap.address,
|
|
261
285
|
is_meta: true,
|
|
262
286
|
is_factory: true,
|
|
@@ -279,9 +303,9 @@ function getFactoryPoolsDataFromApi(isCrypto) {
|
|
|
279
303
|
full_name: pool.name,
|
|
280
304
|
symbol: pool.symbol,
|
|
281
305
|
reference_asset: pool.assetTypeName.toUpperCase(),
|
|
282
|
-
swap_address: pool.address
|
|
283
|
-
token_address: pool.address
|
|
284
|
-
gauge_address: pool.gaugeAddress ? pool.gaugeAddress
|
|
306
|
+
swap_address: pool.address,
|
|
307
|
+
token_address: pool.address,
|
|
308
|
+
gauge_address: pool.gaugeAddress ? pool.gaugeAddress : ethers_1.ethers.constants.AddressZero,
|
|
285
309
|
is_plain: true,
|
|
286
310
|
is_factory: true,
|
|
287
311
|
underlying_coins: coinNames,
|
package/lib/factory/factory.js
CHANGED
|
@@ -149,7 +149,7 @@ function getFactoryImplementations(factorySwapAddresses) {
|
|
|
149
149
|
calls.push(factoryMulticallContract.get_implementation_address(addr));
|
|
150
150
|
}
|
|
151
151
|
return [4 /*yield*/, this.multicallProvider.all(calls)];
|
|
152
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
152
|
+
case 2: return [2 /*return*/, (_a.sent()).map(function (a) { return a.toLowerCase(); })];
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
155
|
});
|
package/lib/index.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare const curve: {
|
|
|
57
57
|
symbol: string;
|
|
58
58
|
}[]>;
|
|
59
59
|
factory: {
|
|
60
|
-
deployPlainPool: (name: string, symbol: string, coins: string[], A: number, fee: number, assetType: 0 |
|
|
60
|
+
deployPlainPool: (name: string, symbol: string, coins: string[], A: number, fee: number, assetType: 0 | 2 | 1 | 3, implementationIdx: 0 | 2 | 1 | 3) => Promise<ethers.ContractTransaction>;
|
|
61
61
|
deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number, fee: number, implementationIdx: 0 | 1) => Promise<ethers.ContractTransaction>;
|
|
62
62
|
deployGauge: (poolAddress: string) => Promise<ethers.ContractTransaction>;
|
|
63
63
|
getDeployedPlainPoolAddress: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
@@ -65,7 +65,7 @@ declare const curve: {
|
|
|
65
65
|
getDeployedGaugeAddress: (tx: ethers.ContractTransaction) => Promise<string>;
|
|
66
66
|
fetchRecentlyDeployedPool: typeof fetchRecentlyDeployedFactoryPool;
|
|
67
67
|
estimateGas: {
|
|
68
|
-
deployPlainPool: (name: string, symbol: string, coins: string[], A: number, fee: number, assetType: 0 |
|
|
68
|
+
deployPlainPool: (name: string, symbol: string, coins: string[], A: number, fee: number, assetType: 0 | 2 | 1 | 3, implementationIdx: 0 | 2 | 1 | 3) => Promise<number>;
|
|
69
69
|
deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number, fee: number, implementationIdx: 0 | 1) => Promise<number>;
|
|
70
70
|
deployGauge: (poolAddress: string) => Promise<number>;
|
|
71
71
|
};
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ export declare class PoolTemplate {
|
|
|
78
78
|
day: string;
|
|
79
79
|
week: string;
|
|
80
80
|
}>;
|
|
81
|
-
tokenApy: () => Promise<[baseApy:
|
|
81
|
+
tokenApy: (useApi?: boolean) => Promise<[baseApy: number, boostedApy: number]>;
|
|
82
82
|
rewardsApy: () => Promise<IReward[]>;
|
|
83
83
|
};
|
|
84
84
|
wallet: {
|
|
@@ -132,7 +132,7 @@ export declare class PoolTemplate {
|
|
|
132
132
|
claimCrvEstimateGas(): Promise<number>;
|
|
133
133
|
claimCrv(): Promise<string>;
|
|
134
134
|
boost: (address?: string) => Promise<string>;
|
|
135
|
-
currentCrvApy: (address?: string) => Promise<
|
|
135
|
+
currentCrvApy: (address?: string) => Promise<number>;
|
|
136
136
|
maxBoostedStake: (...addresses: string[]) => Promise<IDict<string> | string>;
|
|
137
137
|
rewardTokens: (() => Promise<{
|
|
138
138
|
token: string;
|