@ripe-finance/sdk 1.13.2 → 1.14.2

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.
Files changed (173) hide show
  1. package/dist/contracts/AuctionHouse.d.ts +126 -60
  2. package/dist/contracts/AuctionHouse.d.ts.map +1 -1
  3. package/dist/contracts/AuctionHouse.js +145 -75
  4. package/dist/contracts/CreditEngine.d.ts +679 -242
  5. package/dist/contracts/CreditEngine.d.ts.map +1 -1
  6. package/dist/contracts/CreditEngine.js +790 -276
  7. package/dist/contracts/CreditRedeem.d.ts +475 -0
  8. package/dist/contracts/CreditRedeem.d.ts.map +1 -0
  9. package/dist/contracts/CreditRedeem.js +551 -0
  10. package/dist/contracts/Deleverage.d.ts +929 -0
  11. package/dist/contracts/Deleverage.d.ts.map +1 -0
  12. package/dist/contracts/Deleverage.js +1095 -0
  13. package/dist/contracts/RedStone.d.ts +1581 -0
  14. package/dist/contracts/RedStone.d.ts.map +1 -0
  15. package/dist/contracts/{AgentFactory_v2.js → RedStone.js} +1077 -682
  16. package/dist/contracts/RipePoolAero.d.ts +5 -5
  17. package/dist/contracts/RipePoolAero.d.ts.map +1 -1
  18. package/dist/contracts/SwitchboardAlpha.d.ts +56 -0
  19. package/dist/contracts/SwitchboardAlpha.d.ts.map +1 -1
  20. package/dist/contracts/SwitchboardAlpha.js +73 -1
  21. package/dist/contracts/SwitchboardDelta.d.ts +115 -0
  22. package/dist/contracts/SwitchboardDelta.d.ts.map +1 -1
  23. package/dist/contracts/SwitchboardDelta.js +144 -1
  24. package/dist/contracts/Teller.d.ts +419 -0
  25. package/dist/contracts/Teller.d.ts.map +1 -1
  26. package/dist/contracts/Teller.js +531 -1
  27. package/dist/contracts/TellerUtils.d.ts +819 -0
  28. package/dist/contracts/TellerUtils.d.ts.map +1 -0
  29. package/dist/contracts/TellerUtils.js +994 -0
  30. package/dist/contracts/UnderscoreVault.d.ts +1028 -0
  31. package/dist/contracts/UnderscoreVault.d.ts.map +1 -0
  32. package/dist/contracts/UnderscoreVault.js +1243 -0
  33. package/dist/contracts/UndyVaultPrices.d.ts +1781 -0
  34. package/dist/contracts/UndyVaultPrices.d.ts.map +1 -0
  35. package/dist/contracts/{AgentFactory.js → UndyVaultPrices.js} +1185 -1024
  36. package/dist/contracts/index.d.ts +7 -0
  37. package/dist/contracts/index.d.ts.map +1 -1
  38. package/dist/contracts/index.js +7 -0
  39. package/dist/contracts/sdk.d.ts +14 -0
  40. package/dist/contracts/sdk.d.ts.map +1 -1
  41. package/dist/contracts/sdk.js +14 -0
  42. package/dist/contracts/{LegoMorpho.d.ts → wsuperOETHbPrices.d.ts} +610 -573
  43. package/dist/contracts/wsuperOETHbPrices.d.ts.map +1 -0
  44. package/dist/contracts/{LegoMorpho.js → wsuperOETHbPrices.js} +654 -632
  45. package/dist/index.d.ts +327 -31
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +21 -0
  48. package/package.json +2 -2
  49. package/dist/contracts/AddyRegistry.d.ts +0 -1109
  50. package/dist/contracts/AddyRegistry.d.ts.map +0 -1
  51. package/dist/contracts/AddyRegistry.js +0 -1392
  52. package/dist/contracts/AddyRegistry_v1.d.ts +0 -473
  53. package/dist/contracts/AddyRegistry_v1.d.ts.map +0 -1
  54. package/dist/contracts/AddyRegistry_v1.js +0 -594
  55. package/dist/contracts/AddyRegistry_v2.d.ts +0 -1050
  56. package/dist/contracts/AddyRegistry_v2.d.ts.map +0 -1
  57. package/dist/contracts/AddyRegistry_v2.js +0 -1313
  58. package/dist/contracts/Agent.d.ts +0 -2709
  59. package/dist/contracts/Agent.d.ts.map +0 -1
  60. package/dist/contracts/Agent.js +0 -3458
  61. package/dist/contracts/AgentFactory.d.ts +0 -1665
  62. package/dist/contracts/AgentFactory.d.ts.map +0 -1
  63. package/dist/contracts/AgentFactory_v1.d.ts +0 -1054
  64. package/dist/contracts/AgentFactory_v1.d.ts.map +0 -1
  65. package/dist/contracts/AgentFactory_v1.js +0 -1336
  66. package/dist/contracts/AgentFactory_v2.d.ts +0 -1275
  67. package/dist/contracts/AgentFactory_v2.d.ts.map +0 -1
  68. package/dist/contracts/AgentTemplate.d.ts +0 -2629
  69. package/dist/contracts/AgentTemplate.d.ts.map +0 -1
  70. package/dist/contracts/AgentTemplate.js +0 -3370
  71. package/dist/contracts/Agent_v1.d.ts +0 -2631
  72. package/dist/contracts/Agent_v1.d.ts.map +0 -1
  73. package/dist/contracts/Agent_v1.js +0 -3372
  74. package/dist/contracts/Agent_v2.d.ts +0 -2709
  75. package/dist/contracts/Agent_v2.d.ts.map +0 -1
  76. package/dist/contracts/Agent_v2.js +0 -3458
  77. package/dist/contracts/ChainlinkFeeds.d.ts +0 -706
  78. package/dist/contracts/ChainlinkFeeds.d.ts.map +0 -1
  79. package/dist/contracts/ChainlinkFeeds.js +0 -900
  80. package/dist/contracts/LegoAaveV3.d.ts +0 -1033
  81. package/dist/contracts/LegoAaveV3.d.ts.map +0 -1
  82. package/dist/contracts/LegoAaveV3.js +0 -1330
  83. package/dist/contracts/LegoAeroClassic.d.ts +0 -1204
  84. package/dist/contracts/LegoAeroClassic.d.ts.map +0 -1
  85. package/dist/contracts/LegoAeroClassic.js +0 -1546
  86. package/dist/contracts/LegoAeroSlipstream.d.ts +0 -1300
  87. package/dist/contracts/LegoAeroSlipstream.d.ts.map +0 -1
  88. package/dist/contracts/LegoAeroSlipstream.js +0 -1671
  89. package/dist/contracts/LegoCommon.d.ts +0 -164
  90. package/dist/contracts/LegoCommon.d.ts.map +0 -1
  91. package/dist/contracts/LegoCommon.js +0 -202
  92. package/dist/contracts/LegoCompoundV3.d.ts +0 -1060
  93. package/dist/contracts/LegoCompoundV3.d.ts.map +0 -1
  94. package/dist/contracts/LegoCompoundV3.js +0 -1365
  95. package/dist/contracts/LegoCredit.d.ts +0 -140
  96. package/dist/contracts/LegoCredit.d.ts.map +0 -1
  97. package/dist/contracts/LegoCredit.js +0 -179
  98. package/dist/contracts/LegoCurve.d.ts +0 -1189
  99. package/dist/contracts/LegoCurve.d.ts.map +0 -1
  100. package/dist/contracts/LegoCurve.js +0 -1519
  101. package/dist/contracts/LegoDex.d.ts +0 -587
  102. package/dist/contracts/LegoDex.d.ts.map +0 -1
  103. package/dist/contracts/LegoDex.js +0 -774
  104. package/dist/contracts/LegoEuler.d.ts +0 -1074
  105. package/dist/contracts/LegoEuler.d.ts.map +0 -1
  106. package/dist/contracts/LegoEuler.js +0 -1383
  107. package/dist/contracts/LegoFluid.d.ts +0 -1025
  108. package/dist/contracts/LegoFluid.d.ts.map +0 -1
  109. package/dist/contracts/LegoFluid.js +0 -1320
  110. package/dist/contracts/LegoHelper.d.ts +0 -1563
  111. package/dist/contracts/LegoHelper.d.ts.map +0 -1
  112. package/dist/contracts/LegoHelper.js +0 -1947
  113. package/dist/contracts/LegoMoonwell.d.ts +0 -1042
  114. package/dist/contracts/LegoMoonwell.d.ts.map +0 -1
  115. package/dist/contracts/LegoMoonwell.js +0 -1342
  116. package/dist/contracts/LegoMorpho.d.ts.map +0 -1
  117. package/dist/contracts/LegoRegistry.d.ts +0 -1079
  118. package/dist/contracts/LegoRegistry.d.ts.map +0 -1
  119. package/dist/contracts/LegoRegistry.js +0 -1368
  120. package/dist/contracts/LegoSky.d.ts +0 -923
  121. package/dist/contracts/LegoSky.d.ts.map +0 -1
  122. package/dist/contracts/LegoSky.js +0 -1180
  123. package/dist/contracts/LegoUniswapV2.d.ts +0 -1204
  124. package/dist/contracts/LegoUniswapV2.d.ts.map +0 -1
  125. package/dist/contracts/LegoUniswapV2.js +0 -1546
  126. package/dist/contracts/LegoUniswapV3.d.ts +0 -1338
  127. package/dist/contracts/LegoUniswapV3.d.ts.map +0 -1
  128. package/dist/contracts/LegoUniswapV3.js +0 -1718
  129. package/dist/contracts/LegoYield.d.ts +0 -390
  130. package/dist/contracts/LegoYield.d.ts.map +0 -1
  131. package/dist/contracts/LegoYield.js +0 -511
  132. package/dist/contracts/OracleParser.d.ts +0 -207
  133. package/dist/contracts/OracleParser.d.ts.map +0 -1
  134. package/dist/contracts/OracleParser.js +0 -264
  135. package/dist/contracts/OracleRegistry.d.ts +0 -1221
  136. package/dist/contracts/OracleRegistry.d.ts.map +0 -1
  137. package/dist/contracts/OracleRegistry.js +0 -1562
  138. package/dist/contracts/PriceSheets.d.ts +0 -1127
  139. package/dist/contracts/PriceSheets.d.ts.map +0 -1
  140. package/dist/contracts/PriceSheets.js +0 -1383
  141. package/dist/contracts/PythFeeds.d.ts +0 -640
  142. package/dist/contracts/PythFeeds.d.ts.map +0 -1
  143. package/dist/contracts/PythFeeds.js +0 -813
  144. package/dist/contracts/RipePool.d.ts +0 -1264
  145. package/dist/contracts/RipePool.d.ts.map +0 -1
  146. package/dist/contracts/RipePool.js +0 -1627
  147. package/dist/contracts/StorkFeeds.d.ts +0 -640
  148. package/dist/contracts/StorkFeeds.d.ts.map +0 -1
  149. package/dist/contracts/StorkFeeds.js +0 -813
  150. package/dist/contracts/UserWallet.d.ts +0 -1975
  151. package/dist/contracts/UserWallet.d.ts.map +0 -1
  152. package/dist/contracts/UserWallet.js +0 -2577
  153. package/dist/contracts/UserWalletConfig.d.ts +0 -1852
  154. package/dist/contracts/UserWalletConfig.d.ts.map +0 -1
  155. package/dist/contracts/UserWalletConfig.js +0 -2263
  156. package/dist/contracts/UserWalletConfig_v1.d.ts +0 -1400
  157. package/dist/contracts/UserWalletConfig_v1.d.ts.map +0 -1
  158. package/dist/contracts/UserWalletConfig_v1.js +0 -1676
  159. package/dist/contracts/UserWalletConfig_v2.d.ts +0 -1468
  160. package/dist/contracts/UserWalletConfig_v2.d.ts.map +0 -1
  161. package/dist/contracts/UserWalletConfig_v2.js +0 -1764
  162. package/dist/contracts/UserWallet_v1.d.ts +0 -1980
  163. package/dist/contracts/UserWallet_v1.d.ts.map +0 -1
  164. package/dist/contracts/UserWallet_v1.js +0 -2581
  165. package/dist/contracts/UserWallet_v2.d.ts +0 -1958
  166. package/dist/contracts/UserWallet_v2.d.ts.map +0 -1
  167. package/dist/contracts/UserWallet_v2.js +0 -2553
  168. package/dist/contracts/WalletConfig.d.ts +0 -1398
  169. package/dist/contracts/WalletConfig.d.ts.map +0 -1
  170. package/dist/contracts/WalletConfig.js +0 -1674
  171. package/dist/contracts/WalletFunds.d.ts +0 -1978
  172. package/dist/contracts/WalletFunds.d.ts.map +0 -1
  173. package/dist/contracts/WalletFunds.js +0 -2579
@@ -1,774 +0,0 @@
1
- /* Autogenerated file. Do not edit manually. */
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /* @ts-nocheck */
5
- import { singleQuery, mutate } from '@dappql/async';
6
- export const abi = [
7
- {
8
- stateMutability: 'nonpayable',
9
- type: 'function',
10
- name: 'swapTokens',
11
- inputs: [
12
- {
13
- name: '_amountIn',
14
- type: 'uint256',
15
- },
16
- {
17
- name: '_minAmountOut',
18
- type: 'uint256',
19
- },
20
- {
21
- name: '_tokenPath',
22
- type: 'address[]',
23
- },
24
- {
25
- name: '_poolPath',
26
- type: 'address[]',
27
- },
28
- {
29
- name: '_recipient',
30
- type: 'address',
31
- },
32
- ],
33
- outputs: [
34
- {
35
- name: '',
36
- type: 'uint256',
37
- },
38
- {
39
- name: '',
40
- type: 'uint256',
41
- },
42
- {
43
- name: '',
44
- type: 'uint256',
45
- },
46
- {
47
- name: '',
48
- type: 'uint256',
49
- },
50
- ],
51
- },
52
- {
53
- stateMutability: 'nonpayable',
54
- type: 'function',
55
- name: 'swapTokens',
56
- inputs: [
57
- {
58
- name: '_amountIn',
59
- type: 'uint256',
60
- },
61
- {
62
- name: '_minAmountOut',
63
- type: 'uint256',
64
- },
65
- {
66
- name: '_tokenPath',
67
- type: 'address[]',
68
- },
69
- {
70
- name: '_poolPath',
71
- type: 'address[]',
72
- },
73
- {
74
- name: '_recipient',
75
- type: 'address',
76
- },
77
- {
78
- name: '_oracleRegistry',
79
- type: 'address',
80
- },
81
- ],
82
- outputs: [
83
- {
84
- name: '',
85
- type: 'uint256',
86
- },
87
- {
88
- name: '',
89
- type: 'uint256',
90
- },
91
- {
92
- name: '',
93
- type: 'uint256',
94
- },
95
- {
96
- name: '',
97
- type: 'uint256',
98
- },
99
- ],
100
- },
101
- {
102
- stateMutability: 'nonpayable',
103
- type: 'function',
104
- name: 'addLiquidity',
105
- inputs: [
106
- {
107
- name: '_nftTokenId',
108
- type: 'uint256',
109
- },
110
- {
111
- name: '_pool',
112
- type: 'address',
113
- },
114
- {
115
- name: '_tokenA',
116
- type: 'address',
117
- },
118
- {
119
- name: '_tokenB',
120
- type: 'address',
121
- },
122
- {
123
- name: '_tickLower',
124
- type: 'int24',
125
- },
126
- {
127
- name: '_tickUpper',
128
- type: 'int24',
129
- },
130
- {
131
- name: '_amountA',
132
- type: 'uint256',
133
- },
134
- {
135
- name: '_amountB',
136
- type: 'uint256',
137
- },
138
- {
139
- name: '_minAmountA',
140
- type: 'uint256',
141
- },
142
- {
143
- name: '_minAmountB',
144
- type: 'uint256',
145
- },
146
- {
147
- name: '_minLpAmount',
148
- type: 'uint256',
149
- },
150
- {
151
- name: '_recipient',
152
- type: 'address',
153
- },
154
- ],
155
- outputs: [
156
- {
157
- name: '',
158
- type: 'uint256',
159
- },
160
- {
161
- name: '',
162
- type: 'uint256',
163
- },
164
- {
165
- name: '',
166
- type: 'uint256',
167
- },
168
- {
169
- name: '',
170
- type: 'uint256',
171
- },
172
- {
173
- name: '',
174
- type: 'uint256',
175
- },
176
- {
177
- name: '',
178
- type: 'uint256',
179
- },
180
- {
181
- name: '',
182
- type: 'uint256',
183
- },
184
- ],
185
- },
186
- {
187
- stateMutability: 'nonpayable',
188
- type: 'function',
189
- name: 'addLiquidity',
190
- inputs: [
191
- {
192
- name: '_nftTokenId',
193
- type: 'uint256',
194
- },
195
- {
196
- name: '_pool',
197
- type: 'address',
198
- },
199
- {
200
- name: '_tokenA',
201
- type: 'address',
202
- },
203
- {
204
- name: '_tokenB',
205
- type: 'address',
206
- },
207
- {
208
- name: '_tickLower',
209
- type: 'int24',
210
- },
211
- {
212
- name: '_tickUpper',
213
- type: 'int24',
214
- },
215
- {
216
- name: '_amountA',
217
- type: 'uint256',
218
- },
219
- {
220
- name: '_amountB',
221
- type: 'uint256',
222
- },
223
- {
224
- name: '_minAmountA',
225
- type: 'uint256',
226
- },
227
- {
228
- name: '_minAmountB',
229
- type: 'uint256',
230
- },
231
- {
232
- name: '_minLpAmount',
233
- type: 'uint256',
234
- },
235
- {
236
- name: '_recipient',
237
- type: 'address',
238
- },
239
- {
240
- name: '_oracleRegistry',
241
- type: 'address',
242
- },
243
- ],
244
- outputs: [
245
- {
246
- name: '',
247
- type: 'uint256',
248
- },
249
- {
250
- name: '',
251
- type: 'uint256',
252
- },
253
- {
254
- name: '',
255
- type: 'uint256',
256
- },
257
- {
258
- name: '',
259
- type: 'uint256',
260
- },
261
- {
262
- name: '',
263
- type: 'uint256',
264
- },
265
- {
266
- name: '',
267
- type: 'uint256',
268
- },
269
- {
270
- name: '',
271
- type: 'uint256',
272
- },
273
- ],
274
- },
275
- {
276
- stateMutability: 'nonpayable',
277
- type: 'function',
278
- name: 'removeLiquidity',
279
- inputs: [
280
- {
281
- name: '_nftTokenId',
282
- type: 'uint256',
283
- },
284
- {
285
- name: '_pool',
286
- type: 'address',
287
- },
288
- {
289
- name: '_tokenA',
290
- type: 'address',
291
- },
292
- {
293
- name: '_tokenB',
294
- type: 'address',
295
- },
296
- {
297
- name: '_lpToken',
298
- type: 'address',
299
- },
300
- {
301
- name: '_liqToRemove',
302
- type: 'uint256',
303
- },
304
- {
305
- name: '_minAmountA',
306
- type: 'uint256',
307
- },
308
- {
309
- name: '_minAmountB',
310
- type: 'uint256',
311
- },
312
- {
313
- name: '_recipient',
314
- type: 'address',
315
- },
316
- ],
317
- outputs: [
318
- {
319
- name: '',
320
- type: 'uint256',
321
- },
322
- {
323
- name: '',
324
- type: 'uint256',
325
- },
326
- {
327
- name: '',
328
- type: 'uint256',
329
- },
330
- {
331
- name: '',
332
- type: 'uint256',
333
- },
334
- {
335
- name: '',
336
- type: 'uint256',
337
- },
338
- {
339
- name: '',
340
- type: 'bool',
341
- },
342
- ],
343
- },
344
- {
345
- stateMutability: 'nonpayable',
346
- type: 'function',
347
- name: 'removeLiquidity',
348
- inputs: [
349
- {
350
- name: '_nftTokenId',
351
- type: 'uint256',
352
- },
353
- {
354
- name: '_pool',
355
- type: 'address',
356
- },
357
- {
358
- name: '_tokenA',
359
- type: 'address',
360
- },
361
- {
362
- name: '_tokenB',
363
- type: 'address',
364
- },
365
- {
366
- name: '_lpToken',
367
- type: 'address',
368
- },
369
- {
370
- name: '_liqToRemove',
371
- type: 'uint256',
372
- },
373
- {
374
- name: '_minAmountA',
375
- type: 'uint256',
376
- },
377
- {
378
- name: '_minAmountB',
379
- type: 'uint256',
380
- },
381
- {
382
- name: '_recipient',
383
- type: 'address',
384
- },
385
- {
386
- name: '_oracleRegistry',
387
- type: 'address',
388
- },
389
- ],
390
- outputs: [
391
- {
392
- name: '',
393
- type: 'uint256',
394
- },
395
- {
396
- name: '',
397
- type: 'uint256',
398
- },
399
- {
400
- name: '',
401
- type: 'uint256',
402
- },
403
- {
404
- name: '',
405
- type: 'uint256',
406
- },
407
- {
408
- name: '',
409
- type: 'uint256',
410
- },
411
- {
412
- name: '',
413
- type: 'bool',
414
- },
415
- ],
416
- },
417
- {
418
- stateMutability: 'view',
419
- type: 'function',
420
- name: 'getLpToken',
421
- inputs: [
422
- {
423
- name: '_pool',
424
- type: 'address',
425
- },
426
- ],
427
- outputs: [
428
- {
429
- name: '',
430
- type: 'address',
431
- },
432
- ],
433
- },
434
- {
435
- stateMutability: 'view',
436
- type: 'function',
437
- name: 'getPoolForLpToken',
438
- inputs: [
439
- {
440
- name: '_lpToken',
441
- type: 'address',
442
- },
443
- ],
444
- outputs: [
445
- {
446
- name: '',
447
- type: 'address',
448
- },
449
- ],
450
- },
451
- {
452
- stateMutability: 'view',
453
- type: 'function',
454
- name: 'getSwapAmountOut',
455
- inputs: [
456
- {
457
- name: '_pool',
458
- type: 'address',
459
- },
460
- {
461
- name: '_tokenIn',
462
- type: 'address',
463
- },
464
- {
465
- name: '_tokenOut',
466
- type: 'address',
467
- },
468
- {
469
- name: '_amountIn',
470
- type: 'uint256',
471
- },
472
- ],
473
- outputs: [
474
- {
475
- name: '',
476
- type: 'uint256',
477
- },
478
- ],
479
- },
480
- {
481
- stateMutability: 'view',
482
- type: 'function',
483
- name: 'getSwapAmountIn',
484
- inputs: [
485
- {
486
- name: '_pool',
487
- type: 'address',
488
- },
489
- {
490
- name: '_tokenIn',
491
- type: 'address',
492
- },
493
- {
494
- name: '_tokenOut',
495
- type: 'address',
496
- },
497
- {
498
- name: '_amountOut',
499
- type: 'uint256',
500
- },
501
- ],
502
- outputs: [
503
- {
504
- name: '',
505
- type: 'uint256',
506
- },
507
- ],
508
- },
509
- {
510
- stateMutability: 'view',
511
- type: 'function',
512
- name: 'getAddLiqAmountsIn',
513
- inputs: [
514
- {
515
- name: '_pool',
516
- type: 'address',
517
- },
518
- {
519
- name: '_tokenA',
520
- type: 'address',
521
- },
522
- {
523
- name: '_tokenB',
524
- type: 'address',
525
- },
526
- {
527
- name: '_availAmountA',
528
- type: 'uint256',
529
- },
530
- {
531
- name: '_availAmountB',
532
- type: 'uint256',
533
- },
534
- ],
535
- outputs: [
536
- {
537
- name: '',
538
- type: 'uint256',
539
- },
540
- {
541
- name: '',
542
- type: 'uint256',
543
- },
544
- {
545
- name: '',
546
- type: 'uint256',
547
- },
548
- ],
549
- },
550
- {
551
- stateMutability: 'view',
552
- type: 'function',
553
- name: 'getRemoveLiqAmountsOut',
554
- inputs: [
555
- {
556
- name: '_pool',
557
- type: 'address',
558
- },
559
- {
560
- name: '_tokenA',
561
- type: 'address',
562
- },
563
- {
564
- name: '_tokenB',
565
- type: 'address',
566
- },
567
- {
568
- name: '_lpAmount',
569
- type: 'uint256',
570
- },
571
- ],
572
- outputs: [
573
- {
574
- name: '',
575
- type: 'uint256',
576
- },
577
- {
578
- name: '',
579
- type: 'uint256',
580
- },
581
- ],
582
- },
583
- {
584
- stateMutability: 'view',
585
- type: 'function',
586
- name: 'getPriceUnsafe',
587
- inputs: [
588
- {
589
- name: '_pool',
590
- type: 'address',
591
- },
592
- {
593
- name: '_targetToken',
594
- type: 'address',
595
- },
596
- ],
597
- outputs: [
598
- {
599
- name: '',
600
- type: 'uint256',
601
- },
602
- ],
603
- },
604
- {
605
- stateMutability: 'view',
606
- type: 'function',
607
- name: 'getPriceUnsafe',
608
- inputs: [
609
- {
610
- name: '_pool',
611
- type: 'address',
612
- },
613
- {
614
- name: '_targetToken',
615
- type: 'address',
616
- },
617
- {
618
- name: '_oracleRegistry',
619
- type: 'address',
620
- },
621
- ],
622
- outputs: [
623
- {
624
- name: '',
625
- type: 'uint256',
626
- },
627
- ],
628
- },
629
- {
630
- stateMutability: 'view',
631
- type: 'function',
632
- name: 'getBestSwapAmountOut',
633
- inputs: [
634
- {
635
- name: '_tokenIn',
636
- type: 'address',
637
- },
638
- {
639
- name: '_tokenOut',
640
- type: 'address',
641
- },
642
- {
643
- name: '_amountIn',
644
- type: 'uint256',
645
- },
646
- ],
647
- outputs: [
648
- {
649
- name: '',
650
- type: 'address',
651
- },
652
- {
653
- name: '',
654
- type: 'uint256',
655
- },
656
- ],
657
- },
658
- {
659
- stateMutability: 'view',
660
- type: 'function',
661
- name: 'getBestSwapAmountIn',
662
- inputs: [
663
- {
664
- name: '_tokenIn',
665
- type: 'address',
666
- },
667
- {
668
- name: '_tokenOut',
669
- type: 'address',
670
- },
671
- {
672
- name: '_amountOut',
673
- type: 'uint256',
674
- },
675
- ],
676
- outputs: [
677
- {
678
- name: '',
679
- type: 'address',
680
- },
681
- {
682
- name: '',
683
- type: 'uint256',
684
- },
685
- ],
686
- },
687
- {
688
- stateMutability: 'view',
689
- type: 'function',
690
- name: 'getCoreRouterPool',
691
- inputs: [],
692
- outputs: [
693
- {
694
- name: '',
695
- type: 'address',
696
- },
697
- ],
698
- },
699
- ];
700
- export const deployAddress = undefined;
701
- function getRequest(method, args, contractAddressOrOptions) {
702
- const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
703
- const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
704
- const call = {
705
- contractName: 'LegoDex',
706
- method,
707
- args,
708
- address,
709
- deployAddress,
710
- defaultValue,
711
- getAbi: () => abi,
712
- with: (options) => {
713
- call.address = options.contractAddress;
714
- call.defaultValue = options.defaultValue;
715
- return call;
716
- },
717
- defaultTo: (defaultValue) => {
718
- call.defaultValue = defaultValue;
719
- return call;
720
- },
721
- at: (address) => {
722
- call.address = address;
723
- return call;
724
- },
725
- };
726
- return call;
727
- }
728
- export const call = {
729
- getLpToken: (...args) => getRequest('getLpToken', args),
730
- getPoolForLpToken: (...args) => getRequest('getPoolForLpToken', args),
731
- getSwapAmountOut: (...args) => getRequest('getSwapAmountOut', args),
732
- getSwapAmountIn: (...args) => getRequest('getSwapAmountIn', args),
733
- getAddLiqAmountsIn: (...args) => getRequest('getAddLiqAmountsIn', args),
734
- getRemoveLiqAmountsOut: (...args) => getRequest('getRemoveLiqAmountsOut', args),
735
- getPriceUnsafe: (...args) => getRequest('getPriceUnsafe', args),
736
- getBestSwapAmountOut: (...args) => getRequest('getBestSwapAmountOut', args),
737
- getBestSwapAmountIn: (...args) => getRequest('getBestSwapAmountIn', args),
738
- getCoreRouterPool: (...args) => getRequest('getCoreRouterPool', args),
739
- };
740
- function getMutation(functionName) {
741
- return {
742
- contractName: 'LegoDex',
743
- functionName,
744
- deployAddress,
745
- argsType: undefined,
746
- getAbi: () => abi,
747
- };
748
- }
749
- export const mutation = {
750
- swapTokens: getMutation('swapTokens'),
751
- addLiquidity: getMutation('addLiquidity'),
752
- removeLiquidity: getMutation('removeLiquidity'),
753
- };
754
- export function toSdk(deployAddress, publicClient, walletClient) {
755
- return {
756
- deployAddress,
757
- abi,
758
- // Queries
759
- getLpToken: (...args) => singleQuery(publicClient, call.getLpToken(...args).at(deployAddress)),
760
- getPoolForLpToken: (...args) => singleQuery(publicClient, call.getPoolForLpToken(...args).at(deployAddress)),
761
- getSwapAmountOut: (...args) => singleQuery(publicClient, call.getSwapAmountOut(...args).at(deployAddress)),
762
- getSwapAmountIn: (...args) => singleQuery(publicClient, call.getSwapAmountIn(...args).at(deployAddress)),
763
- getAddLiqAmountsIn: (...args) => singleQuery(publicClient, call.getAddLiqAmountsIn(...args).at(deployAddress)),
764
- getRemoveLiqAmountsOut: (...args) => singleQuery(publicClient, call.getRemoveLiqAmountsOut(...args).at(deployAddress)),
765
- getPriceUnsafe: (...args) => singleQuery(publicClient, call.getPriceUnsafe(...args).at(deployAddress)),
766
- getBestSwapAmountOut: (...args) => singleQuery(publicClient, call.getBestSwapAmountOut(...args).at(deployAddress)),
767
- getBestSwapAmountIn: (...args) => singleQuery(publicClient, call.getBestSwapAmountIn(...args).at(deployAddress)),
768
- getCoreRouterPool: (...args) => singleQuery(publicClient, call.getCoreRouterPool(...args).at(deployAddress)),
769
- // Mutations
770
- swapTokens: (...args) => mutate(walletClient, mutation.swapTokens, { address: deployAddress })(...args),
771
- addLiquidity: (...args) => mutate(walletClient, mutation.addLiquidity, { address: deployAddress })(...args),
772
- removeLiquidity: (...args) => mutate(walletClient, mutation.removeLiquidity, { address: deployAddress })(...args),
773
- };
774
- }