@gearbox-protocol/sdk 1.3.3 → 1.5.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.
Files changed (153) hide show
  1. package/lib/apy/index.d.ts +1 -0
  2. package/lib/core/adapter.d.ts +34 -0
  3. package/lib/core/adapter.js +76 -0
  4. package/lib/core/assets.d.ts +34 -0
  5. package/lib/core/assets.js +98 -0
  6. package/lib/core/constants.d.ts +1 -0
  7. package/lib/core/constants.js +3 -1
  8. package/lib/core/creditAccount.d.ts +14 -5
  9. package/lib/core/creditAccount.js +35 -3
  10. package/lib/core/creditManager.d.ts +12 -3
  11. package/lib/core/creditManager.js +34 -36
  12. package/lib/core/strategy.d.ts +15 -5
  13. package/lib/core/strategy.js +42 -7
  14. package/lib/core/trade.d.ts +49 -0
  15. package/lib/core/trade.js +70 -0
  16. package/lib/core/wcOperation.d.ts +54 -0
  17. package/lib/core/wcOperation.js +76 -0
  18. package/lib/index.d.ts +6 -0
  19. package/lib/index.js +6 -0
  20. package/lib/parsers/abstractParser.d.ts +18 -0
  21. package/lib/parsers/abstractParser.js +32 -0
  22. package/lib/parsers/convexBaseRewardPoolAdapterParser.d.ts +9 -0
  23. package/lib/parsers/convexBaseRewardPoolAdapterParser.js +60 -0
  24. package/lib/parsers/convexBaseRewardPoolAdapterParser.spec.d.ts +1 -0
  25. package/lib/parsers/convexBaseRewardPoolAdapterParser.spec.js +24 -0
  26. package/lib/parsers/convexBoosterAdapterParser.d.ts +10 -0
  27. package/lib/parsers/convexBoosterAdapterParser.js +62 -0
  28. package/lib/parsers/convexBoosterAdapterParser.spec.d.ts +1 -0
  29. package/lib/parsers/convexBoosterAdapterParser.spec.js +20 -0
  30. package/lib/parsers/creditFacadeParser.d.ts +9 -0
  31. package/lib/parsers/creditFacadeParser.js +66 -0
  32. package/lib/parsers/creditFacadeParser.spec.d.ts +1 -0
  33. package/lib/parsers/creditFacadeParser.spec.js +27 -0
  34. package/lib/parsers/curveAdapterParser.d.ts +12 -0
  35. package/lib/parsers/curveAdapterParser.js +106 -0
  36. package/lib/parsers/curveAdapterParser.spec.d.ts +1 -0
  37. package/lib/parsers/curveAdapterParser.spec.js +49 -0
  38. package/lib/parsers/iParser.d.ts +3 -0
  39. package/lib/{types/contracts/test/suites/mainnet/IPriceFeedsRegistry.js → parsers/iParser.js} +0 -0
  40. package/lib/parsers/lidoAdapterParser.d.ts +7 -0
  41. package/lib/parsers/lidoAdapterParser.js +46 -0
  42. package/lib/parsers/lidoAdapterParser.spec.d.ts +1 -0
  43. package/lib/parsers/lidoAdapterParser.spec.js +17 -0
  44. package/lib/parsers/txParser.d.ts +18 -0
  45. package/lib/parsers/txParser.js +122 -0
  46. package/lib/parsers/uniV2AdapterParser.d.ts +8 -0
  47. package/lib/parsers/uniV2AdapterParser.js +73 -0
  48. package/lib/parsers/uniV2AdapterParser.spec.d.ts +1 -0
  49. package/lib/parsers/uniV2AdapterParser.spec.js +48 -0
  50. package/lib/parsers/uniV3AdapterParser.d.ts +9 -0
  51. package/lib/parsers/uniV3AdapterParser.js +99 -0
  52. package/lib/parsers/uniV3AdapterParser.spec.d.ts +1 -0
  53. package/lib/parsers/uniV3AdapterParser.spec.js +82 -0
  54. package/lib/parsers/yearnAdapterParser.spec.d.ts +1 -0
  55. package/lib/parsers/yearnAdapterParser.spec.js +36 -0
  56. package/lib/parsers/yearnV2AdapterParser.d.ts +7 -0
  57. package/lib/parsers/yearnV2AdapterParser.js +54 -0
  58. package/lib/tokens/convex.d.ts +4 -2
  59. package/lib/tokens/convex.js +10 -1
  60. package/lib/tokens/decimals.d.ts +2 -0
  61. package/lib/tokens/decimals.js +62 -0
  62. package/lib/tokens/tokenType.d.ts +10 -9
  63. package/lib/tokens/tokenType.js +10 -9
  64. package/lib/types/contracts/interfaces/ICreditFacade.sol/ICreditFacadeExtended.d.ts +66 -2
  65. package/lib/types/contracts/interfaces/adapters/curve/ICurveV1_2AssetsAdapter.d.ts +620 -0
  66. package/lib/types/contracts/interfaces/adapters/curve/ICurveV1_2AssetsAdapter.js +2 -0
  67. package/lib/types/contracts/interfaces/adapters/curve/ICurveV1_3AssetsAdapter.d.ts +622 -0
  68. package/lib/types/contracts/interfaces/adapters/curve/ICurveV1_3AssetsAdapter.js +2 -0
  69. package/lib/types/contracts/interfaces/adapters/curve/ICurveV1_4AssetsAdapter.d.ts +648 -0
  70. package/lib/types/contracts/interfaces/adapters/curve/ICurveV1_4AssetsAdapter.js +2 -0
  71. package/lib/types/contracts/interfaces/adapters/curve/index.d.ts +3 -0
  72. package/lib/types/contracts/interfaces/adapters/index.d.ts +2 -0
  73. package/lib/types/contracts/interfaces/adapters/yearn/IYearnV2Adapter.d.ts +330 -0
  74. package/lib/types/contracts/interfaces/adapters/yearn/IYearnV2Adapter.js +2 -0
  75. package/lib/types/contracts/interfaces/adapters/yearn/index.d.ts +1 -0
  76. package/lib/types/contracts/interfaces/adapters/yearn/index.js +2 -0
  77. package/lib/types/contracts/pathfinder/interfaces/IClosePathResolver.d.ts +28 -7
  78. package/lib/types/contracts/pathfinder/interfaces/IDepositor.sol/IDepositor.d.ts +30 -9
  79. package/lib/types/contracts/pathfinder/interfaces/IDepositor.sol/IDepositorOptions.d.ts +31 -10
  80. package/lib/types/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorker.d.ts +28 -7
  81. package/lib/types/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorkerOptions.d.ts +28 -7
  82. package/lib/types/contracts/pathfinder/interfaces/IPathFinder.d.ts +24 -0
  83. package/lib/types/contracts/pathfinder/interfaces/IPathFinderComponent.d.ts +50 -0
  84. package/lib/types/contracts/pathfinder/interfaces/IPathFinderComponent.js +2 -0
  85. package/lib/types/contracts/pathfinder/interfaces/IPathResolver.d.ts +29 -8
  86. package/lib/types/contracts/pathfinder/interfaces/ISwapAggregator.d.ts +99 -15
  87. package/lib/types/contracts/pathfinder/interfaces/ISwapper.d.ts +17 -1
  88. package/lib/types/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawer.d.ts +53 -9
  89. package/lib/types/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawerOptions.d.ts +53 -9
  90. package/lib/types/contracts/pathfinder/interfaces/index.d.ts +1 -0
  91. package/lib/types/contracts/test/suites/mainnet/ITokenTestSuite.d.ts +110 -18
  92. package/lib/types/contracts/test/suites/mainnet/SupportedContracts.sol/ISupportedContracts.d.ts +50 -0
  93. package/lib/types/contracts/test/suites/mainnet/SupportedContracts.sol/ISupportedContracts.js +2 -0
  94. package/lib/types/contracts/test/suites/mainnet/SupportedContracts.sol/index.d.ts +1 -0
  95. package/lib/types/contracts/test/suites/mainnet/SupportedContracts.sol/index.js +2 -0
  96. package/lib/types/contracts/test/suites/mainnet/Tokens.sol/IToken.d.ts +60 -0
  97. package/lib/types/contracts/test/suites/mainnet/Tokens.sol/IToken.js +2 -0
  98. package/lib/types/contracts/test/suites/mainnet/Tokens.sol/index.d.ts +1 -0
  99. package/lib/types/contracts/test/suites/mainnet/Tokens.sol/index.js +2 -0
  100. package/lib/types/contracts/test/suites/mainnet/index.d.ts +4 -1
  101. package/lib/types/factories/contracts/interfaces/ICreditFacade.sol/ICreditFacadeExtended__factory.js +62 -0
  102. package/lib/types/factories/contracts/{test/suites/mainnet/IPriceFeedsRegistry__factory.d.ts → interfaces/adapters/curve/ICurveV1_2AssetsAdapter__factory.d.ts} +4 -4
  103. package/lib/types/factories/contracts/interfaces/adapters/curve/ICurveV1_2AssetsAdapter__factory.js +1066 -0
  104. package/lib/types/factories/contracts/interfaces/adapters/curve/ICurveV1_3AssetsAdapter__factory.d.ts +32 -0
  105. package/lib/types/factories/contracts/interfaces/adapters/curve/ICurveV1_3AssetsAdapter__factory.js +1066 -0
  106. package/lib/types/factories/contracts/interfaces/adapters/curve/ICurveV1_4AssetsAdapter__factory.d.ts +32 -0
  107. package/lib/types/factories/contracts/interfaces/adapters/curve/ICurveV1_4AssetsAdapter__factory.js +1066 -0
  108. package/lib/types/factories/contracts/interfaces/adapters/curve/index.d.ts +3 -0
  109. package/lib/types/factories/contracts/interfaces/adapters/curve/index.js +7 -1
  110. package/lib/types/factories/contracts/interfaces/adapters/index.d.ts +1 -0
  111. package/lib/types/factories/contracts/interfaces/adapters/index.js +2 -1
  112. package/lib/types/factories/contracts/interfaces/adapters/yearn/IYearnV2Adapter__factory.d.ts +46 -0
  113. package/lib/types/factories/contracts/interfaces/adapters/yearn/IYearnV2Adapter__factory.js +487 -0
  114. package/lib/types/factories/contracts/interfaces/adapters/yearn/index.d.ts +1 -0
  115. package/lib/types/factories/contracts/interfaces/adapters/yearn/index.js +8 -0
  116. package/lib/types/factories/contracts/pathfinder/interfaces/IClosePathResolver__factory.d.ts +12 -2
  117. package/lib/types/factories/contracts/pathfinder/interfaces/IClosePathResolver__factory.js +54 -8
  118. package/lib/types/factories/contracts/pathfinder/interfaces/IDepositor.sol/IDepositorOptions__factory.js +138 -32
  119. package/lib/types/factories/contracts/pathfinder/interfaces/IDepositor.sol/IDepositor__factory.js +110 -24
  120. package/lib/types/factories/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorkerOptions__factory.js +54 -8
  121. package/lib/types/factories/contracts/pathfinder/interfaces/ILPWorker.sol/ILPWorker__factory.js +54 -8
  122. package/lib/types/factories/contracts/pathfinder/interfaces/IPathFinderComponent__factory.d.ts +18 -0
  123. package/lib/types/factories/contracts/pathfinder/interfaces/IPathFinderComponent__factory.js +48 -0
  124. package/lib/types/factories/contracts/pathfinder/interfaces/IPathFinder__factory.js +32 -0
  125. package/lib/types/factories/contracts/pathfinder/interfaces/IPathResolver__factory.d.ts +12 -2
  126. package/lib/types/factories/contracts/pathfinder/interfaces/IPathResolver__factory.js +82 -16
  127. package/lib/types/factories/contracts/pathfinder/interfaces/ISwapAggregator__factory.js +877 -56
  128. package/lib/types/factories/contracts/pathfinder/interfaces/ISwapper__factory.d.ts +12 -2
  129. package/lib/types/factories/contracts/pathfinder/interfaces/ISwapper__factory.js +26 -0
  130. package/lib/types/factories/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawerOptions__factory.js +365 -24
  131. package/lib/types/factories/contracts/pathfinder/interfaces/IWithdrawer.sol/IWithdrawer__factory.js +355 -24
  132. package/lib/types/factories/contracts/pathfinder/interfaces/index.d.ts +1 -0
  133. package/lib/types/factories/contracts/pathfinder/interfaces/index.js +3 -1
  134. package/lib/types/factories/contracts/support/MultiCall.sol/Multicall2__factory.d.ts +1 -1
  135. package/lib/types/factories/contracts/support/MultiCall.sol/Multicall2__factory.js +1 -1
  136. package/lib/types/factories/contracts/test/suites/mainnet/ITokenTestSuite__factory.d.ts +2 -12
  137. package/lib/types/factories/contracts/test/suites/mainnet/ITokenTestSuite__factory.js +140 -12
  138. package/lib/types/factories/contracts/test/suites/mainnet/SupportedContracts.sol/ISupportedContracts__factory.d.ts +22 -0
  139. package/lib/types/factories/contracts/test/suites/mainnet/{IPriceFeedsRegistry__factory.js → SupportedContracts.sol/ISupportedContracts__factory.js} +25 -17
  140. package/lib/types/factories/contracts/test/suites/mainnet/SupportedContracts.sol/index.d.ts +1 -0
  141. package/lib/types/factories/contracts/test/suites/mainnet/SupportedContracts.sol/index.js +8 -0
  142. package/lib/types/factories/contracts/test/suites/mainnet/Tokens.sol/IToken__factory.d.ts +22 -0
  143. package/lib/types/factories/contracts/test/suites/mainnet/Tokens.sol/IToken__factory.js +79 -0
  144. package/lib/types/factories/contracts/test/suites/mainnet/Tokens.sol/index.d.ts +1 -0
  145. package/lib/types/factories/contracts/test/suites/mainnet/Tokens.sol/index.js +8 -0
  146. package/lib/types/factories/contracts/test/suites/mainnet/index.d.ts +2 -1
  147. package/lib/types/factories/contracts/test/suites/mainnet/index.js +26 -3
  148. package/lib/types/index.d.ts +14 -2
  149. package/lib/types/index.js +17 -5
  150. package/lib/utils/math.d.ts +1 -0
  151. package/lib/utils/math.js +5 -1
  152. package/package.json +6 -2
  153. package/lib/types/contracts/test/suites/mainnet/IPriceFeedsRegistry.d.ts +0 -42
@@ -108,26 +108,669 @@ var _abi = [
108
108
  },
109
109
  {
110
110
  inputs: [
111
+ {
112
+ internalType: "address",
113
+ name: "tokenIn",
114
+ type: "address",
115
+ },
116
+ {
117
+ internalType: "address",
118
+ name: "tokenOut",
119
+ type: "address",
120
+ },
121
+ {
122
+ components: [
123
+ {
124
+ internalType: "address",
125
+ name: "creditAccount",
126
+ type: "address",
127
+ },
128
+ {
129
+ components: [
130
+ {
131
+ internalType: "address",
132
+ name: "token",
133
+ type: "address",
134
+ },
135
+ {
136
+ internalType: "uint256",
137
+ name: "balance",
138
+ type: "uint256",
139
+ },
140
+ ],
141
+ internalType: "struct Balance[]",
142
+ name: "balances",
143
+ type: "tuple[]",
144
+ },
145
+ {
146
+ internalType: "address",
147
+ name: "target",
148
+ type: "address",
149
+ },
150
+ {
151
+ internalType: "address[]",
152
+ name: "connectors",
153
+ type: "address[]",
154
+ },
155
+ {
156
+ internalType: "address[]",
157
+ name: "adapters",
158
+ type: "address[]",
159
+ },
160
+ {
161
+ internalType: "uint256",
162
+ name: "slippagePerStep",
163
+ type: "uint256",
164
+ },
165
+ {
166
+ internalType: "enum TokenType",
167
+ name: "targetType",
168
+ type: "uint8",
169
+ },
170
+ {
171
+ components: [
172
+ {
173
+ internalType: "address",
174
+ name: "token",
175
+ type: "address",
176
+ },
177
+ {
178
+ internalType: "address",
179
+ name: "depositAdapter",
180
+ type: "address",
181
+ },
182
+ {
183
+ internalType: "address",
184
+ name: "withdrawAdapter",
185
+ type: "address",
186
+ },
187
+ ],
188
+ internalType: "struct TokenAdapters[]",
189
+ name: "foundAdapters",
190
+ type: "tuple[]",
191
+ },
192
+ {
193
+ internalType: "uint256",
194
+ name: "gasPriceTargetRAY",
195
+ type: "uint256",
196
+ },
197
+ {
198
+ internalType: "uint256",
199
+ name: "gasUsage",
200
+ type: "uint256",
201
+ },
202
+ {
203
+ internalType: "uint256",
204
+ name: "slippageMultiplier",
205
+ type: "uint256",
206
+ },
207
+ {
208
+ internalType: "uint256",
209
+ name: "initTargetBalance",
210
+ type: "uint256",
211
+ },
212
+ {
213
+ components: [
214
+ {
215
+ internalType: "address",
216
+ name: "target",
217
+ type: "address",
218
+ },
219
+ {
220
+ internalType: "bytes",
221
+ name: "callData",
222
+ type: "bytes",
223
+ },
224
+ ],
225
+ internalType: "struct MultiCall[]",
226
+ name: "calls",
227
+ type: "tuple[]",
228
+ },
229
+ ],
230
+ internalType: "struct StrategyPathTask",
231
+ name: "task",
232
+ type: "tuple",
233
+ },
234
+ ],
235
+ name: "findBestAllInputSwap",
236
+ outputs: [
237
+ {
238
+ internalType: "uint256",
239
+ name: "amountOut",
240
+ type: "uint256",
241
+ },
242
+ {
243
+ components: [
244
+ {
245
+ internalType: "address",
246
+ name: "creditAccount",
247
+ type: "address",
248
+ },
249
+ {
250
+ components: [
251
+ {
252
+ internalType: "address",
253
+ name: "token",
254
+ type: "address",
255
+ },
256
+ {
257
+ internalType: "uint256",
258
+ name: "balance",
259
+ type: "uint256",
260
+ },
261
+ ],
262
+ internalType: "struct Balance[]",
263
+ name: "balances",
264
+ type: "tuple[]",
265
+ },
266
+ {
267
+ internalType: "address",
268
+ name: "target",
269
+ type: "address",
270
+ },
271
+ {
272
+ internalType: "address[]",
273
+ name: "connectors",
274
+ type: "address[]",
275
+ },
276
+ {
277
+ internalType: "address[]",
278
+ name: "adapters",
279
+ type: "address[]",
280
+ },
281
+ {
282
+ internalType: "uint256",
283
+ name: "slippagePerStep",
284
+ type: "uint256",
285
+ },
286
+ {
287
+ internalType: "enum TokenType",
288
+ name: "targetType",
289
+ type: "uint8",
290
+ },
291
+ {
292
+ components: [
293
+ {
294
+ internalType: "address",
295
+ name: "token",
296
+ type: "address",
297
+ },
298
+ {
299
+ internalType: "address",
300
+ name: "depositAdapter",
301
+ type: "address",
302
+ },
303
+ {
304
+ internalType: "address",
305
+ name: "withdrawAdapter",
306
+ type: "address",
307
+ },
308
+ ],
309
+ internalType: "struct TokenAdapters[]",
310
+ name: "foundAdapters",
311
+ type: "tuple[]",
312
+ },
313
+ {
314
+ internalType: "uint256",
315
+ name: "gasPriceTargetRAY",
316
+ type: "uint256",
317
+ },
318
+ {
319
+ internalType: "uint256",
320
+ name: "gasUsage",
321
+ type: "uint256",
322
+ },
323
+ {
324
+ internalType: "uint256",
325
+ name: "slippageMultiplier",
326
+ type: "uint256",
327
+ },
328
+ {
329
+ internalType: "uint256",
330
+ name: "initTargetBalance",
331
+ type: "uint256",
332
+ },
333
+ {
334
+ components: [
335
+ {
336
+ internalType: "address",
337
+ name: "target",
338
+ type: "address",
339
+ },
340
+ {
341
+ internalType: "bytes",
342
+ name: "callData",
343
+ type: "bytes",
344
+ },
345
+ ],
346
+ internalType: "struct MultiCall[]",
347
+ name: "calls",
348
+ type: "tuple[]",
349
+ },
350
+ ],
351
+ internalType: "struct StrategyPathTask",
352
+ name: "",
353
+ type: "tuple",
354
+ },
355
+ ],
356
+ stateMutability: "nonpayable",
357
+ type: "function",
358
+ },
359
+ {
360
+ inputs: [
361
+ {
362
+ internalType: "address",
363
+ name: "tokenIn",
364
+ type: "address",
365
+ },
366
+ {
367
+ internalType: "address",
368
+ name: "tokenOut",
369
+ type: "address",
370
+ },
371
+ {
372
+ components: [
373
+ {
374
+ internalType: "address",
375
+ name: "creditAccount",
376
+ type: "address",
377
+ },
378
+ {
379
+ components: [
380
+ {
381
+ internalType: "address",
382
+ name: "token",
383
+ type: "address",
384
+ },
385
+ {
386
+ internalType: "uint256",
387
+ name: "balance",
388
+ type: "uint256",
389
+ },
390
+ ],
391
+ internalType: "struct Balance[]",
392
+ name: "balances",
393
+ type: "tuple[]",
394
+ },
395
+ {
396
+ internalType: "address",
397
+ name: "target",
398
+ type: "address",
399
+ },
400
+ {
401
+ internalType: "address[]",
402
+ name: "connectors",
403
+ type: "address[]",
404
+ },
405
+ {
406
+ internalType: "address[]",
407
+ name: "adapters",
408
+ type: "address[]",
409
+ },
410
+ {
411
+ internalType: "uint256",
412
+ name: "slippagePerStep",
413
+ type: "uint256",
414
+ },
415
+ {
416
+ internalType: "enum TokenType",
417
+ name: "targetType",
418
+ type: "uint8",
419
+ },
420
+ {
421
+ components: [
422
+ {
423
+ internalType: "address",
424
+ name: "token",
425
+ type: "address",
426
+ },
427
+ {
428
+ internalType: "address",
429
+ name: "depositAdapter",
430
+ type: "address",
431
+ },
432
+ {
433
+ internalType: "address",
434
+ name: "withdrawAdapter",
435
+ type: "address",
436
+ },
437
+ ],
438
+ internalType: "struct TokenAdapters[]",
439
+ name: "foundAdapters",
440
+ type: "tuple[]",
441
+ },
442
+ {
443
+ internalType: "uint256",
444
+ name: "gasPriceTargetRAY",
445
+ type: "uint256",
446
+ },
447
+ {
448
+ internalType: "uint256",
449
+ name: "gasUsage",
450
+ type: "uint256",
451
+ },
452
+ {
453
+ internalType: "uint256",
454
+ name: "slippageMultiplier",
455
+ type: "uint256",
456
+ },
457
+ {
458
+ internalType: "uint256",
459
+ name: "initTargetBalance",
460
+ type: "uint256",
461
+ },
462
+ {
463
+ components: [
464
+ {
465
+ internalType: "address",
466
+ name: "target",
467
+ type: "address",
468
+ },
469
+ {
470
+ internalType: "bytes",
471
+ name: "callData",
472
+ type: "bytes",
473
+ },
474
+ ],
475
+ internalType: "struct MultiCall[]",
476
+ name: "calls",
477
+ type: "tuple[]",
478
+ },
479
+ ],
480
+ internalType: "struct StrategyPathTask",
481
+ name: "task",
482
+ type: "tuple",
483
+ },
484
+ ],
485
+ name: "findBestAllInputSwapOrRevert",
486
+ outputs: [
487
+ {
488
+ internalType: "uint256",
489
+ name: "amountOut",
490
+ type: "uint256",
491
+ },
111
492
  {
112
493
  components: [
113
494
  {
114
- internalType: "enum SwapOperation",
115
- name: "swapOperation",
495
+ internalType: "address",
496
+ name: "creditAccount",
497
+ type: "address",
498
+ },
499
+ {
500
+ components: [
501
+ {
502
+ internalType: "address",
503
+ name: "token",
504
+ type: "address",
505
+ },
506
+ {
507
+ internalType: "uint256",
508
+ name: "balance",
509
+ type: "uint256",
510
+ },
511
+ ],
512
+ internalType: "struct Balance[]",
513
+ name: "balances",
514
+ type: "tuple[]",
515
+ },
516
+ {
517
+ internalType: "address",
518
+ name: "target",
519
+ type: "address",
520
+ },
521
+ {
522
+ internalType: "address[]",
523
+ name: "connectors",
524
+ type: "address[]",
525
+ },
526
+ {
527
+ internalType: "address[]",
528
+ name: "adapters",
529
+ type: "address[]",
530
+ },
531
+ {
532
+ internalType: "uint256",
533
+ name: "slippagePerStep",
534
+ type: "uint256",
535
+ },
536
+ {
537
+ internalType: "enum TokenType",
538
+ name: "targetType",
116
539
  type: "uint8",
117
540
  },
541
+ {
542
+ components: [
543
+ {
544
+ internalType: "address",
545
+ name: "token",
546
+ type: "address",
547
+ },
548
+ {
549
+ internalType: "address",
550
+ name: "depositAdapter",
551
+ type: "address",
552
+ },
553
+ {
554
+ internalType: "address",
555
+ name: "withdrawAdapter",
556
+ type: "address",
557
+ },
558
+ ],
559
+ internalType: "struct TokenAdapters[]",
560
+ name: "foundAdapters",
561
+ type: "tuple[]",
562
+ },
563
+ {
564
+ internalType: "uint256",
565
+ name: "gasPriceTargetRAY",
566
+ type: "uint256",
567
+ },
568
+ {
569
+ internalType: "uint256",
570
+ name: "gasUsage",
571
+ type: "uint256",
572
+ },
573
+ {
574
+ internalType: "uint256",
575
+ name: "slippageMultiplier",
576
+ type: "uint256",
577
+ },
578
+ {
579
+ internalType: "uint256",
580
+ name: "initTargetBalance",
581
+ type: "uint256",
582
+ },
583
+ {
584
+ components: [
585
+ {
586
+ internalType: "address",
587
+ name: "target",
588
+ type: "address",
589
+ },
590
+ {
591
+ internalType: "bytes",
592
+ name: "callData",
593
+ type: "bytes",
594
+ },
595
+ ],
596
+ internalType: "struct MultiCall[]",
597
+ name: "calls",
598
+ type: "tuple[]",
599
+ },
600
+ ],
601
+ internalType: "struct StrategyPathTask",
602
+ name: "",
603
+ type: "tuple",
604
+ },
605
+ ],
606
+ stateMutability: "nonpayable",
607
+ type: "function",
608
+ },
609
+ {
610
+ inputs: [
611
+ {
612
+ internalType: "address",
613
+ name: "tokenIn",
614
+ type: "address",
615
+ },
616
+ {
617
+ internalType: "uint256",
618
+ name: "amountIn",
619
+ type: "uint256",
620
+ },
621
+ {
622
+ internalType: "address",
623
+ name: "tokenOut",
624
+ type: "address",
625
+ },
626
+ {
627
+ components: [
118
628
  {
119
629
  internalType: "address",
120
630
  name: "creditAccount",
121
631
  type: "address",
122
632
  },
633
+ {
634
+ components: [
635
+ {
636
+ internalType: "address",
637
+ name: "token",
638
+ type: "address",
639
+ },
640
+ {
641
+ internalType: "uint256",
642
+ name: "balance",
643
+ type: "uint256",
644
+ },
645
+ ],
646
+ internalType: "struct Balance[]",
647
+ name: "balances",
648
+ type: "tuple[]",
649
+ },
123
650
  {
124
651
  internalType: "address",
125
- name: "tokenIn",
652
+ name: "target",
653
+ type: "address",
654
+ },
655
+ {
656
+ internalType: "address[]",
657
+ name: "connectors",
658
+ type: "address[]",
659
+ },
660
+ {
661
+ internalType: "address[]",
662
+ name: "adapters",
663
+ type: "address[]",
664
+ },
665
+ {
666
+ internalType: "uint256",
667
+ name: "slippagePerStep",
668
+ type: "uint256",
669
+ },
670
+ {
671
+ internalType: "enum TokenType",
672
+ name: "targetType",
673
+ type: "uint8",
674
+ },
675
+ {
676
+ components: [
677
+ {
678
+ internalType: "address",
679
+ name: "token",
680
+ type: "address",
681
+ },
682
+ {
683
+ internalType: "address",
684
+ name: "depositAdapter",
685
+ type: "address",
686
+ },
687
+ {
688
+ internalType: "address",
689
+ name: "withdrawAdapter",
690
+ type: "address",
691
+ },
692
+ ],
693
+ internalType: "struct TokenAdapters[]",
694
+ name: "foundAdapters",
695
+ type: "tuple[]",
696
+ },
697
+ {
698
+ internalType: "uint256",
699
+ name: "gasPriceTargetRAY",
700
+ type: "uint256",
701
+ },
702
+ {
703
+ internalType: "uint256",
704
+ name: "gasUsage",
705
+ type: "uint256",
706
+ },
707
+ {
708
+ internalType: "uint256",
709
+ name: "slippageMultiplier",
710
+ type: "uint256",
711
+ },
712
+ {
713
+ internalType: "uint256",
714
+ name: "initTargetBalance",
715
+ type: "uint256",
716
+ },
717
+ {
718
+ components: [
719
+ {
720
+ internalType: "address",
721
+ name: "target",
722
+ type: "address",
723
+ },
724
+ {
725
+ internalType: "bytes",
726
+ name: "callData",
727
+ type: "bytes",
728
+ },
729
+ ],
730
+ internalType: "struct MultiCall[]",
731
+ name: "calls",
732
+ type: "tuple[]",
733
+ },
734
+ ],
735
+ internalType: "struct StrategyPathTask",
736
+ name: "task",
737
+ type: "tuple",
738
+ },
739
+ ],
740
+ name: "findBestSwap",
741
+ outputs: [
742
+ {
743
+ internalType: "uint256",
744
+ name: "amountOut",
745
+ type: "uint256",
746
+ },
747
+ {
748
+ components: [
749
+ {
750
+ internalType: "address",
751
+ name: "creditAccount",
126
752
  type: "address",
127
753
  },
754
+ {
755
+ components: [
756
+ {
757
+ internalType: "address",
758
+ name: "token",
759
+ type: "address",
760
+ },
761
+ {
762
+ internalType: "uint256",
763
+ name: "balance",
764
+ type: "uint256",
765
+ },
766
+ ],
767
+ internalType: "struct Balance[]",
768
+ name: "balances",
769
+ type: "tuple[]",
770
+ },
128
771
  {
129
772
  internalType: "address",
130
- name: "tokenOut",
773
+ name: "target",
131
774
  type: "address",
132
775
  },
133
776
  {
@@ -136,70 +779,82 @@ var _abi = [
136
779
  type: "address[]",
137
780
  },
138
781
  {
139
- internalType: "uint256",
140
- name: "amount",
141
- type: "uint256",
782
+ internalType: "address[]",
783
+ name: "adapters",
784
+ type: "address[]",
142
785
  },
143
786
  {
144
787
  internalType: "uint256",
145
- name: "slippage",
788
+ name: "slippagePerStep",
146
789
  type: "uint256",
147
790
  },
148
791
  {
149
- internalType: "bool",
150
- name: "externalSlippage",
151
- type: "bool",
792
+ internalType: "enum TokenType",
793
+ name: "targetType",
794
+ type: "uint8",
152
795
  },
153
- ],
154
- internalType: "struct SwapTask",
155
- name: "swapTask",
156
- type: "tuple",
157
- },
158
- {
159
- internalType: "address[]",
160
- name: "adapters",
161
- type: "address[]",
162
- },
163
- ],
164
- name: "findBestSwap",
165
- outputs: [
166
- {
167
- components: [
168
796
  {
169
797
  components: [
170
798
  {
171
799
  internalType: "address",
172
- name: "target",
800
+ name: "token",
173
801
  type: "address",
174
802
  },
175
803
  {
176
- internalType: "bytes",
177
- name: "callData",
178
- type: "bytes",
804
+ internalType: "address",
805
+ name: "depositAdapter",
806
+ type: "address",
807
+ },
808
+ {
809
+ internalType: "address",
810
+ name: "withdrawAdapter",
811
+ type: "address",
179
812
  },
180
813
  ],
181
- internalType: "struct MultiCall",
182
- name: "multiCall",
183
- type: "tuple",
814
+ internalType: "struct TokenAdapters[]",
815
+ name: "foundAdapters",
816
+ type: "tuple[]",
184
817
  },
185
818
  {
186
819
  internalType: "uint256",
187
- name: "amount",
820
+ name: "gasPriceTargetRAY",
188
821
  type: "uint256",
189
822
  },
190
823
  {
191
- internalType: "bool",
192
- name: "found",
193
- type: "bool",
824
+ internalType: "uint256",
825
+ name: "gasUsage",
826
+ type: "uint256",
194
827
  },
195
828
  {
196
829
  internalType: "uint256",
197
- name: "gasUsage",
830
+ name: "slippageMultiplier",
831
+ type: "uint256",
832
+ },
833
+ {
834
+ internalType: "uint256",
835
+ name: "initTargetBalance",
198
836
  type: "uint256",
199
837
  },
838
+ {
839
+ components: [
840
+ {
841
+ internalType: "address",
842
+ name: "target",
843
+ type: "address",
844
+ },
845
+ {
846
+ internalType: "bytes",
847
+ name: "callData",
848
+ type: "bytes",
849
+ },
850
+ ],
851
+ internalType: "struct MultiCall[]",
852
+ name: "calls",
853
+ type: "tuple[]",
854
+ },
200
855
  ],
201
- internalType: "struct SwapQuote",
202
- name: "bestQuote",
856
+ internalType: "struct StrategyPathTask",
857
+ name: "",
203
858
  type: "tuple",
204
859
  },
205
860
  ],
@@ -264,7 +919,7 @@ var _abi = [
264
919
  },
265
920
  {
266
921
  internalType: "uint256",
267
- name: "slippage",
922
+ name: "slippagePerStep",
268
923
  type: "uint256",
269
924
  },
270
925
  {
@@ -280,9 +935,14 @@ var _abi = [
280
935
  type: "address",
281
936
  },
282
937
  {
283
- internalType: "address[]",
284
- name: "adapters",
285
- type: "address[]",
938
+ internalType: "address",
939
+ name: "depositAdapter",
940
+ type: "address",
941
+ },
942
+ {
943
+ internalType: "address",
944
+ name: "withdrawAdapter",
945
+ type: "address",
286
946
  },
287
947
  ],
288
948
  internalType: "struct TokenAdapters[]",
@@ -299,6 +959,11 @@ var _abi = [
299
959
  name: "gasUsage",
300
960
  type: "uint256",
301
961
  },
962
+ {
963
+ internalType: "uint256",
964
+ name: "slippageMultiplier",
965
+ type: "uint256",
966
+ },
302
967
  {
303
968
  internalType: "uint256",
304
969
  name: "initTargetBalance",
@@ -375,7 +1040,7 @@ var _abi = [
375
1040
  },
376
1041
  {
377
1042
  internalType: "uint256",
378
- name: "slippage",
1043
+ name: "slippagePerStep",
379
1044
  type: "uint256",
380
1045
  },
381
1046
  {
@@ -391,9 +1056,14 @@ var _abi = [
391
1056
  type: "address",
392
1057
  },
393
1058
  {
394
- internalType: "address[]",
395
- name: "adapters",
396
- type: "address[]",
1059
+ internalType: "address",
1060
+ name: "depositAdapter",
1061
+ type: "address",
1062
+ },
1063
+ {
1064
+ internalType: "address",
1065
+ name: "withdrawAdapter",
1066
+ type: "address",
397
1067
  },
398
1068
  ],
399
1069
  internalType: "struct TokenAdapters[]",
@@ -410,6 +1080,11 @@ var _abi = [
410
1080
  name: "gasUsage",
411
1081
  type: "uint256",
412
1082
  },
1083
+ {
1084
+ internalType: "uint256",
1085
+ name: "slippageMultiplier",
1086
+ type: "uint256",
1087
+ },
413
1088
  {
414
1089
  internalType: "uint256",
415
1090
  name: "initTargetBalance",
@@ -441,6 +1116,106 @@ var _abi = [
441
1116
  stateMutability: "nonpayable",
442
1117
  type: "function",
443
1118
  },
1119
+ {
1120
+ inputs: [
1121
+ {
1122
+ components: [
1123
+ {
1124
+ internalType: "enum SwapOperation",
1125
+ name: "swapOperation",
1126
+ type: "uint8",
1127
+ },
1128
+ {
1129
+ internalType: "address",
1130
+ name: "creditAccount",
1131
+ type: "address",
1132
+ },
1133
+ {
1134
+ internalType: "address",
1135
+ name: "tokenIn",
1136
+ type: "address",
1137
+ },
1138
+ {
1139
+ internalType: "address",
1140
+ name: "tokenOut",
1141
+ type: "address",
1142
+ },
1143
+ {
1144
+ internalType: "address[]",
1145
+ name: "connectors",
1146
+ type: "address[]",
1147
+ },
1148
+ {
1149
+ internalType: "uint256",
1150
+ name: "amount",
1151
+ type: "uint256",
1152
+ },
1153
+ {
1154
+ internalType: "uint256",
1155
+ name: "slippage",
1156
+ type: "uint256",
1157
+ },
1158
+ {
1159
+ internalType: "bool",
1160
+ name: "externalSlippage",
1161
+ type: "bool",
1162
+ },
1163
+ ],
1164
+ internalType: "struct SwapTask",
1165
+ name: "swapTask",
1166
+ type: "tuple",
1167
+ },
1168
+ {
1169
+ internalType: "address[]",
1170
+ name: "adapters",
1171
+ type: "address[]",
1172
+ },
1173
+ ],
1174
+ name: "findBestSwapQuote",
1175
+ outputs: [
1176
+ {
1177
+ components: [
1178
+ {
1179
+ components: [
1180
+ {
1181
+ internalType: "address",
1182
+ name: "target",
1183
+ type: "address",
1184
+ },
1185
+ {
1186
+ internalType: "bytes",
1187
+ name: "callData",
1188
+ type: "bytes",
1189
+ },
1190
+ ],
1191
+ internalType: "struct MultiCall",
1192
+ name: "multiCall",
1193
+ type: "tuple",
1194
+ },
1195
+ {
1196
+ internalType: "uint256",
1197
+ name: "amount",
1198
+ type: "uint256",
1199
+ },
1200
+ {
1201
+ internalType: "bool",
1202
+ name: "found",
1203
+ type: "bool",
1204
+ },
1205
+ {
1206
+ internalType: "uint256",
1207
+ name: "gasUsage",
1208
+ type: "uint256",
1209
+ },
1210
+ ],
1211
+ internalType: "struct SwapQuote",
1212
+ name: "bestQuote",
1213
+ type: "tuple",
1214
+ },
1215
+ ],
1216
+ stateMutability: "nonpayable",
1217
+ type: "function",
1218
+ },
444
1219
  {
445
1220
  inputs: [
446
1221
  {
@@ -546,6 +1321,19 @@ var _abi = [
546
1321
  stateMutability: "nonpayable",
547
1322
  type: "function",
548
1323
  },
1324
+ {
1325
+ inputs: [],
1326
+ name: "getComponentId",
1327
+ outputs: [
1328
+ {
1329
+ internalType: "enum PathFinderComponent",
1330
+ name: "",
1331
+ type: "uint8",
1332
+ },
1333
+ ],
1334
+ stateMutability: "view",
1335
+ type: "function",
1336
+ },
549
1337
  {
550
1338
  inputs: [
551
1339
  {
@@ -589,7 +1377,7 @@ var _abi = [
589
1377
  },
590
1378
  {
591
1379
  internalType: "uint256",
592
- name: "slippage",
1380
+ name: "slippagePerStep",
593
1381
  type: "uint256",
594
1382
  },
595
1383
  {
@@ -605,9 +1393,14 @@ var _abi = [
605
1393
  type: "address",
606
1394
  },
607
1395
  {
608
- internalType: "address[]",
609
- name: "adapters",
610
- type: "address[]",
1396
+ internalType: "address",
1397
+ name: "depositAdapter",
1398
+ type: "address",
1399
+ },
1400
+ {
1401
+ internalType: "address",
1402
+ name: "withdrawAdapter",
1403
+ type: "address",
611
1404
  },
612
1405
  ],
613
1406
  internalType: "struct TokenAdapters[]",
@@ -624,6 +1417,11 @@ var _abi = [
624
1417
  name: "gasUsage",
625
1418
  type: "uint256",
626
1419
  },
1420
+ {
1421
+ internalType: "uint256",
1422
+ name: "slippageMultiplier",
1423
+ type: "uint256",
1424
+ },
627
1425
  {
628
1426
  internalType: "uint256",
629
1427
  name: "initTargetBalance",
@@ -700,7 +1498,7 @@ var _abi = [
700
1498
  },
701
1499
  {
702
1500
  internalType: "uint256",
703
- name: "slippage",
1501
+ name: "slippagePerStep",
704
1502
  type: "uint256",
705
1503
  },
706
1504
  {
@@ -716,9 +1514,14 @@ var _abi = [
716
1514
  type: "address",
717
1515
  },
718
1516
  {
719
- internalType: "address[]",
720
- name: "adapters",
721
- type: "address[]",
1517
+ internalType: "address",
1518
+ name: "depositAdapter",
1519
+ type: "address",
1520
+ },
1521
+ {
1522
+ internalType: "address",
1523
+ name: "withdrawAdapter",
1524
+ type: "address",
722
1525
  },
723
1526
  ],
724
1527
  internalType: "struct TokenAdapters[]",
@@ -735,6 +1538,11 @@ var _abi = [
735
1538
  name: "gasUsage",
736
1539
  type: "uint256",
737
1540
  },
1541
+ {
1542
+ internalType: "uint256",
1543
+ name: "slippageMultiplier",
1544
+ type: "uint256",
1545
+ },
738
1546
  {
739
1547
  internalType: "uint256",
740
1548
  name: "initTargetBalance",
@@ -766,6 +1574,19 @@ var _abi = [
766
1574
  stateMutability: "nonpayable",
767
1575
  type: "function",
768
1576
  },
1577
+ {
1578
+ inputs: [],
1579
+ name: "version",
1580
+ outputs: [
1581
+ {
1582
+ internalType: "uint256",
1583
+ name: "",
1584
+ type: "uint256",
1585
+ },
1586
+ ],
1587
+ stateMutability: "view",
1588
+ type: "function",
1589
+ },
769
1590
  ];
770
1591
  var ISwapAggregator__factory = /** @class */ (function () {
771
1592
  function ISwapAggregator__factory() {