@underscore-finance/sdk 1.2.20-next.1 → 1.2.20-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/AGENTS.md +172 -0
  2. package/README.md +17 -116
  3. package/abis.json +193056 -0
  4. package/addresses.json +76 -0
  5. package/dist/contracts/AaveV3.d.ts +2594 -0
  6. package/dist/contracts/AaveV3.d.ts.map +1 -0
  7. package/dist/contracts/AaveV3.js +3272 -0
  8. package/dist/contracts/Addys.d.ts +124 -0
  9. package/dist/contracts/Addys.d.ts.map +1 -0
  10. package/dist/contracts/Addys.js +134 -0
  11. package/dist/contracts/AeroClassic.d.ts +2118 -0
  12. package/dist/contracts/AeroClassic.d.ts.map +1 -0
  13. package/dist/contracts/AeroClassic.js +2679 -0
  14. package/dist/contracts/AeroSlipstream.d.ts +2256 -0
  15. package/dist/contracts/AeroSlipstream.d.ts.map +1 -0
  16. package/dist/contracts/AeroSlipstream.js +2848 -0
  17. package/dist/contracts/AgentSenderGeneric.d.ts +4771 -0
  18. package/dist/contracts/AgentSenderGeneric.d.ts.map +1 -0
  19. package/dist/contracts/AgentSenderGeneric.js +6192 -0
  20. package/dist/contracts/AgentSenderSpecial.d.ts +2124 -0
  21. package/dist/contracts/AgentSenderSpecial.d.ts.map +1 -0
  22. package/dist/contracts/AgentSenderSpecial.js +2671 -0
  23. package/dist/contracts/AgentSenderSpecialAdmin.d.ts +984 -0
  24. package/dist/contracts/AgentSenderSpecialAdmin.d.ts.map +1 -0
  25. package/dist/contracts/AgentSenderSpecialAdmin.js +1185 -0
  26. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts +3180 -0
  27. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts.map +1 -0
  28. package/dist/contracts/AgentSenderSpecialSigHelper.js +4211 -0
  29. package/dist/contracts/AgentWrapper.d.ts +2678 -0
  30. package/dist/contracts/AgentWrapper.d.ts.map +1 -0
  31. package/dist/contracts/AgentWrapper.js +3602 -0
  32. package/dist/contracts/AgentWrapperV1.d.ts +3789 -0
  33. package/dist/contracts/AgentWrapperV1.d.ts.map +1 -0
  34. package/dist/contracts/AgentWrapperV1.js +4945 -0
  35. package/dist/contracts/AgentWrapperV2.d.ts +2494 -0
  36. package/dist/contracts/AgentWrapperV2.d.ts.map +1 -0
  37. package/dist/contracts/AgentWrapperV2.js +3354 -0
  38. package/dist/contracts/Appraiser.d.ts +577 -0
  39. package/dist/contracts/Appraiser.d.ts.map +1 -0
  40. package/dist/contracts/Appraiser.js +735 -0
  41. package/dist/contracts/Avantis.d.ts +2606 -0
  42. package/dist/contracts/Avantis.d.ts.map +1 -0
  43. package/dist/contracts/Avantis.js +3282 -0
  44. package/dist/contracts/Billing.d.ts +381 -0
  45. package/dist/contracts/Billing.d.ts.map +1 -0
  46. package/dist/contracts/Billing.js +451 -0
  47. package/dist/contracts/ChequeBook.d.ts +1860 -0
  48. package/dist/contracts/ChequeBook.d.ts.map +1 -0
  49. package/dist/contracts/ChequeBook.js +2131 -0
  50. package/dist/contracts/CompoundV3.d.ts +2622 -0
  51. package/dist/contracts/CompoundV3.d.ts.map +1 -0
  52. package/dist/contracts/CompoundV3.js +3304 -0
  53. package/dist/contracts/ConvertVaultToken.d.ts +64 -0
  54. package/dist/contracts/ConvertVaultToken.d.ts.map +1 -0
  55. package/dist/contracts/ConvertVaultToken.js +75 -0
  56. package/dist/contracts/Curve.d.ts +1107 -0
  57. package/dist/contracts/Curve.d.ts.map +1 -0
  58. package/dist/contracts/Curve.js +1379 -0
  59. package/dist/contracts/DefaultsBase.d.ts +306 -0
  60. package/dist/contracts/DefaultsBase.d.ts.map +1 -0
  61. package/dist/contracts/DefaultsBase.js +331 -0
  62. package/dist/contracts/DefaultsLocal.d.ts +320 -0
  63. package/dist/contracts/DefaultsLocal.d.ts.map +1 -0
  64. package/dist/contracts/DefaultsLocal.js +350 -0
  65. package/dist/contracts/ERC20.d.ts +813 -0
  66. package/dist/contracts/ERC20.d.ts.map +1 -0
  67. package/dist/contracts/ERC20.js +1006 -0
  68. package/dist/contracts/EarnVault.d.ts +1762 -0
  69. package/dist/contracts/EarnVault.d.ts.map +1 -0
  70. package/dist/contracts/EarnVault.js +2267 -0
  71. package/dist/contracts/EarnVaultAgent.d.ts +1160 -0
  72. package/dist/contracts/EarnVaultAgent.d.ts.map +1 -0
  73. package/dist/contracts/EarnVaultAgent.js +1435 -0
  74. package/dist/contracts/EarnVaultAgentSigHelper.d.ts +905 -0
  75. package/dist/contracts/EarnVaultAgentSigHelper.d.ts.map +1 -0
  76. package/dist/contracts/EarnVaultAgentSigHelper.js +1198 -0
  77. package/dist/contracts/EarnVaultWallet.d.ts +777 -0
  78. package/dist/contracts/EarnVaultWallet.d.ts.map +1 -0
  79. package/dist/contracts/EarnVaultWallet.js +987 -0
  80. package/dist/contracts/Erc20Token.d.ts +813 -0
  81. package/dist/contracts/Erc20Token.d.ts.map +1 -0
  82. package/dist/contracts/Erc20Token.js +1006 -0
  83. package/dist/contracts/Euler.d.ts +2662 -0
  84. package/dist/contracts/Euler.d.ts.map +1 -0
  85. package/dist/contracts/Euler.js +3350 -0
  86. package/dist/contracts/ExtraFi.d.ts +2637 -0
  87. package/dist/contracts/ExtraFi.d.ts.map +1 -0
  88. package/dist/contracts/ExtraFi.js +3323 -0
  89. package/dist/contracts/Fluid.d.ts +2634 -0
  90. package/dist/contracts/Fluid.d.ts.map +1 -0
  91. package/dist/contracts/Fluid.js +3318 -0
  92. package/dist/contracts/FortyAcres.d.ts +2620 -0
  93. package/dist/contracts/FortyAcres.d.ts.map +1 -0
  94. package/dist/contracts/FortyAcres.js +3300 -0
  95. package/dist/contracts/Hatchery.d.ts +392 -0
  96. package/dist/contracts/Hatchery.d.ts.map +1 -0
  97. package/dist/contracts/Hatchery.js +472 -0
  98. package/dist/contracts/Helpers.d.ts +1463 -0
  99. package/dist/contracts/Helpers.d.ts.map +1 -0
  100. package/dist/contracts/Helpers.js +1763 -0
  101. package/dist/contracts/HighCommand.d.ts +2169 -0
  102. package/dist/contracts/HighCommand.d.ts.map +1 -0
  103. package/dist/contracts/HighCommand.js +2474 -0
  104. package/dist/contracts/Kernel.d.ts +391 -0
  105. package/dist/contracts/Kernel.d.ts.map +1 -0
  106. package/dist/contracts/Kernel.js +446 -0
  107. package/dist/contracts/Ledger.d.ts +637 -0
  108. package/dist/contracts/Ledger.d.ts.map +1 -0
  109. package/dist/contracts/Ledger.js +759 -0
  110. package/dist/contracts/LegoBook.d.ts +1463 -0
  111. package/dist/contracts/LegoBook.d.ts.map +1 -0
  112. package/dist/contracts/LegoBook.js +1763 -0
  113. package/dist/contracts/LegoTools.d.ts +1913 -0
  114. package/dist/contracts/LegoTools.d.ts.map +1 -0
  115. package/dist/contracts/LegoTools.js +2402 -0
  116. package/dist/contracts/LevgVault.d.ts +2115 -0
  117. package/dist/contracts/LevgVault.d.ts.map +1 -0
  118. package/dist/contracts/LevgVault.js +2733 -0
  119. package/dist/contracts/LevgVaultAgent.d.ts +2013 -0
  120. package/dist/contracts/LevgVaultAgent.d.ts.map +1 -0
  121. package/dist/contracts/LevgVaultAgent.js +2563 -0
  122. package/dist/contracts/LevgVaultAgentSigHelper.d.ts +2221 -0
  123. package/dist/contracts/LevgVaultAgentSigHelper.d.ts.map +1 -0
  124. package/dist/contracts/LevgVaultAgentSigHelper.js +2963 -0
  125. package/dist/contracts/LevgVaultHelper.d.ts +977 -0
  126. package/dist/contracts/LevgVaultHelper.d.ts.map +1 -0
  127. package/dist/contracts/LevgVaultHelper.js +1289 -0
  128. package/dist/contracts/LevgVaultTools.d.ts +2629 -0
  129. package/dist/contracts/LevgVaultTools.d.ts.map +1 -0
  130. package/dist/contracts/LevgVaultTools.js +3560 -0
  131. package/dist/contracts/LevgVaultWallet.d.ts +1119 -0
  132. package/dist/contracts/LevgVaultWallet.d.ts.map +1 -0
  133. package/dist/contracts/LevgVaultWallet.js +1439 -0
  134. package/dist/contracts/LocalGov.d.ts +427 -0
  135. package/dist/contracts/LocalGov.d.ts.map +1 -0
  136. package/dist/contracts/LocalGov.js +507 -0
  137. package/dist/contracts/LootDistributor.d.ts +1053 -0
  138. package/dist/contracts/LootDistributor.d.ts.map +1 -0
  139. package/dist/contracts/LootDistributor.js +1291 -0
  140. package/dist/contracts/Migrator.d.ts +449 -0
  141. package/dist/contracts/Migrator.d.ts.map +1 -0
  142. package/dist/contracts/Migrator.js +535 -0
  143. package/dist/contracts/MissionControl.d.ts +1405 -0
  144. package/dist/contracts/MissionControl.d.ts.map +1 -0
  145. package/dist/contracts/MissionControl.js +1592 -0
  146. package/dist/contracts/Moonwell.d.ts +2623 -0
  147. package/dist/contracts/Moonwell.d.ts.map +1 -0
  148. package/dist/contracts/Moonwell.js +3304 -0
  149. package/dist/contracts/Morpho.d.ts +2662 -0
  150. package/dist/contracts/Morpho.d.ts.map +1 -0
  151. package/dist/contracts/Morpho.js +3350 -0
  152. package/dist/contracts/Ownership.d.ts +414 -0
  153. package/dist/contracts/Ownership.d.ts.map +1 -0
  154. package/dist/contracts/Ownership.js +472 -0
  155. package/dist/contracts/Paymaster.d.ts +1511 -0
  156. package/dist/contracts/Paymaster.d.ts.map +1 -0
  157. package/dist/contracts/Paymaster.js +1812 -0
  158. package/dist/contracts/RipeLego.d.ts +2913 -0
  159. package/dist/contracts/RipeLego.d.ts.map +1 -0
  160. package/dist/contracts/RipeLego.js +3643 -0
  161. package/dist/contracts/Sentinel.d.ts +2067 -0
  162. package/dist/contracts/Sentinel.d.ts.map +1 -0
  163. package/dist/contracts/Sentinel.js +2480 -0
  164. package/dist/contracts/SignatureHelper.d.ts +4250 -0
  165. package/dist/contracts/SignatureHelper.d.ts.map +1 -0
  166. package/dist/contracts/SignatureHelper.js +5714 -0
  167. package/dist/contracts/SignatureHelperV1.d.ts +4250 -0
  168. package/dist/contracts/SignatureHelperV1.d.ts.map +1 -0
  169. package/dist/contracts/SignatureHelperV1.js +5714 -0
  170. package/dist/contracts/SkyPsm.d.ts +2667 -0
  171. package/dist/contracts/SkyPsm.d.ts.map +1 -0
  172. package/dist/contracts/SkyPsm.js +3356 -0
  173. package/dist/contracts/Switchboard.d.ts +1483 -0
  174. package/dist/contracts/Switchboard.d.ts.map +1 -0
  175. package/dist/contracts/Switchboard.js +1790 -0
  176. package/dist/contracts/SwitchboardAlpha.d.ts +3161 -0
  177. package/dist/contracts/SwitchboardAlpha.d.ts.map +1 -0
  178. package/dist/contracts/SwitchboardAlpha.js +3771 -0
  179. package/dist/contracts/SwitchboardBravo.d.ts +1591 -0
  180. package/dist/contracts/SwitchboardBravo.d.ts.map +1 -0
  181. package/dist/contracts/SwitchboardBravo.js +1872 -0
  182. package/dist/contracts/SwitchboardCharlie.d.ts +3172 -0
  183. package/dist/contracts/SwitchboardCharlie.d.ts.map +1 -0
  184. package/dist/contracts/SwitchboardCharlie.js +3713 -0
  185. package/dist/contracts/UnderscoreLego.d.ts +2592 -0
  186. package/dist/contracts/UnderscoreLego.d.ts.map +1 -0
  187. package/dist/contracts/UnderscoreLego.js +3264 -0
  188. package/dist/contracts/UndyAero.d.ts +1733 -0
  189. package/dist/contracts/UndyAero.d.ts.map +1 -0
  190. package/dist/contracts/UndyAero.js +2235 -0
  191. package/dist/contracts/UndyBtc.d.ts +1733 -0
  192. package/dist/contracts/UndyBtc.d.ts.map +1 -0
  193. package/dist/contracts/UndyBtc.js +2235 -0
  194. package/dist/contracts/UndyCbeth.d.ts +1733 -0
  195. package/dist/contracts/UndyCbeth.d.ts.map +1 -0
  196. package/dist/contracts/UndyCbeth.js +2235 -0
  197. package/dist/contracts/UndyEth.d.ts +1733 -0
  198. package/dist/contracts/UndyEth.d.ts.map +1 -0
  199. package/dist/contracts/UndyEth.js +2235 -0
  200. package/dist/contracts/UndyEurc.d.ts +1733 -0
  201. package/dist/contracts/UndyEurc.d.ts.map +1 -0
  202. package/dist/contracts/UndyEurc.js +2235 -0
  203. package/dist/contracts/UndyGho.d.ts +1733 -0
  204. package/dist/contracts/UndyGho.d.ts.map +1 -0
  205. package/dist/contracts/UndyGho.js +2235 -0
  206. package/dist/contracts/UndyHq.d.ts +1677 -0
  207. package/dist/contracts/UndyHq.d.ts.map +1 -0
  208. package/dist/contracts/UndyHq.js +2026 -0
  209. package/dist/contracts/UndyRewardsLego.d.ts +1572 -0
  210. package/dist/contracts/UndyRewardsLego.d.ts.map +1 -0
  211. package/dist/contracts/UndyRewardsLego.js +1994 -0
  212. package/dist/contracts/UndyToken.d.ts +821 -0
  213. package/dist/contracts/UndyToken.d.ts.map +1 -0
  214. package/dist/contracts/UndyToken.js +1017 -0
  215. package/dist/contracts/UndyUsd.d.ts +1733 -0
  216. package/dist/contracts/UndyUsd.d.ts.map +1 -0
  217. package/dist/contracts/UndyUsd.js +2235 -0
  218. package/dist/contracts/UndyUsdV2.d.ts +1762 -0
  219. package/dist/contracts/UndyUsdV2.d.ts.map +1 -0
  220. package/dist/contracts/UndyUsdV2.js +2267 -0
  221. package/dist/contracts/UndyUsds.d.ts +1733 -0
  222. package/dist/contracts/UndyUsds.d.ts.map +1 -0
  223. package/dist/contracts/UndyUsds.js +2235 -0
  224. package/dist/contracts/UndyVirtual.d.ts +1762 -0
  225. package/dist/contracts/UndyVirtual.d.ts.map +1 -0
  226. package/dist/contracts/UndyVirtual.js +2267 -0
  227. package/dist/contracts/UniswapV2.d.ts +2118 -0
  228. package/dist/contracts/UniswapV2.d.ts.map +1 -0
  229. package/dist/contracts/UniswapV2.js +2679 -0
  230. package/dist/contracts/UniswapV3.d.ts +2256 -0
  231. package/dist/contracts/UniswapV3.d.ts.map +1 -0
  232. package/dist/contracts/UniswapV3.js +2848 -0
  233. package/dist/contracts/UserWallet.d.ts +2650 -0
  234. package/dist/contracts/UserWallet.d.ts.map +1 -0
  235. package/dist/contracts/UserWallet.js +3520 -0
  236. package/dist/contracts/UserWalletConfig.d.ts +3918 -0
  237. package/dist/contracts/UserWalletConfig.d.ts.map +1 -0
  238. package/dist/contracts/UserWalletConfig.js +4527 -0
  239. package/dist/contracts/UserWalletConfigV1.d.ts +3692 -0
  240. package/dist/contracts/UserWalletConfigV1.d.ts.map +1 -0
  241. package/dist/contracts/UserWalletConfigV1.js +4276 -0
  242. package/dist/contracts/UserWalletSignatureHelper.d.ts +5558 -0
  243. package/dist/contracts/UserWalletSignatureHelper.d.ts.map +1 -0
  244. package/dist/contracts/UserWalletSignatureHelper.js +7480 -0
  245. package/dist/contracts/UserWalletV1.d.ts +2650 -0
  246. package/dist/contracts/UserWalletV1.d.ts.map +1 -0
  247. package/dist/contracts/UserWalletV1.js +3520 -0
  248. package/dist/contracts/VaultErc20Token.d.ts +522 -0
  249. package/dist/contracts/VaultErc20Token.d.ts.map +1 -0
  250. package/dist/contracts/VaultErc20Token.js +658 -0
  251. package/dist/contracts/VaultRegistry.d.ts +3162 -0
  252. package/dist/contracts/VaultRegistry.d.ts.map +1 -0
  253. package/dist/contracts/VaultRegistry.js +3893 -0
  254. package/dist/contracts/WalletBackpack.d.ts +1248 -0
  255. package/dist/contracts/WalletBackpack.d.ts.map +1 -0
  256. package/dist/contracts/WalletBackpack.js +1519 -0
  257. package/dist/contracts/Wasabi.d.ts +2620 -0
  258. package/dist/contracts/Wasabi.d.ts.map +1 -0
  259. package/dist/contracts/Wasabi.js +3300 -0
  260. package/dist/contracts/index.d.ts +86 -0
  261. package/dist/contracts/index.d.ts.map +1 -0
  262. package/dist/contracts/index.js +89 -0
  263. package/dist/contracts/sdk.d.ts +176 -0
  264. package/dist/contracts/sdk.d.ts.map +1 -0
  265. package/dist/contracts/sdk.js +178 -0
  266. package/dist/getSwapInstructions.d.ts +34 -0
  267. package/dist/getSwapInstructions.d.ts.map +1 -0
  268. package/dist/getSwapInstructions.js +21 -0
  269. package/dist/index.d.ts +135 -0
  270. package/dist/index.d.ts.map +1 -0
  271. package/dist/index.js +137 -0
  272. package/package.json +44 -17
  273. package/.claude/settings.local.json +0 -31
  274. package/.eslintrc.json +0 -27
  275. package/.prettierrc +0 -9
  276. package/.tool-versions +0 -1
  277. package/LICENSE +0 -41
  278. package/LICENSE_DATE.md +0 -34
  279. package/LICENSE_GRANTS.md +0 -33
  280. package/LICENSE_INFO.md +0 -90
  281. package/dapp.config.js +0 -154
  282. package/src/getSwapInstructions.ts +0 -55
  283. package/src/index.ts +0 -192
  284. package/tsconfig.json +0 -18
@@ -0,0 +1,2671 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /* @ts-nocheck */
5
+ import { singleQuery, mutate } from '@dappql/async';
6
+ import { encodeEventTopics, parseEventLogs } from 'viem';
7
+ export const abi = [
8
+ {
9
+ "name": "NonceIncremented",
10
+ "inputs": [
11
+ {
12
+ "name": "userWallet",
13
+ "type": "address",
14
+ "indexed": false
15
+ },
16
+ {
17
+ "name": "oldNonce",
18
+ "type": "uint256",
19
+ "indexed": false
20
+ },
21
+ {
22
+ "name": "newNonce",
23
+ "type": "uint256",
24
+ "indexed": false
25
+ }
26
+ ],
27
+ "anonymous": false,
28
+ "type": "event"
29
+ },
30
+ {
31
+ "name": "OwnershipChangeInitiated",
32
+ "inputs": [
33
+ {
34
+ "name": "prevOwner",
35
+ "type": "address",
36
+ "indexed": true
37
+ },
38
+ {
39
+ "name": "newOwner",
40
+ "type": "address",
41
+ "indexed": true
42
+ },
43
+ {
44
+ "name": "confirmBlock",
45
+ "type": "uint256",
46
+ "indexed": false
47
+ }
48
+ ],
49
+ "anonymous": false,
50
+ "type": "event"
51
+ },
52
+ {
53
+ "name": "OwnershipChangeConfirmed",
54
+ "inputs": [
55
+ {
56
+ "name": "prevOwner",
57
+ "type": "address",
58
+ "indexed": true
59
+ },
60
+ {
61
+ "name": "newOwner",
62
+ "type": "address",
63
+ "indexed": true
64
+ },
65
+ {
66
+ "name": "initiatedBlock",
67
+ "type": "uint256",
68
+ "indexed": false
69
+ },
70
+ {
71
+ "name": "confirmBlock",
72
+ "type": "uint256",
73
+ "indexed": false
74
+ }
75
+ ],
76
+ "anonymous": false,
77
+ "type": "event"
78
+ },
79
+ {
80
+ "name": "OwnershipChangeCancelled",
81
+ "inputs": [
82
+ {
83
+ "name": "cancelledOwner",
84
+ "type": "address",
85
+ "indexed": true
86
+ },
87
+ {
88
+ "name": "cancelledBy",
89
+ "type": "address",
90
+ "indexed": true
91
+ },
92
+ {
93
+ "name": "initiatedBlock",
94
+ "type": "uint256",
95
+ "indexed": false
96
+ },
97
+ {
98
+ "name": "confirmBlock",
99
+ "type": "uint256",
100
+ "indexed": false
101
+ }
102
+ ],
103
+ "anonymous": false,
104
+ "type": "event"
105
+ },
106
+ {
107
+ "name": "PendingOwnershipTimeLockCancelled",
108
+ "inputs": [
109
+ {
110
+ "name": "newTimeLock",
111
+ "type": "uint256",
112
+ "indexed": false
113
+ },
114
+ {
115
+ "name": "initiatedBlock",
116
+ "type": "uint256",
117
+ "indexed": false
118
+ },
119
+ {
120
+ "name": "confirmBlock",
121
+ "type": "uint256",
122
+ "indexed": false
123
+ },
124
+ {
125
+ "name": "cancelledBy",
126
+ "type": "address",
127
+ "indexed": true
128
+ }
129
+ ],
130
+ "anonymous": false,
131
+ "type": "event"
132
+ },
133
+ {
134
+ "name": "OwnershipTimeLockSet",
135
+ "inputs": [
136
+ {
137
+ "name": "numBlocks",
138
+ "type": "uint256",
139
+ "indexed": false
140
+ }
141
+ ],
142
+ "anonymous": false,
143
+ "type": "event"
144
+ },
145
+ {
146
+ "name": "PendingOwnershipTimeLockSet",
147
+ "inputs": [
148
+ {
149
+ "name": "newTimeLock",
150
+ "type": "uint256",
151
+ "indexed": false
152
+ },
153
+ {
154
+ "name": "initiatedBlock",
155
+ "type": "uint256",
156
+ "indexed": false
157
+ },
158
+ {
159
+ "name": "confirmBlock",
160
+ "type": "uint256",
161
+ "indexed": false
162
+ },
163
+ {
164
+ "name": "currentOwner",
165
+ "type": "address",
166
+ "indexed": true
167
+ }
168
+ ],
169
+ "anonymous": false,
170
+ "type": "event"
171
+ },
172
+ {
173
+ "name": "PendingOwnershipTimeLockConfirmed",
174
+ "inputs": [
175
+ {
176
+ "name": "oldTimeLock",
177
+ "type": "uint256",
178
+ "indexed": false
179
+ },
180
+ {
181
+ "name": "newTimeLock",
182
+ "type": "uint256",
183
+ "indexed": false
184
+ },
185
+ {
186
+ "name": "initiatedBlock",
187
+ "type": "uint256",
188
+ "indexed": false
189
+ },
190
+ {
191
+ "name": "confirmBlock",
192
+ "type": "uint256",
193
+ "indexed": false
194
+ },
195
+ {
196
+ "name": "confirmedBy",
197
+ "type": "address",
198
+ "indexed": true
199
+ }
200
+ ],
201
+ "anonymous": false,
202
+ "type": "event"
203
+ },
204
+ {
205
+ "stateMutability": "nonpayable",
206
+ "type": "function",
207
+ "name": "changeOwnership",
208
+ "inputs": [
209
+ {
210
+ "name": "_newOwner",
211
+ "type": "address"
212
+ }
213
+ ],
214
+ "outputs": []
215
+ },
216
+ {
217
+ "stateMutability": "nonpayable",
218
+ "type": "function",
219
+ "name": "confirmOwnershipChange",
220
+ "inputs": [],
221
+ "outputs": []
222
+ },
223
+ {
224
+ "stateMutability": "nonpayable",
225
+ "type": "function",
226
+ "name": "cancelOwnershipChange",
227
+ "inputs": [],
228
+ "outputs": []
229
+ },
230
+ {
231
+ "stateMutability": "view",
232
+ "type": "function",
233
+ "name": "hasPendingOwnerChange",
234
+ "inputs": [],
235
+ "outputs": [
236
+ {
237
+ "name": "",
238
+ "type": "bool"
239
+ }
240
+ ]
241
+ },
242
+ {
243
+ "stateMutability": "nonpayable",
244
+ "type": "function",
245
+ "name": "setOwnershipTimeLock",
246
+ "inputs": [
247
+ {
248
+ "name": "_numBlocks",
249
+ "type": "uint256"
250
+ }
251
+ ],
252
+ "outputs": []
253
+ },
254
+ {
255
+ "stateMutability": "nonpayable",
256
+ "type": "function",
257
+ "name": "confirmPendingOwnershipTimeLock",
258
+ "inputs": [],
259
+ "outputs": []
260
+ },
261
+ {
262
+ "stateMutability": "nonpayable",
263
+ "type": "function",
264
+ "name": "cancelPendingOwnershipTimeLock",
265
+ "inputs": [],
266
+ "outputs": []
267
+ },
268
+ {
269
+ "stateMutability": "view",
270
+ "type": "function",
271
+ "name": "owner",
272
+ "inputs": [],
273
+ "outputs": [
274
+ {
275
+ "name": "",
276
+ "type": "address"
277
+ }
278
+ ]
279
+ },
280
+ {
281
+ "stateMutability": "view",
282
+ "type": "function",
283
+ "name": "ownershipTimeLock",
284
+ "inputs": [],
285
+ "outputs": [
286
+ {
287
+ "name": "",
288
+ "type": "uint256"
289
+ }
290
+ ]
291
+ },
292
+ {
293
+ "stateMutability": "view",
294
+ "type": "function",
295
+ "name": "pendingOwner",
296
+ "inputs": [],
297
+ "outputs": [
298
+ {
299
+ "name": "",
300
+ "type": "tuple",
301
+ "components": [
302
+ {
303
+ "name": "newOwner",
304
+ "type": "address"
305
+ },
306
+ {
307
+ "name": "initiatedBlock",
308
+ "type": "uint256"
309
+ },
310
+ {
311
+ "name": "confirmBlock",
312
+ "type": "uint256"
313
+ }
314
+ ]
315
+ }
316
+ ]
317
+ },
318
+ {
319
+ "stateMutability": "view",
320
+ "type": "function",
321
+ "name": "pendingOwnershipTimeLock",
322
+ "inputs": [],
323
+ "outputs": [
324
+ {
325
+ "name": "",
326
+ "type": "tuple",
327
+ "components": [
328
+ {
329
+ "name": "newTimeLock",
330
+ "type": "uint256"
331
+ },
332
+ {
333
+ "name": "initiatedBlock",
334
+ "type": "uint256"
335
+ },
336
+ {
337
+ "name": "confirmBlock",
338
+ "type": "uint256"
339
+ },
340
+ {
341
+ "name": "currentOwner",
342
+ "type": "address"
343
+ }
344
+ ]
345
+ }
346
+ ]
347
+ },
348
+ {
349
+ "stateMutability": "view",
350
+ "type": "function",
351
+ "name": "MIN_OWNERSHIP_TIMELOCK",
352
+ "inputs": [],
353
+ "outputs": [
354
+ {
355
+ "name": "",
356
+ "type": "uint256"
357
+ }
358
+ ]
359
+ },
360
+ {
361
+ "stateMutability": "view",
362
+ "type": "function",
363
+ "name": "MAX_OWNERSHIP_TIMELOCK",
364
+ "inputs": [],
365
+ "outputs": [
366
+ {
367
+ "name": "",
368
+ "type": "uint256"
369
+ }
370
+ ]
371
+ },
372
+ {
373
+ "stateMutability": "nonpayable",
374
+ "type": "function",
375
+ "name": "addCollateralAndBorrow",
376
+ "inputs": [
377
+ {
378
+ "name": "_agentWrapper",
379
+ "type": "address"
380
+ },
381
+ {
382
+ "name": "_userWallet",
383
+ "type": "address"
384
+ },
385
+ {
386
+ "name": "_debtLegoId",
387
+ "type": "uint256"
388
+ }
389
+ ],
390
+ "outputs": []
391
+ },
392
+ {
393
+ "stateMutability": "nonpayable",
394
+ "type": "function",
395
+ "name": "addCollateralAndBorrow",
396
+ "inputs": [
397
+ {
398
+ "name": "_agentWrapper",
399
+ "type": "address"
400
+ },
401
+ {
402
+ "name": "_userWallet",
403
+ "type": "address"
404
+ },
405
+ {
406
+ "name": "_debtLegoId",
407
+ "type": "uint256"
408
+ },
409
+ {
410
+ "name": "_addCollateralAssets",
411
+ "type": "tuple[]",
412
+ "components": [
413
+ {
414
+ "name": "vaultId",
415
+ "type": "uint256"
416
+ },
417
+ {
418
+ "name": "asset",
419
+ "type": "address"
420
+ },
421
+ {
422
+ "name": "amount",
423
+ "type": "uint256"
424
+ }
425
+ ]
426
+ }
427
+ ],
428
+ "outputs": []
429
+ },
430
+ {
431
+ "stateMutability": "nonpayable",
432
+ "type": "function",
433
+ "name": "addCollateralAndBorrow",
434
+ "inputs": [
435
+ {
436
+ "name": "_agentWrapper",
437
+ "type": "address"
438
+ },
439
+ {
440
+ "name": "_userWallet",
441
+ "type": "address"
442
+ },
443
+ {
444
+ "name": "_debtLegoId",
445
+ "type": "uint256"
446
+ },
447
+ {
448
+ "name": "_addCollateralAssets",
449
+ "type": "tuple[]",
450
+ "components": [
451
+ {
452
+ "name": "vaultId",
453
+ "type": "uint256"
454
+ },
455
+ {
456
+ "name": "asset",
457
+ "type": "address"
458
+ },
459
+ {
460
+ "name": "amount",
461
+ "type": "uint256"
462
+ }
463
+ ]
464
+ },
465
+ {
466
+ "name": "_greenBorrowAmount",
467
+ "type": "uint256"
468
+ }
469
+ ],
470
+ "outputs": []
471
+ },
472
+ {
473
+ "stateMutability": "nonpayable",
474
+ "type": "function",
475
+ "name": "addCollateralAndBorrow",
476
+ "inputs": [
477
+ {
478
+ "name": "_agentWrapper",
479
+ "type": "address"
480
+ },
481
+ {
482
+ "name": "_userWallet",
483
+ "type": "address"
484
+ },
485
+ {
486
+ "name": "_debtLegoId",
487
+ "type": "uint256"
488
+ },
489
+ {
490
+ "name": "_addCollateralAssets",
491
+ "type": "tuple[]",
492
+ "components": [
493
+ {
494
+ "name": "vaultId",
495
+ "type": "uint256"
496
+ },
497
+ {
498
+ "name": "asset",
499
+ "type": "address"
500
+ },
501
+ {
502
+ "name": "amount",
503
+ "type": "uint256"
504
+ }
505
+ ]
506
+ },
507
+ {
508
+ "name": "_greenBorrowAmount",
509
+ "type": "uint256"
510
+ },
511
+ {
512
+ "name": "_wantsSavingsGreen",
513
+ "type": "bool"
514
+ }
515
+ ],
516
+ "outputs": []
517
+ },
518
+ {
519
+ "stateMutability": "nonpayable",
520
+ "type": "function",
521
+ "name": "addCollateralAndBorrow",
522
+ "inputs": [
523
+ {
524
+ "name": "_agentWrapper",
525
+ "type": "address"
526
+ },
527
+ {
528
+ "name": "_userWallet",
529
+ "type": "address"
530
+ },
531
+ {
532
+ "name": "_debtLegoId",
533
+ "type": "uint256"
534
+ },
535
+ {
536
+ "name": "_addCollateralAssets",
537
+ "type": "tuple[]",
538
+ "components": [
539
+ {
540
+ "name": "vaultId",
541
+ "type": "uint256"
542
+ },
543
+ {
544
+ "name": "asset",
545
+ "type": "address"
546
+ },
547
+ {
548
+ "name": "amount",
549
+ "type": "uint256"
550
+ }
551
+ ]
552
+ },
553
+ {
554
+ "name": "_greenBorrowAmount",
555
+ "type": "uint256"
556
+ },
557
+ {
558
+ "name": "_wantsSavingsGreen",
559
+ "type": "bool"
560
+ },
561
+ {
562
+ "name": "_shouldEnterStabPool",
563
+ "type": "bool"
564
+ }
565
+ ],
566
+ "outputs": []
567
+ },
568
+ {
569
+ "stateMutability": "nonpayable",
570
+ "type": "function",
571
+ "name": "addCollateralAndBorrow",
572
+ "inputs": [
573
+ {
574
+ "name": "_agentWrapper",
575
+ "type": "address"
576
+ },
577
+ {
578
+ "name": "_userWallet",
579
+ "type": "address"
580
+ },
581
+ {
582
+ "name": "_debtLegoId",
583
+ "type": "uint256"
584
+ },
585
+ {
586
+ "name": "_addCollateralAssets",
587
+ "type": "tuple[]",
588
+ "components": [
589
+ {
590
+ "name": "vaultId",
591
+ "type": "uint256"
592
+ },
593
+ {
594
+ "name": "asset",
595
+ "type": "address"
596
+ },
597
+ {
598
+ "name": "amount",
599
+ "type": "uint256"
600
+ }
601
+ ]
602
+ },
603
+ {
604
+ "name": "_greenBorrowAmount",
605
+ "type": "uint256"
606
+ },
607
+ {
608
+ "name": "_wantsSavingsGreen",
609
+ "type": "bool"
610
+ },
611
+ {
612
+ "name": "_shouldEnterStabPool",
613
+ "type": "bool"
614
+ },
615
+ {
616
+ "name": "_swapInstructions",
617
+ "type": "tuple[]",
618
+ "components": [
619
+ {
620
+ "name": "legoId",
621
+ "type": "uint256"
622
+ },
623
+ {
624
+ "name": "amountIn",
625
+ "type": "uint256"
626
+ },
627
+ {
628
+ "name": "minAmountOut",
629
+ "type": "uint256"
630
+ },
631
+ {
632
+ "name": "tokenPath",
633
+ "type": "address[]"
634
+ },
635
+ {
636
+ "name": "poolPath",
637
+ "type": "address[]"
638
+ }
639
+ ]
640
+ }
641
+ ],
642
+ "outputs": []
643
+ },
644
+ {
645
+ "stateMutability": "nonpayable",
646
+ "type": "function",
647
+ "name": "addCollateralAndBorrow",
648
+ "inputs": [
649
+ {
650
+ "name": "_agentWrapper",
651
+ "type": "address"
652
+ },
653
+ {
654
+ "name": "_userWallet",
655
+ "type": "address"
656
+ },
657
+ {
658
+ "name": "_debtLegoId",
659
+ "type": "uint256"
660
+ },
661
+ {
662
+ "name": "_addCollateralAssets",
663
+ "type": "tuple[]",
664
+ "components": [
665
+ {
666
+ "name": "vaultId",
667
+ "type": "uint256"
668
+ },
669
+ {
670
+ "name": "asset",
671
+ "type": "address"
672
+ },
673
+ {
674
+ "name": "amount",
675
+ "type": "uint256"
676
+ }
677
+ ]
678
+ },
679
+ {
680
+ "name": "_greenBorrowAmount",
681
+ "type": "uint256"
682
+ },
683
+ {
684
+ "name": "_wantsSavingsGreen",
685
+ "type": "bool"
686
+ },
687
+ {
688
+ "name": "_shouldEnterStabPool",
689
+ "type": "bool"
690
+ },
691
+ {
692
+ "name": "_swapInstructions",
693
+ "type": "tuple[]",
694
+ "components": [
695
+ {
696
+ "name": "legoId",
697
+ "type": "uint256"
698
+ },
699
+ {
700
+ "name": "amountIn",
701
+ "type": "uint256"
702
+ },
703
+ {
704
+ "name": "minAmountOut",
705
+ "type": "uint256"
706
+ },
707
+ {
708
+ "name": "tokenPath",
709
+ "type": "address[]"
710
+ },
711
+ {
712
+ "name": "poolPath",
713
+ "type": "address[]"
714
+ }
715
+ ]
716
+ },
717
+ {
718
+ "name": "_yieldPosition",
719
+ "type": "tuple",
720
+ "components": [
721
+ {
722
+ "name": "legoId",
723
+ "type": "uint256"
724
+ },
725
+ {
726
+ "name": "asset",
727
+ "type": "address"
728
+ },
729
+ {
730
+ "name": "amount",
731
+ "type": "uint256"
732
+ },
733
+ {
734
+ "name": "vaultAddr",
735
+ "type": "address"
736
+ }
737
+ ]
738
+ }
739
+ ],
740
+ "outputs": []
741
+ },
742
+ {
743
+ "stateMutability": "nonpayable",
744
+ "type": "function",
745
+ "name": "addCollateralAndBorrow",
746
+ "inputs": [
747
+ {
748
+ "name": "_agentWrapper",
749
+ "type": "address"
750
+ },
751
+ {
752
+ "name": "_userWallet",
753
+ "type": "address"
754
+ },
755
+ {
756
+ "name": "_debtLegoId",
757
+ "type": "uint256"
758
+ },
759
+ {
760
+ "name": "_addCollateralAssets",
761
+ "type": "tuple[]",
762
+ "components": [
763
+ {
764
+ "name": "vaultId",
765
+ "type": "uint256"
766
+ },
767
+ {
768
+ "name": "asset",
769
+ "type": "address"
770
+ },
771
+ {
772
+ "name": "amount",
773
+ "type": "uint256"
774
+ }
775
+ ]
776
+ },
777
+ {
778
+ "name": "_greenBorrowAmount",
779
+ "type": "uint256"
780
+ },
781
+ {
782
+ "name": "_wantsSavingsGreen",
783
+ "type": "bool"
784
+ },
785
+ {
786
+ "name": "_shouldEnterStabPool",
787
+ "type": "bool"
788
+ },
789
+ {
790
+ "name": "_swapInstructions",
791
+ "type": "tuple[]",
792
+ "components": [
793
+ {
794
+ "name": "legoId",
795
+ "type": "uint256"
796
+ },
797
+ {
798
+ "name": "amountIn",
799
+ "type": "uint256"
800
+ },
801
+ {
802
+ "name": "minAmountOut",
803
+ "type": "uint256"
804
+ },
805
+ {
806
+ "name": "tokenPath",
807
+ "type": "address[]"
808
+ },
809
+ {
810
+ "name": "poolPath",
811
+ "type": "address[]"
812
+ }
813
+ ]
814
+ },
815
+ {
816
+ "name": "_yieldPosition",
817
+ "type": "tuple",
818
+ "components": [
819
+ {
820
+ "name": "legoId",
821
+ "type": "uint256"
822
+ },
823
+ {
824
+ "name": "asset",
825
+ "type": "address"
826
+ },
827
+ {
828
+ "name": "amount",
829
+ "type": "uint256"
830
+ },
831
+ {
832
+ "name": "vaultAddr",
833
+ "type": "address"
834
+ }
835
+ ]
836
+ },
837
+ {
838
+ "name": "_sig",
839
+ "type": "tuple",
840
+ "components": [
841
+ {
842
+ "name": "signature",
843
+ "type": "bytes"
844
+ },
845
+ {
846
+ "name": "nonce",
847
+ "type": "uint256"
848
+ },
849
+ {
850
+ "name": "expiration",
851
+ "type": "uint256"
852
+ }
853
+ ]
854
+ }
855
+ ],
856
+ "outputs": []
857
+ },
858
+ {
859
+ "stateMutability": "nonpayable",
860
+ "type": "function",
861
+ "name": "repayAndWithdraw",
862
+ "inputs": [
863
+ {
864
+ "name": "_agentWrapper",
865
+ "type": "address"
866
+ },
867
+ {
868
+ "name": "_userWallet",
869
+ "type": "address"
870
+ },
871
+ {
872
+ "name": "_debtLegoId",
873
+ "type": "uint256"
874
+ }
875
+ ],
876
+ "outputs": []
877
+ },
878
+ {
879
+ "stateMutability": "nonpayable",
880
+ "type": "function",
881
+ "name": "repayAndWithdraw",
882
+ "inputs": [
883
+ {
884
+ "name": "_agentWrapper",
885
+ "type": "address"
886
+ },
887
+ {
888
+ "name": "_userWallet",
889
+ "type": "address"
890
+ },
891
+ {
892
+ "name": "_debtLegoId",
893
+ "type": "uint256"
894
+ },
895
+ {
896
+ "name": "_deleverageAssets",
897
+ "type": "tuple[]",
898
+ "components": [
899
+ {
900
+ "name": "vaultId",
901
+ "type": "uint256"
902
+ },
903
+ {
904
+ "name": "asset",
905
+ "type": "address"
906
+ },
907
+ {
908
+ "name": "targetRepayAmount",
909
+ "type": "uint256"
910
+ }
911
+ ]
912
+ }
913
+ ],
914
+ "outputs": []
915
+ },
916
+ {
917
+ "stateMutability": "nonpayable",
918
+ "type": "function",
919
+ "name": "repayAndWithdraw",
920
+ "inputs": [
921
+ {
922
+ "name": "_agentWrapper",
923
+ "type": "address"
924
+ },
925
+ {
926
+ "name": "_userWallet",
927
+ "type": "address"
928
+ },
929
+ {
930
+ "name": "_debtLegoId",
931
+ "type": "uint256"
932
+ },
933
+ {
934
+ "name": "_deleverageAssets",
935
+ "type": "tuple[]",
936
+ "components": [
937
+ {
938
+ "name": "vaultId",
939
+ "type": "uint256"
940
+ },
941
+ {
942
+ "name": "asset",
943
+ "type": "address"
944
+ },
945
+ {
946
+ "name": "targetRepayAmount",
947
+ "type": "uint256"
948
+ }
949
+ ]
950
+ },
951
+ {
952
+ "name": "_yieldPosition",
953
+ "type": "tuple",
954
+ "components": [
955
+ {
956
+ "name": "legoId",
957
+ "type": "uint256"
958
+ },
959
+ {
960
+ "name": "vaultToken",
961
+ "type": "address"
962
+ },
963
+ {
964
+ "name": "vaultTokenAmount",
965
+ "type": "uint256"
966
+ }
967
+ ]
968
+ }
969
+ ],
970
+ "outputs": []
971
+ },
972
+ {
973
+ "stateMutability": "nonpayable",
974
+ "type": "function",
975
+ "name": "repayAndWithdraw",
976
+ "inputs": [
977
+ {
978
+ "name": "_agentWrapper",
979
+ "type": "address"
980
+ },
981
+ {
982
+ "name": "_userWallet",
983
+ "type": "address"
984
+ },
985
+ {
986
+ "name": "_debtLegoId",
987
+ "type": "uint256"
988
+ },
989
+ {
990
+ "name": "_deleverageAssets",
991
+ "type": "tuple[]",
992
+ "components": [
993
+ {
994
+ "name": "vaultId",
995
+ "type": "uint256"
996
+ },
997
+ {
998
+ "name": "asset",
999
+ "type": "address"
1000
+ },
1001
+ {
1002
+ "name": "targetRepayAmount",
1003
+ "type": "uint256"
1004
+ }
1005
+ ]
1006
+ },
1007
+ {
1008
+ "name": "_yieldPosition",
1009
+ "type": "tuple",
1010
+ "components": [
1011
+ {
1012
+ "name": "legoId",
1013
+ "type": "uint256"
1014
+ },
1015
+ {
1016
+ "name": "vaultToken",
1017
+ "type": "address"
1018
+ },
1019
+ {
1020
+ "name": "vaultTokenAmount",
1021
+ "type": "uint256"
1022
+ }
1023
+ ]
1024
+ },
1025
+ {
1026
+ "name": "_swapInstructions",
1027
+ "type": "tuple[]",
1028
+ "components": [
1029
+ {
1030
+ "name": "legoId",
1031
+ "type": "uint256"
1032
+ },
1033
+ {
1034
+ "name": "amountIn",
1035
+ "type": "uint256"
1036
+ },
1037
+ {
1038
+ "name": "minAmountOut",
1039
+ "type": "uint256"
1040
+ },
1041
+ {
1042
+ "name": "tokenPath",
1043
+ "type": "address[]"
1044
+ },
1045
+ {
1046
+ "name": "poolPath",
1047
+ "type": "address[]"
1048
+ }
1049
+ ]
1050
+ }
1051
+ ],
1052
+ "outputs": []
1053
+ },
1054
+ {
1055
+ "stateMutability": "nonpayable",
1056
+ "type": "function",
1057
+ "name": "repayAndWithdraw",
1058
+ "inputs": [
1059
+ {
1060
+ "name": "_agentWrapper",
1061
+ "type": "address"
1062
+ },
1063
+ {
1064
+ "name": "_userWallet",
1065
+ "type": "address"
1066
+ },
1067
+ {
1068
+ "name": "_debtLegoId",
1069
+ "type": "uint256"
1070
+ },
1071
+ {
1072
+ "name": "_deleverageAssets",
1073
+ "type": "tuple[]",
1074
+ "components": [
1075
+ {
1076
+ "name": "vaultId",
1077
+ "type": "uint256"
1078
+ },
1079
+ {
1080
+ "name": "asset",
1081
+ "type": "address"
1082
+ },
1083
+ {
1084
+ "name": "targetRepayAmount",
1085
+ "type": "uint256"
1086
+ }
1087
+ ]
1088
+ },
1089
+ {
1090
+ "name": "_yieldPosition",
1091
+ "type": "tuple",
1092
+ "components": [
1093
+ {
1094
+ "name": "legoId",
1095
+ "type": "uint256"
1096
+ },
1097
+ {
1098
+ "name": "vaultToken",
1099
+ "type": "address"
1100
+ },
1101
+ {
1102
+ "name": "vaultTokenAmount",
1103
+ "type": "uint256"
1104
+ }
1105
+ ]
1106
+ },
1107
+ {
1108
+ "name": "_swapInstructions",
1109
+ "type": "tuple[]",
1110
+ "components": [
1111
+ {
1112
+ "name": "legoId",
1113
+ "type": "uint256"
1114
+ },
1115
+ {
1116
+ "name": "amountIn",
1117
+ "type": "uint256"
1118
+ },
1119
+ {
1120
+ "name": "minAmountOut",
1121
+ "type": "uint256"
1122
+ },
1123
+ {
1124
+ "name": "tokenPath",
1125
+ "type": "address[]"
1126
+ },
1127
+ {
1128
+ "name": "poolPath",
1129
+ "type": "address[]"
1130
+ }
1131
+ ]
1132
+ },
1133
+ {
1134
+ "name": "_repayAsset",
1135
+ "type": "address"
1136
+ }
1137
+ ],
1138
+ "outputs": []
1139
+ },
1140
+ {
1141
+ "stateMutability": "nonpayable",
1142
+ "type": "function",
1143
+ "name": "repayAndWithdraw",
1144
+ "inputs": [
1145
+ {
1146
+ "name": "_agentWrapper",
1147
+ "type": "address"
1148
+ },
1149
+ {
1150
+ "name": "_userWallet",
1151
+ "type": "address"
1152
+ },
1153
+ {
1154
+ "name": "_debtLegoId",
1155
+ "type": "uint256"
1156
+ },
1157
+ {
1158
+ "name": "_deleverageAssets",
1159
+ "type": "tuple[]",
1160
+ "components": [
1161
+ {
1162
+ "name": "vaultId",
1163
+ "type": "uint256"
1164
+ },
1165
+ {
1166
+ "name": "asset",
1167
+ "type": "address"
1168
+ },
1169
+ {
1170
+ "name": "targetRepayAmount",
1171
+ "type": "uint256"
1172
+ }
1173
+ ]
1174
+ },
1175
+ {
1176
+ "name": "_yieldPosition",
1177
+ "type": "tuple",
1178
+ "components": [
1179
+ {
1180
+ "name": "legoId",
1181
+ "type": "uint256"
1182
+ },
1183
+ {
1184
+ "name": "vaultToken",
1185
+ "type": "address"
1186
+ },
1187
+ {
1188
+ "name": "vaultTokenAmount",
1189
+ "type": "uint256"
1190
+ }
1191
+ ]
1192
+ },
1193
+ {
1194
+ "name": "_swapInstructions",
1195
+ "type": "tuple[]",
1196
+ "components": [
1197
+ {
1198
+ "name": "legoId",
1199
+ "type": "uint256"
1200
+ },
1201
+ {
1202
+ "name": "amountIn",
1203
+ "type": "uint256"
1204
+ },
1205
+ {
1206
+ "name": "minAmountOut",
1207
+ "type": "uint256"
1208
+ },
1209
+ {
1210
+ "name": "tokenPath",
1211
+ "type": "address[]"
1212
+ },
1213
+ {
1214
+ "name": "poolPath",
1215
+ "type": "address[]"
1216
+ }
1217
+ ]
1218
+ },
1219
+ {
1220
+ "name": "_repayAsset",
1221
+ "type": "address"
1222
+ },
1223
+ {
1224
+ "name": "_repayAmount",
1225
+ "type": "uint256"
1226
+ }
1227
+ ],
1228
+ "outputs": []
1229
+ },
1230
+ {
1231
+ "stateMutability": "nonpayable",
1232
+ "type": "function",
1233
+ "name": "repayAndWithdraw",
1234
+ "inputs": [
1235
+ {
1236
+ "name": "_agentWrapper",
1237
+ "type": "address"
1238
+ },
1239
+ {
1240
+ "name": "_userWallet",
1241
+ "type": "address"
1242
+ },
1243
+ {
1244
+ "name": "_debtLegoId",
1245
+ "type": "uint256"
1246
+ },
1247
+ {
1248
+ "name": "_deleverageAssets",
1249
+ "type": "tuple[]",
1250
+ "components": [
1251
+ {
1252
+ "name": "vaultId",
1253
+ "type": "uint256"
1254
+ },
1255
+ {
1256
+ "name": "asset",
1257
+ "type": "address"
1258
+ },
1259
+ {
1260
+ "name": "targetRepayAmount",
1261
+ "type": "uint256"
1262
+ }
1263
+ ]
1264
+ },
1265
+ {
1266
+ "name": "_yieldPosition",
1267
+ "type": "tuple",
1268
+ "components": [
1269
+ {
1270
+ "name": "legoId",
1271
+ "type": "uint256"
1272
+ },
1273
+ {
1274
+ "name": "vaultToken",
1275
+ "type": "address"
1276
+ },
1277
+ {
1278
+ "name": "vaultTokenAmount",
1279
+ "type": "uint256"
1280
+ }
1281
+ ]
1282
+ },
1283
+ {
1284
+ "name": "_swapInstructions",
1285
+ "type": "tuple[]",
1286
+ "components": [
1287
+ {
1288
+ "name": "legoId",
1289
+ "type": "uint256"
1290
+ },
1291
+ {
1292
+ "name": "amountIn",
1293
+ "type": "uint256"
1294
+ },
1295
+ {
1296
+ "name": "minAmountOut",
1297
+ "type": "uint256"
1298
+ },
1299
+ {
1300
+ "name": "tokenPath",
1301
+ "type": "address[]"
1302
+ },
1303
+ {
1304
+ "name": "poolPath",
1305
+ "type": "address[]"
1306
+ }
1307
+ ]
1308
+ },
1309
+ {
1310
+ "name": "_repayAsset",
1311
+ "type": "address"
1312
+ },
1313
+ {
1314
+ "name": "_repayAmount",
1315
+ "type": "uint256"
1316
+ },
1317
+ {
1318
+ "name": "_removeCollateralAssets",
1319
+ "type": "tuple[]",
1320
+ "components": [
1321
+ {
1322
+ "name": "vaultId",
1323
+ "type": "uint256"
1324
+ },
1325
+ {
1326
+ "name": "asset",
1327
+ "type": "address"
1328
+ },
1329
+ {
1330
+ "name": "amount",
1331
+ "type": "uint256"
1332
+ }
1333
+ ]
1334
+ }
1335
+ ],
1336
+ "outputs": []
1337
+ },
1338
+ {
1339
+ "stateMutability": "nonpayable",
1340
+ "type": "function",
1341
+ "name": "repayAndWithdraw",
1342
+ "inputs": [
1343
+ {
1344
+ "name": "_agentWrapper",
1345
+ "type": "address"
1346
+ },
1347
+ {
1348
+ "name": "_userWallet",
1349
+ "type": "address"
1350
+ },
1351
+ {
1352
+ "name": "_debtLegoId",
1353
+ "type": "uint256"
1354
+ },
1355
+ {
1356
+ "name": "_deleverageAssets",
1357
+ "type": "tuple[]",
1358
+ "components": [
1359
+ {
1360
+ "name": "vaultId",
1361
+ "type": "uint256"
1362
+ },
1363
+ {
1364
+ "name": "asset",
1365
+ "type": "address"
1366
+ },
1367
+ {
1368
+ "name": "targetRepayAmount",
1369
+ "type": "uint256"
1370
+ }
1371
+ ]
1372
+ },
1373
+ {
1374
+ "name": "_yieldPosition",
1375
+ "type": "tuple",
1376
+ "components": [
1377
+ {
1378
+ "name": "legoId",
1379
+ "type": "uint256"
1380
+ },
1381
+ {
1382
+ "name": "vaultToken",
1383
+ "type": "address"
1384
+ },
1385
+ {
1386
+ "name": "vaultTokenAmount",
1387
+ "type": "uint256"
1388
+ }
1389
+ ]
1390
+ },
1391
+ {
1392
+ "name": "_swapInstructions",
1393
+ "type": "tuple[]",
1394
+ "components": [
1395
+ {
1396
+ "name": "legoId",
1397
+ "type": "uint256"
1398
+ },
1399
+ {
1400
+ "name": "amountIn",
1401
+ "type": "uint256"
1402
+ },
1403
+ {
1404
+ "name": "minAmountOut",
1405
+ "type": "uint256"
1406
+ },
1407
+ {
1408
+ "name": "tokenPath",
1409
+ "type": "address[]"
1410
+ },
1411
+ {
1412
+ "name": "poolPath",
1413
+ "type": "address[]"
1414
+ }
1415
+ ]
1416
+ },
1417
+ {
1418
+ "name": "_repayAsset",
1419
+ "type": "address"
1420
+ },
1421
+ {
1422
+ "name": "_repayAmount",
1423
+ "type": "uint256"
1424
+ },
1425
+ {
1426
+ "name": "_removeCollateralAssets",
1427
+ "type": "tuple[]",
1428
+ "components": [
1429
+ {
1430
+ "name": "vaultId",
1431
+ "type": "uint256"
1432
+ },
1433
+ {
1434
+ "name": "asset",
1435
+ "type": "address"
1436
+ },
1437
+ {
1438
+ "name": "amount",
1439
+ "type": "uint256"
1440
+ }
1441
+ ]
1442
+ },
1443
+ {
1444
+ "name": "_sig",
1445
+ "type": "tuple",
1446
+ "components": [
1447
+ {
1448
+ "name": "signature",
1449
+ "type": "bytes"
1450
+ },
1451
+ {
1452
+ "name": "nonce",
1453
+ "type": "uint256"
1454
+ },
1455
+ {
1456
+ "name": "expiration",
1457
+ "type": "uint256"
1458
+ }
1459
+ ]
1460
+ }
1461
+ ],
1462
+ "outputs": []
1463
+ },
1464
+ {
1465
+ "stateMutability": "nonpayable",
1466
+ "type": "function",
1467
+ "name": "rebalanceYieldPositionsWithSwap",
1468
+ "inputs": [
1469
+ {
1470
+ "name": "_agentWrapper",
1471
+ "type": "address"
1472
+ },
1473
+ {
1474
+ "name": "_userWallet",
1475
+ "type": "address"
1476
+ }
1477
+ ],
1478
+ "outputs": []
1479
+ },
1480
+ {
1481
+ "stateMutability": "nonpayable",
1482
+ "type": "function",
1483
+ "name": "rebalanceYieldPositionsWithSwap",
1484
+ "inputs": [
1485
+ {
1486
+ "name": "_agentWrapper",
1487
+ "type": "address"
1488
+ },
1489
+ {
1490
+ "name": "_userWallet",
1491
+ "type": "address"
1492
+ },
1493
+ {
1494
+ "name": "_withdrawFrom",
1495
+ "type": "tuple[]",
1496
+ "components": [
1497
+ {
1498
+ "name": "legoId",
1499
+ "type": "uint256"
1500
+ },
1501
+ {
1502
+ "name": "vaultToken",
1503
+ "type": "address"
1504
+ },
1505
+ {
1506
+ "name": "vaultTokenAmount",
1507
+ "type": "uint256"
1508
+ }
1509
+ ]
1510
+ }
1511
+ ],
1512
+ "outputs": []
1513
+ },
1514
+ {
1515
+ "stateMutability": "nonpayable",
1516
+ "type": "function",
1517
+ "name": "rebalanceYieldPositionsWithSwap",
1518
+ "inputs": [
1519
+ {
1520
+ "name": "_agentWrapper",
1521
+ "type": "address"
1522
+ },
1523
+ {
1524
+ "name": "_userWallet",
1525
+ "type": "address"
1526
+ },
1527
+ {
1528
+ "name": "_withdrawFrom",
1529
+ "type": "tuple[]",
1530
+ "components": [
1531
+ {
1532
+ "name": "legoId",
1533
+ "type": "uint256"
1534
+ },
1535
+ {
1536
+ "name": "vaultToken",
1537
+ "type": "address"
1538
+ },
1539
+ {
1540
+ "name": "vaultTokenAmount",
1541
+ "type": "uint256"
1542
+ }
1543
+ ]
1544
+ },
1545
+ {
1546
+ "name": "_swapInstructions",
1547
+ "type": "tuple[]",
1548
+ "components": [
1549
+ {
1550
+ "name": "legoId",
1551
+ "type": "uint256"
1552
+ },
1553
+ {
1554
+ "name": "amountIn",
1555
+ "type": "uint256"
1556
+ },
1557
+ {
1558
+ "name": "minAmountOut",
1559
+ "type": "uint256"
1560
+ },
1561
+ {
1562
+ "name": "tokenPath",
1563
+ "type": "address[]"
1564
+ },
1565
+ {
1566
+ "name": "poolPath",
1567
+ "type": "address[]"
1568
+ }
1569
+ ]
1570
+ }
1571
+ ],
1572
+ "outputs": []
1573
+ },
1574
+ {
1575
+ "stateMutability": "nonpayable",
1576
+ "type": "function",
1577
+ "name": "rebalanceYieldPositionsWithSwap",
1578
+ "inputs": [
1579
+ {
1580
+ "name": "_agentWrapper",
1581
+ "type": "address"
1582
+ },
1583
+ {
1584
+ "name": "_userWallet",
1585
+ "type": "address"
1586
+ },
1587
+ {
1588
+ "name": "_withdrawFrom",
1589
+ "type": "tuple[]",
1590
+ "components": [
1591
+ {
1592
+ "name": "legoId",
1593
+ "type": "uint256"
1594
+ },
1595
+ {
1596
+ "name": "vaultToken",
1597
+ "type": "address"
1598
+ },
1599
+ {
1600
+ "name": "vaultTokenAmount",
1601
+ "type": "uint256"
1602
+ }
1603
+ ]
1604
+ },
1605
+ {
1606
+ "name": "_swapInstructions",
1607
+ "type": "tuple[]",
1608
+ "components": [
1609
+ {
1610
+ "name": "legoId",
1611
+ "type": "uint256"
1612
+ },
1613
+ {
1614
+ "name": "amountIn",
1615
+ "type": "uint256"
1616
+ },
1617
+ {
1618
+ "name": "minAmountOut",
1619
+ "type": "uint256"
1620
+ },
1621
+ {
1622
+ "name": "tokenPath",
1623
+ "type": "address[]"
1624
+ },
1625
+ {
1626
+ "name": "poolPath",
1627
+ "type": "address[]"
1628
+ }
1629
+ ]
1630
+ },
1631
+ {
1632
+ "name": "_depositTo",
1633
+ "type": "tuple[]",
1634
+ "components": [
1635
+ {
1636
+ "name": "legoId",
1637
+ "type": "uint256"
1638
+ },
1639
+ {
1640
+ "name": "asset",
1641
+ "type": "address"
1642
+ },
1643
+ {
1644
+ "name": "amount",
1645
+ "type": "uint256"
1646
+ },
1647
+ {
1648
+ "name": "vaultAddr",
1649
+ "type": "address"
1650
+ }
1651
+ ]
1652
+ }
1653
+ ],
1654
+ "outputs": []
1655
+ },
1656
+ {
1657
+ "stateMutability": "nonpayable",
1658
+ "type": "function",
1659
+ "name": "rebalanceYieldPositionsWithSwap",
1660
+ "inputs": [
1661
+ {
1662
+ "name": "_agentWrapper",
1663
+ "type": "address"
1664
+ },
1665
+ {
1666
+ "name": "_userWallet",
1667
+ "type": "address"
1668
+ },
1669
+ {
1670
+ "name": "_withdrawFrom",
1671
+ "type": "tuple[]",
1672
+ "components": [
1673
+ {
1674
+ "name": "legoId",
1675
+ "type": "uint256"
1676
+ },
1677
+ {
1678
+ "name": "vaultToken",
1679
+ "type": "address"
1680
+ },
1681
+ {
1682
+ "name": "vaultTokenAmount",
1683
+ "type": "uint256"
1684
+ }
1685
+ ]
1686
+ },
1687
+ {
1688
+ "name": "_swapInstructions",
1689
+ "type": "tuple[]",
1690
+ "components": [
1691
+ {
1692
+ "name": "legoId",
1693
+ "type": "uint256"
1694
+ },
1695
+ {
1696
+ "name": "amountIn",
1697
+ "type": "uint256"
1698
+ },
1699
+ {
1700
+ "name": "minAmountOut",
1701
+ "type": "uint256"
1702
+ },
1703
+ {
1704
+ "name": "tokenPath",
1705
+ "type": "address[]"
1706
+ },
1707
+ {
1708
+ "name": "poolPath",
1709
+ "type": "address[]"
1710
+ }
1711
+ ]
1712
+ },
1713
+ {
1714
+ "name": "_depositTo",
1715
+ "type": "tuple[]",
1716
+ "components": [
1717
+ {
1718
+ "name": "legoId",
1719
+ "type": "uint256"
1720
+ },
1721
+ {
1722
+ "name": "asset",
1723
+ "type": "address"
1724
+ },
1725
+ {
1726
+ "name": "amount",
1727
+ "type": "uint256"
1728
+ },
1729
+ {
1730
+ "name": "vaultAddr",
1731
+ "type": "address"
1732
+ }
1733
+ ]
1734
+ },
1735
+ {
1736
+ "name": "_transferTo",
1737
+ "type": "tuple[]",
1738
+ "components": [
1739
+ {
1740
+ "name": "asset",
1741
+ "type": "address"
1742
+ },
1743
+ {
1744
+ "name": "amount",
1745
+ "type": "uint256"
1746
+ },
1747
+ {
1748
+ "name": "recipient",
1749
+ "type": "address"
1750
+ }
1751
+ ]
1752
+ }
1753
+ ],
1754
+ "outputs": []
1755
+ },
1756
+ {
1757
+ "stateMutability": "nonpayable",
1758
+ "type": "function",
1759
+ "name": "rebalanceYieldPositionsWithSwap",
1760
+ "inputs": [
1761
+ {
1762
+ "name": "_agentWrapper",
1763
+ "type": "address"
1764
+ },
1765
+ {
1766
+ "name": "_userWallet",
1767
+ "type": "address"
1768
+ },
1769
+ {
1770
+ "name": "_withdrawFrom",
1771
+ "type": "tuple[]",
1772
+ "components": [
1773
+ {
1774
+ "name": "legoId",
1775
+ "type": "uint256"
1776
+ },
1777
+ {
1778
+ "name": "vaultToken",
1779
+ "type": "address"
1780
+ },
1781
+ {
1782
+ "name": "vaultTokenAmount",
1783
+ "type": "uint256"
1784
+ }
1785
+ ]
1786
+ },
1787
+ {
1788
+ "name": "_swapInstructions",
1789
+ "type": "tuple[]",
1790
+ "components": [
1791
+ {
1792
+ "name": "legoId",
1793
+ "type": "uint256"
1794
+ },
1795
+ {
1796
+ "name": "amountIn",
1797
+ "type": "uint256"
1798
+ },
1799
+ {
1800
+ "name": "minAmountOut",
1801
+ "type": "uint256"
1802
+ },
1803
+ {
1804
+ "name": "tokenPath",
1805
+ "type": "address[]"
1806
+ },
1807
+ {
1808
+ "name": "poolPath",
1809
+ "type": "address[]"
1810
+ }
1811
+ ]
1812
+ },
1813
+ {
1814
+ "name": "_depositTo",
1815
+ "type": "tuple[]",
1816
+ "components": [
1817
+ {
1818
+ "name": "legoId",
1819
+ "type": "uint256"
1820
+ },
1821
+ {
1822
+ "name": "asset",
1823
+ "type": "address"
1824
+ },
1825
+ {
1826
+ "name": "amount",
1827
+ "type": "uint256"
1828
+ },
1829
+ {
1830
+ "name": "vaultAddr",
1831
+ "type": "address"
1832
+ }
1833
+ ]
1834
+ },
1835
+ {
1836
+ "name": "_transferTo",
1837
+ "type": "tuple[]",
1838
+ "components": [
1839
+ {
1840
+ "name": "asset",
1841
+ "type": "address"
1842
+ },
1843
+ {
1844
+ "name": "amount",
1845
+ "type": "uint256"
1846
+ },
1847
+ {
1848
+ "name": "recipient",
1849
+ "type": "address"
1850
+ }
1851
+ ]
1852
+ },
1853
+ {
1854
+ "name": "_sig",
1855
+ "type": "tuple",
1856
+ "components": [
1857
+ {
1858
+ "name": "signature",
1859
+ "type": "bytes"
1860
+ },
1861
+ {
1862
+ "name": "nonce",
1863
+ "type": "uint256"
1864
+ },
1865
+ {
1866
+ "name": "expiration",
1867
+ "type": "uint256"
1868
+ }
1869
+ ]
1870
+ }
1871
+ ],
1872
+ "outputs": []
1873
+ },
1874
+ {
1875
+ "stateMutability": "nonpayable",
1876
+ "type": "function",
1877
+ "name": "claimIncentivesAndSwap",
1878
+ "inputs": [
1879
+ {
1880
+ "name": "_agentWrapper",
1881
+ "type": "address"
1882
+ },
1883
+ {
1884
+ "name": "_userWallet",
1885
+ "type": "address"
1886
+ }
1887
+ ],
1888
+ "outputs": []
1889
+ },
1890
+ {
1891
+ "stateMutability": "nonpayable",
1892
+ "type": "function",
1893
+ "name": "claimIncentivesAndSwap",
1894
+ "inputs": [
1895
+ {
1896
+ "name": "_agentWrapper",
1897
+ "type": "address"
1898
+ },
1899
+ {
1900
+ "name": "_userWallet",
1901
+ "type": "address"
1902
+ },
1903
+ {
1904
+ "name": "_rewardLegoId",
1905
+ "type": "uint256"
1906
+ }
1907
+ ],
1908
+ "outputs": []
1909
+ },
1910
+ {
1911
+ "stateMutability": "nonpayable",
1912
+ "type": "function",
1913
+ "name": "claimIncentivesAndSwap",
1914
+ "inputs": [
1915
+ {
1916
+ "name": "_agentWrapper",
1917
+ "type": "address"
1918
+ },
1919
+ {
1920
+ "name": "_userWallet",
1921
+ "type": "address"
1922
+ },
1923
+ {
1924
+ "name": "_rewardLegoId",
1925
+ "type": "uint256"
1926
+ },
1927
+ {
1928
+ "name": "_rewardToken",
1929
+ "type": "address"
1930
+ }
1931
+ ],
1932
+ "outputs": []
1933
+ },
1934
+ {
1935
+ "stateMutability": "nonpayable",
1936
+ "type": "function",
1937
+ "name": "claimIncentivesAndSwap",
1938
+ "inputs": [
1939
+ {
1940
+ "name": "_agentWrapper",
1941
+ "type": "address"
1942
+ },
1943
+ {
1944
+ "name": "_userWallet",
1945
+ "type": "address"
1946
+ },
1947
+ {
1948
+ "name": "_rewardLegoId",
1949
+ "type": "uint256"
1950
+ },
1951
+ {
1952
+ "name": "_rewardToken",
1953
+ "type": "address"
1954
+ },
1955
+ {
1956
+ "name": "_rewardAmount",
1957
+ "type": "uint256"
1958
+ }
1959
+ ],
1960
+ "outputs": []
1961
+ },
1962
+ {
1963
+ "stateMutability": "nonpayable",
1964
+ "type": "function",
1965
+ "name": "claimIncentivesAndSwap",
1966
+ "inputs": [
1967
+ {
1968
+ "name": "_agentWrapper",
1969
+ "type": "address"
1970
+ },
1971
+ {
1972
+ "name": "_userWallet",
1973
+ "type": "address"
1974
+ },
1975
+ {
1976
+ "name": "_rewardLegoId",
1977
+ "type": "uint256"
1978
+ },
1979
+ {
1980
+ "name": "_rewardToken",
1981
+ "type": "address"
1982
+ },
1983
+ {
1984
+ "name": "_rewardAmount",
1985
+ "type": "uint256"
1986
+ },
1987
+ {
1988
+ "name": "_rewardProofs",
1989
+ "type": "bytes32[]"
1990
+ }
1991
+ ],
1992
+ "outputs": []
1993
+ },
1994
+ {
1995
+ "stateMutability": "nonpayable",
1996
+ "type": "function",
1997
+ "name": "claimIncentivesAndSwap",
1998
+ "inputs": [
1999
+ {
2000
+ "name": "_agentWrapper",
2001
+ "type": "address"
2002
+ },
2003
+ {
2004
+ "name": "_userWallet",
2005
+ "type": "address"
2006
+ },
2007
+ {
2008
+ "name": "_rewardLegoId",
2009
+ "type": "uint256"
2010
+ },
2011
+ {
2012
+ "name": "_rewardToken",
2013
+ "type": "address"
2014
+ },
2015
+ {
2016
+ "name": "_rewardAmount",
2017
+ "type": "uint256"
2018
+ },
2019
+ {
2020
+ "name": "_rewardProofs",
2021
+ "type": "bytes32[]"
2022
+ },
2023
+ {
2024
+ "name": "_swapInstructions",
2025
+ "type": "tuple[]",
2026
+ "components": [
2027
+ {
2028
+ "name": "legoId",
2029
+ "type": "uint256"
2030
+ },
2031
+ {
2032
+ "name": "amountIn",
2033
+ "type": "uint256"
2034
+ },
2035
+ {
2036
+ "name": "minAmountOut",
2037
+ "type": "uint256"
2038
+ },
2039
+ {
2040
+ "name": "tokenPath",
2041
+ "type": "address[]"
2042
+ },
2043
+ {
2044
+ "name": "poolPath",
2045
+ "type": "address[]"
2046
+ }
2047
+ ]
2048
+ }
2049
+ ],
2050
+ "outputs": []
2051
+ },
2052
+ {
2053
+ "stateMutability": "nonpayable",
2054
+ "type": "function",
2055
+ "name": "claimIncentivesAndSwap",
2056
+ "inputs": [
2057
+ {
2058
+ "name": "_agentWrapper",
2059
+ "type": "address"
2060
+ },
2061
+ {
2062
+ "name": "_userWallet",
2063
+ "type": "address"
2064
+ },
2065
+ {
2066
+ "name": "_rewardLegoId",
2067
+ "type": "uint256"
2068
+ },
2069
+ {
2070
+ "name": "_rewardToken",
2071
+ "type": "address"
2072
+ },
2073
+ {
2074
+ "name": "_rewardAmount",
2075
+ "type": "uint256"
2076
+ },
2077
+ {
2078
+ "name": "_rewardProofs",
2079
+ "type": "bytes32[]"
2080
+ },
2081
+ {
2082
+ "name": "_swapInstructions",
2083
+ "type": "tuple[]",
2084
+ "components": [
2085
+ {
2086
+ "name": "legoId",
2087
+ "type": "uint256"
2088
+ },
2089
+ {
2090
+ "name": "amountIn",
2091
+ "type": "uint256"
2092
+ },
2093
+ {
2094
+ "name": "minAmountOut",
2095
+ "type": "uint256"
2096
+ },
2097
+ {
2098
+ "name": "tokenPath",
2099
+ "type": "address[]"
2100
+ },
2101
+ {
2102
+ "name": "poolPath",
2103
+ "type": "address[]"
2104
+ }
2105
+ ]
2106
+ },
2107
+ {
2108
+ "name": "_depositTo",
2109
+ "type": "tuple[]",
2110
+ "components": [
2111
+ {
2112
+ "name": "legoId",
2113
+ "type": "uint256"
2114
+ },
2115
+ {
2116
+ "name": "asset",
2117
+ "type": "address"
2118
+ },
2119
+ {
2120
+ "name": "amount",
2121
+ "type": "uint256"
2122
+ },
2123
+ {
2124
+ "name": "vaultAddr",
2125
+ "type": "address"
2126
+ }
2127
+ ]
2128
+ }
2129
+ ],
2130
+ "outputs": []
2131
+ },
2132
+ {
2133
+ "stateMutability": "nonpayable",
2134
+ "type": "function",
2135
+ "name": "claimIncentivesAndSwap",
2136
+ "inputs": [
2137
+ {
2138
+ "name": "_agentWrapper",
2139
+ "type": "address"
2140
+ },
2141
+ {
2142
+ "name": "_userWallet",
2143
+ "type": "address"
2144
+ },
2145
+ {
2146
+ "name": "_rewardLegoId",
2147
+ "type": "uint256"
2148
+ },
2149
+ {
2150
+ "name": "_rewardToken",
2151
+ "type": "address"
2152
+ },
2153
+ {
2154
+ "name": "_rewardAmount",
2155
+ "type": "uint256"
2156
+ },
2157
+ {
2158
+ "name": "_rewardProofs",
2159
+ "type": "bytes32[]"
2160
+ },
2161
+ {
2162
+ "name": "_swapInstructions",
2163
+ "type": "tuple[]",
2164
+ "components": [
2165
+ {
2166
+ "name": "legoId",
2167
+ "type": "uint256"
2168
+ },
2169
+ {
2170
+ "name": "amountIn",
2171
+ "type": "uint256"
2172
+ },
2173
+ {
2174
+ "name": "minAmountOut",
2175
+ "type": "uint256"
2176
+ },
2177
+ {
2178
+ "name": "tokenPath",
2179
+ "type": "address[]"
2180
+ },
2181
+ {
2182
+ "name": "poolPath",
2183
+ "type": "address[]"
2184
+ }
2185
+ ]
2186
+ },
2187
+ {
2188
+ "name": "_depositTo",
2189
+ "type": "tuple[]",
2190
+ "components": [
2191
+ {
2192
+ "name": "legoId",
2193
+ "type": "uint256"
2194
+ },
2195
+ {
2196
+ "name": "asset",
2197
+ "type": "address"
2198
+ },
2199
+ {
2200
+ "name": "amount",
2201
+ "type": "uint256"
2202
+ },
2203
+ {
2204
+ "name": "vaultAddr",
2205
+ "type": "address"
2206
+ }
2207
+ ]
2208
+ },
2209
+ {
2210
+ "name": "_debtLegoId",
2211
+ "type": "uint256"
2212
+ }
2213
+ ],
2214
+ "outputs": []
2215
+ },
2216
+ {
2217
+ "stateMutability": "nonpayable",
2218
+ "type": "function",
2219
+ "name": "claimIncentivesAndSwap",
2220
+ "inputs": [
2221
+ {
2222
+ "name": "_agentWrapper",
2223
+ "type": "address"
2224
+ },
2225
+ {
2226
+ "name": "_userWallet",
2227
+ "type": "address"
2228
+ },
2229
+ {
2230
+ "name": "_rewardLegoId",
2231
+ "type": "uint256"
2232
+ },
2233
+ {
2234
+ "name": "_rewardToken",
2235
+ "type": "address"
2236
+ },
2237
+ {
2238
+ "name": "_rewardAmount",
2239
+ "type": "uint256"
2240
+ },
2241
+ {
2242
+ "name": "_rewardProofs",
2243
+ "type": "bytes32[]"
2244
+ },
2245
+ {
2246
+ "name": "_swapInstructions",
2247
+ "type": "tuple[]",
2248
+ "components": [
2249
+ {
2250
+ "name": "legoId",
2251
+ "type": "uint256"
2252
+ },
2253
+ {
2254
+ "name": "amountIn",
2255
+ "type": "uint256"
2256
+ },
2257
+ {
2258
+ "name": "minAmountOut",
2259
+ "type": "uint256"
2260
+ },
2261
+ {
2262
+ "name": "tokenPath",
2263
+ "type": "address[]"
2264
+ },
2265
+ {
2266
+ "name": "poolPath",
2267
+ "type": "address[]"
2268
+ }
2269
+ ]
2270
+ },
2271
+ {
2272
+ "name": "_depositTo",
2273
+ "type": "tuple[]",
2274
+ "components": [
2275
+ {
2276
+ "name": "legoId",
2277
+ "type": "uint256"
2278
+ },
2279
+ {
2280
+ "name": "asset",
2281
+ "type": "address"
2282
+ },
2283
+ {
2284
+ "name": "amount",
2285
+ "type": "uint256"
2286
+ },
2287
+ {
2288
+ "name": "vaultAddr",
2289
+ "type": "address"
2290
+ }
2291
+ ]
2292
+ },
2293
+ {
2294
+ "name": "_debtLegoId",
2295
+ "type": "uint256"
2296
+ },
2297
+ {
2298
+ "name": "_addCollateralAssets",
2299
+ "type": "tuple[]",
2300
+ "components": [
2301
+ {
2302
+ "name": "vaultId",
2303
+ "type": "uint256"
2304
+ },
2305
+ {
2306
+ "name": "asset",
2307
+ "type": "address"
2308
+ },
2309
+ {
2310
+ "name": "amount",
2311
+ "type": "uint256"
2312
+ }
2313
+ ]
2314
+ }
2315
+ ],
2316
+ "outputs": []
2317
+ },
2318
+ {
2319
+ "stateMutability": "nonpayable",
2320
+ "type": "function",
2321
+ "name": "claimIncentivesAndSwap",
2322
+ "inputs": [
2323
+ {
2324
+ "name": "_agentWrapper",
2325
+ "type": "address"
2326
+ },
2327
+ {
2328
+ "name": "_userWallet",
2329
+ "type": "address"
2330
+ },
2331
+ {
2332
+ "name": "_rewardLegoId",
2333
+ "type": "uint256"
2334
+ },
2335
+ {
2336
+ "name": "_rewardToken",
2337
+ "type": "address"
2338
+ },
2339
+ {
2340
+ "name": "_rewardAmount",
2341
+ "type": "uint256"
2342
+ },
2343
+ {
2344
+ "name": "_rewardProofs",
2345
+ "type": "bytes32[]"
2346
+ },
2347
+ {
2348
+ "name": "_swapInstructions",
2349
+ "type": "tuple[]",
2350
+ "components": [
2351
+ {
2352
+ "name": "legoId",
2353
+ "type": "uint256"
2354
+ },
2355
+ {
2356
+ "name": "amountIn",
2357
+ "type": "uint256"
2358
+ },
2359
+ {
2360
+ "name": "minAmountOut",
2361
+ "type": "uint256"
2362
+ },
2363
+ {
2364
+ "name": "tokenPath",
2365
+ "type": "address[]"
2366
+ },
2367
+ {
2368
+ "name": "poolPath",
2369
+ "type": "address[]"
2370
+ }
2371
+ ]
2372
+ },
2373
+ {
2374
+ "name": "_depositTo",
2375
+ "type": "tuple[]",
2376
+ "components": [
2377
+ {
2378
+ "name": "legoId",
2379
+ "type": "uint256"
2380
+ },
2381
+ {
2382
+ "name": "asset",
2383
+ "type": "address"
2384
+ },
2385
+ {
2386
+ "name": "amount",
2387
+ "type": "uint256"
2388
+ },
2389
+ {
2390
+ "name": "vaultAddr",
2391
+ "type": "address"
2392
+ }
2393
+ ]
2394
+ },
2395
+ {
2396
+ "name": "_debtLegoId",
2397
+ "type": "uint256"
2398
+ },
2399
+ {
2400
+ "name": "_addCollateralAssets",
2401
+ "type": "tuple[]",
2402
+ "components": [
2403
+ {
2404
+ "name": "vaultId",
2405
+ "type": "uint256"
2406
+ },
2407
+ {
2408
+ "name": "asset",
2409
+ "type": "address"
2410
+ },
2411
+ {
2412
+ "name": "amount",
2413
+ "type": "uint256"
2414
+ }
2415
+ ]
2416
+ },
2417
+ {
2418
+ "name": "_sig",
2419
+ "type": "tuple",
2420
+ "components": [
2421
+ {
2422
+ "name": "signature",
2423
+ "type": "bytes"
2424
+ },
2425
+ {
2426
+ "name": "nonce",
2427
+ "type": "uint256"
2428
+ },
2429
+ {
2430
+ "name": "expiration",
2431
+ "type": "uint256"
2432
+ }
2433
+ ]
2434
+ }
2435
+ ],
2436
+ "outputs": []
2437
+ },
2438
+ {
2439
+ "stateMutability": "nonpayable",
2440
+ "type": "function",
2441
+ "name": "incrementNonce",
2442
+ "inputs": [
2443
+ {
2444
+ "name": "_userWallet",
2445
+ "type": "address"
2446
+ }
2447
+ ],
2448
+ "outputs": []
2449
+ },
2450
+ {
2451
+ "stateMutability": "view",
2452
+ "type": "function",
2453
+ "name": "getNonce",
2454
+ "inputs": [
2455
+ {
2456
+ "name": "_userWallet",
2457
+ "type": "address"
2458
+ }
2459
+ ],
2460
+ "outputs": [
2461
+ {
2462
+ "name": "",
2463
+ "type": "uint256"
2464
+ }
2465
+ ]
2466
+ },
2467
+ {
2468
+ "stateMutability": "view",
2469
+ "type": "function",
2470
+ "name": "currentNonce",
2471
+ "inputs": [
2472
+ {
2473
+ "name": "arg0",
2474
+ "type": "address"
2475
+ }
2476
+ ],
2477
+ "outputs": [
2478
+ {
2479
+ "name": "",
2480
+ "type": "uint256"
2481
+ }
2482
+ ]
2483
+ },
2484
+ {
2485
+ "stateMutability": "view",
2486
+ "type": "function",
2487
+ "name": "UNDY_HQ",
2488
+ "inputs": [],
2489
+ "outputs": [
2490
+ {
2491
+ "name": "",
2492
+ "type": "address"
2493
+ }
2494
+ ]
2495
+ },
2496
+ {
2497
+ "stateMutability": "view",
2498
+ "type": "function",
2499
+ "name": "RIPE_GREEN_TOKEN",
2500
+ "inputs": [],
2501
+ "outputs": [
2502
+ {
2503
+ "name": "",
2504
+ "type": "address"
2505
+ }
2506
+ ]
2507
+ },
2508
+ {
2509
+ "stateMutability": "view",
2510
+ "type": "function",
2511
+ "name": "RIPE_SAVINGS_GREEN",
2512
+ "inputs": [],
2513
+ "outputs": [
2514
+ {
2515
+ "name": "",
2516
+ "type": "address"
2517
+ }
2518
+ ]
2519
+ },
2520
+ {
2521
+ "stateMutability": "nonpayable",
2522
+ "type": "constructor",
2523
+ "inputs": [
2524
+ {
2525
+ "name": "_undyHq",
2526
+ "type": "address"
2527
+ },
2528
+ {
2529
+ "name": "_owner",
2530
+ "type": "address"
2531
+ },
2532
+ {
2533
+ "name": "_minTimeLock",
2534
+ "type": "uint256"
2535
+ },
2536
+ {
2537
+ "name": "_maxTimeLock",
2538
+ "type": "uint256"
2539
+ },
2540
+ {
2541
+ "name": "_greenToken",
2542
+ "type": "address"
2543
+ },
2544
+ {
2545
+ "name": "_savingsGreen",
2546
+ "type": "address"
2547
+ }
2548
+ ],
2549
+ "outputs": []
2550
+ }
2551
+ ];
2552
+ export const deployAddress = '0xF02Bc5c9a1A57015C09c4e1B89A273a2849874D3';
2553
+ function getRequest(method, args, contractAddressOrOptions) {
2554
+ const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
2555
+ const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
2556
+ const call = {
2557
+ contractName: 'AgentSenderSpecial',
2558
+ method,
2559
+ args,
2560
+ address,
2561
+ deployAddress,
2562
+ defaultValue,
2563
+ getAbi: () => abi,
2564
+ with: (options) => {
2565
+ call.address = options.contractAddress;
2566
+ call.defaultValue = options.defaultValue;
2567
+ return call;
2568
+ },
2569
+ defaultTo: (defaultValue) => {
2570
+ call.defaultValue = defaultValue;
2571
+ return call;
2572
+ },
2573
+ at: (address) => {
2574
+ call.address = address;
2575
+ return call;
2576
+ },
2577
+ };
2578
+ return call;
2579
+ }
2580
+ export const call = {
2581
+ hasPendingOwnerChange: (...args) => getRequest('hasPendingOwnerChange', args),
2582
+ owner: (...args) => getRequest('owner', args),
2583
+ ownershipTimeLock: (...args) => getRequest('ownershipTimeLock', args),
2584
+ pendingOwner: (...args) => getRequest('pendingOwner', args),
2585
+ pendingOwnershipTimeLock: (...args) => getRequest('pendingOwnershipTimeLock', args),
2586
+ MIN_OWNERSHIP_TIMELOCK: (...args) => getRequest('MIN_OWNERSHIP_TIMELOCK', args),
2587
+ MAX_OWNERSHIP_TIMELOCK: (...args) => getRequest('MAX_OWNERSHIP_TIMELOCK', args),
2588
+ getNonce: (...args) => getRequest('getNonce', args),
2589
+ currentNonce: (...args) => getRequest('currentNonce', args),
2590
+ UNDY_HQ: (...args) => getRequest('UNDY_HQ', args),
2591
+ RIPE_GREEN_TOKEN: (...args) => getRequest('RIPE_GREEN_TOKEN', args),
2592
+ RIPE_SAVINGS_GREEN: (...args) => getRequest('RIPE_SAVINGS_GREEN', args),
2593
+ };
2594
+ function getMutation(functionName) {
2595
+ return {
2596
+ contractName: 'AgentSenderSpecial',
2597
+ functionName,
2598
+ deployAddress,
2599
+ argsType: undefined,
2600
+ getAbi: () => abi,
2601
+ };
2602
+ }
2603
+ export const mutation = {
2604
+ changeOwnership: getMutation('changeOwnership'),
2605
+ confirmOwnershipChange: getMutation('confirmOwnershipChange'),
2606
+ cancelOwnershipChange: getMutation('cancelOwnershipChange'),
2607
+ setOwnershipTimeLock: getMutation('setOwnershipTimeLock'),
2608
+ confirmPendingOwnershipTimeLock: getMutation('confirmPendingOwnershipTimeLock'),
2609
+ cancelPendingOwnershipTimeLock: getMutation('cancelPendingOwnershipTimeLock'),
2610
+ addCollateralAndBorrow: getMutation('addCollateralAndBorrow'),
2611
+ repayAndWithdraw: getMutation('repayAndWithdraw'),
2612
+ rebalanceYieldPositionsWithSwap: getMutation('rebalanceYieldPositionsWithSwap'),
2613
+ claimIncentivesAndSwap: getMutation('claimIncentivesAndSwap'),
2614
+ incrementNonce: getMutation('incrementNonce'),
2615
+ };
2616
+ export function parseEvents(eventName, events) {
2617
+ return events.map((event) => {
2618
+ return {
2619
+ event,
2620
+ parsed: parseEventLogs({
2621
+ abi,
2622
+ eventName,
2623
+ logs: [event],
2624
+ }),
2625
+ };
2626
+ });
2627
+ }
2628
+ export function getEventTopic(eventName) {
2629
+ return encodeEventTopics({ abi, eventName })[0];
2630
+ }
2631
+ export function toSdk(deployAddress, publicClient, walletClient, addressResolver) {
2632
+ return {
2633
+ deployAddress,
2634
+ abi,
2635
+ events: {
2636
+ NonceIncremented: { topic: getEventTopic('NonceIncremented'), parse: (events) => parseEvents('NonceIncremented', events) },
2637
+ OwnershipChangeInitiated: { topic: getEventTopic('OwnershipChangeInitiated'), parse: (events) => parseEvents('OwnershipChangeInitiated', events) },
2638
+ OwnershipChangeConfirmed: { topic: getEventTopic('OwnershipChangeConfirmed'), parse: (events) => parseEvents('OwnershipChangeConfirmed', events) },
2639
+ OwnershipChangeCancelled: { topic: getEventTopic('OwnershipChangeCancelled'), parse: (events) => parseEvents('OwnershipChangeCancelled', events) },
2640
+ PendingOwnershipTimeLockCancelled: { topic: getEventTopic('PendingOwnershipTimeLockCancelled'), parse: (events) => parseEvents('PendingOwnershipTimeLockCancelled', events) },
2641
+ OwnershipTimeLockSet: { topic: getEventTopic('OwnershipTimeLockSet'), parse: (events) => parseEvents('OwnershipTimeLockSet', events) },
2642
+ PendingOwnershipTimeLockSet: { topic: getEventTopic('PendingOwnershipTimeLockSet'), parse: (events) => parseEvents('PendingOwnershipTimeLockSet', events) },
2643
+ PendingOwnershipTimeLockConfirmed: { topic: getEventTopic('PendingOwnershipTimeLockConfirmed'), parse: (events) => parseEvents('PendingOwnershipTimeLockConfirmed', events) },
2644
+ },
2645
+ // Queries
2646
+ hasPendingOwnerChange: (...args) => singleQuery(publicClient, call.hasPendingOwnerChange(...args).at(deployAddress), {}, addressResolver),
2647
+ owner: (...args) => singleQuery(publicClient, call.owner(...args).at(deployAddress), {}, addressResolver),
2648
+ ownershipTimeLock: (...args) => singleQuery(publicClient, call.ownershipTimeLock(...args).at(deployAddress), {}, addressResolver),
2649
+ pendingOwner: (...args) => singleQuery(publicClient, call.pendingOwner(...args).at(deployAddress), {}, addressResolver),
2650
+ pendingOwnershipTimeLock: (...args) => singleQuery(publicClient, call.pendingOwnershipTimeLock(...args).at(deployAddress), {}, addressResolver),
2651
+ MIN_OWNERSHIP_TIMELOCK: (...args) => singleQuery(publicClient, call.MIN_OWNERSHIP_TIMELOCK(...args).at(deployAddress), {}, addressResolver),
2652
+ MAX_OWNERSHIP_TIMELOCK: (...args) => singleQuery(publicClient, call.MAX_OWNERSHIP_TIMELOCK(...args).at(deployAddress), {}, addressResolver),
2653
+ getNonce: (...args) => singleQuery(publicClient, call.getNonce(...args).at(deployAddress), {}, addressResolver),
2654
+ currentNonce: (...args) => singleQuery(publicClient, call.currentNonce(...args).at(deployAddress), {}, addressResolver),
2655
+ UNDY_HQ: (...args) => singleQuery(publicClient, call.UNDY_HQ(...args).at(deployAddress), {}, addressResolver),
2656
+ RIPE_GREEN_TOKEN: (...args) => singleQuery(publicClient, call.RIPE_GREEN_TOKEN(...args).at(deployAddress), {}, addressResolver),
2657
+ RIPE_SAVINGS_GREEN: (...args) => singleQuery(publicClient, call.RIPE_SAVINGS_GREEN(...args).at(deployAddress), {}, addressResolver),
2658
+ // Mutations
2659
+ changeOwnership: (...args) => mutate(walletClient, mutation.changeOwnership, { address: deployAddress, addressResolver })(...args),
2660
+ confirmOwnershipChange: (...args) => mutate(walletClient, mutation.confirmOwnershipChange, { address: deployAddress, addressResolver })(...args),
2661
+ cancelOwnershipChange: (...args) => mutate(walletClient, mutation.cancelOwnershipChange, { address: deployAddress, addressResolver })(...args),
2662
+ setOwnershipTimeLock: (...args) => mutate(walletClient, mutation.setOwnershipTimeLock, { address: deployAddress, addressResolver })(...args),
2663
+ confirmPendingOwnershipTimeLock: (...args) => mutate(walletClient, mutation.confirmPendingOwnershipTimeLock, { address: deployAddress, addressResolver })(...args),
2664
+ cancelPendingOwnershipTimeLock: (...args) => mutate(walletClient, mutation.cancelPendingOwnershipTimeLock, { address: deployAddress, addressResolver })(...args),
2665
+ addCollateralAndBorrow: (...args) => mutate(walletClient, mutation.addCollateralAndBorrow, { address: deployAddress, addressResolver })(...args),
2666
+ repayAndWithdraw: (...args) => mutate(walletClient, mutation.repayAndWithdraw, { address: deployAddress, addressResolver })(...args),
2667
+ rebalanceYieldPositionsWithSwap: (...args) => mutate(walletClient, mutation.rebalanceYieldPositionsWithSwap, { address: deployAddress, addressResolver })(...args),
2668
+ claimIncentivesAndSwap: (...args) => mutate(walletClient, mutation.claimIncentivesAndSwap, { address: deployAddress, addressResolver })(...args),
2669
+ incrementNonce: (...args) => mutate(walletClient, mutation.incrementNonce, { address: deployAddress, addressResolver })(...args),
2670
+ };
2671
+ }