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

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 (254) hide show
  1. package/.claude/settings.local.json +31 -0
  2. package/.eslintrc.json +27 -0
  3. package/.prettierrc +9 -0
  4. package/.tool-versions +1 -0
  5. package/LICENSE +41 -0
  6. package/LICENSE_DATE.md +34 -0
  7. package/LICENSE_GRANTS.md +33 -0
  8. package/LICENSE_INFO.md +90 -0
  9. package/README.md +116 -17
  10. package/dapp.config.js +154 -0
  11. package/package.json +17 -44
  12. package/src/getSwapInstructions.ts +55 -0
  13. package/src/index.ts +192 -0
  14. package/tsconfig.json +18 -0
  15. package/AGENTS.md +0 -162
  16. package/abis.json +0 -181875
  17. package/addresses.json +0 -76
  18. package/dist/contracts/AaveV3.d.ts +0 -2594
  19. package/dist/contracts/AaveV3.d.ts.map +0 -1
  20. package/dist/contracts/AaveV3.js +0 -3272
  21. package/dist/contracts/AeroClassic.d.ts +0 -2118
  22. package/dist/contracts/AeroClassic.d.ts.map +0 -1
  23. package/dist/contracts/AeroClassic.js +0 -2679
  24. package/dist/contracts/AeroSlipstream.d.ts +0 -2256
  25. package/dist/contracts/AeroSlipstream.d.ts.map +0 -1
  26. package/dist/contracts/AeroSlipstream.js +0 -2848
  27. package/dist/contracts/AgentSenderGeneric.d.ts +0 -4129
  28. package/dist/contracts/AgentSenderGeneric.d.ts.map +0 -1
  29. package/dist/contracts/AgentSenderGeneric.js +0 -5397
  30. package/dist/contracts/AgentSenderSpecial.d.ts +0 -1997
  31. package/dist/contracts/AgentSenderSpecial.d.ts.map +0 -1
  32. package/dist/contracts/AgentSenderSpecial.js +0 -2532
  33. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts +0 -2245
  34. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts.map +0 -1
  35. package/dist/contracts/AgentSenderSpecialSigHelper.js +0 -2971
  36. package/dist/contracts/AgentWrapper.d.ts +0 -2520
  37. package/dist/contracts/AgentWrapper.d.ts.map +0 -1
  38. package/dist/contracts/AgentWrapper.js +0 -3389
  39. package/dist/contracts/AgentWrapperV1.d.ts +0 -3789
  40. package/dist/contracts/AgentWrapperV1.d.ts.map +0 -1
  41. package/dist/contracts/AgentWrapperV1.js +0 -4945
  42. package/dist/contracts/AgentWrapperV2.d.ts +0 -2494
  43. package/dist/contracts/AgentWrapperV2.d.ts.map +0 -1
  44. package/dist/contracts/AgentWrapperV2.js +0 -3354
  45. package/dist/contracts/Appraiser.d.ts +0 -577
  46. package/dist/contracts/Appraiser.d.ts.map +0 -1
  47. package/dist/contracts/Appraiser.js +0 -735
  48. package/dist/contracts/Avantis.d.ts +0 -2606
  49. package/dist/contracts/Avantis.d.ts.map +0 -1
  50. package/dist/contracts/Avantis.js +0 -3282
  51. package/dist/contracts/Billing.d.ts +0 -381
  52. package/dist/contracts/Billing.d.ts.map +0 -1
  53. package/dist/contracts/Billing.js +0 -451
  54. package/dist/contracts/ChequeBook.d.ts +0 -1704
  55. package/dist/contracts/ChequeBook.d.ts.map +0 -1
  56. package/dist/contracts/ChequeBook.js +0 -1922
  57. package/dist/contracts/CompoundV3.d.ts +0 -2622
  58. package/dist/contracts/CompoundV3.d.ts.map +0 -1
  59. package/dist/contracts/CompoundV3.js +0 -3304
  60. package/dist/contracts/ConvertVaultToken.d.ts +0 -64
  61. package/dist/contracts/ConvertVaultToken.d.ts.map +0 -1
  62. package/dist/contracts/ConvertVaultToken.js +0 -75
  63. package/dist/contracts/Curve.d.ts +0 -1107
  64. package/dist/contracts/Curve.d.ts.map +0 -1
  65. package/dist/contracts/Curve.js +0 -1379
  66. package/dist/contracts/DefaultsBase.d.ts +0 -306
  67. package/dist/contracts/DefaultsBase.d.ts.map +0 -1
  68. package/dist/contracts/DefaultsBase.js +0 -331
  69. package/dist/contracts/ERC20.d.ts +0 -288
  70. package/dist/contracts/ERC20.d.ts.map +0 -1
  71. package/dist/contracts/ERC20.js +0 -359
  72. package/dist/contracts/EarnVault.d.ts +0 -1733
  73. package/dist/contracts/EarnVault.d.ts.map +0 -1
  74. package/dist/contracts/EarnVault.js +0 -2235
  75. package/dist/contracts/EarnVaultAgent.d.ts +0 -1033
  76. package/dist/contracts/EarnVaultAgent.d.ts.map +0 -1
  77. package/dist/contracts/EarnVaultAgent.js +0 -1296
  78. package/dist/contracts/EarnVaultAgentSigHelper.d.ts +0 -905
  79. package/dist/contracts/EarnVaultAgentSigHelper.d.ts.map +0 -1
  80. package/dist/contracts/EarnVaultAgentSigHelper.js +0 -1198
  81. package/dist/contracts/Euler.d.ts +0 -2662
  82. package/dist/contracts/Euler.d.ts.map +0 -1
  83. package/dist/contracts/Euler.js +0 -3350
  84. package/dist/contracts/ExtraFi.d.ts +0 -2637
  85. package/dist/contracts/ExtraFi.d.ts.map +0 -1
  86. package/dist/contracts/ExtraFi.js +0 -3323
  87. package/dist/contracts/Fluid.d.ts +0 -2634
  88. package/dist/contracts/Fluid.d.ts.map +0 -1
  89. package/dist/contracts/Fluid.js +0 -3318
  90. package/dist/contracts/FortyAcres.d.ts +0 -2620
  91. package/dist/contracts/FortyAcres.d.ts.map +0 -1
  92. package/dist/contracts/FortyAcres.js +0 -3300
  93. package/dist/contracts/Hatchery.d.ts +0 -392
  94. package/dist/contracts/Hatchery.d.ts.map +0 -1
  95. package/dist/contracts/Hatchery.js +0 -472
  96. package/dist/contracts/Helpers.d.ts +0 -1463
  97. package/dist/contracts/Helpers.d.ts.map +0 -1
  98. package/dist/contracts/Helpers.js +0 -1763
  99. package/dist/contracts/HighCommand.d.ts +0 -2129
  100. package/dist/contracts/HighCommand.d.ts.map +0 -1
  101. package/dist/contracts/HighCommand.js +0 -2429
  102. package/dist/contracts/Kernel.d.ts +0 -387
  103. package/dist/contracts/Kernel.d.ts.map +0 -1
  104. package/dist/contracts/Kernel.js +0 -442
  105. package/dist/contracts/Ledger.d.ts +0 -708
  106. package/dist/contracts/Ledger.d.ts.map +0 -1
  107. package/dist/contracts/Ledger.js +0 -854
  108. package/dist/contracts/LegoBook.d.ts +0 -1463
  109. package/dist/contracts/LegoBook.d.ts.map +0 -1
  110. package/dist/contracts/LegoBook.js +0 -1763
  111. package/dist/contracts/LegoTools.d.ts +0 -1913
  112. package/dist/contracts/LegoTools.d.ts.map +0 -1
  113. package/dist/contracts/LegoTools.js +0 -2402
  114. package/dist/contracts/LevgVault.d.ts +0 -2115
  115. package/dist/contracts/LevgVault.d.ts.map +0 -1
  116. package/dist/contracts/LevgVault.js +0 -2733
  117. package/dist/contracts/LevgVaultAgent.d.ts +0 -1955
  118. package/dist/contracts/LevgVaultAgent.d.ts.map +0 -1
  119. package/dist/contracts/LevgVaultAgent.js +0 -2508
  120. package/dist/contracts/LevgVaultAgentSigHelper.d.ts +0 -2221
  121. package/dist/contracts/LevgVaultAgentSigHelper.d.ts.map +0 -1
  122. package/dist/contracts/LevgVaultAgentSigHelper.js +0 -2963
  123. package/dist/contracts/LevgVaultHelper.d.ts +0 -977
  124. package/dist/contracts/LevgVaultHelper.d.ts.map +0 -1
  125. package/dist/contracts/LevgVaultHelper.js +0 -1289
  126. package/dist/contracts/LevgVaultTools.d.ts +0 -2629
  127. package/dist/contracts/LevgVaultTools.d.ts.map +0 -1
  128. package/dist/contracts/LevgVaultTools.js +0 -3560
  129. package/dist/contracts/LootDistributor.d.ts +0 -1053
  130. package/dist/contracts/LootDistributor.d.ts.map +0 -1
  131. package/dist/contracts/LootDistributor.js +0 -1291
  132. package/dist/contracts/Migrator.d.ts +0 -289
  133. package/dist/contracts/Migrator.d.ts.map +0 -1
  134. package/dist/contracts/Migrator.js +0 -348
  135. package/dist/contracts/MissionControl.d.ts +0 -1405
  136. package/dist/contracts/MissionControl.d.ts.map +0 -1
  137. package/dist/contracts/MissionControl.js +0 -1592
  138. package/dist/contracts/Moonwell.d.ts +0 -2623
  139. package/dist/contracts/Moonwell.d.ts.map +0 -1
  140. package/dist/contracts/Moonwell.js +0 -3304
  141. package/dist/contracts/Morpho.d.ts +0 -2662
  142. package/dist/contracts/Morpho.d.ts.map +0 -1
  143. package/dist/contracts/Morpho.js +0 -3350
  144. package/dist/contracts/Paymaster.d.ts +0 -1714
  145. package/dist/contracts/Paymaster.d.ts.map +0 -1
  146. package/dist/contracts/Paymaster.js +0 -2098
  147. package/dist/contracts/RipeLego.d.ts +0 -2913
  148. package/dist/contracts/RipeLego.d.ts.map +0 -1
  149. package/dist/contracts/RipeLego.js +0 -3643
  150. package/dist/contracts/Sentinel.d.ts +0 -2064
  151. package/dist/contracts/Sentinel.d.ts.map +0 -1
  152. package/dist/contracts/Sentinel.js +0 -2476
  153. package/dist/contracts/SignatureHelper.d.ts +0 -4250
  154. package/dist/contracts/SignatureHelper.d.ts.map +0 -1
  155. package/dist/contracts/SignatureHelper.js +0 -5714
  156. package/dist/contracts/SignatureHelperV1.d.ts +0 -4250
  157. package/dist/contracts/SignatureHelperV1.d.ts.map +0 -1
  158. package/dist/contracts/SignatureHelperV1.js +0 -5714
  159. package/dist/contracts/SkyPsm.d.ts +0 -2667
  160. package/dist/contracts/SkyPsm.d.ts.map +0 -1
  161. package/dist/contracts/SkyPsm.js +0 -3356
  162. package/dist/contracts/Switchboard.d.ts +0 -1483
  163. package/dist/contracts/Switchboard.d.ts.map +0 -1
  164. package/dist/contracts/Switchboard.js +0 -1790
  165. package/dist/contracts/SwitchboardAlpha.d.ts +0 -3161
  166. package/dist/contracts/SwitchboardAlpha.d.ts.map +0 -1
  167. package/dist/contracts/SwitchboardAlpha.js +0 -3771
  168. package/dist/contracts/SwitchboardBravo.d.ts +0 -1591
  169. package/dist/contracts/SwitchboardBravo.d.ts.map +0 -1
  170. package/dist/contracts/SwitchboardBravo.js +0 -1872
  171. package/dist/contracts/SwitchboardCharlie.d.ts +0 -3172
  172. package/dist/contracts/SwitchboardCharlie.d.ts.map +0 -1
  173. package/dist/contracts/SwitchboardCharlie.js +0 -3713
  174. package/dist/contracts/UnderscoreLego.d.ts +0 -2592
  175. package/dist/contracts/UnderscoreLego.d.ts.map +0 -1
  176. package/dist/contracts/UnderscoreLego.js +0 -3264
  177. package/dist/contracts/UndyAero.d.ts +0 -1733
  178. package/dist/contracts/UndyAero.d.ts.map +0 -1
  179. package/dist/contracts/UndyAero.js +0 -2235
  180. package/dist/contracts/UndyBtc.d.ts +0 -1733
  181. package/dist/contracts/UndyBtc.d.ts.map +0 -1
  182. package/dist/contracts/UndyBtc.js +0 -2235
  183. package/dist/contracts/UndyCbeth.d.ts +0 -1733
  184. package/dist/contracts/UndyCbeth.d.ts.map +0 -1
  185. package/dist/contracts/UndyCbeth.js +0 -2235
  186. package/dist/contracts/UndyEth.d.ts +0 -1733
  187. package/dist/contracts/UndyEth.d.ts.map +0 -1
  188. package/dist/contracts/UndyEth.js +0 -2235
  189. package/dist/contracts/UndyEurc.d.ts +0 -1733
  190. package/dist/contracts/UndyEurc.d.ts.map +0 -1
  191. package/dist/contracts/UndyEurc.js +0 -2235
  192. package/dist/contracts/UndyGho.d.ts +0 -1733
  193. package/dist/contracts/UndyGho.d.ts.map +0 -1
  194. package/dist/contracts/UndyGho.js +0 -2235
  195. package/dist/contracts/UndyHq.d.ts +0 -1677
  196. package/dist/contracts/UndyHq.d.ts.map +0 -1
  197. package/dist/contracts/UndyHq.js +0 -2026
  198. package/dist/contracts/UndyRewardsLego.d.ts +0 -1572
  199. package/dist/contracts/UndyRewardsLego.d.ts.map +0 -1
  200. package/dist/contracts/UndyRewardsLego.js +0 -1994
  201. package/dist/contracts/UndyUsd.d.ts +0 -1733
  202. package/dist/contracts/UndyUsd.d.ts.map +0 -1
  203. package/dist/contracts/UndyUsd.js +0 -2235
  204. package/dist/contracts/UndyUsdV2.d.ts +0 -1762
  205. package/dist/contracts/UndyUsdV2.d.ts.map +0 -1
  206. package/dist/contracts/UndyUsdV2.js +0 -2267
  207. package/dist/contracts/UndyUsds.d.ts +0 -1733
  208. package/dist/contracts/UndyUsds.d.ts.map +0 -1
  209. package/dist/contracts/UndyUsds.js +0 -2235
  210. package/dist/contracts/UndyVirtual.d.ts +0 -1762
  211. package/dist/contracts/UndyVirtual.d.ts.map +0 -1
  212. package/dist/contracts/UndyVirtual.js +0 -2267
  213. package/dist/contracts/UniswapV2.d.ts +0 -2118
  214. package/dist/contracts/UniswapV2.d.ts.map +0 -1
  215. package/dist/contracts/UniswapV2.js +0 -2679
  216. package/dist/contracts/UniswapV3.d.ts +0 -2256
  217. package/dist/contracts/UniswapV3.d.ts.map +0 -1
  218. package/dist/contracts/UniswapV3.js +0 -2848
  219. package/dist/contracts/UserWallet.d.ts +0 -2650
  220. package/dist/contracts/UserWallet.d.ts.map +0 -1
  221. package/dist/contracts/UserWallet.js +0 -3520
  222. package/dist/contracts/UserWalletConfig.d.ts +0 -3901
  223. package/dist/contracts/UserWalletConfig.d.ts.map +0 -1
  224. package/dist/contracts/UserWalletConfig.js +0 -4507
  225. package/dist/contracts/UserWalletConfigV1.d.ts +0 -3692
  226. package/dist/contracts/UserWalletConfigV1.d.ts.map +0 -1
  227. package/dist/contracts/UserWalletConfigV1.js +0 -4276
  228. package/dist/contracts/UserWalletSignatureHelper.d.ts +0 -4552
  229. package/dist/contracts/UserWalletSignatureHelper.d.ts.map +0 -1
  230. package/dist/contracts/UserWalletSignatureHelper.js +0 -6123
  231. package/dist/contracts/UserWalletV1.d.ts +0 -2650
  232. package/dist/contracts/UserWalletV1.d.ts.map +0 -1
  233. package/dist/contracts/UserWalletV1.js +0 -3520
  234. package/dist/contracts/VaultRegistry.d.ts +0 -3162
  235. package/dist/contracts/VaultRegistry.d.ts.map +0 -1
  236. package/dist/contracts/VaultRegistry.js +0 -3893
  237. package/dist/contracts/WalletBackpack.d.ts +0 -1248
  238. package/dist/contracts/WalletBackpack.d.ts.map +0 -1
  239. package/dist/contracts/WalletBackpack.js +0 -1519
  240. package/dist/contracts/Wasabi.d.ts +0 -2620
  241. package/dist/contracts/Wasabi.d.ts.map +0 -1
  242. package/dist/contracts/Wasabi.js +0 -3300
  243. package/dist/contracts/index.d.ts +0 -76
  244. package/dist/contracts/index.d.ts.map +0 -1
  245. package/dist/contracts/index.js +0 -79
  246. package/dist/contracts/sdk.d.ts +0 -156
  247. package/dist/contracts/sdk.d.ts.map +0 -1
  248. package/dist/contracts/sdk.js +0 -158
  249. package/dist/getSwapInstructions.d.ts +0 -34
  250. package/dist/getSwapInstructions.d.ts.map +0 -1
  251. package/dist/getSwapInstructions.js +0 -21
  252. package/dist/index.d.ts +0 -135
  253. package/dist/index.d.ts.map +0 -1
  254. package/dist/index.js +0 -137
@@ -1,854 +0,0 @@
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": "DepartmentPauseModified",
10
- "inputs": [
11
- {
12
- "name": "isPaused",
13
- "type": "bool",
14
- "indexed": false
15
- }
16
- ],
17
- "anonymous": false,
18
- "type": "event"
19
- },
20
- {
21
- "name": "DepartmentFundsRecovered",
22
- "inputs": [
23
- {
24
- "name": "asset",
25
- "type": "address",
26
- "indexed": true
27
- },
28
- {
29
- "name": "recipient",
30
- "type": "address",
31
- "indexed": true
32
- },
33
- {
34
- "name": "balance",
35
- "type": "uint256",
36
- "indexed": false
37
- }
38
- ],
39
- "anonymous": false,
40
- "type": "event"
41
- },
42
- {
43
- "stateMutability": "view",
44
- "type": "function",
45
- "name": "getAddys",
46
- "inputs": [],
47
- "outputs": [
48
- {
49
- "name": "",
50
- "type": "tuple",
51
- "components": [
52
- {
53
- "name": "hq",
54
- "type": "address"
55
- },
56
- {
57
- "name": "undyToken",
58
- "type": "address"
59
- },
60
- {
61
- "name": "ledger",
62
- "type": "address"
63
- },
64
- {
65
- "name": "missionControl",
66
- "type": "address"
67
- },
68
- {
69
- "name": "legoBook",
70
- "type": "address"
71
- },
72
- {
73
- "name": "switchboard",
74
- "type": "address"
75
- },
76
- {
77
- "name": "hatchery",
78
- "type": "address"
79
- },
80
- {
81
- "name": "lootDistributor",
82
- "type": "address"
83
- },
84
- {
85
- "name": "appraiser",
86
- "type": "address"
87
- },
88
- {
89
- "name": "walletBackpack",
90
- "type": "address"
91
- },
92
- {
93
- "name": "billing",
94
- "type": "address"
95
- }
96
- ]
97
- }
98
- ]
99
- },
100
- {
101
- "stateMutability": "view",
102
- "type": "function",
103
- "name": "getUndyHq",
104
- "inputs": [],
105
- "outputs": [
106
- {
107
- "name": "",
108
- "type": "address"
109
- }
110
- ]
111
- },
112
- {
113
- "stateMutability": "view",
114
- "type": "function",
115
- "name": "canMintUndy",
116
- "inputs": [],
117
- "outputs": [
118
- {
119
- "name": "",
120
- "type": "bool"
121
- }
122
- ]
123
- },
124
- {
125
- "stateMutability": "nonpayable",
126
- "type": "function",
127
- "name": "pause",
128
- "inputs": [
129
- {
130
- "name": "_shouldPause",
131
- "type": "bool"
132
- }
133
- ],
134
- "outputs": []
135
- },
136
- {
137
- "stateMutability": "nonpayable",
138
- "type": "function",
139
- "name": "recoverFunds",
140
- "inputs": [
141
- {
142
- "name": "_recipient",
143
- "type": "address"
144
- },
145
- {
146
- "name": "_asset",
147
- "type": "address"
148
- }
149
- ],
150
- "outputs": []
151
- },
152
- {
153
- "stateMutability": "nonpayable",
154
- "type": "function",
155
- "name": "recoverFundsMany",
156
- "inputs": [
157
- {
158
- "name": "_recipient",
159
- "type": "address"
160
- },
161
- {
162
- "name": "_assets",
163
- "type": "address[]"
164
- }
165
- ],
166
- "outputs": []
167
- },
168
- {
169
- "stateMutability": "view",
170
- "type": "function",
171
- "name": "isPaused",
172
- "inputs": [],
173
- "outputs": [
174
- {
175
- "name": "",
176
- "type": "bool"
177
- }
178
- ]
179
- },
180
- {
181
- "stateMutability": "nonpayable",
182
- "type": "function",
183
- "name": "createUserWallet",
184
- "inputs": [
185
- {
186
- "name": "_user",
187
- "type": "address"
188
- },
189
- {
190
- "name": "_ambassador",
191
- "type": "address"
192
- }
193
- ],
194
- "outputs": []
195
- },
196
- {
197
- "stateMutability": "view",
198
- "type": "function",
199
- "name": "getNumUserWallets",
200
- "inputs": [],
201
- "outputs": [
202
- {
203
- "name": "",
204
- "type": "uint256"
205
- }
206
- ]
207
- },
208
- {
209
- "stateMutability": "view",
210
- "type": "function",
211
- "name": "isUserWallet",
212
- "inputs": [
213
- {
214
- "name": "_user",
215
- "type": "address"
216
- }
217
- ],
218
- "outputs": [
219
- {
220
- "name": "",
221
- "type": "bool"
222
- }
223
- ]
224
- },
225
- {
226
- "stateMutability": "nonpayable",
227
- "type": "function",
228
- "name": "setUserPoints",
229
- "inputs": [
230
- {
231
- "name": "_user",
232
- "type": "address"
233
- },
234
- {
235
- "name": "_data",
236
- "type": "tuple",
237
- "components": [
238
- {
239
- "name": "usdValue",
240
- "type": "uint256"
241
- },
242
- {
243
- "name": "depositPoints",
244
- "type": "uint256"
245
- },
246
- {
247
- "name": "lastUpdate",
248
- "type": "uint256"
249
- }
250
- ]
251
- }
252
- ],
253
- "outputs": []
254
- },
255
- {
256
- "stateMutability": "nonpayable",
257
- "type": "function",
258
- "name": "setGlobalPoints",
259
- "inputs": [
260
- {
261
- "name": "_data",
262
- "type": "tuple",
263
- "components": [
264
- {
265
- "name": "usdValue",
266
- "type": "uint256"
267
- },
268
- {
269
- "name": "depositPoints",
270
- "type": "uint256"
271
- },
272
- {
273
- "name": "lastUpdate",
274
- "type": "uint256"
275
- }
276
- ]
277
- }
278
- ],
279
- "outputs": []
280
- },
281
- {
282
- "stateMutability": "nonpayable",
283
- "type": "function",
284
- "name": "setUserAndGlobalPoints",
285
- "inputs": [
286
- {
287
- "name": "_user",
288
- "type": "address"
289
- },
290
- {
291
- "name": "_userData",
292
- "type": "tuple",
293
- "components": [
294
- {
295
- "name": "usdValue",
296
- "type": "uint256"
297
- },
298
- {
299
- "name": "depositPoints",
300
- "type": "uint256"
301
- },
302
- {
303
- "name": "lastUpdate",
304
- "type": "uint256"
305
- }
306
- ]
307
- },
308
- {
309
- "name": "_globalData",
310
- "type": "tuple",
311
- "components": [
312
- {
313
- "name": "usdValue",
314
- "type": "uint256"
315
- },
316
- {
317
- "name": "depositPoints",
318
- "type": "uint256"
319
- },
320
- {
321
- "name": "lastUpdate",
322
- "type": "uint256"
323
- }
324
- ]
325
- }
326
- ],
327
- "outputs": []
328
- },
329
- {
330
- "stateMutability": "view",
331
- "type": "function",
332
- "name": "getLastTotalUsdValue",
333
- "inputs": [
334
- {
335
- "name": "_user",
336
- "type": "address"
337
- }
338
- ],
339
- "outputs": [
340
- {
341
- "name": "",
342
- "type": "uint256"
343
- }
344
- ]
345
- },
346
- {
347
- "stateMutability": "view",
348
- "type": "function",
349
- "name": "getUserAndGlobalPoints",
350
- "inputs": [
351
- {
352
- "name": "_user",
353
- "type": "address"
354
- }
355
- ],
356
- "outputs": [
357
- {
358
- "name": "",
359
- "type": "tuple",
360
- "components": [
361
- {
362
- "name": "usdValue",
363
- "type": "uint256"
364
- },
365
- {
366
- "name": "depositPoints",
367
- "type": "uint256"
368
- },
369
- {
370
- "name": "lastUpdate",
371
- "type": "uint256"
372
- }
373
- ]
374
- },
375
- {
376
- "name": "",
377
- "type": "tuple",
378
- "components": [
379
- {
380
- "name": "usdValue",
381
- "type": "uint256"
382
- },
383
- {
384
- "name": "depositPoints",
385
- "type": "uint256"
386
- },
387
- {
388
- "name": "lastUpdate",
389
- "type": "uint256"
390
- }
391
- ]
392
- }
393
- ]
394
- },
395
- {
396
- "stateMutability": "view",
397
- "type": "function",
398
- "name": "isRegisteredVaultToken",
399
- "inputs": [
400
- {
401
- "name": "_vaultToken",
402
- "type": "address"
403
- }
404
- ],
405
- "outputs": [
406
- {
407
- "name": "",
408
- "type": "bool"
409
- }
410
- ]
411
- },
412
- {
413
- "stateMutability": "nonpayable",
414
- "type": "function",
415
- "name": "setVaultToken",
416
- "inputs": [
417
- {
418
- "name": "_vaultToken",
419
- "type": "address"
420
- },
421
- {
422
- "name": "_legoId",
423
- "type": "uint256"
424
- },
425
- {
426
- "name": "_underlyingAsset",
427
- "type": "address"
428
- },
429
- {
430
- "name": "_decimals",
431
- "type": "uint256"
432
- },
433
- {
434
- "name": "_isRebasing",
435
- "type": "bool"
436
- }
437
- ],
438
- "outputs": []
439
- },
440
- {
441
- "stateMutability": "nonpayable",
442
- "type": "function",
443
- "name": "registerBackpackItem",
444
- "inputs": [
445
- {
446
- "name": "_addr",
447
- "type": "address"
448
- }
449
- ],
450
- "outputs": []
451
- },
452
- {
453
- "stateMutability": "nonpayable",
454
- "type": "function",
455
- "name": "createAgent",
456
- "inputs": [
457
- {
458
- "name": "_agent",
459
- "type": "address"
460
- }
461
- ],
462
- "outputs": []
463
- },
464
- {
465
- "stateMutability": "view",
466
- "type": "function",
467
- "name": "getNumAgents",
468
- "inputs": [],
469
- "outputs": [
470
- {
471
- "name": "",
472
- "type": "uint256"
473
- }
474
- ]
475
- },
476
- {
477
- "stateMutability": "view",
478
- "type": "function",
479
- "name": "isAgent",
480
- "inputs": [
481
- {
482
- "name": "_agent",
483
- "type": "address"
484
- }
485
- ],
486
- "outputs": [
487
- {
488
- "name": "",
489
- "type": "bool"
490
- }
491
- ]
492
- },
493
- {
494
- "stateMutability": "view",
495
- "type": "function",
496
- "name": "userPoints",
497
- "inputs": [
498
- {
499
- "name": "arg0",
500
- "type": "address"
501
- }
502
- ],
503
- "outputs": [
504
- {
505
- "name": "",
506
- "type": "tuple",
507
- "components": [
508
- {
509
- "name": "usdValue",
510
- "type": "uint256"
511
- },
512
- {
513
- "name": "depositPoints",
514
- "type": "uint256"
515
- },
516
- {
517
- "name": "lastUpdate",
518
- "type": "uint256"
519
- }
520
- ]
521
- }
522
- ]
523
- },
524
- {
525
- "stateMutability": "view",
526
- "type": "function",
527
- "name": "globalPoints",
528
- "inputs": [],
529
- "outputs": [
530
- {
531
- "name": "",
532
- "type": "tuple",
533
- "components": [
534
- {
535
- "name": "usdValue",
536
- "type": "uint256"
537
- },
538
- {
539
- "name": "depositPoints",
540
- "type": "uint256"
541
- },
542
- {
543
- "name": "lastUpdate",
544
- "type": "uint256"
545
- }
546
- ]
547
- }
548
- ]
549
- },
550
- {
551
- "stateMutability": "view",
552
- "type": "function",
553
- "name": "userWallets",
554
- "inputs": [
555
- {
556
- "name": "arg0",
557
- "type": "uint256"
558
- }
559
- ],
560
- "outputs": [
561
- {
562
- "name": "",
563
- "type": "address"
564
- }
565
- ]
566
- },
567
- {
568
- "stateMutability": "view",
569
- "type": "function",
570
- "name": "indexOfUserWallet",
571
- "inputs": [
572
- {
573
- "name": "arg0",
574
- "type": "address"
575
- }
576
- ],
577
- "outputs": [
578
- {
579
- "name": "",
580
- "type": "uint256"
581
- }
582
- ]
583
- },
584
- {
585
- "stateMutability": "view",
586
- "type": "function",
587
- "name": "numUserWallets",
588
- "inputs": [],
589
- "outputs": [
590
- {
591
- "name": "",
592
- "type": "uint256"
593
- }
594
- ]
595
- },
596
- {
597
- "stateMutability": "view",
598
- "type": "function",
599
- "name": "ambassadors",
600
- "inputs": [
601
- {
602
- "name": "arg0",
603
- "type": "address"
604
- }
605
- ],
606
- "outputs": [
607
- {
608
- "name": "",
609
- "type": "address"
610
- }
611
- ]
612
- },
613
- {
614
- "stateMutability": "view",
615
- "type": "function",
616
- "name": "agents",
617
- "inputs": [
618
- {
619
- "name": "arg0",
620
- "type": "uint256"
621
- }
622
- ],
623
- "outputs": [
624
- {
625
- "name": "",
626
- "type": "address"
627
- }
628
- ]
629
- },
630
- {
631
- "stateMutability": "view",
632
- "type": "function",
633
- "name": "indexOfAgent",
634
- "inputs": [
635
- {
636
- "name": "arg0",
637
- "type": "address"
638
- }
639
- ],
640
- "outputs": [
641
- {
642
- "name": "",
643
- "type": "uint256"
644
- }
645
- ]
646
- },
647
- {
648
- "stateMutability": "view",
649
- "type": "function",
650
- "name": "numAgents",
651
- "inputs": [],
652
- "outputs": [
653
- {
654
- "name": "",
655
- "type": "uint256"
656
- }
657
- ]
658
- },
659
- {
660
- "stateMutability": "view",
661
- "type": "function",
662
- "name": "vaultTokens",
663
- "inputs": [
664
- {
665
- "name": "arg0",
666
- "type": "address"
667
- }
668
- ],
669
- "outputs": [
670
- {
671
- "name": "",
672
- "type": "tuple",
673
- "components": [
674
- {
675
- "name": "legoId",
676
- "type": "uint256"
677
- },
678
- {
679
- "name": "underlyingAsset",
680
- "type": "address"
681
- },
682
- {
683
- "name": "decimals",
684
- "type": "uint256"
685
- },
686
- {
687
- "name": "isRebasing",
688
- "type": "bool"
689
- }
690
- ]
691
- }
692
- ]
693
- },
694
- {
695
- "stateMutability": "view",
696
- "type": "function",
697
- "name": "isRegisteredBackpackItem",
698
- "inputs": [
699
- {
700
- "name": "arg0",
701
- "type": "address"
702
- }
703
- ],
704
- "outputs": [
705
- {
706
- "name": "",
707
- "type": "bool"
708
- }
709
- ]
710
- },
711
- {
712
- "stateMutability": "nonpayable",
713
- "type": "constructor",
714
- "inputs": [
715
- {
716
- "name": "_undyHq",
717
- "type": "address"
718
- }
719
- ],
720
- "outputs": []
721
- }
722
- ];
723
- export const deployAddress = '0x9e97A2e527890E690c7FA978696A88EFA868c5D0';
724
- function getRequest(method, args, contractAddressOrOptions) {
725
- const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
726
- const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
727
- const call = {
728
- contractName: 'Ledger',
729
- method,
730
- args,
731
- address,
732
- deployAddress,
733
- defaultValue,
734
- getAbi: () => abi,
735
- with: (options) => {
736
- call.address = options.contractAddress;
737
- call.defaultValue = options.defaultValue;
738
- return call;
739
- },
740
- defaultTo: (defaultValue) => {
741
- call.defaultValue = defaultValue;
742
- return call;
743
- },
744
- at: (address) => {
745
- call.address = address;
746
- return call;
747
- },
748
- };
749
- return call;
750
- }
751
- export const call = {
752
- getAddys: (...args) => getRequest('getAddys', args),
753
- getUndyHq: (...args) => getRequest('getUndyHq', args),
754
- canMintUndy: (...args) => getRequest('canMintUndy', args),
755
- isPaused: (...args) => getRequest('isPaused', args),
756
- getNumUserWallets: (...args) => getRequest('getNumUserWallets', args),
757
- isUserWallet: (...args) => getRequest('isUserWallet', args),
758
- getLastTotalUsdValue: (...args) => getRequest('getLastTotalUsdValue', args),
759
- getUserAndGlobalPoints: (...args) => getRequest('getUserAndGlobalPoints', args),
760
- isRegisteredVaultToken: (...args) => getRequest('isRegisteredVaultToken', args),
761
- getNumAgents: (...args) => getRequest('getNumAgents', args),
762
- isAgent: (...args) => getRequest('isAgent', args),
763
- userPoints: (...args) => getRequest('userPoints', args),
764
- globalPoints: (...args) => getRequest('globalPoints', args),
765
- userWallets: (...args) => getRequest('userWallets', args),
766
- indexOfUserWallet: (...args) => getRequest('indexOfUserWallet', args),
767
- numUserWallets: (...args) => getRequest('numUserWallets', args),
768
- ambassadors: (...args) => getRequest('ambassadors', args),
769
- agents: (...args) => getRequest('agents', args),
770
- indexOfAgent: (...args) => getRequest('indexOfAgent', args),
771
- numAgents: (...args) => getRequest('numAgents', args),
772
- vaultTokens: (...args) => getRequest('vaultTokens', args),
773
- isRegisteredBackpackItem: (...args) => getRequest('isRegisteredBackpackItem', args),
774
- };
775
- function getMutation(functionName) {
776
- return {
777
- contractName: 'Ledger',
778
- functionName,
779
- deployAddress,
780
- argsType: undefined,
781
- getAbi: () => abi,
782
- };
783
- }
784
- export const mutation = {
785
- pause: getMutation('pause'),
786
- recoverFunds: getMutation('recoverFunds'),
787
- recoverFundsMany: getMutation('recoverFundsMany'),
788
- createUserWallet: getMutation('createUserWallet'),
789
- setUserPoints: getMutation('setUserPoints'),
790
- setGlobalPoints: getMutation('setGlobalPoints'),
791
- setUserAndGlobalPoints: getMutation('setUserAndGlobalPoints'),
792
- setVaultToken: getMutation('setVaultToken'),
793
- registerBackpackItem: getMutation('registerBackpackItem'),
794
- createAgent: getMutation('createAgent'),
795
- };
796
- export function parseEvents(eventName, events) {
797
- return events.map((event) => {
798
- return {
799
- event,
800
- parsed: parseEventLogs({
801
- abi,
802
- eventName,
803
- logs: [event],
804
- }),
805
- };
806
- });
807
- }
808
- export function getEventTopic(eventName) {
809
- return encodeEventTopics({ abi, eventName })[0];
810
- }
811
- export function toSdk(publicClient, walletClient, addressResolver) {
812
- return {
813
- deployAddress,
814
- abi,
815
- events: {
816
- DepartmentPauseModified: { topic: getEventTopic('DepartmentPauseModified'), parse: (events) => parseEvents('DepartmentPauseModified', events) },
817
- DepartmentFundsRecovered: { topic: getEventTopic('DepartmentFundsRecovered'), parse: (events) => parseEvents('DepartmentFundsRecovered', events) },
818
- },
819
- // Queries
820
- getAddys: (...args) => singleQuery(publicClient, call.getAddys(...args), {}, addressResolver),
821
- getUndyHq: (...args) => singleQuery(publicClient, call.getUndyHq(...args), {}, addressResolver),
822
- canMintUndy: (...args) => singleQuery(publicClient, call.canMintUndy(...args), {}, addressResolver),
823
- isPaused: (...args) => singleQuery(publicClient, call.isPaused(...args), {}, addressResolver),
824
- getNumUserWallets: (...args) => singleQuery(publicClient, call.getNumUserWallets(...args), {}, addressResolver),
825
- isUserWallet: (...args) => singleQuery(publicClient, call.isUserWallet(...args), {}, addressResolver),
826
- getLastTotalUsdValue: (...args) => singleQuery(publicClient, call.getLastTotalUsdValue(...args), {}, addressResolver),
827
- getUserAndGlobalPoints: (...args) => singleQuery(publicClient, call.getUserAndGlobalPoints(...args), {}, addressResolver),
828
- isRegisteredVaultToken: (...args) => singleQuery(publicClient, call.isRegisteredVaultToken(...args), {}, addressResolver),
829
- getNumAgents: (...args) => singleQuery(publicClient, call.getNumAgents(...args), {}, addressResolver),
830
- isAgent: (...args) => singleQuery(publicClient, call.isAgent(...args), {}, addressResolver),
831
- userPoints: (...args) => singleQuery(publicClient, call.userPoints(...args), {}, addressResolver),
832
- globalPoints: (...args) => singleQuery(publicClient, call.globalPoints(...args), {}, addressResolver),
833
- userWallets: (...args) => singleQuery(publicClient, call.userWallets(...args), {}, addressResolver),
834
- indexOfUserWallet: (...args) => singleQuery(publicClient, call.indexOfUserWallet(...args), {}, addressResolver),
835
- numUserWallets: (...args) => singleQuery(publicClient, call.numUserWallets(...args), {}, addressResolver),
836
- ambassadors: (...args) => singleQuery(publicClient, call.ambassadors(...args), {}, addressResolver),
837
- agents: (...args) => singleQuery(publicClient, call.agents(...args), {}, addressResolver),
838
- indexOfAgent: (...args) => singleQuery(publicClient, call.indexOfAgent(...args), {}, addressResolver),
839
- numAgents: (...args) => singleQuery(publicClient, call.numAgents(...args), {}, addressResolver),
840
- vaultTokens: (...args) => singleQuery(publicClient, call.vaultTokens(...args), {}, addressResolver),
841
- isRegisteredBackpackItem: (...args) => singleQuery(publicClient, call.isRegisteredBackpackItem(...args), {}, addressResolver),
842
- // Mutations
843
- pause: (...args) => mutate(walletClient, mutation.pause, { addressResolver })(...args),
844
- recoverFunds: (...args) => mutate(walletClient, mutation.recoverFunds, { addressResolver })(...args),
845
- recoverFundsMany: (...args) => mutate(walletClient, mutation.recoverFundsMany, { addressResolver })(...args),
846
- createUserWallet: (...args) => mutate(walletClient, mutation.createUserWallet, { addressResolver })(...args),
847
- setUserPoints: (...args) => mutate(walletClient, mutation.setUserPoints, { addressResolver })(...args),
848
- setGlobalPoints: (...args) => mutate(walletClient, mutation.setGlobalPoints, { addressResolver })(...args),
849
- setUserAndGlobalPoints: (...args) => mutate(walletClient, mutation.setUserAndGlobalPoints, { addressResolver })(...args),
850
- setVaultToken: (...args) => mutate(walletClient, mutation.setVaultToken, { addressResolver })(...args),
851
- registerBackpackItem: (...args) => mutate(walletClient, mutation.registerBackpackItem, { addressResolver })(...args),
852
- createAgent: (...args) => mutate(walletClient, mutation.createAgent, { addressResolver })(...args),
853
- };
854
- }