@morpho-org/morpho-sdk 2.1.1 → 3.1.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 (206) hide show
  1. package/lib/cjs/abis.d.ts +2816 -0
  2. package/lib/cjs/abis.js +1951 -0
  3. package/lib/cjs/actions/index.d.ts +3 -0
  4. package/lib/cjs/actions/marketV1/borrow.js +7 -10
  5. package/lib/cjs/actions/marketV1/buildReallocationActions.d.ts +2 -3
  6. package/lib/cjs/actions/marketV1/buildReallocationActions.js +1 -2
  7. package/lib/cjs/actions/marketV1/index.d.ts +2 -0
  8. package/lib/cjs/actions/marketV1/index.js +2 -0
  9. package/lib/cjs/actions/marketV1/repay.d.ts +2 -0
  10. package/lib/cjs/actions/marketV1/repay.js +7 -8
  11. package/lib/cjs/actions/marketV1/repayWithdrawCollateral.d.ts +2 -0
  12. package/lib/cjs/actions/marketV1/repayWithdrawCollateral.js +9 -10
  13. package/lib/cjs/actions/marketV1/supply.d.ts +69 -0
  14. package/lib/cjs/actions/marketV1/supply.js +128 -0
  15. package/lib/cjs/actions/marketV1/supplyCollateral.d.ts +3 -1
  16. package/lib/cjs/actions/marketV1/supplyCollateral.js +12 -13
  17. package/lib/cjs/actions/marketV1/supplyCollateralBorrow.d.ts +3 -1
  18. package/lib/cjs/actions/marketV1/supplyCollateralBorrow.js +14 -15
  19. package/lib/cjs/actions/marketV1/withdraw.d.ts +83 -0
  20. package/lib/cjs/actions/marketV1/withdraw.js +110 -0
  21. package/lib/cjs/actions/requirements/encode/encodeErc20Approval.js +2 -2
  22. package/lib/cjs/actions/requirements/getRequirementsAction.d.ts +1 -1
  23. package/lib/cjs/actions/requirements/getRequirementsApproval.js +2 -2
  24. package/lib/cjs/actions/vaultV1/deposit.d.ts +2 -0
  25. package/lib/cjs/actions/vaultV1/deposit.js +13 -14
  26. package/lib/cjs/actions/vaultV1/migrateToV2.d.ts +2 -0
  27. package/lib/cjs/actions/vaultV1/migrateToV2.js +11 -9
  28. package/lib/cjs/actions/vaultV2/deposit.d.ts +2 -0
  29. package/lib/cjs/actions/vaultV2/deposit.js +13 -14
  30. package/lib/cjs/addresses.d.ts +2 -0
  31. package/lib/cjs/addresses.js +18 -0
  32. package/lib/cjs/augment/AccrualPosition.d.ts +9 -0
  33. package/lib/cjs/augment/AccrualPosition.js +8 -0
  34. package/lib/cjs/augment/AccrualVault.d.ts +8 -0
  35. package/lib/cjs/augment/AccrualVault.js +7 -0
  36. package/lib/cjs/augment/Holding.d.ts +8 -0
  37. package/lib/cjs/augment/Holding.js +7 -0
  38. package/lib/cjs/augment/Market.d.ts +8 -0
  39. package/lib/cjs/augment/Market.js +7 -0
  40. package/lib/cjs/augment/MarketParams.d.ts +8 -0
  41. package/lib/cjs/augment/MarketParams.js +7 -0
  42. package/lib/cjs/augment/Position.d.ts +8 -0
  43. package/lib/cjs/augment/Position.js +7 -0
  44. package/lib/cjs/augment/Token.d.ts +8 -0
  45. package/lib/cjs/augment/Token.js +7 -0
  46. package/lib/cjs/augment/User.d.ts +8 -0
  47. package/lib/cjs/augment/User.js +7 -0
  48. package/lib/cjs/augment/Vault.d.ts +8 -0
  49. package/lib/cjs/augment/Vault.js +7 -0
  50. package/lib/cjs/augment/VaultConfig.d.ts +8 -0
  51. package/lib/cjs/augment/VaultConfig.js +7 -0
  52. package/lib/cjs/augment/VaultMarketAllocation.d.ts +8 -0
  53. package/lib/cjs/augment/VaultMarketAllocation.js +7 -0
  54. package/lib/cjs/augment/VaultMarketConfig.d.ts +8 -0
  55. package/lib/cjs/augment/VaultMarketConfig.js +7 -0
  56. package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.d.ts +8 -0
  57. package/lib/cjs/augment/VaultMarketPublicAllocatorConfig.js +8 -0
  58. package/lib/cjs/augment/VaultUser.d.ts +8 -0
  59. package/lib/cjs/augment/VaultUser.js +7 -0
  60. package/lib/cjs/augment.d.ts +14 -0
  61. package/lib/cjs/augment.js +16 -0
  62. package/lib/cjs/bundler/actions.d.ts +637 -0
  63. package/lib/cjs/bundler/actions.js +1088 -0
  64. package/lib/cjs/bundler/index.d.ts +2 -0
  65. package/lib/cjs/bundler/index.js +18 -0
  66. package/lib/cjs/bundler/types.d.ts +200 -0
  67. package/lib/cjs/bundler/types.js +2 -0
  68. package/lib/cjs/constants.d.ts +3 -0
  69. package/lib/cjs/constants.js +32 -0
  70. package/lib/cjs/entities/index.d.ts +6 -3
  71. package/lib/cjs/entities/index.js +41 -17
  72. package/lib/cjs/entities/marketV1/marketV1.d.ts +161 -24
  73. package/lib/cjs/entities/marketV1/marketV1.js +166 -19
  74. package/lib/cjs/entities/reallocationData.d.ts +193 -0
  75. package/lib/cjs/entities/reallocationData.js +406 -0
  76. package/lib/cjs/errors.d.ts +2 -0
  77. package/lib/cjs/errors.js +18 -0
  78. package/lib/cjs/fetch.d.ts +1 -0
  79. package/lib/cjs/fetch.js +30 -0
  80. package/lib/cjs/format.d.ts +2 -0
  81. package/lib/cjs/format.js +22 -0
  82. package/lib/cjs/helpers/computeReallocations.d.ts +63 -12
  83. package/lib/cjs/helpers/computeReallocations.js +160 -41
  84. package/lib/cjs/helpers/constant.d.ts +17 -0
  85. package/lib/cjs/helpers/constant.js +30 -1
  86. package/lib/cjs/helpers/index.d.ts +3 -2
  87. package/lib/cjs/helpers/index.js +14 -2
  88. package/lib/cjs/helpers/slippage.d.ts +57 -0
  89. package/lib/cjs/helpers/slippage.js +82 -0
  90. package/lib/cjs/helpers/validate.d.ts +40 -7
  91. package/lib/cjs/helpers/validate.js +67 -12
  92. package/lib/cjs/index.d.ts +0 -1
  93. package/lib/cjs/index.js +0 -1
  94. package/lib/cjs/types/action.d.ts +27 -6
  95. package/lib/cjs/types/client.d.ts +1 -1
  96. package/lib/cjs/types/error.d.ts +155 -7
  97. package/lib/cjs/types/error.js +202 -11
  98. package/lib/cjs/types/sharedLiquidity.d.ts +43 -3
  99. package/lib/cjs/types.d.ts +3 -0
  100. package/lib/cjs/types.js +17 -0
  101. package/lib/cjs/utils.d.ts +9 -0
  102. package/lib/cjs/utils.js +65 -0
  103. package/lib/esm/abis.d.ts +2816 -0
  104. package/lib/esm/abis.js +1922 -0
  105. package/lib/esm/actions/index.d.ts +3 -0
  106. package/lib/esm/actions/marketV1/borrow.js +2 -5
  107. package/lib/esm/actions/marketV1/buildReallocationActions.d.ts +2 -3
  108. package/lib/esm/actions/marketV1/buildReallocationActions.js +1 -2
  109. package/lib/esm/actions/marketV1/index.d.ts +2 -0
  110. package/lib/esm/actions/marketV1/index.js +2 -0
  111. package/lib/esm/actions/marketV1/repay.d.ts +2 -0
  112. package/lib/esm/actions/marketV1/repay.js +4 -5
  113. package/lib/esm/actions/marketV1/repayWithdrawCollateral.d.ts +2 -0
  114. package/lib/esm/actions/marketV1/repayWithdrawCollateral.js +4 -5
  115. package/lib/esm/actions/marketV1/supply.d.ts +69 -0
  116. package/lib/esm/actions/marketV1/supply.js +124 -0
  117. package/lib/esm/actions/marketV1/supplyCollateral.d.ts +3 -1
  118. package/lib/esm/actions/marketV1/supplyCollateral.js +7 -8
  119. package/lib/esm/actions/marketV1/supplyCollateralBorrow.d.ts +3 -1
  120. package/lib/esm/actions/marketV1/supplyCollateralBorrow.js +7 -8
  121. package/lib/esm/actions/marketV1/withdraw.d.ts +83 -0
  122. package/lib/esm/actions/marketV1/withdraw.js +106 -0
  123. package/lib/esm/actions/requirements/encode/encodeErc20Approval.js +1 -1
  124. package/lib/esm/actions/requirements/getRequirementsAction.d.ts +1 -1
  125. package/lib/esm/actions/requirements/getRequirementsApproval.js +1 -1
  126. package/lib/esm/actions/vaultV1/deposit.d.ts +2 -0
  127. package/lib/esm/actions/vaultV1/deposit.js +3 -4
  128. package/lib/esm/actions/vaultV1/migrateToV2.d.ts +2 -0
  129. package/lib/esm/actions/vaultV1/migrateToV2.js +3 -1
  130. package/lib/esm/actions/vaultV2/deposit.d.ts +2 -0
  131. package/lib/esm/actions/vaultV2/deposit.js +3 -4
  132. package/lib/esm/addresses.d.ts +2 -0
  133. package/lib/esm/addresses.js +1 -0
  134. package/lib/esm/augment/AccrualPosition.d.ts +9 -0
  135. package/lib/esm/augment/AccrualPosition.js +5 -0
  136. package/lib/esm/augment/AccrualVault.d.ts +8 -0
  137. package/lib/esm/augment/AccrualVault.js +4 -0
  138. package/lib/esm/augment/Holding.d.ts +8 -0
  139. package/lib/esm/augment/Holding.js +4 -0
  140. package/lib/esm/augment/Market.d.ts +8 -0
  141. package/lib/esm/augment/Market.js +4 -0
  142. package/lib/esm/augment/MarketParams.d.ts +8 -0
  143. package/lib/esm/augment/MarketParams.js +4 -0
  144. package/lib/esm/augment/Position.d.ts +8 -0
  145. package/lib/esm/augment/Position.js +4 -0
  146. package/lib/esm/augment/Token.d.ts +8 -0
  147. package/lib/esm/augment/Token.js +4 -0
  148. package/lib/esm/augment/User.d.ts +8 -0
  149. package/lib/esm/augment/User.js +4 -0
  150. package/lib/esm/augment/Vault.d.ts +8 -0
  151. package/lib/esm/augment/Vault.js +4 -0
  152. package/lib/esm/augment/VaultConfig.d.ts +8 -0
  153. package/lib/esm/augment/VaultConfig.js +4 -0
  154. package/lib/esm/augment/VaultMarketAllocation.d.ts +8 -0
  155. package/lib/esm/augment/VaultMarketAllocation.js +4 -0
  156. package/lib/esm/augment/VaultMarketConfig.d.ts +8 -0
  157. package/lib/esm/augment/VaultMarketConfig.js +4 -0
  158. package/lib/esm/augment/VaultMarketPublicAllocatorConfig.d.ts +8 -0
  159. package/lib/esm/augment/VaultMarketPublicAllocatorConfig.js +5 -0
  160. package/lib/esm/augment/VaultUser.d.ts +8 -0
  161. package/lib/esm/augment/VaultUser.js +4 -0
  162. package/lib/esm/augment.d.ts +14 -0
  163. package/lib/esm/augment.js +14 -0
  164. package/lib/esm/bundler/actions.d.ts +637 -0
  165. package/lib/esm/bundler/actions.js +1085 -0
  166. package/lib/esm/bundler/index.d.ts +2 -0
  167. package/lib/esm/bundler/index.js +2 -0
  168. package/lib/esm/bundler/types.d.ts +200 -0
  169. package/lib/esm/bundler/types.js +1 -0
  170. package/lib/esm/constants.d.ts +3 -0
  171. package/lib/esm/constants.js +3 -0
  172. package/lib/esm/entities/index.d.ts +6 -3
  173. package/lib/esm/entities/index.js +5 -3
  174. package/lib/esm/entities/marketV1/marketV1.d.ts +161 -24
  175. package/lib/esm/entities/marketV1/marketV1.js +170 -23
  176. package/lib/esm/entities/reallocationData.d.ts +193 -0
  177. package/lib/esm/entities/reallocationData.js +402 -0
  178. package/lib/esm/errors.d.ts +2 -0
  179. package/lib/esm/errors.js +1 -0
  180. package/lib/esm/fetch.d.ts +1 -0
  181. package/lib/esm/fetch.js +1 -0
  182. package/lib/esm/format.d.ts +2 -0
  183. package/lib/esm/format.js +1 -0
  184. package/lib/esm/helpers/computeReallocations.d.ts +63 -12
  185. package/lib/esm/helpers/computeReallocations.js +160 -41
  186. package/lib/esm/helpers/constant.d.ts +17 -0
  187. package/lib/esm/helpers/constant.js +30 -1
  188. package/lib/esm/helpers/index.d.ts +3 -2
  189. package/lib/esm/helpers/index.js +3 -2
  190. package/lib/esm/helpers/slippage.d.ts +57 -0
  191. package/lib/esm/helpers/slippage.js +80 -0
  192. package/lib/esm/helpers/validate.d.ts +40 -7
  193. package/lib/esm/helpers/validate.js +63 -11
  194. package/lib/esm/index.d.ts +0 -1
  195. package/lib/esm/index.js +0 -1
  196. package/lib/esm/types/action.d.ts +27 -6
  197. package/lib/esm/types/client.d.ts +1 -1
  198. package/lib/esm/types/error.d.ts +155 -7
  199. package/lib/esm/types/error.js +185 -9
  200. package/lib/esm/types/sharedLiquidity.d.ts +43 -3
  201. package/lib/esm/types.d.ts +3 -0
  202. package/lib/esm/types.js +1 -0
  203. package/lib/esm/utils.d.ts +9 -0
  204. package/lib/esm/utils.js +7 -0
  205. package/package.json +128 -17
  206. package/src/index.ts +0 -1
@@ -0,0 +1,1922 @@
1
+ export { marketParamsAbi } from "@morpho-org/blue-sdk";
2
+ export { adaptiveCurveIrmAbi, blueAbi, blueOracleAbi, erc2612Abi, erc5267Abi, metaMorphoAbi, metaMorphoFactoryAbi, morphoMarketV1AdapterAbi, morphoMarketV1AdapterFactoryAbi, morphoMarketV1AdapterV2Abi, morphoMarketV1AdapterV2FactoryAbi, morphoVaultV1AdapterAbi, morphoVaultV1AdapterFactoryAbi, permissionedErc20WrapperAbi, permit2Abi, preLiquidationAbi, preLiquidationFactoryAbi, publicAllocatorAbi, vaultV1AdapterAbi, vaultV1AdapterFactoryAbi, vaultV2Abi, vaultV2FactoryAbi, whitelistControllerAggregatorV2Abi, wrappedBackedTokenAbi, wstEthAbi, } from "@morpho-org/blue-sdk-viem";
3
+ /** ABI for the Bundler3 multicall contract. */
4
+ export const bundler3Abi = [
5
+ {
6
+ type: "function",
7
+ name: "initiator",
8
+ inputs: [],
9
+ outputs: [
10
+ {
11
+ name: "",
12
+ type: "address",
13
+ internalType: "address",
14
+ },
15
+ ],
16
+ stateMutability: "view",
17
+ },
18
+ {
19
+ type: "function",
20
+ name: "multicall",
21
+ inputs: [
22
+ {
23
+ name: "bundle",
24
+ type: "tuple[]",
25
+ internalType: "struct Call[]",
26
+ components: [
27
+ {
28
+ name: "to",
29
+ type: "address",
30
+ internalType: "address",
31
+ },
32
+ {
33
+ name: "data",
34
+ type: "bytes",
35
+ internalType: "bytes",
36
+ },
37
+ {
38
+ name: "value",
39
+ type: "uint256",
40
+ internalType: "uint256",
41
+ },
42
+ {
43
+ name: "skipRevert",
44
+ type: "bool",
45
+ internalType: "bool",
46
+ },
47
+ {
48
+ name: "callbackHash",
49
+ type: "bytes32",
50
+ internalType: "bytes32",
51
+ },
52
+ ],
53
+ },
54
+ ],
55
+ outputs: [],
56
+ stateMutability: "payable",
57
+ },
58
+ {
59
+ type: "function",
60
+ name: "reenter",
61
+ inputs: [
62
+ {
63
+ name: "bundle",
64
+ type: "tuple[]",
65
+ internalType: "struct Call[]",
66
+ components: [
67
+ {
68
+ name: "to",
69
+ type: "address",
70
+ internalType: "address",
71
+ },
72
+ {
73
+ name: "data",
74
+ type: "bytes",
75
+ internalType: "bytes",
76
+ },
77
+ {
78
+ name: "value",
79
+ type: "uint256",
80
+ internalType: "uint256",
81
+ },
82
+ {
83
+ name: "skipRevert",
84
+ type: "bool",
85
+ internalType: "bool",
86
+ },
87
+ {
88
+ name: "callbackHash",
89
+ type: "bytes32",
90
+ internalType: "bytes32",
91
+ },
92
+ ],
93
+ },
94
+ ],
95
+ outputs: [],
96
+ stateMutability: "nonpayable",
97
+ },
98
+ {
99
+ type: "function",
100
+ name: "reenterHash",
101
+ inputs: [],
102
+ outputs: [
103
+ {
104
+ name: "",
105
+ type: "bytes32",
106
+ internalType: "bytes32",
107
+ },
108
+ ],
109
+ stateMutability: "view",
110
+ },
111
+ {
112
+ type: "error",
113
+ name: "AlreadyInitiated",
114
+ inputs: [],
115
+ },
116
+ {
117
+ type: "error",
118
+ name: "EmptyBundle",
119
+ inputs: [],
120
+ },
121
+ {
122
+ type: "error",
123
+ name: "IncorrectReenterHash",
124
+ inputs: [],
125
+ },
126
+ {
127
+ type: "error",
128
+ name: "MissingExpectedReenter",
129
+ inputs: [],
130
+ },
131
+ ];
132
+ /** ABI for the Bundler3 core adapter. */
133
+ export const coreAdapterAbi = [
134
+ {
135
+ type: "receive",
136
+ stateMutability: "payable",
137
+ },
138
+ {
139
+ type: "function",
140
+ name: "BUNDLER3",
141
+ inputs: [],
142
+ outputs: [
143
+ {
144
+ name: "",
145
+ type: "address",
146
+ internalType: "address",
147
+ },
148
+ ],
149
+ stateMutability: "view",
150
+ },
151
+ {
152
+ type: "function",
153
+ name: "erc20Transfer",
154
+ inputs: [
155
+ {
156
+ name: "token",
157
+ type: "address",
158
+ internalType: "address",
159
+ },
160
+ {
161
+ name: "receiver",
162
+ type: "address",
163
+ internalType: "address",
164
+ },
165
+ {
166
+ name: "amount",
167
+ type: "uint256",
168
+ internalType: "uint256",
169
+ },
170
+ ],
171
+ outputs: [],
172
+ stateMutability: "nonpayable",
173
+ },
174
+ {
175
+ type: "function",
176
+ name: "nativeTransfer",
177
+ inputs: [
178
+ {
179
+ name: "receiver",
180
+ type: "address",
181
+ internalType: "address",
182
+ },
183
+ {
184
+ name: "amount",
185
+ type: "uint256",
186
+ internalType: "uint256",
187
+ },
188
+ ],
189
+ outputs: [],
190
+ stateMutability: "nonpayable",
191
+ },
192
+ {
193
+ type: "error",
194
+ name: "AdapterAddress",
195
+ inputs: [],
196
+ },
197
+ {
198
+ type: "error",
199
+ name: "FailedCall",
200
+ inputs: [],
201
+ },
202
+ {
203
+ type: "error",
204
+ name: "InsufficientBalance",
205
+ inputs: [
206
+ {
207
+ name: "balance",
208
+ type: "uint256",
209
+ internalType: "uint256",
210
+ },
211
+ {
212
+ name: "needed",
213
+ type: "uint256",
214
+ internalType: "uint256",
215
+ },
216
+ ],
217
+ },
218
+ {
219
+ type: "error",
220
+ name: "SafeERC20FailedOperation",
221
+ inputs: [
222
+ {
223
+ name: "token",
224
+ type: "address",
225
+ internalType: "address",
226
+ },
227
+ ],
228
+ },
229
+ {
230
+ type: "error",
231
+ name: "UnauthorizedSender",
232
+ inputs: [],
233
+ },
234
+ {
235
+ type: "error",
236
+ name: "ZeroAddress",
237
+ inputs: [],
238
+ },
239
+ {
240
+ type: "error",
241
+ name: "ZeroAmount",
242
+ inputs: [],
243
+ },
244
+ ];
245
+ /** ABI for the Bundler3 GeneralAdapter1 contract. */
246
+ export const generalAdapter1Abi = [
247
+ ...coreAdapterAbi,
248
+ {
249
+ type: "constructor",
250
+ inputs: [
251
+ {
252
+ name: "bundler3",
253
+ type: "address",
254
+ internalType: "address",
255
+ },
256
+ {
257
+ name: "morpho",
258
+ type: "address",
259
+ internalType: "address",
260
+ },
261
+ {
262
+ name: "wNative",
263
+ type: "address",
264
+ internalType: "address",
265
+ },
266
+ ],
267
+ stateMutability: "nonpayable",
268
+ },
269
+ {
270
+ type: "function",
271
+ name: "MORPHO",
272
+ inputs: [],
273
+ outputs: [
274
+ {
275
+ name: "",
276
+ type: "address",
277
+ internalType: "contract IMorpho",
278
+ },
279
+ ],
280
+ stateMutability: "view",
281
+ },
282
+ {
283
+ type: "function",
284
+ name: "WRAPPED_NATIVE",
285
+ inputs: [],
286
+ outputs: [
287
+ {
288
+ name: "",
289
+ type: "address",
290
+ internalType: "contract IWNative",
291
+ },
292
+ ],
293
+ stateMutability: "view",
294
+ },
295
+ {
296
+ type: "function",
297
+ name: "erc20TransferFrom",
298
+ inputs: [
299
+ {
300
+ name: "token",
301
+ type: "address",
302
+ internalType: "address",
303
+ },
304
+ {
305
+ name: "receiver",
306
+ type: "address",
307
+ internalType: "address",
308
+ },
309
+ {
310
+ name: "amount",
311
+ type: "uint256",
312
+ internalType: "uint256",
313
+ },
314
+ ],
315
+ outputs: [],
316
+ stateMutability: "nonpayable",
317
+ },
318
+ {
319
+ type: "function",
320
+ name: "erc4626Deposit",
321
+ inputs: [
322
+ {
323
+ name: "vault",
324
+ type: "address",
325
+ internalType: "address",
326
+ },
327
+ {
328
+ name: "assets",
329
+ type: "uint256",
330
+ internalType: "uint256",
331
+ },
332
+ {
333
+ name: "maxSharePriceE27",
334
+ type: "uint256",
335
+ internalType: "uint256",
336
+ },
337
+ {
338
+ name: "receiver",
339
+ type: "address",
340
+ internalType: "address",
341
+ },
342
+ ],
343
+ outputs: [],
344
+ stateMutability: "nonpayable",
345
+ },
346
+ {
347
+ type: "function",
348
+ name: "erc4626Mint",
349
+ inputs: [
350
+ {
351
+ name: "vault",
352
+ type: "address",
353
+ internalType: "address",
354
+ },
355
+ {
356
+ name: "shares",
357
+ type: "uint256",
358
+ internalType: "uint256",
359
+ },
360
+ {
361
+ name: "maxSharePriceE27",
362
+ type: "uint256",
363
+ internalType: "uint256",
364
+ },
365
+ {
366
+ name: "receiver",
367
+ type: "address",
368
+ internalType: "address",
369
+ },
370
+ ],
371
+ outputs: [],
372
+ stateMutability: "nonpayable",
373
+ },
374
+ {
375
+ type: "function",
376
+ name: "erc4626Redeem",
377
+ inputs: [
378
+ {
379
+ name: "vault",
380
+ type: "address",
381
+ internalType: "address",
382
+ },
383
+ {
384
+ name: "shares",
385
+ type: "uint256",
386
+ internalType: "uint256",
387
+ },
388
+ {
389
+ name: "minSharePriceE27",
390
+ type: "uint256",
391
+ internalType: "uint256",
392
+ },
393
+ {
394
+ name: "receiver",
395
+ type: "address",
396
+ internalType: "address",
397
+ },
398
+ {
399
+ name: "owner",
400
+ type: "address",
401
+ internalType: "address",
402
+ },
403
+ ],
404
+ outputs: [],
405
+ stateMutability: "nonpayable",
406
+ },
407
+ {
408
+ type: "function",
409
+ name: "erc4626Withdraw",
410
+ inputs: [
411
+ {
412
+ name: "vault",
413
+ type: "address",
414
+ internalType: "address",
415
+ },
416
+ {
417
+ name: "assets",
418
+ type: "uint256",
419
+ internalType: "uint256",
420
+ },
421
+ {
422
+ name: "minSharePriceE27",
423
+ type: "uint256",
424
+ internalType: "uint256",
425
+ },
426
+ {
427
+ name: "receiver",
428
+ type: "address",
429
+ internalType: "address",
430
+ },
431
+ {
432
+ name: "owner",
433
+ type: "address",
434
+ internalType: "address",
435
+ },
436
+ ],
437
+ outputs: [],
438
+ stateMutability: "nonpayable",
439
+ },
440
+ {
441
+ type: "function",
442
+ name: "morphoBorrow",
443
+ inputs: [
444
+ {
445
+ name: "marketParams",
446
+ type: "tuple",
447
+ internalType: "struct MarketParams",
448
+ components: [
449
+ {
450
+ name: "loanToken",
451
+ type: "address",
452
+ internalType: "address",
453
+ },
454
+ {
455
+ name: "collateralToken",
456
+ type: "address",
457
+ internalType: "address",
458
+ },
459
+ {
460
+ name: "oracle",
461
+ type: "address",
462
+ internalType: "address",
463
+ },
464
+ {
465
+ name: "irm",
466
+ type: "address",
467
+ internalType: "address",
468
+ },
469
+ {
470
+ name: "lltv",
471
+ type: "uint256",
472
+ internalType: "uint256",
473
+ },
474
+ ],
475
+ },
476
+ {
477
+ name: "assets",
478
+ type: "uint256",
479
+ internalType: "uint256",
480
+ },
481
+ {
482
+ name: "shares",
483
+ type: "uint256",
484
+ internalType: "uint256",
485
+ },
486
+ {
487
+ name: "minSharePriceE27",
488
+ type: "uint256",
489
+ internalType: "uint256",
490
+ },
491
+ {
492
+ name: "receiver",
493
+ type: "address",
494
+ internalType: "address",
495
+ },
496
+ ],
497
+ outputs: [],
498
+ stateMutability: "nonpayable",
499
+ },
500
+ {
501
+ type: "function",
502
+ name: "morphoFlashLoan",
503
+ inputs: [
504
+ {
505
+ name: "token",
506
+ type: "address",
507
+ internalType: "address",
508
+ },
509
+ {
510
+ name: "assets",
511
+ type: "uint256",
512
+ internalType: "uint256",
513
+ },
514
+ {
515
+ name: "data",
516
+ type: "bytes",
517
+ internalType: "bytes",
518
+ },
519
+ ],
520
+ outputs: [],
521
+ stateMutability: "nonpayable",
522
+ },
523
+ {
524
+ type: "function",
525
+ name: "morphoRepay",
526
+ inputs: [
527
+ {
528
+ name: "marketParams",
529
+ type: "tuple",
530
+ internalType: "struct MarketParams",
531
+ components: [
532
+ {
533
+ name: "loanToken",
534
+ type: "address",
535
+ internalType: "address",
536
+ },
537
+ {
538
+ name: "collateralToken",
539
+ type: "address",
540
+ internalType: "address",
541
+ },
542
+ {
543
+ name: "oracle",
544
+ type: "address",
545
+ internalType: "address",
546
+ },
547
+ {
548
+ name: "irm",
549
+ type: "address",
550
+ internalType: "address",
551
+ },
552
+ {
553
+ name: "lltv",
554
+ type: "uint256",
555
+ internalType: "uint256",
556
+ },
557
+ ],
558
+ },
559
+ {
560
+ name: "assets",
561
+ type: "uint256",
562
+ internalType: "uint256",
563
+ },
564
+ {
565
+ name: "shares",
566
+ type: "uint256",
567
+ internalType: "uint256",
568
+ },
569
+ {
570
+ name: "maxSharePriceE27",
571
+ type: "uint256",
572
+ internalType: "uint256",
573
+ },
574
+ {
575
+ name: "onBehalf",
576
+ type: "address",
577
+ internalType: "address",
578
+ },
579
+ {
580
+ name: "data",
581
+ type: "bytes",
582
+ internalType: "bytes",
583
+ },
584
+ ],
585
+ outputs: [],
586
+ stateMutability: "nonpayable",
587
+ },
588
+ {
589
+ type: "function",
590
+ name: "morphoSupply",
591
+ inputs: [
592
+ {
593
+ name: "marketParams",
594
+ type: "tuple",
595
+ internalType: "struct MarketParams",
596
+ components: [
597
+ {
598
+ name: "loanToken",
599
+ type: "address",
600
+ internalType: "address",
601
+ },
602
+ {
603
+ name: "collateralToken",
604
+ type: "address",
605
+ internalType: "address",
606
+ },
607
+ {
608
+ name: "oracle",
609
+ type: "address",
610
+ internalType: "address",
611
+ },
612
+ {
613
+ name: "irm",
614
+ type: "address",
615
+ internalType: "address",
616
+ },
617
+ {
618
+ name: "lltv",
619
+ type: "uint256",
620
+ internalType: "uint256",
621
+ },
622
+ ],
623
+ },
624
+ {
625
+ name: "assets",
626
+ type: "uint256",
627
+ internalType: "uint256",
628
+ },
629
+ {
630
+ name: "shares",
631
+ type: "uint256",
632
+ internalType: "uint256",
633
+ },
634
+ {
635
+ name: "maxSharePriceE27",
636
+ type: "uint256",
637
+ internalType: "uint256",
638
+ },
639
+ {
640
+ name: "onBehalf",
641
+ type: "address",
642
+ internalType: "address",
643
+ },
644
+ {
645
+ name: "data",
646
+ type: "bytes",
647
+ internalType: "bytes",
648
+ },
649
+ ],
650
+ outputs: [],
651
+ stateMutability: "nonpayable",
652
+ },
653
+ {
654
+ type: "function",
655
+ name: "morphoSupplyCollateral",
656
+ inputs: [
657
+ {
658
+ name: "marketParams",
659
+ type: "tuple",
660
+ internalType: "struct MarketParams",
661
+ components: [
662
+ {
663
+ name: "loanToken",
664
+ type: "address",
665
+ internalType: "address",
666
+ },
667
+ {
668
+ name: "collateralToken",
669
+ type: "address",
670
+ internalType: "address",
671
+ },
672
+ {
673
+ name: "oracle",
674
+ type: "address",
675
+ internalType: "address",
676
+ },
677
+ {
678
+ name: "irm",
679
+ type: "address",
680
+ internalType: "address",
681
+ },
682
+ {
683
+ name: "lltv",
684
+ type: "uint256",
685
+ internalType: "uint256",
686
+ },
687
+ ],
688
+ },
689
+ {
690
+ name: "assets",
691
+ type: "uint256",
692
+ internalType: "uint256",
693
+ },
694
+ {
695
+ name: "onBehalf",
696
+ type: "address",
697
+ internalType: "address",
698
+ },
699
+ {
700
+ name: "data",
701
+ type: "bytes",
702
+ internalType: "bytes",
703
+ },
704
+ ],
705
+ outputs: [],
706
+ stateMutability: "nonpayable",
707
+ },
708
+ {
709
+ type: "function",
710
+ name: "morphoWithdraw",
711
+ inputs: [
712
+ {
713
+ name: "marketParams",
714
+ type: "tuple",
715
+ internalType: "struct MarketParams",
716
+ components: [
717
+ {
718
+ name: "loanToken",
719
+ type: "address",
720
+ internalType: "address",
721
+ },
722
+ {
723
+ name: "collateralToken",
724
+ type: "address",
725
+ internalType: "address",
726
+ },
727
+ {
728
+ name: "oracle",
729
+ type: "address",
730
+ internalType: "address",
731
+ },
732
+ {
733
+ name: "irm",
734
+ type: "address",
735
+ internalType: "address",
736
+ },
737
+ {
738
+ name: "lltv",
739
+ type: "uint256",
740
+ internalType: "uint256",
741
+ },
742
+ ],
743
+ },
744
+ {
745
+ name: "assets",
746
+ type: "uint256",
747
+ internalType: "uint256",
748
+ },
749
+ {
750
+ name: "shares",
751
+ type: "uint256",
752
+ internalType: "uint256",
753
+ },
754
+ {
755
+ name: "minSharePriceE27",
756
+ type: "uint256",
757
+ internalType: "uint256",
758
+ },
759
+ {
760
+ name: "receiver",
761
+ type: "address",
762
+ internalType: "address",
763
+ },
764
+ ],
765
+ outputs: [],
766
+ stateMutability: "nonpayable",
767
+ },
768
+ {
769
+ type: "function",
770
+ name: "morphoWithdrawCollateral",
771
+ inputs: [
772
+ {
773
+ name: "marketParams",
774
+ type: "tuple",
775
+ internalType: "struct MarketParams",
776
+ components: [
777
+ {
778
+ name: "loanToken",
779
+ type: "address",
780
+ internalType: "address",
781
+ },
782
+ {
783
+ name: "collateralToken",
784
+ type: "address",
785
+ internalType: "address",
786
+ },
787
+ {
788
+ name: "oracle",
789
+ type: "address",
790
+ internalType: "address",
791
+ },
792
+ {
793
+ name: "irm",
794
+ type: "address",
795
+ internalType: "address",
796
+ },
797
+ {
798
+ name: "lltv",
799
+ type: "uint256",
800
+ internalType: "uint256",
801
+ },
802
+ ],
803
+ },
804
+ {
805
+ name: "assets",
806
+ type: "uint256",
807
+ internalType: "uint256",
808
+ },
809
+ {
810
+ name: "receiver",
811
+ type: "address",
812
+ internalType: "address",
813
+ },
814
+ ],
815
+ outputs: [],
816
+ stateMutability: "nonpayable",
817
+ },
818
+ {
819
+ type: "function",
820
+ name: "onMorphoFlashLoan",
821
+ inputs: [
822
+ {
823
+ name: "",
824
+ type: "uint256",
825
+ internalType: "uint256",
826
+ },
827
+ {
828
+ name: "data",
829
+ type: "bytes",
830
+ internalType: "bytes",
831
+ },
832
+ ],
833
+ outputs: [],
834
+ stateMutability: "nonpayable",
835
+ },
836
+ {
837
+ type: "function",
838
+ name: "onMorphoRepay",
839
+ inputs: [
840
+ {
841
+ name: "",
842
+ type: "uint256",
843
+ internalType: "uint256",
844
+ },
845
+ {
846
+ name: "data",
847
+ type: "bytes",
848
+ internalType: "bytes",
849
+ },
850
+ ],
851
+ outputs: [],
852
+ stateMutability: "nonpayable",
853
+ },
854
+ {
855
+ type: "function",
856
+ name: "onMorphoSupply",
857
+ inputs: [
858
+ {
859
+ name: "",
860
+ type: "uint256",
861
+ internalType: "uint256",
862
+ },
863
+ {
864
+ name: "data",
865
+ type: "bytes",
866
+ internalType: "bytes",
867
+ },
868
+ ],
869
+ outputs: [],
870
+ stateMutability: "nonpayable",
871
+ },
872
+ {
873
+ type: "function",
874
+ name: "onMorphoSupplyCollateral",
875
+ inputs: [
876
+ {
877
+ name: "",
878
+ type: "uint256",
879
+ internalType: "uint256",
880
+ },
881
+ {
882
+ name: "data",
883
+ type: "bytes",
884
+ internalType: "bytes",
885
+ },
886
+ ],
887
+ outputs: [],
888
+ stateMutability: "nonpayable",
889
+ },
890
+ {
891
+ type: "function",
892
+ name: "permit2TransferFrom",
893
+ inputs: [
894
+ {
895
+ name: "token",
896
+ type: "address",
897
+ internalType: "address",
898
+ },
899
+ {
900
+ name: "receiver",
901
+ type: "address",
902
+ internalType: "address",
903
+ },
904
+ {
905
+ name: "amount",
906
+ type: "uint256",
907
+ internalType: "uint256",
908
+ },
909
+ ],
910
+ outputs: [],
911
+ stateMutability: "nonpayable",
912
+ },
913
+ {
914
+ type: "function",
915
+ name: "unwrapNative",
916
+ inputs: [
917
+ {
918
+ name: "amount",
919
+ type: "uint256",
920
+ internalType: "uint256",
921
+ },
922
+ {
923
+ name: "receiver",
924
+ type: "address",
925
+ internalType: "address",
926
+ },
927
+ ],
928
+ outputs: [],
929
+ stateMutability: "nonpayable",
930
+ },
931
+ {
932
+ type: "function",
933
+ name: "wrapNative",
934
+ inputs: [
935
+ {
936
+ name: "amount",
937
+ type: "uint256",
938
+ internalType: "uint256",
939
+ },
940
+ {
941
+ name: "receiver",
942
+ type: "address",
943
+ internalType: "address",
944
+ },
945
+ ],
946
+ outputs: [],
947
+ stateMutability: "nonpayable",
948
+ },
949
+ {
950
+ type: "error",
951
+ name: "SlippageExceeded",
952
+ inputs: [],
953
+ },
954
+ {
955
+ type: "error",
956
+ name: "UnexpectedOwner",
957
+ inputs: [],
958
+ },
959
+ {
960
+ type: "error",
961
+ name: "UnsafeCast",
962
+ inputs: [],
963
+ },
964
+ {
965
+ type: "error",
966
+ name: "ZeroShares",
967
+ inputs: [],
968
+ },
969
+ ];
970
+ /** ABI for the Ethereum-specific Bundler3 GeneralAdapter1 extension. */
971
+ export const ethereumGeneralAdapter1Abi = [
972
+ ...generalAdapter1Abi,
973
+ {
974
+ type: "constructor",
975
+ inputs: [
976
+ {
977
+ name: "bundler3",
978
+ type: "address",
979
+ internalType: "address",
980
+ },
981
+ {
982
+ name: "morpho",
983
+ type: "address",
984
+ internalType: "address",
985
+ },
986
+ {
987
+ name: "weth",
988
+ type: "address",
989
+ internalType: "address",
990
+ },
991
+ {
992
+ name: "wStEth",
993
+ type: "address",
994
+ internalType: "address",
995
+ },
996
+ {
997
+ name: "morphoToken",
998
+ type: "address",
999
+ internalType: "address",
1000
+ },
1001
+ {
1002
+ name: "morphoWrapper",
1003
+ type: "address",
1004
+ internalType: "address",
1005
+ },
1006
+ ],
1007
+ stateMutability: "nonpayable",
1008
+ },
1009
+ {
1010
+ type: "function",
1011
+ name: "MORPHO_TOKEN",
1012
+ inputs: [],
1013
+ outputs: [
1014
+ {
1015
+ name: "",
1016
+ type: "address",
1017
+ internalType: "address",
1018
+ },
1019
+ ],
1020
+ stateMutability: "view",
1021
+ },
1022
+ {
1023
+ type: "function",
1024
+ name: "MORPHO_WRAPPER",
1025
+ inputs: [],
1026
+ outputs: [
1027
+ {
1028
+ name: "",
1029
+ type: "address",
1030
+ internalType: "address",
1031
+ },
1032
+ ],
1033
+ stateMutability: "view",
1034
+ },
1035
+ {
1036
+ type: "function",
1037
+ name: "ST_ETH",
1038
+ inputs: [],
1039
+ outputs: [
1040
+ {
1041
+ name: "",
1042
+ type: "address",
1043
+ internalType: "address",
1044
+ },
1045
+ ],
1046
+ stateMutability: "view",
1047
+ },
1048
+ {
1049
+ type: "function",
1050
+ name: "WST_ETH",
1051
+ inputs: [],
1052
+ outputs: [
1053
+ {
1054
+ name: "",
1055
+ type: "address",
1056
+ internalType: "address",
1057
+ },
1058
+ ],
1059
+ stateMutability: "view",
1060
+ },
1061
+ {
1062
+ type: "function",
1063
+ name: "morphoWrapperDepositFor",
1064
+ inputs: [
1065
+ {
1066
+ name: "receiver",
1067
+ type: "address",
1068
+ internalType: "address",
1069
+ },
1070
+ {
1071
+ name: "amount",
1072
+ type: "uint256",
1073
+ internalType: "uint256",
1074
+ },
1075
+ ],
1076
+ outputs: [],
1077
+ stateMutability: "nonpayable",
1078
+ },
1079
+ {
1080
+ type: "function",
1081
+ name: "morphoWrapperWithdrawTo",
1082
+ inputs: [
1083
+ {
1084
+ name: "receiver",
1085
+ type: "address",
1086
+ internalType: "address",
1087
+ },
1088
+ {
1089
+ name: "amount",
1090
+ type: "uint256",
1091
+ internalType: "uint256",
1092
+ },
1093
+ ],
1094
+ outputs: [],
1095
+ stateMutability: "nonpayable",
1096
+ },
1097
+ {
1098
+ type: "function",
1099
+ name: "stakeEth",
1100
+ inputs: [
1101
+ {
1102
+ name: "amount",
1103
+ type: "uint256",
1104
+ internalType: "uint256",
1105
+ },
1106
+ {
1107
+ name: "maxSharePriceE27",
1108
+ type: "uint256",
1109
+ internalType: "uint256",
1110
+ },
1111
+ {
1112
+ name: "referral",
1113
+ type: "address",
1114
+ internalType: "address",
1115
+ },
1116
+ {
1117
+ name: "receiver",
1118
+ type: "address",
1119
+ internalType: "address",
1120
+ },
1121
+ ],
1122
+ outputs: [],
1123
+ stateMutability: "nonpayable",
1124
+ },
1125
+ {
1126
+ type: "function",
1127
+ name: "unwrapStEth",
1128
+ inputs: [
1129
+ {
1130
+ name: "amount",
1131
+ type: "uint256",
1132
+ internalType: "uint256",
1133
+ },
1134
+ {
1135
+ name: "receiver",
1136
+ type: "address",
1137
+ internalType: "address",
1138
+ },
1139
+ ],
1140
+ outputs: [],
1141
+ stateMutability: "nonpayable",
1142
+ },
1143
+ {
1144
+ type: "function",
1145
+ name: "wrapStEth",
1146
+ inputs: [
1147
+ {
1148
+ name: "amount",
1149
+ type: "uint256",
1150
+ internalType: "uint256",
1151
+ },
1152
+ {
1153
+ name: "receiver",
1154
+ type: "address",
1155
+ internalType: "address",
1156
+ },
1157
+ ],
1158
+ outputs: [],
1159
+ stateMutability: "nonpayable",
1160
+ },
1161
+ ];
1162
+ /** ABI for the Bundler3 Paraswap adapter. */
1163
+ export const paraswapAdapterAbi = [
1164
+ ...coreAdapterAbi,
1165
+ {
1166
+ type: "constructor",
1167
+ inputs: [
1168
+ {
1169
+ name: "bundler3",
1170
+ type: "address",
1171
+ internalType: "address",
1172
+ },
1173
+ {
1174
+ name: "morpho",
1175
+ type: "address",
1176
+ internalType: "address",
1177
+ },
1178
+ {
1179
+ name: "augustusRegistry",
1180
+ type: "address",
1181
+ internalType: "address",
1182
+ },
1183
+ ],
1184
+ stateMutability: "nonpayable",
1185
+ },
1186
+ {
1187
+ type: "function",
1188
+ name: "AUGUSTUS_REGISTRY",
1189
+ inputs: [],
1190
+ outputs: [
1191
+ {
1192
+ name: "",
1193
+ type: "address",
1194
+ internalType: "contract IAugustusRegistry",
1195
+ },
1196
+ ],
1197
+ stateMutability: "view",
1198
+ },
1199
+ {
1200
+ type: "function",
1201
+ name: "MORPHO",
1202
+ inputs: [],
1203
+ outputs: [
1204
+ {
1205
+ name: "",
1206
+ type: "address",
1207
+ internalType: "contract IMorpho",
1208
+ },
1209
+ ],
1210
+ stateMutability: "view",
1211
+ },
1212
+ {
1213
+ type: "function",
1214
+ name: "buy",
1215
+ inputs: [
1216
+ {
1217
+ name: "augustus",
1218
+ type: "address",
1219
+ internalType: "address",
1220
+ },
1221
+ {
1222
+ name: "callData",
1223
+ type: "bytes",
1224
+ internalType: "bytes",
1225
+ },
1226
+ {
1227
+ name: "srcToken",
1228
+ type: "address",
1229
+ internalType: "address",
1230
+ },
1231
+ {
1232
+ name: "destToken",
1233
+ type: "address",
1234
+ internalType: "address",
1235
+ },
1236
+ {
1237
+ name: "newDestAmount",
1238
+ type: "uint256",
1239
+ internalType: "uint256",
1240
+ },
1241
+ {
1242
+ name: "offsets",
1243
+ type: "tuple",
1244
+ internalType: "struct Offsets",
1245
+ components: [
1246
+ {
1247
+ name: "exactAmount",
1248
+ type: "uint256",
1249
+ internalType: "uint256",
1250
+ },
1251
+ {
1252
+ name: "limitAmount",
1253
+ type: "uint256",
1254
+ internalType: "uint256",
1255
+ },
1256
+ {
1257
+ name: "quotedAmount",
1258
+ type: "uint256",
1259
+ internalType: "uint256",
1260
+ },
1261
+ ],
1262
+ },
1263
+ {
1264
+ name: "receiver",
1265
+ type: "address",
1266
+ internalType: "address",
1267
+ },
1268
+ ],
1269
+ outputs: [],
1270
+ stateMutability: "nonpayable",
1271
+ },
1272
+ {
1273
+ type: "function",
1274
+ name: "buyMorphoDebt",
1275
+ inputs: [
1276
+ {
1277
+ name: "augustus",
1278
+ type: "address",
1279
+ internalType: "address",
1280
+ },
1281
+ {
1282
+ name: "callData",
1283
+ type: "bytes",
1284
+ internalType: "bytes",
1285
+ },
1286
+ {
1287
+ name: "srcToken",
1288
+ type: "address",
1289
+ internalType: "address",
1290
+ },
1291
+ {
1292
+ name: "marketParams",
1293
+ type: "tuple",
1294
+ internalType: "struct MarketParams",
1295
+ components: [
1296
+ {
1297
+ name: "loanToken",
1298
+ type: "address",
1299
+ internalType: "address",
1300
+ },
1301
+ {
1302
+ name: "collateralToken",
1303
+ type: "address",
1304
+ internalType: "address",
1305
+ },
1306
+ {
1307
+ name: "oracle",
1308
+ type: "address",
1309
+ internalType: "address",
1310
+ },
1311
+ {
1312
+ name: "irm",
1313
+ type: "address",
1314
+ internalType: "address",
1315
+ },
1316
+ {
1317
+ name: "lltv",
1318
+ type: "uint256",
1319
+ internalType: "uint256",
1320
+ },
1321
+ ],
1322
+ },
1323
+ {
1324
+ name: "offsets",
1325
+ type: "tuple",
1326
+ internalType: "struct Offsets",
1327
+ components: [
1328
+ {
1329
+ name: "exactAmount",
1330
+ type: "uint256",
1331
+ internalType: "uint256",
1332
+ },
1333
+ {
1334
+ name: "limitAmount",
1335
+ type: "uint256",
1336
+ internalType: "uint256",
1337
+ },
1338
+ {
1339
+ name: "quotedAmount",
1340
+ type: "uint256",
1341
+ internalType: "uint256",
1342
+ },
1343
+ ],
1344
+ },
1345
+ {
1346
+ name: "onBehalf",
1347
+ type: "address",
1348
+ internalType: "address",
1349
+ },
1350
+ {
1351
+ name: "receiver",
1352
+ type: "address",
1353
+ internalType: "address",
1354
+ },
1355
+ ],
1356
+ outputs: [],
1357
+ stateMutability: "nonpayable",
1358
+ },
1359
+ {
1360
+ type: "function",
1361
+ name: "sell",
1362
+ inputs: [
1363
+ {
1364
+ name: "augustus",
1365
+ type: "address",
1366
+ internalType: "address",
1367
+ },
1368
+ {
1369
+ name: "callData",
1370
+ type: "bytes",
1371
+ internalType: "bytes",
1372
+ },
1373
+ {
1374
+ name: "srcToken",
1375
+ type: "address",
1376
+ internalType: "address",
1377
+ },
1378
+ {
1379
+ name: "destToken",
1380
+ type: "address",
1381
+ internalType: "address",
1382
+ },
1383
+ {
1384
+ name: "sellEntireBalance",
1385
+ type: "bool",
1386
+ internalType: "bool",
1387
+ },
1388
+ {
1389
+ name: "offsets",
1390
+ type: "tuple",
1391
+ internalType: "struct Offsets",
1392
+ components: [
1393
+ {
1394
+ name: "exactAmount",
1395
+ type: "uint256",
1396
+ internalType: "uint256",
1397
+ },
1398
+ {
1399
+ name: "limitAmount",
1400
+ type: "uint256",
1401
+ internalType: "uint256",
1402
+ },
1403
+ {
1404
+ name: "quotedAmount",
1405
+ type: "uint256",
1406
+ internalType: "uint256",
1407
+ },
1408
+ ],
1409
+ },
1410
+ {
1411
+ name: "receiver",
1412
+ type: "address",
1413
+ internalType: "address",
1414
+ },
1415
+ ],
1416
+ outputs: [],
1417
+ stateMutability: "nonpayable",
1418
+ },
1419
+ {
1420
+ type: "error",
1421
+ name: "BuyAmountTooLow",
1422
+ inputs: [],
1423
+ },
1424
+ {
1425
+ type: "error",
1426
+ name: "InvalidAugustus",
1427
+ inputs: [],
1428
+ },
1429
+ {
1430
+ type: "error",
1431
+ name: "InvalidOffset",
1432
+ inputs: [],
1433
+ },
1434
+ {
1435
+ type: "error",
1436
+ name: "SellAmountTooHigh",
1437
+ inputs: [],
1438
+ },
1439
+ ];
1440
+ /** ABI for the Bundler3 ERC20 wrapper adapter. */
1441
+ export const erc20WrapperAdapterAbi = [
1442
+ ...coreAdapterAbi,
1443
+ {
1444
+ type: "constructor",
1445
+ inputs: [
1446
+ {
1447
+ name: "bundler3",
1448
+ type: "address",
1449
+ internalType: "address",
1450
+ },
1451
+ ],
1452
+ stateMutability: "nonpayable",
1453
+ },
1454
+ {
1455
+ type: "function",
1456
+ name: "erc20WrapperDepositFor",
1457
+ inputs: [
1458
+ {
1459
+ name: "wrapper",
1460
+ type: "address",
1461
+ internalType: "address",
1462
+ },
1463
+ {
1464
+ name: "amount",
1465
+ type: "uint256",
1466
+ internalType: "uint256",
1467
+ },
1468
+ ],
1469
+ outputs: [],
1470
+ stateMutability: "nonpayable",
1471
+ },
1472
+ {
1473
+ type: "function",
1474
+ name: "erc20WrapperWithdrawTo",
1475
+ inputs: [
1476
+ {
1477
+ name: "wrapper",
1478
+ type: "address",
1479
+ internalType: "address",
1480
+ },
1481
+ {
1482
+ name: "receiver",
1483
+ type: "address",
1484
+ internalType: "address",
1485
+ },
1486
+ {
1487
+ name: "amount",
1488
+ type: "uint256",
1489
+ internalType: "uint256",
1490
+ },
1491
+ ],
1492
+ outputs: [],
1493
+ stateMutability: "nonpayable",
1494
+ },
1495
+ {
1496
+ type: "error",
1497
+ name: "DepositFailed",
1498
+ inputs: [],
1499
+ },
1500
+ {
1501
+ type: "error",
1502
+ name: "WithdrawFailed",
1503
+ inputs: [],
1504
+ },
1505
+ ];
1506
+ /** ABI for the Bundler3 Aave V2 migration adapter. */
1507
+ export const aaveV2MigrationAdapterAbi = [
1508
+ ...coreAdapterAbi,
1509
+ {
1510
+ type: "constructor",
1511
+ inputs: [
1512
+ {
1513
+ name: "bundler3",
1514
+ type: "address",
1515
+ internalType: "address",
1516
+ },
1517
+ {
1518
+ name: "aaveV2Pool",
1519
+ type: "address",
1520
+ internalType: "address",
1521
+ },
1522
+ ],
1523
+ stateMutability: "nonpayable",
1524
+ },
1525
+ {
1526
+ type: "function",
1527
+ name: "aaveV2Repay",
1528
+ inputs: [
1529
+ {
1530
+ name: "token",
1531
+ type: "address",
1532
+ internalType: "address",
1533
+ },
1534
+ {
1535
+ name: "amount",
1536
+ type: "uint256",
1537
+ internalType: "uint256",
1538
+ },
1539
+ {
1540
+ name: "interestRateMode",
1541
+ type: "uint256",
1542
+ internalType: "uint256",
1543
+ },
1544
+ {
1545
+ name: "onBehalf",
1546
+ type: "address",
1547
+ internalType: "address",
1548
+ },
1549
+ ],
1550
+ outputs: [],
1551
+ stateMutability: "nonpayable",
1552
+ },
1553
+ {
1554
+ type: "function",
1555
+ name: "aaveV2Withdraw",
1556
+ inputs: [
1557
+ {
1558
+ name: "token",
1559
+ type: "address",
1560
+ internalType: "address",
1561
+ },
1562
+ {
1563
+ name: "amount",
1564
+ type: "uint256",
1565
+ internalType: "uint256",
1566
+ },
1567
+ {
1568
+ name: "receiver",
1569
+ type: "address",
1570
+ internalType: "address",
1571
+ },
1572
+ ],
1573
+ outputs: [],
1574
+ stateMutability: "nonpayable",
1575
+ },
1576
+ ];
1577
+ /** ABI for the Bundler3 Aave V3 migration adapter. */
1578
+ export const aaveV3MigrationAdapterAbi = [
1579
+ ...coreAdapterAbi,
1580
+ {
1581
+ type: "constructor",
1582
+ inputs: [
1583
+ {
1584
+ name: "bundler3",
1585
+ type: "address",
1586
+ internalType: "address",
1587
+ },
1588
+ {
1589
+ name: "aaveV3Pool",
1590
+ type: "address",
1591
+ internalType: "address",
1592
+ },
1593
+ ],
1594
+ stateMutability: "nonpayable",
1595
+ },
1596
+ {
1597
+ type: "function",
1598
+ name: "aaveV3Repay",
1599
+ inputs: [
1600
+ {
1601
+ name: "token",
1602
+ type: "address",
1603
+ internalType: "address",
1604
+ },
1605
+ {
1606
+ name: "amount",
1607
+ type: "uint256",
1608
+ internalType: "uint256",
1609
+ },
1610
+ {
1611
+ name: "interestRateMode",
1612
+ type: "uint256",
1613
+ internalType: "uint256",
1614
+ },
1615
+ {
1616
+ name: "onBehalf",
1617
+ type: "address",
1618
+ internalType: "address",
1619
+ },
1620
+ ],
1621
+ outputs: [],
1622
+ stateMutability: "nonpayable",
1623
+ },
1624
+ {
1625
+ type: "function",
1626
+ name: "aaveV3Withdraw",
1627
+ inputs: [
1628
+ {
1629
+ name: "token",
1630
+ type: "address",
1631
+ internalType: "address",
1632
+ },
1633
+ {
1634
+ name: "amount",
1635
+ type: "uint256",
1636
+ internalType: "uint256",
1637
+ },
1638
+ {
1639
+ name: "receiver",
1640
+ type: "address",
1641
+ internalType: "address",
1642
+ },
1643
+ ],
1644
+ outputs: [],
1645
+ stateMutability: "nonpayable",
1646
+ },
1647
+ ];
1648
+ /** ABI for the Bundler3 Aave V3 Optimizer migration adapter. */
1649
+ export const aaveV3OptimizerMigrationAdapterAbi = [
1650
+ ...coreAdapterAbi,
1651
+ {
1652
+ type: "constructor",
1653
+ inputs: [
1654
+ {
1655
+ name: "bundler3",
1656
+ type: "address",
1657
+ internalType: "address",
1658
+ },
1659
+ {
1660
+ name: "aaveV3Optimizer",
1661
+ type: "address",
1662
+ internalType: "address",
1663
+ },
1664
+ ],
1665
+ stateMutability: "nonpayable",
1666
+ },
1667
+ {
1668
+ type: "function",
1669
+ name: "aaveV3OptimizerRepay",
1670
+ inputs: [
1671
+ {
1672
+ name: "underlying",
1673
+ type: "address",
1674
+ internalType: "address",
1675
+ },
1676
+ {
1677
+ name: "amount",
1678
+ type: "uint256",
1679
+ internalType: "uint256",
1680
+ },
1681
+ {
1682
+ name: "onBehalf",
1683
+ type: "address",
1684
+ internalType: "address",
1685
+ },
1686
+ ],
1687
+ outputs: [],
1688
+ stateMutability: "nonpayable",
1689
+ },
1690
+ {
1691
+ type: "function",
1692
+ name: "aaveV3OptimizerWithdraw",
1693
+ inputs: [
1694
+ {
1695
+ name: "underlying",
1696
+ type: "address",
1697
+ internalType: "address",
1698
+ },
1699
+ {
1700
+ name: "amount",
1701
+ type: "uint256",
1702
+ internalType: "uint256",
1703
+ },
1704
+ {
1705
+ name: "maxIterations",
1706
+ type: "uint256",
1707
+ internalType: "uint256",
1708
+ },
1709
+ {
1710
+ name: "receiver",
1711
+ type: "address",
1712
+ internalType: "address",
1713
+ },
1714
+ ],
1715
+ outputs: [],
1716
+ stateMutability: "nonpayable",
1717
+ },
1718
+ {
1719
+ type: "function",
1720
+ name: "aaveV3OptimizerWithdrawCollateral",
1721
+ inputs: [
1722
+ {
1723
+ name: "underlying",
1724
+ type: "address",
1725
+ internalType: "address",
1726
+ },
1727
+ {
1728
+ name: "amount",
1729
+ type: "uint256",
1730
+ internalType: "uint256",
1731
+ },
1732
+ {
1733
+ name: "receiver",
1734
+ type: "address",
1735
+ internalType: "address",
1736
+ },
1737
+ ],
1738
+ outputs: [],
1739
+ stateMutability: "nonpayable",
1740
+ },
1741
+ ];
1742
+ /** ABI for the Bundler3 Compound V2 migration adapter. */
1743
+ export const compoundV2MigrationAdapterAbi = [
1744
+ ...coreAdapterAbi,
1745
+ {
1746
+ type: "constructor",
1747
+ inputs: [
1748
+ {
1749
+ name: "bundler3",
1750
+ type: "address",
1751
+ internalType: "address",
1752
+ },
1753
+ {
1754
+ name: "cEth",
1755
+ type: "address",
1756
+ internalType: "address",
1757
+ },
1758
+ ],
1759
+ stateMutability: "nonpayable",
1760
+ },
1761
+ {
1762
+ type: "function",
1763
+ name: "C_ETH",
1764
+ inputs: [],
1765
+ outputs: [
1766
+ {
1767
+ name: "",
1768
+ type: "address",
1769
+ internalType: "address",
1770
+ },
1771
+ ],
1772
+ stateMutability: "view",
1773
+ },
1774
+ {
1775
+ type: "function",
1776
+ name: "compoundV2RedeemErc20",
1777
+ inputs: [
1778
+ {
1779
+ name: "cToken",
1780
+ type: "address",
1781
+ internalType: "address",
1782
+ },
1783
+ {
1784
+ name: "amount",
1785
+ type: "uint256",
1786
+ internalType: "uint256",
1787
+ },
1788
+ {
1789
+ name: "receiver",
1790
+ type: "address",
1791
+ internalType: "address",
1792
+ },
1793
+ ],
1794
+ outputs: [],
1795
+ stateMutability: "nonpayable",
1796
+ },
1797
+ {
1798
+ type: "function",
1799
+ name: "compoundV2RedeemEth",
1800
+ inputs: [
1801
+ {
1802
+ name: "amount",
1803
+ type: "uint256",
1804
+ internalType: "uint256",
1805
+ },
1806
+ {
1807
+ name: "receiver",
1808
+ type: "address",
1809
+ internalType: "address",
1810
+ },
1811
+ ],
1812
+ outputs: [],
1813
+ stateMutability: "nonpayable",
1814
+ },
1815
+ {
1816
+ type: "function",
1817
+ name: "compoundV2RepayErc20",
1818
+ inputs: [
1819
+ {
1820
+ name: "cToken",
1821
+ type: "address",
1822
+ internalType: "address",
1823
+ },
1824
+ {
1825
+ name: "amount",
1826
+ type: "uint256",
1827
+ internalType: "uint256",
1828
+ },
1829
+ {
1830
+ name: "onBehalf",
1831
+ type: "address",
1832
+ internalType: "address",
1833
+ },
1834
+ ],
1835
+ outputs: [],
1836
+ stateMutability: "nonpayable",
1837
+ },
1838
+ {
1839
+ type: "function",
1840
+ name: "compoundV2RepayEth",
1841
+ inputs: [
1842
+ {
1843
+ name: "amount",
1844
+ type: "uint256",
1845
+ internalType: "uint256",
1846
+ },
1847
+ {
1848
+ name: "onBehalf",
1849
+ type: "address",
1850
+ internalType: "address",
1851
+ },
1852
+ ],
1853
+ outputs: [],
1854
+ stateMutability: "nonpayable",
1855
+ },
1856
+ ];
1857
+ /** ABI for the Bundler3 Compound V3 migration adapter. */
1858
+ export const compoundV3MigrationAdapterAbi = [
1859
+ ...coreAdapterAbi,
1860
+ {
1861
+ type: "constructor",
1862
+ inputs: [
1863
+ {
1864
+ name: "bundler3",
1865
+ type: "address",
1866
+ internalType: "address",
1867
+ },
1868
+ ],
1869
+ stateMutability: "nonpayable",
1870
+ },
1871
+ {
1872
+ type: "function",
1873
+ name: "compoundV3Repay",
1874
+ inputs: [
1875
+ {
1876
+ name: "instance",
1877
+ type: "address",
1878
+ internalType: "address",
1879
+ },
1880
+ {
1881
+ name: "amount",
1882
+ type: "uint256",
1883
+ internalType: "uint256",
1884
+ },
1885
+ {
1886
+ name: "onBehalf",
1887
+ type: "address",
1888
+ internalType: "address",
1889
+ },
1890
+ ],
1891
+ outputs: [],
1892
+ stateMutability: "nonpayable",
1893
+ },
1894
+ {
1895
+ type: "function",
1896
+ name: "compoundV3WithdrawFrom",
1897
+ inputs: [
1898
+ {
1899
+ name: "instance",
1900
+ type: "address",
1901
+ internalType: "address",
1902
+ },
1903
+ {
1904
+ name: "asset",
1905
+ type: "address",
1906
+ internalType: "address",
1907
+ },
1908
+ {
1909
+ name: "amount",
1910
+ type: "uint256",
1911
+ internalType: "uint256",
1912
+ },
1913
+ {
1914
+ name: "receiver",
1915
+ type: "address",
1916
+ internalType: "address",
1917
+ },
1918
+ ],
1919
+ outputs: [],
1920
+ stateMutability: "nonpayable",
1921
+ },
1922
+ ];