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