@luxfi/exchange 0.2.0 → 1.0.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/dist/contracts/abis/amm-v2-factory.d.ts +148 -0
- package/dist/contracts/abis/amm-v2-factory.d.ts.map +1 -0
- package/dist/contracts/abis/amm-v2-factory.js +52 -0
- package/dist/contracts/abis/amm-v2-pair.d.ts +236 -0
- package/dist/contracts/abis/amm-v2-pair.d.ts.map +1 -0
- package/dist/contracts/abis/amm-v2-pair.js +88 -0
- package/dist/contracts/abis/amm-v2-router.d.ts +496 -0
- package/dist/contracts/abis/amm-v2-router.d.ts.map +1 -0
- package/dist/contracts/abis/amm-v2-router.js +149 -0
- package/dist/contracts/abis/amm-v3-factory.d.ts +152 -0
- package/dist/contracts/abis/amm-v3-factory.d.ts.map +1 -0
- package/dist/contracts/abis/amm-v3-factory.js +48 -0
- package/dist/contracts/abis/amm-v3-pool.d.ts +254 -0
- package/dist/contracts/abis/amm-v3-pool.d.ts.map +1 -0
- package/dist/contracts/abis/amm-v3-pool.js +84 -0
- package/dist/contracts/abis/index.d.ts +8 -5
- package/dist/contracts/abis/index.d.ts.map +1 -1
- package/dist/contracts/abis/index.js +13 -6
- package/dist/contracts/abis/lux-amm-v2-factory.d.ts +148 -0
- package/dist/contracts/abis/lux-amm-v2-factory.d.ts.map +1 -0
- package/dist/contracts/abis/lux-amm-v2-factory.js +52 -0
- package/dist/contracts/abis/lux-amm-v2-pair.d.ts +236 -0
- package/dist/contracts/abis/lux-amm-v2-pair.d.ts.map +1 -0
- package/dist/contracts/abis/lux-amm-v2-pair.js +88 -0
- package/dist/contracts/abis/lux-amm-v2-router.d.ts +496 -0
- package/dist/contracts/abis/lux-amm-v2-router.d.ts.map +1 -0
- package/dist/contracts/abis/lux-amm-v2-router.js +149 -0
- package/dist/contracts/abis/lux-amm-v3-factory.d.ts +152 -0
- package/dist/contracts/abis/lux-amm-v3-factory.d.ts.map +1 -0
- package/dist/contracts/abis/lux-amm-v3-factory.js +48 -0
- package/dist/contracts/abis/lux-amm-v3-pool.d.ts +254 -0
- package/dist/contracts/abis/lux-amm-v3-pool.d.ts.map +1 -0
- package/dist/contracts/abis/lux-amm-v3-pool.js +84 -0
- package/dist/contracts/addresses.d.ts +18 -48
- package/dist/contracts/addresses.d.ts.map +1 -1
- package/dist/contracts/addresses.js +30 -22
- package/dist/tokens/index.d.ts +25 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +90 -5
- package/package.json +2 -2
- package/src/contracts/abis/{uniswap-v2-factory.ts → amm-v2-factory.ts} +6 -2
- package/src/contracts/abis/{uniswap-v2-pair.ts → amm-v2-pair.ts} +6 -2
- package/src/contracts/abis/{uniswap-v2-router.ts → amm-v2-router.ts} +6 -2
- package/src/contracts/abis/{uniswap-v3-factory.ts → amm-v3-factory.ts} +6 -2
- package/src/contracts/abis/{uniswap-v3-pool.ts → amm-v3-pool.ts} +6 -2
- package/src/contracts/abis/index.ts +16 -6
- package/src/contracts/abis/pool-manager.ts +1 -1
- package/src/contracts/addresses.ts +53 -52
- package/src/hooks/use-pools.ts +8 -6
- package/src/hooks/use-positions.ts +3 -3
- package/src/hooks/use-swap-quote.ts +1 -1
- package/src/hooks/use-swap.ts +1 -1
- package/src/tokens/index.ts +148 -32
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lux AMM V2 Router ABI
|
|
3
|
+
* Compatible with Uniswap V2 Router02 interface
|
|
4
|
+
*/
|
|
5
|
+
export declare const LUX_AMM_V2_ROUTER_ABI: readonly [{
|
|
6
|
+
readonly type: "function";
|
|
7
|
+
readonly name: "factory";
|
|
8
|
+
readonly inputs: readonly [];
|
|
9
|
+
readonly outputs: readonly [{
|
|
10
|
+
readonly type: "address";
|
|
11
|
+
}];
|
|
12
|
+
readonly stateMutability: "view";
|
|
13
|
+
}, {
|
|
14
|
+
readonly type: "function";
|
|
15
|
+
readonly name: "WETH";
|
|
16
|
+
readonly inputs: readonly [];
|
|
17
|
+
readonly outputs: readonly [{
|
|
18
|
+
readonly type: "address";
|
|
19
|
+
}];
|
|
20
|
+
readonly stateMutability: "view";
|
|
21
|
+
}, {
|
|
22
|
+
readonly type: "function";
|
|
23
|
+
readonly name: "getAmountsOut";
|
|
24
|
+
readonly inputs: readonly [{
|
|
25
|
+
readonly name: "amountIn";
|
|
26
|
+
readonly type: "uint256";
|
|
27
|
+
}, {
|
|
28
|
+
readonly name: "path";
|
|
29
|
+
readonly type: "address[]";
|
|
30
|
+
}];
|
|
31
|
+
readonly outputs: readonly [{
|
|
32
|
+
readonly name: "amounts";
|
|
33
|
+
readonly type: "uint256[]";
|
|
34
|
+
}];
|
|
35
|
+
readonly stateMutability: "view";
|
|
36
|
+
}, {
|
|
37
|
+
readonly type: "function";
|
|
38
|
+
readonly name: "getAmountsIn";
|
|
39
|
+
readonly inputs: readonly [{
|
|
40
|
+
readonly name: "amountOut";
|
|
41
|
+
readonly type: "uint256";
|
|
42
|
+
}, {
|
|
43
|
+
readonly name: "path";
|
|
44
|
+
readonly type: "address[]";
|
|
45
|
+
}];
|
|
46
|
+
readonly outputs: readonly [{
|
|
47
|
+
readonly name: "amounts";
|
|
48
|
+
readonly type: "uint256[]";
|
|
49
|
+
}];
|
|
50
|
+
readonly stateMutability: "view";
|
|
51
|
+
}, {
|
|
52
|
+
readonly type: "function";
|
|
53
|
+
readonly name: "swapExactTokensForTokens";
|
|
54
|
+
readonly inputs: readonly [{
|
|
55
|
+
readonly name: "amountIn";
|
|
56
|
+
readonly type: "uint256";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "amountOutMin";
|
|
59
|
+
readonly type: "uint256";
|
|
60
|
+
}, {
|
|
61
|
+
readonly name: "path";
|
|
62
|
+
readonly type: "address[]";
|
|
63
|
+
}, {
|
|
64
|
+
readonly name: "to";
|
|
65
|
+
readonly type: "address";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "deadline";
|
|
68
|
+
readonly type: "uint256";
|
|
69
|
+
}];
|
|
70
|
+
readonly outputs: readonly [{
|
|
71
|
+
readonly name: "amounts";
|
|
72
|
+
readonly type: "uint256[]";
|
|
73
|
+
}];
|
|
74
|
+
readonly stateMutability: "nonpayable";
|
|
75
|
+
}, {
|
|
76
|
+
readonly type: "function";
|
|
77
|
+
readonly name: "swapTokensForExactTokens";
|
|
78
|
+
readonly inputs: readonly [{
|
|
79
|
+
readonly name: "amountOut";
|
|
80
|
+
readonly type: "uint256";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "amountInMax";
|
|
83
|
+
readonly type: "uint256";
|
|
84
|
+
}, {
|
|
85
|
+
readonly name: "path";
|
|
86
|
+
readonly type: "address[]";
|
|
87
|
+
}, {
|
|
88
|
+
readonly name: "to";
|
|
89
|
+
readonly type: "address";
|
|
90
|
+
}, {
|
|
91
|
+
readonly name: "deadline";
|
|
92
|
+
readonly type: "uint256";
|
|
93
|
+
}];
|
|
94
|
+
readonly outputs: readonly [{
|
|
95
|
+
readonly name: "amounts";
|
|
96
|
+
readonly type: "uint256[]";
|
|
97
|
+
}];
|
|
98
|
+
readonly stateMutability: "nonpayable";
|
|
99
|
+
}, {
|
|
100
|
+
readonly type: "function";
|
|
101
|
+
readonly name: "swapExactETHForTokens";
|
|
102
|
+
readonly inputs: readonly [{
|
|
103
|
+
readonly name: "amountOutMin";
|
|
104
|
+
readonly type: "uint256";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "path";
|
|
107
|
+
readonly type: "address[]";
|
|
108
|
+
}, {
|
|
109
|
+
readonly name: "to";
|
|
110
|
+
readonly type: "address";
|
|
111
|
+
}, {
|
|
112
|
+
readonly name: "deadline";
|
|
113
|
+
readonly type: "uint256";
|
|
114
|
+
}];
|
|
115
|
+
readonly outputs: readonly [{
|
|
116
|
+
readonly name: "amounts";
|
|
117
|
+
readonly type: "uint256[]";
|
|
118
|
+
}];
|
|
119
|
+
readonly stateMutability: "payable";
|
|
120
|
+
}, {
|
|
121
|
+
readonly type: "function";
|
|
122
|
+
readonly name: "swapExactTokensForETH";
|
|
123
|
+
readonly inputs: readonly [{
|
|
124
|
+
readonly name: "amountIn";
|
|
125
|
+
readonly type: "uint256";
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "amountOutMin";
|
|
128
|
+
readonly type: "uint256";
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: "path";
|
|
131
|
+
readonly type: "address[]";
|
|
132
|
+
}, {
|
|
133
|
+
readonly name: "to";
|
|
134
|
+
readonly type: "address";
|
|
135
|
+
}, {
|
|
136
|
+
readonly name: "deadline";
|
|
137
|
+
readonly type: "uint256";
|
|
138
|
+
}];
|
|
139
|
+
readonly outputs: readonly [{
|
|
140
|
+
readonly name: "amounts";
|
|
141
|
+
readonly type: "uint256[]";
|
|
142
|
+
}];
|
|
143
|
+
readonly stateMutability: "nonpayable";
|
|
144
|
+
}, {
|
|
145
|
+
readonly type: "function";
|
|
146
|
+
readonly name: "addLiquidity";
|
|
147
|
+
readonly inputs: readonly [{
|
|
148
|
+
readonly name: "tokenA";
|
|
149
|
+
readonly type: "address";
|
|
150
|
+
}, {
|
|
151
|
+
readonly name: "tokenB";
|
|
152
|
+
readonly type: "address";
|
|
153
|
+
}, {
|
|
154
|
+
readonly name: "amountADesired";
|
|
155
|
+
readonly type: "uint256";
|
|
156
|
+
}, {
|
|
157
|
+
readonly name: "amountBDesired";
|
|
158
|
+
readonly type: "uint256";
|
|
159
|
+
}, {
|
|
160
|
+
readonly name: "amountAMin";
|
|
161
|
+
readonly type: "uint256";
|
|
162
|
+
}, {
|
|
163
|
+
readonly name: "amountBMin";
|
|
164
|
+
readonly type: "uint256";
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "to";
|
|
167
|
+
readonly type: "address";
|
|
168
|
+
}, {
|
|
169
|
+
readonly name: "deadline";
|
|
170
|
+
readonly type: "uint256";
|
|
171
|
+
}];
|
|
172
|
+
readonly outputs: readonly [{
|
|
173
|
+
readonly name: "amountA";
|
|
174
|
+
readonly type: "uint256";
|
|
175
|
+
}, {
|
|
176
|
+
readonly name: "amountB";
|
|
177
|
+
readonly type: "uint256";
|
|
178
|
+
}, {
|
|
179
|
+
readonly name: "liquidity";
|
|
180
|
+
readonly type: "uint256";
|
|
181
|
+
}];
|
|
182
|
+
readonly stateMutability: "nonpayable";
|
|
183
|
+
}, {
|
|
184
|
+
readonly type: "function";
|
|
185
|
+
readonly name: "addLiquidityETH";
|
|
186
|
+
readonly inputs: readonly [{
|
|
187
|
+
readonly name: "token";
|
|
188
|
+
readonly type: "address";
|
|
189
|
+
}, {
|
|
190
|
+
readonly name: "amountTokenDesired";
|
|
191
|
+
readonly type: "uint256";
|
|
192
|
+
}, {
|
|
193
|
+
readonly name: "amountTokenMin";
|
|
194
|
+
readonly type: "uint256";
|
|
195
|
+
}, {
|
|
196
|
+
readonly name: "amountETHMin";
|
|
197
|
+
readonly type: "uint256";
|
|
198
|
+
}, {
|
|
199
|
+
readonly name: "to";
|
|
200
|
+
readonly type: "address";
|
|
201
|
+
}, {
|
|
202
|
+
readonly name: "deadline";
|
|
203
|
+
readonly type: "uint256";
|
|
204
|
+
}];
|
|
205
|
+
readonly outputs: readonly [{
|
|
206
|
+
readonly name: "amountToken";
|
|
207
|
+
readonly type: "uint256";
|
|
208
|
+
}, {
|
|
209
|
+
readonly name: "amountETH";
|
|
210
|
+
readonly type: "uint256";
|
|
211
|
+
}, {
|
|
212
|
+
readonly name: "liquidity";
|
|
213
|
+
readonly type: "uint256";
|
|
214
|
+
}];
|
|
215
|
+
readonly stateMutability: "payable";
|
|
216
|
+
}, {
|
|
217
|
+
readonly type: "function";
|
|
218
|
+
readonly name: "removeLiquidity";
|
|
219
|
+
readonly inputs: readonly [{
|
|
220
|
+
readonly name: "tokenA";
|
|
221
|
+
readonly type: "address";
|
|
222
|
+
}, {
|
|
223
|
+
readonly name: "tokenB";
|
|
224
|
+
readonly type: "address";
|
|
225
|
+
}, {
|
|
226
|
+
readonly name: "liquidity";
|
|
227
|
+
readonly type: "uint256";
|
|
228
|
+
}, {
|
|
229
|
+
readonly name: "amountAMin";
|
|
230
|
+
readonly type: "uint256";
|
|
231
|
+
}, {
|
|
232
|
+
readonly name: "amountBMin";
|
|
233
|
+
readonly type: "uint256";
|
|
234
|
+
}, {
|
|
235
|
+
readonly name: "to";
|
|
236
|
+
readonly type: "address";
|
|
237
|
+
}, {
|
|
238
|
+
readonly name: "deadline";
|
|
239
|
+
readonly type: "uint256";
|
|
240
|
+
}];
|
|
241
|
+
readonly outputs: readonly [{
|
|
242
|
+
readonly name: "amountA";
|
|
243
|
+
readonly type: "uint256";
|
|
244
|
+
}, {
|
|
245
|
+
readonly name: "amountB";
|
|
246
|
+
readonly type: "uint256";
|
|
247
|
+
}];
|
|
248
|
+
readonly stateMutability: "nonpayable";
|
|
249
|
+
}];
|
|
250
|
+
/** @deprecated Use LUX_AMM_V2_ROUTER_ABI instead */
|
|
251
|
+
export declare const UNISWAP_V2_ROUTER_ABI: readonly [{
|
|
252
|
+
readonly type: "function";
|
|
253
|
+
readonly name: "factory";
|
|
254
|
+
readonly inputs: readonly [];
|
|
255
|
+
readonly outputs: readonly [{
|
|
256
|
+
readonly type: "address";
|
|
257
|
+
}];
|
|
258
|
+
readonly stateMutability: "view";
|
|
259
|
+
}, {
|
|
260
|
+
readonly type: "function";
|
|
261
|
+
readonly name: "WETH";
|
|
262
|
+
readonly inputs: readonly [];
|
|
263
|
+
readonly outputs: readonly [{
|
|
264
|
+
readonly type: "address";
|
|
265
|
+
}];
|
|
266
|
+
readonly stateMutability: "view";
|
|
267
|
+
}, {
|
|
268
|
+
readonly type: "function";
|
|
269
|
+
readonly name: "getAmountsOut";
|
|
270
|
+
readonly inputs: readonly [{
|
|
271
|
+
readonly name: "amountIn";
|
|
272
|
+
readonly type: "uint256";
|
|
273
|
+
}, {
|
|
274
|
+
readonly name: "path";
|
|
275
|
+
readonly type: "address[]";
|
|
276
|
+
}];
|
|
277
|
+
readonly outputs: readonly [{
|
|
278
|
+
readonly name: "amounts";
|
|
279
|
+
readonly type: "uint256[]";
|
|
280
|
+
}];
|
|
281
|
+
readonly stateMutability: "view";
|
|
282
|
+
}, {
|
|
283
|
+
readonly type: "function";
|
|
284
|
+
readonly name: "getAmountsIn";
|
|
285
|
+
readonly inputs: readonly [{
|
|
286
|
+
readonly name: "amountOut";
|
|
287
|
+
readonly type: "uint256";
|
|
288
|
+
}, {
|
|
289
|
+
readonly name: "path";
|
|
290
|
+
readonly type: "address[]";
|
|
291
|
+
}];
|
|
292
|
+
readonly outputs: readonly [{
|
|
293
|
+
readonly name: "amounts";
|
|
294
|
+
readonly type: "uint256[]";
|
|
295
|
+
}];
|
|
296
|
+
readonly stateMutability: "view";
|
|
297
|
+
}, {
|
|
298
|
+
readonly type: "function";
|
|
299
|
+
readonly name: "swapExactTokensForTokens";
|
|
300
|
+
readonly inputs: readonly [{
|
|
301
|
+
readonly name: "amountIn";
|
|
302
|
+
readonly type: "uint256";
|
|
303
|
+
}, {
|
|
304
|
+
readonly name: "amountOutMin";
|
|
305
|
+
readonly type: "uint256";
|
|
306
|
+
}, {
|
|
307
|
+
readonly name: "path";
|
|
308
|
+
readonly type: "address[]";
|
|
309
|
+
}, {
|
|
310
|
+
readonly name: "to";
|
|
311
|
+
readonly type: "address";
|
|
312
|
+
}, {
|
|
313
|
+
readonly name: "deadline";
|
|
314
|
+
readonly type: "uint256";
|
|
315
|
+
}];
|
|
316
|
+
readonly outputs: readonly [{
|
|
317
|
+
readonly name: "amounts";
|
|
318
|
+
readonly type: "uint256[]";
|
|
319
|
+
}];
|
|
320
|
+
readonly stateMutability: "nonpayable";
|
|
321
|
+
}, {
|
|
322
|
+
readonly type: "function";
|
|
323
|
+
readonly name: "swapTokensForExactTokens";
|
|
324
|
+
readonly inputs: readonly [{
|
|
325
|
+
readonly name: "amountOut";
|
|
326
|
+
readonly type: "uint256";
|
|
327
|
+
}, {
|
|
328
|
+
readonly name: "amountInMax";
|
|
329
|
+
readonly type: "uint256";
|
|
330
|
+
}, {
|
|
331
|
+
readonly name: "path";
|
|
332
|
+
readonly type: "address[]";
|
|
333
|
+
}, {
|
|
334
|
+
readonly name: "to";
|
|
335
|
+
readonly type: "address";
|
|
336
|
+
}, {
|
|
337
|
+
readonly name: "deadline";
|
|
338
|
+
readonly type: "uint256";
|
|
339
|
+
}];
|
|
340
|
+
readonly outputs: readonly [{
|
|
341
|
+
readonly name: "amounts";
|
|
342
|
+
readonly type: "uint256[]";
|
|
343
|
+
}];
|
|
344
|
+
readonly stateMutability: "nonpayable";
|
|
345
|
+
}, {
|
|
346
|
+
readonly type: "function";
|
|
347
|
+
readonly name: "swapExactETHForTokens";
|
|
348
|
+
readonly inputs: readonly [{
|
|
349
|
+
readonly name: "amountOutMin";
|
|
350
|
+
readonly type: "uint256";
|
|
351
|
+
}, {
|
|
352
|
+
readonly name: "path";
|
|
353
|
+
readonly type: "address[]";
|
|
354
|
+
}, {
|
|
355
|
+
readonly name: "to";
|
|
356
|
+
readonly type: "address";
|
|
357
|
+
}, {
|
|
358
|
+
readonly name: "deadline";
|
|
359
|
+
readonly type: "uint256";
|
|
360
|
+
}];
|
|
361
|
+
readonly outputs: readonly [{
|
|
362
|
+
readonly name: "amounts";
|
|
363
|
+
readonly type: "uint256[]";
|
|
364
|
+
}];
|
|
365
|
+
readonly stateMutability: "payable";
|
|
366
|
+
}, {
|
|
367
|
+
readonly type: "function";
|
|
368
|
+
readonly name: "swapExactTokensForETH";
|
|
369
|
+
readonly inputs: readonly [{
|
|
370
|
+
readonly name: "amountIn";
|
|
371
|
+
readonly type: "uint256";
|
|
372
|
+
}, {
|
|
373
|
+
readonly name: "amountOutMin";
|
|
374
|
+
readonly type: "uint256";
|
|
375
|
+
}, {
|
|
376
|
+
readonly name: "path";
|
|
377
|
+
readonly type: "address[]";
|
|
378
|
+
}, {
|
|
379
|
+
readonly name: "to";
|
|
380
|
+
readonly type: "address";
|
|
381
|
+
}, {
|
|
382
|
+
readonly name: "deadline";
|
|
383
|
+
readonly type: "uint256";
|
|
384
|
+
}];
|
|
385
|
+
readonly outputs: readonly [{
|
|
386
|
+
readonly name: "amounts";
|
|
387
|
+
readonly type: "uint256[]";
|
|
388
|
+
}];
|
|
389
|
+
readonly stateMutability: "nonpayable";
|
|
390
|
+
}, {
|
|
391
|
+
readonly type: "function";
|
|
392
|
+
readonly name: "addLiquidity";
|
|
393
|
+
readonly inputs: readonly [{
|
|
394
|
+
readonly name: "tokenA";
|
|
395
|
+
readonly type: "address";
|
|
396
|
+
}, {
|
|
397
|
+
readonly name: "tokenB";
|
|
398
|
+
readonly type: "address";
|
|
399
|
+
}, {
|
|
400
|
+
readonly name: "amountADesired";
|
|
401
|
+
readonly type: "uint256";
|
|
402
|
+
}, {
|
|
403
|
+
readonly name: "amountBDesired";
|
|
404
|
+
readonly type: "uint256";
|
|
405
|
+
}, {
|
|
406
|
+
readonly name: "amountAMin";
|
|
407
|
+
readonly type: "uint256";
|
|
408
|
+
}, {
|
|
409
|
+
readonly name: "amountBMin";
|
|
410
|
+
readonly type: "uint256";
|
|
411
|
+
}, {
|
|
412
|
+
readonly name: "to";
|
|
413
|
+
readonly type: "address";
|
|
414
|
+
}, {
|
|
415
|
+
readonly name: "deadline";
|
|
416
|
+
readonly type: "uint256";
|
|
417
|
+
}];
|
|
418
|
+
readonly outputs: readonly [{
|
|
419
|
+
readonly name: "amountA";
|
|
420
|
+
readonly type: "uint256";
|
|
421
|
+
}, {
|
|
422
|
+
readonly name: "amountB";
|
|
423
|
+
readonly type: "uint256";
|
|
424
|
+
}, {
|
|
425
|
+
readonly name: "liquidity";
|
|
426
|
+
readonly type: "uint256";
|
|
427
|
+
}];
|
|
428
|
+
readonly stateMutability: "nonpayable";
|
|
429
|
+
}, {
|
|
430
|
+
readonly type: "function";
|
|
431
|
+
readonly name: "addLiquidityETH";
|
|
432
|
+
readonly inputs: readonly [{
|
|
433
|
+
readonly name: "token";
|
|
434
|
+
readonly type: "address";
|
|
435
|
+
}, {
|
|
436
|
+
readonly name: "amountTokenDesired";
|
|
437
|
+
readonly type: "uint256";
|
|
438
|
+
}, {
|
|
439
|
+
readonly name: "amountTokenMin";
|
|
440
|
+
readonly type: "uint256";
|
|
441
|
+
}, {
|
|
442
|
+
readonly name: "amountETHMin";
|
|
443
|
+
readonly type: "uint256";
|
|
444
|
+
}, {
|
|
445
|
+
readonly name: "to";
|
|
446
|
+
readonly type: "address";
|
|
447
|
+
}, {
|
|
448
|
+
readonly name: "deadline";
|
|
449
|
+
readonly type: "uint256";
|
|
450
|
+
}];
|
|
451
|
+
readonly outputs: readonly [{
|
|
452
|
+
readonly name: "amountToken";
|
|
453
|
+
readonly type: "uint256";
|
|
454
|
+
}, {
|
|
455
|
+
readonly name: "amountETH";
|
|
456
|
+
readonly type: "uint256";
|
|
457
|
+
}, {
|
|
458
|
+
readonly name: "liquidity";
|
|
459
|
+
readonly type: "uint256";
|
|
460
|
+
}];
|
|
461
|
+
readonly stateMutability: "payable";
|
|
462
|
+
}, {
|
|
463
|
+
readonly type: "function";
|
|
464
|
+
readonly name: "removeLiquidity";
|
|
465
|
+
readonly inputs: readonly [{
|
|
466
|
+
readonly name: "tokenA";
|
|
467
|
+
readonly type: "address";
|
|
468
|
+
}, {
|
|
469
|
+
readonly name: "tokenB";
|
|
470
|
+
readonly type: "address";
|
|
471
|
+
}, {
|
|
472
|
+
readonly name: "liquidity";
|
|
473
|
+
readonly type: "uint256";
|
|
474
|
+
}, {
|
|
475
|
+
readonly name: "amountAMin";
|
|
476
|
+
readonly type: "uint256";
|
|
477
|
+
}, {
|
|
478
|
+
readonly name: "amountBMin";
|
|
479
|
+
readonly type: "uint256";
|
|
480
|
+
}, {
|
|
481
|
+
readonly name: "to";
|
|
482
|
+
readonly type: "address";
|
|
483
|
+
}, {
|
|
484
|
+
readonly name: "deadline";
|
|
485
|
+
readonly type: "uint256";
|
|
486
|
+
}];
|
|
487
|
+
readonly outputs: readonly [{
|
|
488
|
+
readonly name: "amountA";
|
|
489
|
+
readonly type: "uint256";
|
|
490
|
+
}, {
|
|
491
|
+
readonly name: "amountB";
|
|
492
|
+
readonly type: "uint256";
|
|
493
|
+
}];
|
|
494
|
+
readonly stateMutability: "nonpayable";
|
|
495
|
+
}];
|
|
496
|
+
//# sourceMappingURL=lux-amm-v2-router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lux-amm-v2-router.d.ts","sourceRoot":"","sources":["../../../src/contracts/abis/lux-amm-v2-router.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8IxB,CAAA;AAEV,oDAAoD;AACpD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAwB,CAAA"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lux AMM V2 Router ABI
|
|
3
|
+
* Compatible with Uniswap V2 Router02 interface
|
|
4
|
+
*/
|
|
5
|
+
export const LUX_AMM_V2_ROUTER_ABI = [
|
|
6
|
+
{
|
|
7
|
+
type: 'function',
|
|
8
|
+
name: 'factory',
|
|
9
|
+
inputs: [],
|
|
10
|
+
outputs: [{ type: 'address' }],
|
|
11
|
+
stateMutability: 'view',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
type: 'function',
|
|
15
|
+
name: 'WETH',
|
|
16
|
+
inputs: [],
|
|
17
|
+
outputs: [{ type: 'address' }],
|
|
18
|
+
stateMutability: 'view',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'function',
|
|
22
|
+
name: 'getAmountsOut',
|
|
23
|
+
inputs: [
|
|
24
|
+
{ name: 'amountIn', type: 'uint256' },
|
|
25
|
+
{ name: 'path', type: 'address[]' },
|
|
26
|
+
],
|
|
27
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
28
|
+
stateMutability: 'view',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'function',
|
|
32
|
+
name: 'getAmountsIn',
|
|
33
|
+
inputs: [
|
|
34
|
+
{ name: 'amountOut', type: 'uint256' },
|
|
35
|
+
{ name: 'path', type: 'address[]' },
|
|
36
|
+
],
|
|
37
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
38
|
+
stateMutability: 'view',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: 'function',
|
|
42
|
+
name: 'swapExactTokensForTokens',
|
|
43
|
+
inputs: [
|
|
44
|
+
{ name: 'amountIn', type: 'uint256' },
|
|
45
|
+
{ name: 'amountOutMin', type: 'uint256' },
|
|
46
|
+
{ name: 'path', type: 'address[]' },
|
|
47
|
+
{ name: 'to', type: 'address' },
|
|
48
|
+
{ name: 'deadline', type: 'uint256' },
|
|
49
|
+
],
|
|
50
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
51
|
+
stateMutability: 'nonpayable',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: 'function',
|
|
55
|
+
name: 'swapTokensForExactTokens',
|
|
56
|
+
inputs: [
|
|
57
|
+
{ name: 'amountOut', type: 'uint256' },
|
|
58
|
+
{ name: 'amountInMax', type: 'uint256' },
|
|
59
|
+
{ name: 'path', type: 'address[]' },
|
|
60
|
+
{ name: 'to', type: 'address' },
|
|
61
|
+
{ name: 'deadline', type: 'uint256' },
|
|
62
|
+
],
|
|
63
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
64
|
+
stateMutability: 'nonpayable',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'function',
|
|
68
|
+
name: 'swapExactETHForTokens',
|
|
69
|
+
inputs: [
|
|
70
|
+
{ name: 'amountOutMin', type: 'uint256' },
|
|
71
|
+
{ name: 'path', type: 'address[]' },
|
|
72
|
+
{ name: 'to', type: 'address' },
|
|
73
|
+
{ name: 'deadline', type: 'uint256' },
|
|
74
|
+
],
|
|
75
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
76
|
+
stateMutability: 'payable',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'function',
|
|
80
|
+
name: 'swapExactTokensForETH',
|
|
81
|
+
inputs: [
|
|
82
|
+
{ name: 'amountIn', type: 'uint256' },
|
|
83
|
+
{ name: 'amountOutMin', type: 'uint256' },
|
|
84
|
+
{ name: 'path', type: 'address[]' },
|
|
85
|
+
{ name: 'to', type: 'address' },
|
|
86
|
+
{ name: 'deadline', type: 'uint256' },
|
|
87
|
+
],
|
|
88
|
+
outputs: [{ name: 'amounts', type: 'uint256[]' }],
|
|
89
|
+
stateMutability: 'nonpayable',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
type: 'function',
|
|
93
|
+
name: 'addLiquidity',
|
|
94
|
+
inputs: [
|
|
95
|
+
{ name: 'tokenA', type: 'address' },
|
|
96
|
+
{ name: 'tokenB', type: 'address' },
|
|
97
|
+
{ name: 'amountADesired', type: 'uint256' },
|
|
98
|
+
{ name: 'amountBDesired', type: 'uint256' },
|
|
99
|
+
{ name: 'amountAMin', type: 'uint256' },
|
|
100
|
+
{ name: 'amountBMin', type: 'uint256' },
|
|
101
|
+
{ name: 'to', type: 'address' },
|
|
102
|
+
{ name: 'deadline', type: 'uint256' },
|
|
103
|
+
],
|
|
104
|
+
outputs: [
|
|
105
|
+
{ name: 'amountA', type: 'uint256' },
|
|
106
|
+
{ name: 'amountB', type: 'uint256' },
|
|
107
|
+
{ name: 'liquidity', type: 'uint256' },
|
|
108
|
+
],
|
|
109
|
+
stateMutability: 'nonpayable',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: 'function',
|
|
113
|
+
name: 'addLiquidityETH',
|
|
114
|
+
inputs: [
|
|
115
|
+
{ name: 'token', type: 'address' },
|
|
116
|
+
{ name: 'amountTokenDesired', type: 'uint256' },
|
|
117
|
+
{ name: 'amountTokenMin', type: 'uint256' },
|
|
118
|
+
{ name: 'amountETHMin', type: 'uint256' },
|
|
119
|
+
{ name: 'to', type: 'address' },
|
|
120
|
+
{ name: 'deadline', type: 'uint256' },
|
|
121
|
+
],
|
|
122
|
+
outputs: [
|
|
123
|
+
{ name: 'amountToken', type: 'uint256' },
|
|
124
|
+
{ name: 'amountETH', type: 'uint256' },
|
|
125
|
+
{ name: 'liquidity', type: 'uint256' },
|
|
126
|
+
],
|
|
127
|
+
stateMutability: 'payable',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
type: 'function',
|
|
131
|
+
name: 'removeLiquidity',
|
|
132
|
+
inputs: [
|
|
133
|
+
{ name: 'tokenA', type: 'address' },
|
|
134
|
+
{ name: 'tokenB', type: 'address' },
|
|
135
|
+
{ name: 'liquidity', type: 'uint256' },
|
|
136
|
+
{ name: 'amountAMin', type: 'uint256' },
|
|
137
|
+
{ name: 'amountBMin', type: 'uint256' },
|
|
138
|
+
{ name: 'to', type: 'address' },
|
|
139
|
+
{ name: 'deadline', type: 'uint256' },
|
|
140
|
+
],
|
|
141
|
+
outputs: [
|
|
142
|
+
{ name: 'amountA', type: 'uint256' },
|
|
143
|
+
{ name: 'amountB', type: 'uint256' },
|
|
144
|
+
],
|
|
145
|
+
stateMutability: 'nonpayable',
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
/** @deprecated Use LUX_AMM_V2_ROUTER_ABI instead */
|
|
149
|
+
export const UNISWAP_V2_ROUTER_ABI = LUX_AMM_V2_ROUTER_ABI;
|