@curvefi/api 2.12.1 → 2.13.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/3pool/meta_zap_crypto.json +291 -0
- package/lib/constants/abis/fraxusdc/{metaZap.json → meta_zap.json} +0 -0
- package/lib/constants/abis/fraxusdc/meta_zap_crypto.json +283 -0
- package/lib/constants/utils.d.ts +1 -0
- package/lib/constants/utils.js +6 -1
- package/lib/factory/common.d.ts +1 -2
- package/lib/factory/common.js +4 -19
- package/lib/factory/constants-crypto.d.ts +55 -0
- package/lib/factory/constants-crypto.js +86 -0
- package/lib/factory/constants.js +2 -2
- package/lib/factory/factory-api.js +21 -30
- package/lib/factory/factory-crypto.js +28 -22
- package/lib/factory/factory.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/interfaces.d.ts +1 -1
- package/lib/pools/PoolTemplate.d.ts +2 -2
- package/lib/pools/PoolTemplate.js +14 -33
- package/lib/pools/poolConstructor.js +1 -1
- package/lib/router.d.ts +1 -1
- package/lib/router.js +25 -25
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +23 -1
- package/package.json +1 -1
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"stateMutability": "nonpayable",
|
|
4
|
+
"type": "constructor",
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"name": "_base_pool",
|
|
8
|
+
"type": "address"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "_base_lp_token",
|
|
12
|
+
"type": "address"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "_weth",
|
|
16
|
+
"type": "address"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "_base_coins",
|
|
20
|
+
"type": "address[3]"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"outputs": []
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"stateMutability": "payable",
|
|
27
|
+
"type": "fallback"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"stateMutability": "pure",
|
|
31
|
+
"type": "function",
|
|
32
|
+
"name": "base_pool",
|
|
33
|
+
"inputs": [],
|
|
34
|
+
"outputs": [
|
|
35
|
+
{
|
|
36
|
+
"name": "",
|
|
37
|
+
"type": "address"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"stateMutability": "pure",
|
|
43
|
+
"type": "function",
|
|
44
|
+
"name": "base_token",
|
|
45
|
+
"inputs": [],
|
|
46
|
+
"outputs": [
|
|
47
|
+
{
|
|
48
|
+
"name": "",
|
|
49
|
+
"type": "address"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"stateMutability": "view",
|
|
55
|
+
"type": "function",
|
|
56
|
+
"name": "price_oracle",
|
|
57
|
+
"inputs": [
|
|
58
|
+
{
|
|
59
|
+
"name": "_pool",
|
|
60
|
+
"type": "address"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"outputs": [
|
|
64
|
+
{
|
|
65
|
+
"name": "",
|
|
66
|
+
"type": "uint256"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"stateMutability": "view",
|
|
72
|
+
"type": "function",
|
|
73
|
+
"name": "price_scale",
|
|
74
|
+
"inputs": [
|
|
75
|
+
{
|
|
76
|
+
"name": "_pool",
|
|
77
|
+
"type": "address"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"outputs": [
|
|
81
|
+
{
|
|
82
|
+
"name": "",
|
|
83
|
+
"type": "uint256"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"stateMutability": "view",
|
|
89
|
+
"type": "function",
|
|
90
|
+
"name": "lp_price",
|
|
91
|
+
"inputs": [
|
|
92
|
+
{
|
|
93
|
+
"name": "_pool",
|
|
94
|
+
"type": "address"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"outputs": [
|
|
98
|
+
{
|
|
99
|
+
"name": "",
|
|
100
|
+
"type": "uint256"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"stateMutability": "payable",
|
|
106
|
+
"type": "function",
|
|
107
|
+
"name": "exchange",
|
|
108
|
+
"inputs": [
|
|
109
|
+
{
|
|
110
|
+
"name": "_pool",
|
|
111
|
+
"type": "address"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "i",
|
|
115
|
+
"type": "uint256"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "j",
|
|
119
|
+
"type": "uint256"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "_dx",
|
|
123
|
+
"type": "uint256"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "_min_dy",
|
|
127
|
+
"type": "uint256"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"outputs": [
|
|
131
|
+
{
|
|
132
|
+
"name": "",
|
|
133
|
+
"type": "uint256"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"stateMutability": "view",
|
|
139
|
+
"type": "function",
|
|
140
|
+
"name": "get_dy",
|
|
141
|
+
"inputs": [
|
|
142
|
+
{
|
|
143
|
+
"name": "_pool",
|
|
144
|
+
"type": "address"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "i",
|
|
148
|
+
"type": "uint256"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "j",
|
|
152
|
+
"type": "uint256"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "_dx",
|
|
156
|
+
"type": "uint256"
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"outputs": [
|
|
160
|
+
{
|
|
161
|
+
"name": "",
|
|
162
|
+
"type": "uint256"
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"stateMutability": "payable",
|
|
168
|
+
"type": "function",
|
|
169
|
+
"name": "add_liquidity",
|
|
170
|
+
"inputs": [
|
|
171
|
+
{
|
|
172
|
+
"name": "_pool",
|
|
173
|
+
"type": "address"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "_deposit_amounts",
|
|
177
|
+
"type": "uint256[4]"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "_min_mint_amount",
|
|
181
|
+
"type": "uint256"
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"outputs": [
|
|
185
|
+
{
|
|
186
|
+
"name": "",
|
|
187
|
+
"type": "uint256"
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"stateMutability": "view",
|
|
193
|
+
"type": "function",
|
|
194
|
+
"name": "calc_token_amount",
|
|
195
|
+
"inputs": [
|
|
196
|
+
{
|
|
197
|
+
"name": "_pool",
|
|
198
|
+
"type": "address"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "_amounts",
|
|
202
|
+
"type": "uint256[4]"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"outputs": [
|
|
206
|
+
{
|
|
207
|
+
"name": "",
|
|
208
|
+
"type": "uint256"
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"stateMutability": "nonpayable",
|
|
214
|
+
"type": "function",
|
|
215
|
+
"name": "remove_liquidity",
|
|
216
|
+
"inputs": [
|
|
217
|
+
{
|
|
218
|
+
"name": "_pool",
|
|
219
|
+
"type": "address"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"name": "_burn_amount",
|
|
223
|
+
"type": "uint256"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "_min_amounts",
|
|
227
|
+
"type": "uint256[4]"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"outputs": [
|
|
231
|
+
{
|
|
232
|
+
"name": "",
|
|
233
|
+
"type": "uint256[4]"
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"stateMutability": "nonpayable",
|
|
239
|
+
"type": "function",
|
|
240
|
+
"name": "remove_liquidity_one_coin",
|
|
241
|
+
"inputs": [
|
|
242
|
+
{
|
|
243
|
+
"name": "_pool",
|
|
244
|
+
"type": "address"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"name": "_burn_amount",
|
|
248
|
+
"type": "uint256"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "i",
|
|
252
|
+
"type": "uint256"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "_min_amount",
|
|
256
|
+
"type": "uint256"
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"outputs": [
|
|
260
|
+
{
|
|
261
|
+
"name": "",
|
|
262
|
+
"type": "uint256"
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"stateMutability": "view",
|
|
268
|
+
"type": "function",
|
|
269
|
+
"name": "calc_withdraw_one_coin",
|
|
270
|
+
"inputs": [
|
|
271
|
+
{
|
|
272
|
+
"name": "_pool",
|
|
273
|
+
"type": "address"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "_token_amount",
|
|
277
|
+
"type": "uint256"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "i",
|
|
281
|
+
"type": "uint256"
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
"outputs": [
|
|
285
|
+
{
|
|
286
|
+
"name": "",
|
|
287
|
+
"type": "uint256"
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"stateMutability": "nonpayable",
|
|
4
|
+
"type": "constructor",
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"name": "_base_pool",
|
|
8
|
+
"type": "address"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "_weth",
|
|
12
|
+
"type": "address"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"outputs": []
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"stateMutability": "payable",
|
|
19
|
+
"type": "fallback"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"stateMutability": "pure",
|
|
23
|
+
"type": "function",
|
|
24
|
+
"name": "base_pool",
|
|
25
|
+
"inputs": [],
|
|
26
|
+
"outputs": [
|
|
27
|
+
{
|
|
28
|
+
"name": "",
|
|
29
|
+
"type": "address"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"stateMutability": "pure",
|
|
35
|
+
"type": "function",
|
|
36
|
+
"name": "base_token",
|
|
37
|
+
"inputs": [],
|
|
38
|
+
"outputs": [
|
|
39
|
+
{
|
|
40
|
+
"name": "",
|
|
41
|
+
"type": "address"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"stateMutability": "view",
|
|
47
|
+
"type": "function",
|
|
48
|
+
"name": "price_oracle",
|
|
49
|
+
"inputs": [
|
|
50
|
+
{
|
|
51
|
+
"name": "_pool",
|
|
52
|
+
"type": "address"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"outputs": [
|
|
56
|
+
{
|
|
57
|
+
"name": "",
|
|
58
|
+
"type": "uint256"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"stateMutability": "view",
|
|
64
|
+
"type": "function",
|
|
65
|
+
"name": "price_scale",
|
|
66
|
+
"inputs": [
|
|
67
|
+
{
|
|
68
|
+
"name": "_pool",
|
|
69
|
+
"type": "address"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"outputs": [
|
|
73
|
+
{
|
|
74
|
+
"name": "",
|
|
75
|
+
"type": "uint256"
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"stateMutability": "view",
|
|
81
|
+
"type": "function",
|
|
82
|
+
"name": "lp_price",
|
|
83
|
+
"inputs": [
|
|
84
|
+
{
|
|
85
|
+
"name": "_pool",
|
|
86
|
+
"type": "address"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"outputs": [
|
|
90
|
+
{
|
|
91
|
+
"name": "",
|
|
92
|
+
"type": "uint256"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"stateMutability": "payable",
|
|
98
|
+
"type": "function",
|
|
99
|
+
"name": "exchange",
|
|
100
|
+
"inputs": [
|
|
101
|
+
{
|
|
102
|
+
"name": "_pool",
|
|
103
|
+
"type": "address"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "i",
|
|
107
|
+
"type": "uint256"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "j",
|
|
111
|
+
"type": "uint256"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "_dx",
|
|
115
|
+
"type": "uint256"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "_min_dy",
|
|
119
|
+
"type": "uint256"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"outputs": [
|
|
123
|
+
{
|
|
124
|
+
"name": "",
|
|
125
|
+
"type": "uint256"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"stateMutability": "view",
|
|
131
|
+
"type": "function",
|
|
132
|
+
"name": "get_dy",
|
|
133
|
+
"inputs": [
|
|
134
|
+
{
|
|
135
|
+
"name": "_pool",
|
|
136
|
+
"type": "address"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "i",
|
|
140
|
+
"type": "uint256"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "j",
|
|
144
|
+
"type": "uint256"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "_dx",
|
|
148
|
+
"type": "uint256"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"outputs": [
|
|
152
|
+
{
|
|
153
|
+
"name": "",
|
|
154
|
+
"type": "uint256"
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"stateMutability": "payable",
|
|
160
|
+
"type": "function",
|
|
161
|
+
"name": "add_liquidity",
|
|
162
|
+
"inputs": [
|
|
163
|
+
{
|
|
164
|
+
"name": "_pool",
|
|
165
|
+
"type": "address"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "_deposit_amounts",
|
|
169
|
+
"type": "uint256[3]"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "_min_mint_amount",
|
|
173
|
+
"type": "uint256"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"outputs": [
|
|
177
|
+
{
|
|
178
|
+
"name": "",
|
|
179
|
+
"type": "uint256"
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"stateMutability": "view",
|
|
185
|
+
"type": "function",
|
|
186
|
+
"name": "calc_token_amount",
|
|
187
|
+
"inputs": [
|
|
188
|
+
{
|
|
189
|
+
"name": "_pool",
|
|
190
|
+
"type": "address"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "_amounts",
|
|
194
|
+
"type": "uint256[3]"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"outputs": [
|
|
198
|
+
{
|
|
199
|
+
"name": "",
|
|
200
|
+
"type": "uint256"
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"stateMutability": "nonpayable",
|
|
206
|
+
"type": "function",
|
|
207
|
+
"name": "remove_liquidity",
|
|
208
|
+
"inputs": [
|
|
209
|
+
{
|
|
210
|
+
"name": "_pool",
|
|
211
|
+
"type": "address"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": "_burn_amount",
|
|
215
|
+
"type": "uint256"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "_min_amounts",
|
|
219
|
+
"type": "uint256[3]"
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
"outputs": [
|
|
223
|
+
{
|
|
224
|
+
"name": "",
|
|
225
|
+
"type": "uint256[3]"
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"stateMutability": "nonpayable",
|
|
231
|
+
"type": "function",
|
|
232
|
+
"name": "remove_liquidity_one_coin",
|
|
233
|
+
"inputs": [
|
|
234
|
+
{
|
|
235
|
+
"name": "_pool",
|
|
236
|
+
"type": "address"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "_burn_amount",
|
|
240
|
+
"type": "uint256"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"name": "i",
|
|
244
|
+
"type": "uint256"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"name": "_min_amount",
|
|
248
|
+
"type": "uint256"
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
"outputs": [
|
|
252
|
+
{
|
|
253
|
+
"name": "",
|
|
254
|
+
"type": "uint256"
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"stateMutability": "view",
|
|
260
|
+
"type": "function",
|
|
261
|
+
"name": "calc_withdraw_one_coin",
|
|
262
|
+
"inputs": [
|
|
263
|
+
{
|
|
264
|
+
"name": "_pool",
|
|
265
|
+
"type": "address"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "_token_amount",
|
|
269
|
+
"type": "uint256"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "i",
|
|
273
|
+
"type": "uint256"
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
"outputs": [
|
|
277
|
+
{
|
|
278
|
+
"name": "",
|
|
279
|
+
"type": "uint256"
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
]
|
package/lib/constants/utils.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export declare const lowerCasePoolDataAddresses: (poolsData: IDict<IPoolData>) =
|
|
|
3
3
|
export declare const extractDecimals: (poolsData: IDict<IPoolData>) => IDict<number>;
|
|
4
4
|
export declare const extractGauges: (poolsData: IDict<IPoolData>) => string[];
|
|
5
5
|
export declare const lowerCaseValues: (dict: IDict<string>) => IDict<string>;
|
|
6
|
+
export declare const lowerCaseKeys: (dict: IDict<string>) => IDict<string>;
|
package/lib/constants/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lowerCaseValues = exports.extractGauges = exports.extractDecimals = exports.lowerCasePoolDataAddresses = void 0;
|
|
3
|
+
exports.lowerCaseKeys = exports.lowerCaseValues = exports.extractGauges = exports.extractDecimals = exports.lowerCasePoolDataAddresses = void 0;
|
|
4
4
|
var ethers_1 = require("ethers");
|
|
5
5
|
var lowerCasePoolDataAddresses = function (poolsData) {
|
|
6
6
|
for (var poolId in poolsData) {
|
|
@@ -58,3 +58,8 @@ var lowerCaseValues = function (dict) {
|
|
|
58
58
|
return Object.fromEntries(Object.entries(dict).map(function (entry) { return [entry[0], entry[1].toLowerCase()]; }));
|
|
59
59
|
};
|
|
60
60
|
exports.lowerCaseValues = lowerCaseValues;
|
|
61
|
+
var lowerCaseKeys = function (dict) {
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
return Object.fromEntries(Object.entries(dict).map(function (entry) { return [entry[0].toLowerCase(), entry[1]]; }));
|
|
64
|
+
};
|
|
65
|
+
exports.lowerCaseKeys = lowerCaseKeys;
|
package/lib/factory/common.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ICurve } from "../interfaces";
|
|
2
|
-
export declare function setFactoryZapContracts(this: ICurve): void;
|
|
3
|
-
export declare function setCryptoFactoryZapContracts(this: ICurve): void;
|
|
2
|
+
export declare function setFactoryZapContracts(this: ICurve, isCrypto: boolean): void;
|
package/lib/factory/common.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
var ethers_1 = require("ethers");
|
|
8
|
-
var ethcall_1 = require("ethcall");
|
|
3
|
+
exports.setFactoryZapContracts = void 0;
|
|
9
4
|
var constants_1 = require("./constants");
|
|
10
|
-
var
|
|
11
|
-
function setFactoryZapContracts() {
|
|
12
|
-
var basePoolIdZapDict = constants_1.FACTORY_CONSTANTS[this.chainId].basePoolIdZapDict;
|
|
5
|
+
var constants_crypto_1 = require("./constants-crypto");
|
|
6
|
+
function setFactoryZapContracts(isCrypto) {
|
|
7
|
+
var basePoolIdZapDict = (isCrypto ? constants_crypto_1.CRYPTO_FACTORY_CONSTANTS : constants_1.FACTORY_CONSTANTS)[this.chainId].basePoolIdZapDict;
|
|
13
8
|
for (var basePoolId in basePoolIdZapDict) {
|
|
14
9
|
if (!Object.prototype.hasOwnProperty.call(basePoolIdZapDict, basePoolId))
|
|
15
10
|
continue;
|
|
@@ -20,13 +15,3 @@ function setFactoryZapContracts() {
|
|
|
20
15
|
}
|
|
21
16
|
}
|
|
22
17
|
exports.setFactoryZapContracts = setFactoryZapContracts;
|
|
23
|
-
function setCryptoFactoryZapContracts() {
|
|
24
|
-
if (this.chainId === 137) {
|
|
25
|
-
var atricrypto3ZapAddress = "0x3d8EADb739D1Ef95dd53D718e4810721837c69c1".toLowerCase();
|
|
26
|
-
this.contracts[atricrypto3ZapAddress] = {
|
|
27
|
-
contract: new ethers_1.Contract(atricrypto3ZapAddress, base_pool_zap_json_1.default, this.signer || this.provider),
|
|
28
|
-
multicallContract: new ethcall_1.Contract(atricrypto3ZapAddress, base_pool_zap_json_1.default),
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.setCryptoFactoryZapContracts = setCryptoFactoryZapContracts;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IDict } from "../interfaces";
|
|
2
|
+
export declare const lpTokenBasePoolIdDictEthereum: IDict<string>;
|
|
3
|
+
export declare const lpTokenBasePoolIdDictPolygon: IDict<string>;
|
|
4
|
+
export declare const lpTokenBasePoolIdDictFantom: IDict<string>;
|
|
5
|
+
export declare const lpTokenBasePoolIdDictAvalanche: IDict<string>;
|
|
6
|
+
export declare const lpTokenBasePoolIdDictArbitrum: IDict<string>;
|
|
7
|
+
export declare const lpTokenBasePoolIdDictOptimism: IDict<string>;
|
|
8
|
+
export declare const lpTokenBasePoolIdDictXDai: IDict<string>;
|
|
9
|
+
export declare const lpTokenBasePoolIdDictMoonbeam: IDict<string>;
|
|
10
|
+
export declare const lpTokenBasePoolIdDictKava: IDict<string>;
|
|
11
|
+
export declare const basePoolIdZapDictEthereum: IDict<{
|
|
12
|
+
address: string;
|
|
13
|
+
ABI: any;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const basePoolIdZapDictPolygon: IDict<{
|
|
16
|
+
address: string;
|
|
17
|
+
ABI: any;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const basePoolIdZapDictFantom: IDict<{
|
|
20
|
+
address: string;
|
|
21
|
+
ABI: any;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const basePoolIdZapDictAvalanche: IDict<{
|
|
24
|
+
address: string;
|
|
25
|
+
ABI: any;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const basePoolIdZapDictArbitrum: IDict<{
|
|
28
|
+
address: string;
|
|
29
|
+
ABI: any;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const basePoolIdZapDictOptimism: IDict<{
|
|
32
|
+
address: string;
|
|
33
|
+
ABI: any;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const basePoolIdZapDictXDai: IDict<{
|
|
36
|
+
address: string;
|
|
37
|
+
ABI: any;
|
|
38
|
+
}>;
|
|
39
|
+
export declare const basePoolIdZapDictMoonbeam: IDict<{
|
|
40
|
+
address: string;
|
|
41
|
+
ABI: any;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const basePoolIdZapDictKava: IDict<{
|
|
44
|
+
address: string;
|
|
45
|
+
ABI: any;
|
|
46
|
+
}>;
|
|
47
|
+
export declare const CRYPTO_FACTORY_CONSTANTS: {
|
|
48
|
+
[index: number]: {
|
|
49
|
+
lpTokenBasePoolIdDict: IDict<string>;
|
|
50
|
+
basePoolIdZapDict: IDict<{
|
|
51
|
+
address: string;
|
|
52
|
+
ABI: any;
|
|
53
|
+
}>;
|
|
54
|
+
};
|
|
55
|
+
};
|