@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
@@ -66,11 +66,13 @@ export declare type BalanceStructOutput = [string, BigNumber] & {
66
66
  };
67
67
  export declare type TokenAdaptersStruct = {
68
68
  token: string;
69
- adapters: string[];
69
+ depositAdapter: string;
70
+ withdrawAdapter: string;
70
71
  };
71
- export declare type TokenAdaptersStructOutput = [string, string[]] & {
72
+ export declare type TokenAdaptersStructOutput = [string, string, string] & {
72
73
  token: string;
73
- adapters: string[];
74
+ depositAdapter: string;
75
+ withdrawAdapter: string;
74
76
  };
75
77
  export declare type StrategyPathTaskStruct = {
76
78
  creditAccount: string;
@@ -78,11 +80,12 @@ export declare type StrategyPathTaskStruct = {
78
80
  target: string;
79
81
  connectors: string[];
80
82
  adapters: string[];
81
- slippage: BigNumberish;
83
+ slippagePerStep: BigNumberish;
82
84
  targetType: BigNumberish;
83
85
  foundAdapters: TokenAdaptersStruct[];
84
86
  gasPriceTargetRAY: BigNumberish;
85
87
  gasUsage: BigNumberish;
88
+ slippageMultiplier: BigNumberish;
86
89
  initTargetBalance: BigNumberish;
87
90
  calls: MultiCallStruct[];
88
91
  };
@@ -98,6 +101,7 @@ export declare type StrategyPathTaskStructOutput = [
98
101
  BigNumber,
99
102
  BigNumber,
100
103
  BigNumber,
104
+ BigNumber,
101
105
  MultiCallStructOutput[]
102
106
  ] & {
103
107
  creditAccount: string;
@@ -105,33 +109,49 @@ export declare type StrategyPathTaskStructOutput = [
105
109
  target: string;
106
110
  connectors: string[];
107
111
  adapters: string[];
108
- slippage: BigNumber;
112
+ slippagePerStep: BigNumber;
109
113
  targetType: number;
110
114
  foundAdapters: TokenAdaptersStructOutput[];
111
115
  gasPriceTargetRAY: BigNumber;
112
116
  gasUsage: BigNumber;
117
+ slippageMultiplier: BigNumber;
113
118
  initTargetBalance: BigNumber;
114
119
  calls: MultiCallStructOutput[];
115
120
  };
116
121
  export interface ISwapAggregatorInterface extends utils.Interface {
117
122
  functions: {
118
123
  "findAllSwaps((uint8,address,address,address,address[],uint256,uint256,bool),address[])": FunctionFragment;
119
- "findBestSwap((uint8,address,address,address,address[],uint256,uint256,bool),address[])": FunctionFragment;
120
- "findBestSwapOrRevert(address,uint256,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
124
+ "findBestAllInputSwap(address,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
125
+ "findBestAllInputSwapOrRevert(address,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
126
+ "findBestSwap(address,uint256,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
127
+ "findBestSwapOrRevert(address,uint256,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
128
+ "findBestSwapQuote((uint8,address,address,address,address[],uint256,uint256,bool),address[])": FunctionFragment;
121
129
  "getBestDirectPairSwap((uint8,address,address,address,address[],uint256,uint256,bool),address[],uint256)": FunctionFragment;
122
- "swapAllNormalTokens((address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]),address)": FunctionFragment;
130
+ "getComponentId()": FunctionFragment;
131
+ "swapAllNormalTokens((address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]),address)": FunctionFragment;
132
+ "version()": FunctionFragment;
123
133
  };
124
- getFunction(nameOrSignatureOrTopic: "findAllSwaps" | "findBestSwap" | "findBestSwapOrRevert" | "getBestDirectPairSwap" | "swapAllNormalTokens"): FunctionFragment;
134
+ getFunction(nameOrSignatureOrTopic: "findAllSwaps" | "findBestAllInputSwap" | "findBestAllInputSwapOrRevert" | "findBestSwap" | "findBestSwapOrRevert" | "findBestSwapQuote" | "getBestDirectPairSwap" | "getComponentId" | "swapAllNormalTokens" | "version"): FunctionFragment;
125
135
  encodeFunctionData(functionFragment: "findAllSwaps", values: [SwapTaskStruct, string[]]): string;
126
- encodeFunctionData(functionFragment: "findBestSwap", values: [SwapTaskStruct, string[]]): string;
136
+ encodeFunctionData(functionFragment: "findBestAllInputSwap", values: [string, string, StrategyPathTaskStruct]): string;
137
+ encodeFunctionData(functionFragment: "findBestAllInputSwapOrRevert", values: [string, string, StrategyPathTaskStruct]): string;
138
+ encodeFunctionData(functionFragment: "findBestSwap", values: [string, BigNumberish, string, StrategyPathTaskStruct]): string;
127
139
  encodeFunctionData(functionFragment: "findBestSwapOrRevert", values: [string, BigNumberish, string, StrategyPathTaskStruct]): string;
140
+ encodeFunctionData(functionFragment: "findBestSwapQuote", values: [SwapTaskStruct, string[]]): string;
128
141
  encodeFunctionData(functionFragment: "getBestDirectPairSwap", values: [SwapTaskStruct, string[], BigNumberish]): string;
142
+ encodeFunctionData(functionFragment: "getComponentId", values?: undefined): string;
129
143
  encodeFunctionData(functionFragment: "swapAllNormalTokens", values: [StrategyPathTaskStruct, string]): string;
144
+ encodeFunctionData(functionFragment: "version", values?: undefined): string;
130
145
  decodeFunctionResult(functionFragment: "findAllSwaps", data: BytesLike): Result;
146
+ decodeFunctionResult(functionFragment: "findBestAllInputSwap", data: BytesLike): Result;
147
+ decodeFunctionResult(functionFragment: "findBestAllInputSwapOrRevert", data: BytesLike): Result;
131
148
  decodeFunctionResult(functionFragment: "findBestSwap", data: BytesLike): Result;
132
149
  decodeFunctionResult(functionFragment: "findBestSwapOrRevert", data: BytesLike): Result;
150
+ decodeFunctionResult(functionFragment: "findBestSwapQuote", data: BytesLike): Result;
133
151
  decodeFunctionResult(functionFragment: "getBestDirectPairSwap", data: BytesLike): Result;
152
+ decodeFunctionResult(functionFragment: "getComponentId", data: BytesLike): Result;
134
153
  decodeFunctionResult(functionFragment: "swapAllNormalTokens", data: BytesLike): Result;
154
+ decodeFunctionResult(functionFragment: "version", data: BytesLike): Result;
135
155
  events: {};
136
156
  }
137
157
  export interface ISwapAggregator extends BaseContract {
@@ -152,79 +172,143 @@ export interface ISwapAggregator extends BaseContract {
152
172
  findAllSwaps(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
153
173
  from?: string | Promise<string>;
154
174
  }): Promise<ContractTransaction>;
155
- findBestSwap(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
175
+ findBestAllInputSwap(tokenIn: string, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
176
+ from?: string | Promise<string>;
177
+ }): Promise<ContractTransaction>;
178
+ findBestAllInputSwapOrRevert(tokenIn: string, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
179
+ from?: string | Promise<string>;
180
+ }): Promise<ContractTransaction>;
181
+ findBestSwap(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
156
182
  from?: string | Promise<string>;
157
183
  }): Promise<ContractTransaction>;
158
184
  findBestSwapOrRevert(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
159
185
  from?: string | Promise<string>;
160
186
  }): Promise<ContractTransaction>;
187
+ findBestSwapQuote(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
188
+ from?: string | Promise<string>;
189
+ }): Promise<ContractTransaction>;
161
190
  getBestDirectPairSwap(swapTask: SwapTaskStruct, adapters: string[], gasPriceInTokenOut: BigNumberish, overrides?: Overrides & {
162
191
  from?: string | Promise<string>;
163
192
  }): Promise<ContractTransaction>;
193
+ getComponentId(overrides?: CallOverrides): Promise<[number]>;
164
194
  swapAllNormalTokens(task: StrategyPathTaskStruct, target: string, overrides?: Overrides & {
165
195
  from?: string | Promise<string>;
166
196
  }): Promise<ContractTransaction>;
197
+ version(overrides?: CallOverrides): Promise<[BigNumber]>;
167
198
  };
168
199
  findAllSwaps(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
169
200
  from?: string | Promise<string>;
170
201
  }): Promise<ContractTransaction>;
171
- findBestSwap(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
202
+ findBestAllInputSwap(tokenIn: string, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
203
+ from?: string | Promise<string>;
204
+ }): Promise<ContractTransaction>;
205
+ findBestAllInputSwapOrRevert(tokenIn: string, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
206
+ from?: string | Promise<string>;
207
+ }): Promise<ContractTransaction>;
208
+ findBestSwap(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
172
209
  from?: string | Promise<string>;
173
210
  }): Promise<ContractTransaction>;
174
211
  findBestSwapOrRevert(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
175
212
  from?: string | Promise<string>;
176
213
  }): Promise<ContractTransaction>;
214
+ findBestSwapQuote(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
215
+ from?: string | Promise<string>;
216
+ }): Promise<ContractTransaction>;
177
217
  getBestDirectPairSwap(swapTask: SwapTaskStruct, adapters: string[], gasPriceInTokenOut: BigNumberish, overrides?: Overrides & {
178
218
  from?: string | Promise<string>;
179
219
  }): Promise<ContractTransaction>;
220
+ getComponentId(overrides?: CallOverrides): Promise<number>;
180
221
  swapAllNormalTokens(task: StrategyPathTaskStruct, target: string, overrides?: Overrides & {
181
222
  from?: string | Promise<string>;
182
223
  }): Promise<ContractTransaction>;
224
+ version(overrides?: CallOverrides): Promise<BigNumber>;
183
225
  callStatic: {
184
226
  findAllSwaps(swapTask: SwapTaskStruct, adapters: string[], overrides?: CallOverrides): Promise<SwapQuoteStructOutput[]>;
185
- findBestSwap(swapTask: SwapTaskStruct, adapters: string[], overrides?: CallOverrides): Promise<SwapQuoteStructOutput>;
227
+ findBestAllInputSwap(tokenIn: string, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
228
+ BigNumber,
229
+ StrategyPathTaskStructOutput
230
+ ] & {
231
+ amountOut: BigNumber;
232
+ }>;
233
+ findBestAllInputSwapOrRevert(tokenIn: string, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
234
+ BigNumber,
235
+ StrategyPathTaskStructOutput
236
+ ] & {
237
+ amountOut: BigNumber;
238
+ }>;
239
+ findBestSwap(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
240
+ BigNumber,
241
+ StrategyPathTaskStructOutput
242
+ ] & {
243
+ amountOut: BigNumber;
244
+ }>;
186
245
  findBestSwapOrRevert(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
187
246
  BigNumber,
188
247
  StrategyPathTaskStructOutput
189
248
  ] & {
190
249
  amountOut: BigNumber;
191
250
  }>;
251
+ findBestSwapQuote(swapTask: SwapTaskStruct, adapters: string[], overrides?: CallOverrides): Promise<SwapQuoteStructOutput>;
192
252
  getBestDirectPairSwap(swapTask: SwapTaskStruct, adapters: string[], gasPriceInTokenOut: BigNumberish, overrides?: CallOverrides): Promise<SwapQuoteStructOutput>;
253
+ getComponentId(overrides?: CallOverrides): Promise<number>;
193
254
  swapAllNormalTokens(task: StrategyPathTaskStruct, target: string, overrides?: CallOverrides): Promise<StrategyPathTaskStructOutput>;
255
+ version(overrides?: CallOverrides): Promise<BigNumber>;
194
256
  };
195
257
  filters: {};
196
258
  estimateGas: {
197
259
  findAllSwaps(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
198
260
  from?: string | Promise<string>;
199
261
  }): Promise<BigNumber>;
200
- findBestSwap(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
262
+ findBestAllInputSwap(tokenIn: string, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
263
+ from?: string | Promise<string>;
264
+ }): Promise<BigNumber>;
265
+ findBestAllInputSwapOrRevert(tokenIn: string, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
266
+ from?: string | Promise<string>;
267
+ }): Promise<BigNumber>;
268
+ findBestSwap(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
201
269
  from?: string | Promise<string>;
202
270
  }): Promise<BigNumber>;
203
271
  findBestSwapOrRevert(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
204
272
  from?: string | Promise<string>;
205
273
  }): Promise<BigNumber>;
274
+ findBestSwapQuote(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
275
+ from?: string | Promise<string>;
276
+ }): Promise<BigNumber>;
206
277
  getBestDirectPairSwap(swapTask: SwapTaskStruct, adapters: string[], gasPriceInTokenOut: BigNumberish, overrides?: Overrides & {
207
278
  from?: string | Promise<string>;
208
279
  }): Promise<BigNumber>;
280
+ getComponentId(overrides?: CallOverrides): Promise<BigNumber>;
209
281
  swapAllNormalTokens(task: StrategyPathTaskStruct, target: string, overrides?: Overrides & {
210
282
  from?: string | Promise<string>;
211
283
  }): Promise<BigNumber>;
284
+ version(overrides?: CallOverrides): Promise<BigNumber>;
212
285
  };
213
286
  populateTransaction: {
214
287
  findAllSwaps(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
215
288
  from?: string | Promise<string>;
216
289
  }): Promise<PopulatedTransaction>;
217
- findBestSwap(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
290
+ findBestAllInputSwap(tokenIn: string, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
291
+ from?: string | Promise<string>;
292
+ }): Promise<PopulatedTransaction>;
293
+ findBestAllInputSwapOrRevert(tokenIn: string, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
294
+ from?: string | Promise<string>;
295
+ }): Promise<PopulatedTransaction>;
296
+ findBestSwap(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
218
297
  from?: string | Promise<string>;
219
298
  }): Promise<PopulatedTransaction>;
220
299
  findBestSwapOrRevert(tokenIn: string, amountIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: Overrides & {
221
300
  from?: string | Promise<string>;
222
301
  }): Promise<PopulatedTransaction>;
302
+ findBestSwapQuote(swapTask: SwapTaskStruct, adapters: string[], overrides?: Overrides & {
303
+ from?: string | Promise<string>;
304
+ }): Promise<PopulatedTransaction>;
223
305
  getBestDirectPairSwap(swapTask: SwapTaskStruct, adapters: string[], gasPriceInTokenOut: BigNumberish, overrides?: Overrides & {
224
306
  from?: string | Promise<string>;
225
307
  }): Promise<PopulatedTransaction>;
308
+ getComponentId(overrides?: CallOverrides): Promise<PopulatedTransaction>;
226
309
  swapAllNormalTokens(task: StrategyPathTaskStruct, target: string, overrides?: Overrides & {
227
310
  from?: string | Promise<string>;
228
311
  }): Promise<PopulatedTransaction>;
312
+ version(overrides?: CallOverrides): Promise<PopulatedTransaction>;
229
313
  };
230
314
  }
@@ -60,12 +60,18 @@ export interface ISwapperInterface extends utils.Interface {
60
60
  functions: {
61
61
  "getBestConnectorSwap((uint8,address,address,address,address[],uint256,uint256,bool),address)": FunctionFragment;
62
62
  "getBestDirectPairSwap((uint8,address,address,address,address[],uint256,uint256,bool),address)": FunctionFragment;
63
+ "getComponentId()": FunctionFragment;
64
+ "version()": FunctionFragment;
63
65
  };
64
- getFunction(nameOrSignatureOrTopic: "getBestConnectorSwap" | "getBestDirectPairSwap"): FunctionFragment;
66
+ getFunction(nameOrSignatureOrTopic: "getBestConnectorSwap" | "getBestDirectPairSwap" | "getComponentId" | "version"): FunctionFragment;
65
67
  encodeFunctionData(functionFragment: "getBestConnectorSwap", values: [SwapTaskStruct, string]): string;
66
68
  encodeFunctionData(functionFragment: "getBestDirectPairSwap", values: [SwapTaskStruct, string]): string;
69
+ encodeFunctionData(functionFragment: "getComponentId", values?: undefined): string;
70
+ encodeFunctionData(functionFragment: "version", values?: undefined): string;
67
71
  decodeFunctionResult(functionFragment: "getBestConnectorSwap", data: BytesLike): Result;
68
72
  decodeFunctionResult(functionFragment: "getBestDirectPairSwap", data: BytesLike): Result;
73
+ decodeFunctionResult(functionFragment: "getComponentId", data: BytesLike): Result;
74
+ decodeFunctionResult(functionFragment: "version", data: BytesLike): Result;
69
75
  events: {};
70
76
  }
71
77
  export interface ISwapper extends BaseContract {
@@ -89,6 +95,8 @@ export interface ISwapper extends BaseContract {
89
95
  getBestDirectPairSwap(swapTask: SwapTaskStruct, adapter: string, overrides?: Overrides & {
90
96
  from?: string | Promise<string>;
91
97
  }): Promise<ContractTransaction>;
98
+ getComponentId(overrides?: CallOverrides): Promise<[number]>;
99
+ version(overrides?: CallOverrides): Promise<[BigNumber]>;
92
100
  };
93
101
  getBestConnectorSwap(swapTask: SwapTaskStruct, adapter: string, overrides?: Overrides & {
94
102
  from?: string | Promise<string>;
@@ -96,9 +104,13 @@ export interface ISwapper extends BaseContract {
96
104
  getBestDirectPairSwap(swapTask: SwapTaskStruct, adapter: string, overrides?: Overrides & {
97
105
  from?: string | Promise<string>;
98
106
  }): Promise<ContractTransaction>;
107
+ getComponentId(overrides?: CallOverrides): Promise<number>;
108
+ version(overrides?: CallOverrides): Promise<BigNumber>;
99
109
  callStatic: {
100
110
  getBestConnectorSwap(swapTask: SwapTaskStruct, adapter: string, overrides?: CallOverrides): Promise<SwapQuoteStructOutput>;
101
111
  getBestDirectPairSwap(swapTask: SwapTaskStruct, adapter: string, overrides?: CallOverrides): Promise<SwapQuoteStructOutput>;
112
+ getComponentId(overrides?: CallOverrides): Promise<number>;
113
+ version(overrides?: CallOverrides): Promise<BigNumber>;
102
114
  };
103
115
  filters: {};
104
116
  estimateGas: {
@@ -108,6 +120,8 @@ export interface ISwapper extends BaseContract {
108
120
  getBestDirectPairSwap(swapTask: SwapTaskStruct, adapter: string, overrides?: Overrides & {
109
121
  from?: string | Promise<string>;
110
122
  }): Promise<BigNumber>;
123
+ getComponentId(overrides?: CallOverrides): Promise<BigNumber>;
124
+ version(overrides?: CallOverrides): Promise<BigNumber>;
111
125
  };
112
126
  populateTransaction: {
113
127
  getBestConnectorSwap(swapTask: SwapTaskStruct, adapter: string, overrides?: Overrides & {
@@ -116,5 +130,7 @@ export interface ISwapper extends BaseContract {
116
130
  getBestDirectPairSwap(swapTask: SwapTaskStruct, adapter: string, overrides?: Overrides & {
117
131
  from?: string | Promise<string>;
118
132
  }): Promise<PopulatedTransaction>;
133
+ getComponentId(overrides?: CallOverrides): Promise<PopulatedTransaction>;
134
+ version(overrides?: CallOverrides): Promise<PopulatedTransaction>;
119
135
  };
120
136
  }
@@ -12,11 +12,13 @@ export declare type BalanceStructOutput = [string, BigNumber] & {
12
12
  };
13
13
  export declare type TokenAdaptersStruct = {
14
14
  token: string;
15
- adapters: string[];
15
+ depositAdapter: string;
16
+ withdrawAdapter: string;
16
17
  };
17
- export declare type TokenAdaptersStructOutput = [string, string[]] & {
18
+ export declare type TokenAdaptersStructOutput = [string, string, string] & {
18
19
  token: string;
19
- adapters: string[];
20
+ depositAdapter: string;
21
+ withdrawAdapter: string;
20
22
  };
21
23
  export declare type MultiCallStruct = {
22
24
  target: string;
@@ -32,11 +34,12 @@ export declare type StrategyPathTaskStruct = {
32
34
  target: string;
33
35
  connectors: string[];
34
36
  adapters: string[];
35
- slippage: BigNumberish;
37
+ slippagePerStep: BigNumberish;
36
38
  targetType: BigNumberish;
37
39
  foundAdapters: TokenAdaptersStruct[];
38
40
  gasPriceTargetRAY: BigNumberish;
39
41
  gasUsage: BigNumberish;
42
+ slippageMultiplier: BigNumberish;
40
43
  initTargetBalance: BigNumberish;
41
44
  calls: MultiCallStruct[];
42
45
  };
@@ -52,6 +55,7 @@ export declare type StrategyPathTaskStructOutput = [
52
55
  BigNumber,
53
56
  BigNumber,
54
57
  BigNumber,
58
+ BigNumber,
55
59
  MultiCallStructOutput[]
56
60
  ] & {
57
61
  creditAccount: string;
@@ -59,26 +63,36 @@ export declare type StrategyPathTaskStructOutput = [
59
63
  target: string;
60
64
  connectors: string[];
61
65
  adapters: string[];
62
- slippage: BigNumber;
66
+ slippagePerStep: BigNumber;
63
67
  targetType: number;
64
68
  foundAdapters: TokenAdaptersStructOutput[];
65
69
  gasPriceTargetRAY: BigNumber;
66
70
  gasUsage: BigNumber;
71
+ slippageMultiplier: BigNumber;
67
72
  initTargetBalance: BigNumber;
68
73
  calls: MultiCallStructOutput[];
69
74
  };
70
75
  export interface IWithdrawerInterface extends utils.Interface {
71
76
  functions: {
72
- "getUnderlying(address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
73
- "withdraw(uint256,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
74
- "withdrawAllTokens((address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
77
+ "getComponentId()": FunctionFragment;
78
+ "getUnderlying(address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
79
+ "version()": FunctionFragment;
80
+ "withdraw(uint256,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
81
+ "withdrawAll(address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
82
+ "withdrawAllTokens((address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
75
83
  };
76
- getFunction(nameOrSignatureOrTopic: "getUnderlying" | "withdraw" | "withdrawAllTokens"): FunctionFragment;
84
+ getFunction(nameOrSignatureOrTopic: "getComponentId" | "getUnderlying" | "version" | "withdraw" | "withdrawAll" | "withdrawAllTokens"): FunctionFragment;
85
+ encodeFunctionData(functionFragment: "getComponentId", values?: undefined): string;
77
86
  encodeFunctionData(functionFragment: "getUnderlying", values: [string, StrategyPathTaskStruct]): string;
87
+ encodeFunctionData(functionFragment: "version", values?: undefined): string;
78
88
  encodeFunctionData(functionFragment: "withdraw", values: [BigNumberish, string, StrategyPathTaskStruct]): string;
89
+ encodeFunctionData(functionFragment: "withdrawAll", values: [string, StrategyPathTaskStruct]): string;
79
90
  encodeFunctionData(functionFragment: "withdrawAllTokens", values: [StrategyPathTaskStruct]): string;
91
+ decodeFunctionResult(functionFragment: "getComponentId", data: BytesLike): Result;
80
92
  decodeFunctionResult(functionFragment: "getUnderlying", data: BytesLike): Result;
93
+ decodeFunctionResult(functionFragment: "version", data: BytesLike): Result;
81
94
  decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
95
+ decodeFunctionResult(functionFragment: "withdrawAll", data: BytesLike): Result;
82
96
  decodeFunctionResult(functionFragment: "withdrawAllTokens", data: BytesLike): Result;
83
97
  events: {};
84
98
  }
@@ -97,48 +111,78 @@ export interface IWithdrawer extends BaseContract {
97
111
  once: OnEvent<this>;
98
112
  removeListener: OnEvent<this>;
99
113
  functions: {
114
+ getComponentId(overrides?: CallOverrides): Promise<[number]>;
100
115
  getUnderlying(tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[string, StrategyPathTaskStructOutput] & {
101
116
  tokenIn: string;
102
117
  }>;
118
+ version(overrides?: CallOverrides): Promise<[BigNumber]>;
103
119
  withdraw(amountIn: BigNumberish, lpToken: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
104
120
  BigNumber,
105
121
  StrategyPathTaskStructOutput
106
122
  ] & {
107
123
  amountOut: BigNumber;
108
124
  }>;
125
+ withdrawAll(lpToken: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
126
+ BigNumber,
127
+ StrategyPathTaskStructOutput
128
+ ] & {
129
+ amountOut: BigNumber;
130
+ }>;
109
131
  withdrawAllTokens(task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[StrategyPathTaskStructOutput]>;
110
132
  };
133
+ getComponentId(overrides?: CallOverrides): Promise<number>;
111
134
  getUnderlying(tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[string, StrategyPathTaskStructOutput] & {
112
135
  tokenIn: string;
113
136
  }>;
137
+ version(overrides?: CallOverrides): Promise<BigNumber>;
114
138
  withdraw(amountIn: BigNumberish, lpToken: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
115
139
  BigNumber,
116
140
  StrategyPathTaskStructOutput
117
141
  ] & {
118
142
  amountOut: BigNumber;
119
143
  }>;
144
+ withdrawAll(lpToken: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
145
+ BigNumber,
146
+ StrategyPathTaskStructOutput
147
+ ] & {
148
+ amountOut: BigNumber;
149
+ }>;
120
150
  withdrawAllTokens(task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<StrategyPathTaskStructOutput>;
121
151
  callStatic: {
152
+ getComponentId(overrides?: CallOverrides): Promise<number>;
122
153
  getUnderlying(tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[string, StrategyPathTaskStructOutput] & {
123
154
  tokenIn: string;
124
155
  }>;
156
+ version(overrides?: CallOverrides): Promise<BigNumber>;
125
157
  withdraw(amountIn: BigNumberish, lpToken: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
126
158
  BigNumber,
127
159
  StrategyPathTaskStructOutput
128
160
  ] & {
129
161
  amountOut: BigNumber;
130
162
  }>;
163
+ withdrawAll(lpToken: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
164
+ BigNumber,
165
+ StrategyPathTaskStructOutput
166
+ ] & {
167
+ amountOut: BigNumber;
168
+ }>;
131
169
  withdrawAllTokens(task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<StrategyPathTaskStructOutput>;
132
170
  };
133
171
  filters: {};
134
172
  estimateGas: {
173
+ getComponentId(overrides?: CallOverrides): Promise<BigNumber>;
135
174
  getUnderlying(tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<BigNumber>;
175
+ version(overrides?: CallOverrides): Promise<BigNumber>;
136
176
  withdraw(amountIn: BigNumberish, lpToken: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<BigNumber>;
177
+ withdrawAll(lpToken: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<BigNumber>;
137
178
  withdrawAllTokens(task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<BigNumber>;
138
179
  };
139
180
  populateTransaction: {
181
+ getComponentId(overrides?: CallOverrides): Promise<PopulatedTransaction>;
140
182
  getUnderlying(tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<PopulatedTransaction>;
183
+ version(overrides?: CallOverrides): Promise<PopulatedTransaction>;
141
184
  withdraw(amountIn: BigNumberish, lpToken: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<PopulatedTransaction>;
185
+ withdrawAll(lpToken: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<PopulatedTransaction>;
142
186
  withdrawAllTokens(task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<PopulatedTransaction>;
143
187
  };
144
188
  }
@@ -12,11 +12,13 @@ export declare type BalanceStructOutput = [string, BigNumber] & {
12
12
  };
13
13
  export declare type TokenAdaptersStruct = {
14
14
  token: string;
15
- adapters: string[];
15
+ depositAdapter: string;
16
+ withdrawAdapter: string;
16
17
  };
17
- export declare type TokenAdaptersStructOutput = [string, string[]] & {
18
+ export declare type TokenAdaptersStructOutput = [string, string, string] & {
18
19
  token: string;
19
- adapters: string[];
20
+ depositAdapter: string;
21
+ withdrawAdapter: string;
20
22
  };
21
23
  export declare type MultiCallStruct = {
22
24
  target: string;
@@ -32,11 +34,12 @@ export declare type StrategyPathTaskStruct = {
32
34
  target: string;
33
35
  connectors: string[];
34
36
  adapters: string[];
35
- slippage: BigNumberish;
37
+ slippagePerStep: BigNumberish;
36
38
  targetType: BigNumberish;
37
39
  foundAdapters: TokenAdaptersStruct[];
38
40
  gasPriceTargetRAY: BigNumberish;
39
41
  gasUsage: BigNumberish;
42
+ slippageMultiplier: BigNumberish;
40
43
  initTargetBalance: BigNumberish;
41
44
  calls: MultiCallStruct[];
42
45
  };
@@ -52,6 +55,7 @@ export declare type StrategyPathTaskStructOutput = [
52
55
  BigNumber,
53
56
  BigNumber,
54
57
  BigNumber,
58
+ BigNumber,
55
59
  MultiCallStructOutput[]
56
60
  ] & {
57
61
  creditAccount: string;
@@ -59,11 +63,12 @@ export declare type StrategyPathTaskStructOutput = [
59
63
  target: string;
60
64
  connectors: string[];
61
65
  adapters: string[];
62
- slippage: BigNumber;
66
+ slippagePerStep: BigNumber;
63
67
  targetType: number;
64
68
  foundAdapters: TokenAdaptersStructOutput[];
65
69
  gasPriceTargetRAY: BigNumber;
66
70
  gasUsage: BigNumber;
71
+ slippageMultiplier: BigNumber;
67
72
  initTargetBalance: BigNumber;
68
73
  calls: MultiCallStructOutput[];
69
74
  };
@@ -79,16 +84,25 @@ export declare type PathOptionStructOutput = [string, number, number] & {
79
84
  };
80
85
  export interface IWithdrawerOptionsInterface extends utils.Interface {
81
86
  functions: {
82
- "getUnderlyings(uint8,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
83
- "withdraw(address,uint256,uint8,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
84
- "withdrawAllTokens((address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address[])[],uint256,uint256,uint256,(address,bytes)[]),(address,uint8,uint8)[])": FunctionFragment;
87
+ "getComponentId()": FunctionFragment;
88
+ "getUnderlyings(uint8,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
89
+ "version()": FunctionFragment;
90
+ "withdraw(address,uint256,uint8,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
91
+ "withdrawAll(address,uint8,address,(address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]))": FunctionFragment;
92
+ "withdrawAllTokens((address,(address,uint256)[],address,address[],address[],uint256,uint8,(address,address,address)[],uint256,uint256,uint256,uint256,(address,bytes)[]),(address,uint8,uint8)[])": FunctionFragment;
85
93
  };
86
- getFunction(nameOrSignatureOrTopic: "getUnderlyings" | "withdraw" | "withdrawAllTokens"): FunctionFragment;
94
+ getFunction(nameOrSignatureOrTopic: "getComponentId" | "getUnderlyings" | "version" | "withdraw" | "withdrawAll" | "withdrawAllTokens"): FunctionFragment;
95
+ encodeFunctionData(functionFragment: "getComponentId", values?: undefined): string;
87
96
  encodeFunctionData(functionFragment: "getUnderlyings", values: [BigNumberish, string, StrategyPathTaskStruct]): string;
97
+ encodeFunctionData(functionFragment: "version", values?: undefined): string;
88
98
  encodeFunctionData(functionFragment: "withdraw", values: [string, BigNumberish, BigNumberish, string, StrategyPathTaskStruct]): string;
99
+ encodeFunctionData(functionFragment: "withdrawAll", values: [string, BigNumberish, string, StrategyPathTaskStruct]): string;
89
100
  encodeFunctionData(functionFragment: "withdrawAllTokens", values: [StrategyPathTaskStruct, PathOptionStruct[]]): string;
101
+ decodeFunctionResult(functionFragment: "getComponentId", data: BytesLike): Result;
90
102
  decodeFunctionResult(functionFragment: "getUnderlyings", data: BytesLike): Result;
103
+ decodeFunctionResult(functionFragment: "version", data: BytesLike): Result;
91
104
  decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
105
+ decodeFunctionResult(functionFragment: "withdrawAll", data: BytesLike): Result;
92
106
  decodeFunctionResult(functionFragment: "withdrawAllTokens", data: BytesLike): Result;
93
107
  events: {};
94
108
  }
@@ -107,54 +121,84 @@ export interface IWithdrawerOptions extends BaseContract {
107
121
  once: OnEvent<this>;
108
122
  removeListener: OnEvent<this>;
109
123
  functions: {
124
+ getComponentId(overrides?: CallOverrides): Promise<[number]>;
110
125
  getUnderlyings(ttIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
111
126
  string[],
112
127
  StrategyPathTaskStructOutput
113
128
  ] & {
114
129
  tokensIn: string[];
115
130
  }>;
131
+ version(overrides?: CallOverrides): Promise<[BigNumber]>;
116
132
  withdraw(tokenIn: string, amount: BigNumberish, ttOut: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
117
133
  BigNumber,
118
134
  StrategyPathTaskStructOutput
119
135
  ] & {
120
136
  amountOut: BigNumber;
121
137
  }>;
138
+ withdrawAll(tokenIn: string, ttOut: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
139
+ BigNumber,
140
+ StrategyPathTaskStructOutput
141
+ ] & {
142
+ amountOut: BigNumber;
143
+ }>;
122
144
  withdrawAllTokens(task: StrategyPathTaskStruct, pathOptions: PathOptionStruct[], overrides?: CallOverrides): Promise<[StrategyPathTaskStructOutput]>;
123
145
  };
146
+ getComponentId(overrides?: CallOverrides): Promise<number>;
124
147
  getUnderlyings(ttIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[string[], StrategyPathTaskStructOutput] & {
125
148
  tokensIn: string[];
126
149
  }>;
150
+ version(overrides?: CallOverrides): Promise<BigNumber>;
127
151
  withdraw(tokenIn: string, amount: BigNumberish, ttOut: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
128
152
  BigNumber,
129
153
  StrategyPathTaskStructOutput
130
154
  ] & {
131
155
  amountOut: BigNumber;
132
156
  }>;
157
+ withdrawAll(tokenIn: string, ttOut: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
158
+ BigNumber,
159
+ StrategyPathTaskStructOutput
160
+ ] & {
161
+ amountOut: BigNumber;
162
+ }>;
133
163
  withdrawAllTokens(task: StrategyPathTaskStruct, pathOptions: PathOptionStruct[], overrides?: CallOverrides): Promise<StrategyPathTaskStructOutput>;
134
164
  callStatic: {
165
+ getComponentId(overrides?: CallOverrides): Promise<number>;
135
166
  getUnderlyings(ttIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
136
167
  string[],
137
168
  StrategyPathTaskStructOutput
138
169
  ] & {
139
170
  tokensIn: string[];
140
171
  }>;
172
+ version(overrides?: CallOverrides): Promise<BigNumber>;
141
173
  withdraw(tokenIn: string, amount: BigNumberish, ttOut: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
142
174
  BigNumber,
143
175
  StrategyPathTaskStructOutput
144
176
  ] & {
145
177
  amountOut: BigNumber;
146
178
  }>;
179
+ withdrawAll(tokenIn: string, ttOut: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<[
180
+ BigNumber,
181
+ StrategyPathTaskStructOutput
182
+ ] & {
183
+ amountOut: BigNumber;
184
+ }>;
147
185
  withdrawAllTokens(task: StrategyPathTaskStruct, pathOptions: PathOptionStruct[], overrides?: CallOverrides): Promise<StrategyPathTaskStructOutput>;
148
186
  };
149
187
  filters: {};
150
188
  estimateGas: {
189
+ getComponentId(overrides?: CallOverrides): Promise<BigNumber>;
151
190
  getUnderlyings(ttIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<BigNumber>;
191
+ version(overrides?: CallOverrides): Promise<BigNumber>;
152
192
  withdraw(tokenIn: string, amount: BigNumberish, ttOut: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<BigNumber>;
193
+ withdrawAll(tokenIn: string, ttOut: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<BigNumber>;
153
194
  withdrawAllTokens(task: StrategyPathTaskStruct, pathOptions: PathOptionStruct[], overrides?: CallOverrides): Promise<BigNumber>;
154
195
  };
155
196
  populateTransaction: {
197
+ getComponentId(overrides?: CallOverrides): Promise<PopulatedTransaction>;
156
198
  getUnderlyings(ttIn: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<PopulatedTransaction>;
199
+ version(overrides?: CallOverrides): Promise<PopulatedTransaction>;
157
200
  withdraw(tokenIn: string, amount: BigNumberish, ttOut: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<PopulatedTransaction>;
201
+ withdrawAll(tokenIn: string, ttOut: BigNumberish, tokenOut: string, task: StrategyPathTaskStruct, overrides?: CallOverrides): Promise<PopulatedTransaction>;
158
202
  withdrawAllTokens(task: StrategyPathTaskStruct, pathOptions: PathOptionStruct[], overrides?: CallOverrides): Promise<PopulatedTransaction>;
159
203
  };
160
204
  }
@@ -7,6 +7,7 @@ export type { iWithdrawerSol };
7
7
  export type { IClosePathResolver } from "./IClosePathResolver";
8
8
  export type { IGasPricer } from "./IGasPricer";
9
9
  export type { IPathFinder } from "./IPathFinder";
10
+ export type { IPathFinderComponent } from "./IPathFinderComponent";
10
11
  export type { IPathResolver } from "./IPathResolver";
11
12
  export type { ISwapAggregator } from "./ISwapAggregator";
12
13
  export type { ISwapper } from "./ISwapper";