@dhedge/v2-sdk 1.5.2 → 1.5.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhedge/v2-sdk",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "license": "MIT",
5
5
  "description": "🛠 An SDK for building applications on top of dHEDGE V2",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,438 @@
1
+ {
2
+ "abi": [
3
+ {
4
+ "inputs": [
5
+ { "internalType": "address", "name": "_factory", "type": "address" },
6
+ { "internalType": "address", "name": "_weth", "type": "address" }
7
+ ],
8
+ "stateMutability": "nonpayable",
9
+ "type": "constructor"
10
+ },
11
+ {
12
+ "inputs": [
13
+ { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" },
14
+ {
15
+ "components": [
16
+ { "internalType": "address", "name": "from", "type": "address" },
17
+ { "internalType": "address", "name": "to", "type": "address" },
18
+ { "internalType": "bool", "name": "stable", "type": "bool" }
19
+ ],
20
+ "internalType": "struct Router.route[]",
21
+ "name": "routes",
22
+ "type": "tuple[]"
23
+ },
24
+ { "internalType": "address", "name": "to", "type": "address" },
25
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" }
26
+ ],
27
+ "name": "UNSAFE_swapExactTokensForTokens",
28
+ "outputs": [
29
+ { "internalType": "uint256[]", "name": "", "type": "uint256[]" }
30
+ ],
31
+ "stateMutability": "nonpayable",
32
+ "type": "function"
33
+ },
34
+ {
35
+ "inputs": [
36
+ { "internalType": "address", "name": "tokenA", "type": "address" },
37
+ { "internalType": "address", "name": "tokenB", "type": "address" },
38
+ { "internalType": "bool", "name": "stable", "type": "bool" },
39
+ {
40
+ "internalType": "uint256",
41
+ "name": "amountADesired",
42
+ "type": "uint256"
43
+ },
44
+ {
45
+ "internalType": "uint256",
46
+ "name": "amountBDesired",
47
+ "type": "uint256"
48
+ },
49
+ { "internalType": "uint256", "name": "amountAMin", "type": "uint256" },
50
+ { "internalType": "uint256", "name": "amountBMin", "type": "uint256" },
51
+ { "internalType": "address", "name": "to", "type": "address" },
52
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" }
53
+ ],
54
+ "name": "addLiquidity",
55
+ "outputs": [
56
+ { "internalType": "uint256", "name": "amountA", "type": "uint256" },
57
+ { "internalType": "uint256", "name": "amountB", "type": "uint256" },
58
+ { "internalType": "uint256", "name": "liquidity", "type": "uint256" }
59
+ ],
60
+ "stateMutability": "nonpayable",
61
+ "type": "function"
62
+ },
63
+ {
64
+ "inputs": [
65
+ { "internalType": "address", "name": "token", "type": "address" },
66
+ { "internalType": "bool", "name": "stable", "type": "bool" },
67
+ {
68
+ "internalType": "uint256",
69
+ "name": "amountTokenDesired",
70
+ "type": "uint256"
71
+ },
72
+ {
73
+ "internalType": "uint256",
74
+ "name": "amountTokenMin",
75
+ "type": "uint256"
76
+ },
77
+ {
78
+ "internalType": "uint256",
79
+ "name": "amountETHMin",
80
+ "type": "uint256"
81
+ },
82
+ { "internalType": "address", "name": "to", "type": "address" },
83
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" }
84
+ ],
85
+ "name": "addLiquidityETH",
86
+ "outputs": [
87
+ { "internalType": "uint256", "name": "amountToken", "type": "uint256" },
88
+ { "internalType": "uint256", "name": "amountETH", "type": "uint256" },
89
+ { "internalType": "uint256", "name": "liquidity", "type": "uint256" }
90
+ ],
91
+ "stateMutability": "payable",
92
+ "type": "function"
93
+ },
94
+ {
95
+ "inputs": [],
96
+ "name": "factory",
97
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
98
+ "stateMutability": "view",
99
+ "type": "function"
100
+ },
101
+ {
102
+ "inputs": [
103
+ { "internalType": "uint256", "name": "amountIn", "type": "uint256" },
104
+ { "internalType": "address", "name": "tokenIn", "type": "address" },
105
+ { "internalType": "address", "name": "tokenOut", "type": "address" }
106
+ ],
107
+ "name": "getAmountOut",
108
+ "outputs": [
109
+ { "internalType": "uint256", "name": "amount", "type": "uint256" },
110
+ { "internalType": "bool", "name": "stable", "type": "bool" }
111
+ ],
112
+ "stateMutability": "view",
113
+ "type": "function"
114
+ },
115
+ {
116
+ "inputs": [
117
+ { "internalType": "uint256", "name": "amountIn", "type": "uint256" },
118
+ {
119
+ "components": [
120
+ { "internalType": "address", "name": "from", "type": "address" },
121
+ { "internalType": "address", "name": "to", "type": "address" },
122
+ { "internalType": "bool", "name": "stable", "type": "bool" }
123
+ ],
124
+ "internalType": "struct Router.route[]",
125
+ "name": "routes",
126
+ "type": "tuple[]"
127
+ }
128
+ ],
129
+ "name": "getAmountsOut",
130
+ "outputs": [
131
+ { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
132
+ ],
133
+ "stateMutability": "view",
134
+ "type": "function"
135
+ },
136
+ {
137
+ "inputs": [
138
+ { "internalType": "address", "name": "tokenA", "type": "address" },
139
+ { "internalType": "address", "name": "tokenB", "type": "address" },
140
+ { "internalType": "bool", "name": "stable", "type": "bool" }
141
+ ],
142
+ "name": "getReserves",
143
+ "outputs": [
144
+ { "internalType": "uint256", "name": "reserveA", "type": "uint256" },
145
+ { "internalType": "uint256", "name": "reserveB", "type": "uint256" }
146
+ ],
147
+ "stateMutability": "view",
148
+ "type": "function"
149
+ },
150
+ {
151
+ "inputs": [
152
+ { "internalType": "address", "name": "pair", "type": "address" }
153
+ ],
154
+ "name": "isPair",
155
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
156
+ "stateMutability": "view",
157
+ "type": "function"
158
+ },
159
+ {
160
+ "inputs": [
161
+ { "internalType": "address", "name": "tokenA", "type": "address" },
162
+ { "internalType": "address", "name": "tokenB", "type": "address" },
163
+ { "internalType": "bool", "name": "stable", "type": "bool" }
164
+ ],
165
+ "name": "pairFor",
166
+ "outputs": [
167
+ { "internalType": "address", "name": "pair", "type": "address" }
168
+ ],
169
+ "stateMutability": "view",
170
+ "type": "function"
171
+ },
172
+ {
173
+ "inputs": [
174
+ { "internalType": "address", "name": "tokenA", "type": "address" },
175
+ { "internalType": "address", "name": "tokenB", "type": "address" },
176
+ { "internalType": "bool", "name": "stable", "type": "bool" },
177
+ {
178
+ "internalType": "uint256",
179
+ "name": "amountADesired",
180
+ "type": "uint256"
181
+ },
182
+ {
183
+ "internalType": "uint256",
184
+ "name": "amountBDesired",
185
+ "type": "uint256"
186
+ }
187
+ ],
188
+ "name": "quoteAddLiquidity",
189
+ "outputs": [
190
+ { "internalType": "uint256", "name": "amountA", "type": "uint256" },
191
+ { "internalType": "uint256", "name": "amountB", "type": "uint256" },
192
+ { "internalType": "uint256", "name": "liquidity", "type": "uint256" }
193
+ ],
194
+ "stateMutability": "view",
195
+ "type": "function"
196
+ },
197
+ {
198
+ "inputs": [
199
+ { "internalType": "address", "name": "tokenA", "type": "address" },
200
+ { "internalType": "address", "name": "tokenB", "type": "address" },
201
+ { "internalType": "bool", "name": "stable", "type": "bool" },
202
+ { "internalType": "uint256", "name": "liquidity", "type": "uint256" }
203
+ ],
204
+ "name": "quoteRemoveLiquidity",
205
+ "outputs": [
206
+ { "internalType": "uint256", "name": "amountA", "type": "uint256" },
207
+ { "internalType": "uint256", "name": "amountB", "type": "uint256" }
208
+ ],
209
+ "stateMutability": "view",
210
+ "type": "function"
211
+ },
212
+ {
213
+ "inputs": [
214
+ { "internalType": "address", "name": "tokenA", "type": "address" },
215
+ { "internalType": "address", "name": "tokenB", "type": "address" },
216
+ { "internalType": "bool", "name": "stable", "type": "bool" },
217
+ { "internalType": "uint256", "name": "liquidity", "type": "uint256" },
218
+ { "internalType": "uint256", "name": "amountAMin", "type": "uint256" },
219
+ { "internalType": "uint256", "name": "amountBMin", "type": "uint256" },
220
+ { "internalType": "address", "name": "to", "type": "address" },
221
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" }
222
+ ],
223
+ "name": "removeLiquidity",
224
+ "outputs": [
225
+ { "internalType": "uint256", "name": "amountA", "type": "uint256" },
226
+ { "internalType": "uint256", "name": "amountB", "type": "uint256" }
227
+ ],
228
+ "stateMutability": "nonpayable",
229
+ "type": "function"
230
+ },
231
+ {
232
+ "inputs": [
233
+ { "internalType": "address", "name": "token", "type": "address" },
234
+ { "internalType": "bool", "name": "stable", "type": "bool" },
235
+ { "internalType": "uint256", "name": "liquidity", "type": "uint256" },
236
+ {
237
+ "internalType": "uint256",
238
+ "name": "amountTokenMin",
239
+ "type": "uint256"
240
+ },
241
+ {
242
+ "internalType": "uint256",
243
+ "name": "amountETHMin",
244
+ "type": "uint256"
245
+ },
246
+ { "internalType": "address", "name": "to", "type": "address" },
247
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" }
248
+ ],
249
+ "name": "removeLiquidityETH",
250
+ "outputs": [
251
+ { "internalType": "uint256", "name": "amountToken", "type": "uint256" },
252
+ { "internalType": "uint256", "name": "amountETH", "type": "uint256" }
253
+ ],
254
+ "stateMutability": "nonpayable",
255
+ "type": "function"
256
+ },
257
+ {
258
+ "inputs": [
259
+ { "internalType": "address", "name": "token", "type": "address" },
260
+ { "internalType": "bool", "name": "stable", "type": "bool" },
261
+ { "internalType": "uint256", "name": "liquidity", "type": "uint256" },
262
+ {
263
+ "internalType": "uint256",
264
+ "name": "amountTokenMin",
265
+ "type": "uint256"
266
+ },
267
+ {
268
+ "internalType": "uint256",
269
+ "name": "amountETHMin",
270
+ "type": "uint256"
271
+ },
272
+ { "internalType": "address", "name": "to", "type": "address" },
273
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" },
274
+ { "internalType": "bool", "name": "approveMax", "type": "bool" },
275
+ { "internalType": "uint8", "name": "v", "type": "uint8" },
276
+ { "internalType": "bytes32", "name": "r", "type": "bytes32" },
277
+ { "internalType": "bytes32", "name": "s", "type": "bytes32" }
278
+ ],
279
+ "name": "removeLiquidityETHWithPermit",
280
+ "outputs": [
281
+ { "internalType": "uint256", "name": "amountToken", "type": "uint256" },
282
+ { "internalType": "uint256", "name": "amountETH", "type": "uint256" }
283
+ ],
284
+ "stateMutability": "nonpayable",
285
+ "type": "function"
286
+ },
287
+ {
288
+ "inputs": [
289
+ { "internalType": "address", "name": "tokenA", "type": "address" },
290
+ { "internalType": "address", "name": "tokenB", "type": "address" },
291
+ { "internalType": "bool", "name": "stable", "type": "bool" },
292
+ { "internalType": "uint256", "name": "liquidity", "type": "uint256" },
293
+ { "internalType": "uint256", "name": "amountAMin", "type": "uint256" },
294
+ { "internalType": "uint256", "name": "amountBMin", "type": "uint256" },
295
+ { "internalType": "address", "name": "to", "type": "address" },
296
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" },
297
+ { "internalType": "bool", "name": "approveMax", "type": "bool" },
298
+ { "internalType": "uint8", "name": "v", "type": "uint8" },
299
+ { "internalType": "bytes32", "name": "r", "type": "bytes32" },
300
+ { "internalType": "bytes32", "name": "s", "type": "bytes32" }
301
+ ],
302
+ "name": "removeLiquidityWithPermit",
303
+ "outputs": [
304
+ { "internalType": "uint256", "name": "amountA", "type": "uint256" },
305
+ { "internalType": "uint256", "name": "amountB", "type": "uint256" }
306
+ ],
307
+ "stateMutability": "nonpayable",
308
+ "type": "function"
309
+ },
310
+ {
311
+ "inputs": [
312
+ { "internalType": "address", "name": "tokenA", "type": "address" },
313
+ { "internalType": "address", "name": "tokenB", "type": "address" }
314
+ ],
315
+ "name": "sortTokens",
316
+ "outputs": [
317
+ { "internalType": "address", "name": "token0", "type": "address" },
318
+ { "internalType": "address", "name": "token1", "type": "address" }
319
+ ],
320
+ "stateMutability": "pure",
321
+ "type": "function"
322
+ },
323
+ {
324
+ "inputs": [
325
+ {
326
+ "internalType": "uint256",
327
+ "name": "amountOutMin",
328
+ "type": "uint256"
329
+ },
330
+ {
331
+ "components": [
332
+ { "internalType": "address", "name": "from", "type": "address" },
333
+ { "internalType": "address", "name": "to", "type": "address" },
334
+ { "internalType": "bool", "name": "stable", "type": "bool" }
335
+ ],
336
+ "internalType": "struct Router.route[]",
337
+ "name": "routes",
338
+ "type": "tuple[]"
339
+ },
340
+ { "internalType": "address", "name": "to", "type": "address" },
341
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" }
342
+ ],
343
+ "name": "swapExactETHForTokens",
344
+ "outputs": [
345
+ { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
346
+ ],
347
+ "stateMutability": "payable",
348
+ "type": "function"
349
+ },
350
+ {
351
+ "inputs": [
352
+ { "internalType": "uint256", "name": "amountIn", "type": "uint256" },
353
+ {
354
+ "internalType": "uint256",
355
+ "name": "amountOutMin",
356
+ "type": "uint256"
357
+ },
358
+ {
359
+ "components": [
360
+ { "internalType": "address", "name": "from", "type": "address" },
361
+ { "internalType": "address", "name": "to", "type": "address" },
362
+ { "internalType": "bool", "name": "stable", "type": "bool" }
363
+ ],
364
+ "internalType": "struct Router.route[]",
365
+ "name": "routes",
366
+ "type": "tuple[]"
367
+ },
368
+ { "internalType": "address", "name": "to", "type": "address" },
369
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" }
370
+ ],
371
+ "name": "swapExactTokensForETH",
372
+ "outputs": [
373
+ { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
374
+ ],
375
+ "stateMutability": "nonpayable",
376
+ "type": "function"
377
+ },
378
+ {
379
+ "inputs": [
380
+ { "internalType": "uint256", "name": "amountIn", "type": "uint256" },
381
+ {
382
+ "internalType": "uint256",
383
+ "name": "amountOutMin",
384
+ "type": "uint256"
385
+ },
386
+ {
387
+ "components": [
388
+ { "internalType": "address", "name": "from", "type": "address" },
389
+ { "internalType": "address", "name": "to", "type": "address" },
390
+ { "internalType": "bool", "name": "stable", "type": "bool" }
391
+ ],
392
+ "internalType": "struct Router.route[]",
393
+ "name": "routes",
394
+ "type": "tuple[]"
395
+ },
396
+ { "internalType": "address", "name": "to", "type": "address" },
397
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" }
398
+ ],
399
+ "name": "swapExactTokensForTokens",
400
+ "outputs": [
401
+ { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
402
+ ],
403
+ "stateMutability": "nonpayable",
404
+ "type": "function"
405
+ },
406
+ {
407
+ "inputs": [
408
+ { "internalType": "uint256", "name": "amountIn", "type": "uint256" },
409
+ {
410
+ "internalType": "uint256",
411
+ "name": "amountOutMin",
412
+ "type": "uint256"
413
+ },
414
+ { "internalType": "address", "name": "tokenFrom", "type": "address" },
415
+ { "internalType": "address", "name": "tokenTo", "type": "address" },
416
+ { "internalType": "bool", "name": "stable", "type": "bool" },
417
+ { "internalType": "address", "name": "to", "type": "address" },
418
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" }
419
+ ],
420
+ "name": "swapExactTokensForTokensSimple",
421
+ "outputs": [
422
+ { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
423
+ ],
424
+ "stateMutability": "nonpayable",
425
+ "type": "function"
426
+ },
427
+ {
428
+ "inputs": [],
429
+ "name": "weth",
430
+ "outputs": [
431
+ { "internalType": "contract IWETH", "name": "", "type": "address" }
432
+ ],
433
+ "stateMutability": "view",
434
+ "type": "function"
435
+ },
436
+ { "stateMutability": "payable", "type": "receive" }
437
+ ]
438
+ }