@underscore-finance/sdk 1.2.19 → 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 (251) 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 -161
  16. package/abis.json +0 -179426
  17. package/addresses.json +0 -75
  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 -1410
  55. package/dist/contracts/ChequeBook.d.ts.map +0 -1
  56. package/dist/contracts/ChequeBook.js +0 -1581
  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/UndyUsds.d.ts +0 -1733
  205. package/dist/contracts/UndyUsds.d.ts.map +0 -1
  206. package/dist/contracts/UndyUsds.js +0 -2235
  207. package/dist/contracts/UndyVirtual.d.ts +0 -1762
  208. package/dist/contracts/UndyVirtual.d.ts.map +0 -1
  209. package/dist/contracts/UndyVirtual.js +0 -2267
  210. package/dist/contracts/UniswapV2.d.ts +0 -2118
  211. package/dist/contracts/UniswapV2.d.ts.map +0 -1
  212. package/dist/contracts/UniswapV2.js +0 -2679
  213. package/dist/contracts/UniswapV3.d.ts +0 -2256
  214. package/dist/contracts/UniswapV3.d.ts.map +0 -1
  215. package/dist/contracts/UniswapV3.js +0 -2848
  216. package/dist/contracts/UserWallet.d.ts +0 -2650
  217. package/dist/contracts/UserWallet.d.ts.map +0 -1
  218. package/dist/contracts/UserWallet.js +0 -3520
  219. package/dist/contracts/UserWalletConfig.d.ts +0 -3834
  220. package/dist/contracts/UserWalletConfig.d.ts.map +0 -1
  221. package/dist/contracts/UserWalletConfig.js +0 -4429
  222. package/dist/contracts/UserWalletConfigV1.d.ts +0 -3692
  223. package/dist/contracts/UserWalletConfigV1.d.ts.map +0 -1
  224. package/dist/contracts/UserWalletConfigV1.js +0 -4276
  225. package/dist/contracts/UserWalletSignatureHelper.d.ts +0 -4552
  226. package/dist/contracts/UserWalletSignatureHelper.d.ts.map +0 -1
  227. package/dist/contracts/UserWalletSignatureHelper.js +0 -6123
  228. package/dist/contracts/UserWalletV1.d.ts +0 -2650
  229. package/dist/contracts/UserWalletV1.d.ts.map +0 -1
  230. package/dist/contracts/UserWalletV1.js +0 -3520
  231. package/dist/contracts/VaultRegistry.d.ts +0 -3162
  232. package/dist/contracts/VaultRegistry.d.ts.map +0 -1
  233. package/dist/contracts/VaultRegistry.js +0 -3893
  234. package/dist/contracts/WalletBackpack.d.ts +0 -1248
  235. package/dist/contracts/WalletBackpack.d.ts.map +0 -1
  236. package/dist/contracts/WalletBackpack.js +0 -1519
  237. package/dist/contracts/Wasabi.d.ts +0 -2620
  238. package/dist/contracts/Wasabi.d.ts.map +0 -1
  239. package/dist/contracts/Wasabi.js +0 -3300
  240. package/dist/contracts/index.d.ts +0 -75
  241. package/dist/contracts/index.d.ts.map +0 -1
  242. package/dist/contracts/index.js +0 -78
  243. package/dist/contracts/sdk.d.ts +0 -154
  244. package/dist/contracts/sdk.d.ts.map +0 -1
  245. package/dist/contracts/sdk.js +0 -156
  246. package/dist/getSwapInstructions.d.ts +0 -34
  247. package/dist/getSwapInstructions.d.ts.map +0 -1
  248. package/dist/getSwapInstructions.js +0 -21
  249. package/dist/index.d.ts +0 -135
  250. package/dist/index.d.ts.map +0 -1
  251. package/dist/index.js +0 -137
@@ -1,1581 +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": "ChequeCreated",
10
- "inputs": [
11
- {
12
- "name": "user",
13
- "type": "address",
14
- "indexed": true
15
- },
16
- {
17
- "name": "recipient",
18
- "type": "address",
19
- "indexed": true
20
- },
21
- {
22
- "name": "asset",
23
- "type": "address",
24
- "indexed": false
25
- },
26
- {
27
- "name": "amount",
28
- "type": "uint256",
29
- "indexed": false
30
- },
31
- {
32
- "name": "usdValue",
33
- "type": "uint256",
34
- "indexed": false
35
- },
36
- {
37
- "name": "unlockBlock",
38
- "type": "uint256",
39
- "indexed": false
40
- },
41
- {
42
- "name": "expiryBlock",
43
- "type": "uint256",
44
- "indexed": false
45
- },
46
- {
47
- "name": "canManagerPay",
48
- "type": "bool",
49
- "indexed": false
50
- },
51
- {
52
- "name": "canBePulled",
53
- "type": "bool",
54
- "indexed": false
55
- },
56
- {
57
- "name": "creator",
58
- "type": "address",
59
- "indexed": true
60
- }
61
- ],
62
- "anonymous": false,
63
- "type": "event"
64
- },
65
- {
66
- "name": "ChequeCancelled",
67
- "inputs": [
68
- {
69
- "name": "user",
70
- "type": "address",
71
- "indexed": true
72
- },
73
- {
74
- "name": "recipient",
75
- "type": "address",
76
- "indexed": true
77
- },
78
- {
79
- "name": "asset",
80
- "type": "address",
81
- "indexed": false
82
- },
83
- {
84
- "name": "amount",
85
- "type": "uint256",
86
- "indexed": false
87
- },
88
- {
89
- "name": "usdValue",
90
- "type": "uint256",
91
- "indexed": false
92
- },
93
- {
94
- "name": "unlockBlock",
95
- "type": "uint256",
96
- "indexed": false
97
- },
98
- {
99
- "name": "expiryBlock",
100
- "type": "uint256",
101
- "indexed": false
102
- },
103
- {
104
- "name": "canManagerPay",
105
- "type": "bool",
106
- "indexed": false
107
- },
108
- {
109
- "name": "canBePulled",
110
- "type": "bool",
111
- "indexed": false
112
- },
113
- {
114
- "name": "cancelledBy",
115
- "type": "address",
116
- "indexed": true
117
- }
118
- ],
119
- "anonymous": false,
120
- "type": "event"
121
- },
122
- {
123
- "name": "ChequeSettingsModified",
124
- "inputs": [
125
- {
126
- "name": "user",
127
- "type": "address",
128
- "indexed": true
129
- },
130
- {
131
- "name": "maxNumActiveCheques",
132
- "type": "uint256",
133
- "indexed": false
134
- },
135
- {
136
- "name": "maxChequeUsdValue",
137
- "type": "uint256",
138
- "indexed": false
139
- },
140
- {
141
- "name": "instantUsdThreshold",
142
- "type": "uint256",
143
- "indexed": false
144
- },
145
- {
146
- "name": "perPeriodPaidUsdCap",
147
- "type": "uint256",
148
- "indexed": false
149
- },
150
- {
151
- "name": "maxNumChequesPaidPerPeriod",
152
- "type": "uint256",
153
- "indexed": false
154
- },
155
- {
156
- "name": "payCooldownBlocks",
157
- "type": "uint256",
158
- "indexed": false
159
- },
160
- {
161
- "name": "perPeriodCreatedUsdCap",
162
- "type": "uint256",
163
- "indexed": false
164
- },
165
- {
166
- "name": "maxNumChequesCreatedPerPeriod",
167
- "type": "uint256",
168
- "indexed": false
169
- },
170
- {
171
- "name": "createCooldownBlocks",
172
- "type": "uint256",
173
- "indexed": false
174
- },
175
- {
176
- "name": "periodLength",
177
- "type": "uint256",
178
- "indexed": false
179
- },
180
- {
181
- "name": "expensiveDelayBlocks",
182
- "type": "uint256",
183
- "indexed": false
184
- },
185
- {
186
- "name": "defaultExpiryBlocks",
187
- "type": "uint256",
188
- "indexed": false
189
- },
190
- {
191
- "name": "canManagersCreateCheques",
192
- "type": "bool",
193
- "indexed": false
194
- },
195
- {
196
- "name": "canManagerPay",
197
- "type": "bool",
198
- "indexed": false
199
- },
200
- {
201
- "name": "canBePulled",
202
- "type": "bool",
203
- "indexed": false
204
- }
205
- ],
206
- "anonymous": false,
207
- "type": "event"
208
- },
209
- {
210
- "stateMutability": "nonpayable",
211
- "type": "function",
212
- "name": "createCheque",
213
- "inputs": [
214
- {
215
- "name": "_userWallet",
216
- "type": "address"
217
- },
218
- {
219
- "name": "_recipient",
220
- "type": "address"
221
- },
222
- {
223
- "name": "_asset",
224
- "type": "address"
225
- },
226
- {
227
- "name": "_amount",
228
- "type": "uint256"
229
- },
230
- {
231
- "name": "_unlockNumBlocks",
232
- "type": "uint256"
233
- },
234
- {
235
- "name": "_expiryNumBlocks",
236
- "type": "uint256"
237
- },
238
- {
239
- "name": "_canManagerPay",
240
- "type": "bool"
241
- },
242
- {
243
- "name": "_canBePulled",
244
- "type": "bool"
245
- }
246
- ],
247
- "outputs": [
248
- {
249
- "name": "",
250
- "type": "bool"
251
- }
252
- ]
253
- },
254
- {
255
- "stateMutability": "view",
256
- "type": "function",
257
- "name": "canCreateCheque",
258
- "inputs": [
259
- {
260
- "name": "_isCreatorOwner",
261
- "type": "bool"
262
- },
263
- {
264
- "name": "_isCreatorManager",
265
- "type": "bool"
266
- },
267
- {
268
- "name": "_canManagersCreateCheques",
269
- "type": "bool"
270
- },
271
- {
272
- "name": "_asset",
273
- "type": "address"
274
- },
275
- {
276
- "name": "_globalManagerSettings",
277
- "type": "tuple",
278
- "components": [
279
- {
280
- "name": "managerPeriod",
281
- "type": "uint256"
282
- },
283
- {
284
- "name": "startDelay",
285
- "type": "uint256"
286
- },
287
- {
288
- "name": "activationLength",
289
- "type": "uint256"
290
- },
291
- {
292
- "name": "canOwnerManage",
293
- "type": "bool"
294
- },
295
- {
296
- "name": "limits",
297
- "type": "tuple",
298
- "components": [
299
- {
300
- "name": "maxUsdValuePerTx",
301
- "type": "uint256"
302
- },
303
- {
304
- "name": "maxUsdValuePerPeriod",
305
- "type": "uint256"
306
- },
307
- {
308
- "name": "maxUsdValueLifetime",
309
- "type": "uint256"
310
- },
311
- {
312
- "name": "maxNumTxsPerPeriod",
313
- "type": "uint256"
314
- },
315
- {
316
- "name": "txCooldownBlocks",
317
- "type": "uint256"
318
- },
319
- {
320
- "name": "failOnZeroPrice",
321
- "type": "bool"
322
- }
323
- ]
324
- },
325
- {
326
- "name": "legoPerms",
327
- "type": "tuple",
328
- "components": [
329
- {
330
- "name": "canManageYield",
331
- "type": "bool"
332
- },
333
- {
334
- "name": "canBuyAndSell",
335
- "type": "bool"
336
- },
337
- {
338
- "name": "canManageDebt",
339
- "type": "bool"
340
- },
341
- {
342
- "name": "canManageLiq",
343
- "type": "bool"
344
- },
345
- {
346
- "name": "canClaimRewards",
347
- "type": "bool"
348
- },
349
- {
350
- "name": "onlyApprovedYieldOpps",
351
- "type": "bool"
352
- },
353
- {
354
- "name": "allowedLegos",
355
- "type": "uint256[]"
356
- }
357
- ]
358
- },
359
- {
360
- "name": "swapPerms",
361
- "type": "tuple",
362
- "components": [
363
- {
364
- "name": "mustHaveUsdValue",
365
- "type": "bool"
366
- },
367
- {
368
- "name": "maxNumSwapsPerPeriod",
369
- "type": "uint256"
370
- },
371
- {
372
- "name": "maxSlippage",
373
- "type": "uint256"
374
- }
375
- ]
376
- },
377
- {
378
- "name": "whitelistPerms",
379
- "type": "tuple",
380
- "components": [
381
- {
382
- "name": "canAddPending",
383
- "type": "bool"
384
- },
385
- {
386
- "name": "canConfirm",
387
- "type": "bool"
388
- },
389
- {
390
- "name": "canCancel",
391
- "type": "bool"
392
- },
393
- {
394
- "name": "canRemove",
395
- "type": "bool"
396
- }
397
- ]
398
- },
399
- {
400
- "name": "transferPerms",
401
- "type": "tuple",
402
- "components": [
403
- {
404
- "name": "canTransfer",
405
- "type": "bool"
406
- },
407
- {
408
- "name": "canCreateCheque",
409
- "type": "bool"
410
- },
411
- {
412
- "name": "canAddPendingPayee",
413
- "type": "bool"
414
- },
415
- {
416
- "name": "allowedPayees",
417
- "type": "address[]"
418
- }
419
- ]
420
- },
421
- {
422
- "name": "allowedAssets",
423
- "type": "address[]"
424
- }
425
- ]
426
- },
427
- {
428
- "name": "_managerSettings",
429
- "type": "tuple",
430
- "components": [
431
- {
432
- "name": "startBlock",
433
- "type": "uint256"
434
- },
435
- {
436
- "name": "expiryBlock",
437
- "type": "uint256"
438
- },
439
- {
440
- "name": "limits",
441
- "type": "tuple",
442
- "components": [
443
- {
444
- "name": "maxUsdValuePerTx",
445
- "type": "uint256"
446
- },
447
- {
448
- "name": "maxUsdValuePerPeriod",
449
- "type": "uint256"
450
- },
451
- {
452
- "name": "maxUsdValueLifetime",
453
- "type": "uint256"
454
- },
455
- {
456
- "name": "maxNumTxsPerPeriod",
457
- "type": "uint256"
458
- },
459
- {
460
- "name": "txCooldownBlocks",
461
- "type": "uint256"
462
- },
463
- {
464
- "name": "failOnZeroPrice",
465
- "type": "bool"
466
- }
467
- ]
468
- },
469
- {
470
- "name": "legoPerms",
471
- "type": "tuple",
472
- "components": [
473
- {
474
- "name": "canManageYield",
475
- "type": "bool"
476
- },
477
- {
478
- "name": "canBuyAndSell",
479
- "type": "bool"
480
- },
481
- {
482
- "name": "canManageDebt",
483
- "type": "bool"
484
- },
485
- {
486
- "name": "canManageLiq",
487
- "type": "bool"
488
- },
489
- {
490
- "name": "canClaimRewards",
491
- "type": "bool"
492
- },
493
- {
494
- "name": "onlyApprovedYieldOpps",
495
- "type": "bool"
496
- },
497
- {
498
- "name": "allowedLegos",
499
- "type": "uint256[]"
500
- }
501
- ]
502
- },
503
- {
504
- "name": "swapPerms",
505
- "type": "tuple",
506
- "components": [
507
- {
508
- "name": "mustHaveUsdValue",
509
- "type": "bool"
510
- },
511
- {
512
- "name": "maxNumSwapsPerPeriod",
513
- "type": "uint256"
514
- },
515
- {
516
- "name": "maxSlippage",
517
- "type": "uint256"
518
- }
519
- ]
520
- },
521
- {
522
- "name": "whitelistPerms",
523
- "type": "tuple",
524
- "components": [
525
- {
526
- "name": "canAddPending",
527
- "type": "bool"
528
- },
529
- {
530
- "name": "canConfirm",
531
- "type": "bool"
532
- },
533
- {
534
- "name": "canCancel",
535
- "type": "bool"
536
- },
537
- {
538
- "name": "canRemove",
539
- "type": "bool"
540
- }
541
- ]
542
- },
543
- {
544
- "name": "transferPerms",
545
- "type": "tuple",
546
- "components": [
547
- {
548
- "name": "canTransfer",
549
- "type": "bool"
550
- },
551
- {
552
- "name": "canCreateCheque",
553
- "type": "bool"
554
- },
555
- {
556
- "name": "canAddPendingPayee",
557
- "type": "bool"
558
- },
559
- {
560
- "name": "allowedPayees",
561
- "type": "address[]"
562
- }
563
- ]
564
- },
565
- {
566
- "name": "allowedAssets",
567
- "type": "address[]"
568
- },
569
- {
570
- "name": "canClaimLoot",
571
- "type": "bool"
572
- }
573
- ]
574
- }
575
- ],
576
- "outputs": [
577
- {
578
- "name": "",
579
- "type": "bool"
580
- }
581
- ]
582
- },
583
- {
584
- "stateMutability": "view",
585
- "type": "function",
586
- "name": "isValidNewCheque",
587
- "inputs": [
588
- {
589
- "name": "_wallet",
590
- "type": "address"
591
- },
592
- {
593
- "name": "_walletConfig",
594
- "type": "address"
595
- },
596
- {
597
- "name": "_owner",
598
- "type": "address"
599
- },
600
- {
601
- "name": "_isRecipientOnWhitelist",
602
- "type": "bool"
603
- },
604
- {
605
- "name": "_chequeSettings",
606
- "type": "tuple",
607
- "components": [
608
- {
609
- "name": "maxNumActiveCheques",
610
- "type": "uint256"
611
- },
612
- {
613
- "name": "maxChequeUsdValue",
614
- "type": "uint256"
615
- },
616
- {
617
- "name": "instantUsdThreshold",
618
- "type": "uint256"
619
- },
620
- {
621
- "name": "perPeriodPaidUsdCap",
622
- "type": "uint256"
623
- },
624
- {
625
- "name": "maxNumChequesPaidPerPeriod",
626
- "type": "uint256"
627
- },
628
- {
629
- "name": "payCooldownBlocks",
630
- "type": "uint256"
631
- },
632
- {
633
- "name": "perPeriodCreatedUsdCap",
634
- "type": "uint256"
635
- },
636
- {
637
- "name": "maxNumChequesCreatedPerPeriod",
638
- "type": "uint256"
639
- },
640
- {
641
- "name": "createCooldownBlocks",
642
- "type": "uint256"
643
- },
644
- {
645
- "name": "periodLength",
646
- "type": "uint256"
647
- },
648
- {
649
- "name": "expensiveDelayBlocks",
650
- "type": "uint256"
651
- },
652
- {
653
- "name": "defaultExpiryBlocks",
654
- "type": "uint256"
655
- },
656
- {
657
- "name": "allowedAssets",
658
- "type": "address[]"
659
- },
660
- {
661
- "name": "canManagersCreateCheques",
662
- "type": "bool"
663
- },
664
- {
665
- "name": "canManagerPay",
666
- "type": "bool"
667
- },
668
- {
669
- "name": "canBePulled",
670
- "type": "bool"
671
- }
672
- ]
673
- },
674
- {
675
- "name": "_chequeData",
676
- "type": "tuple",
677
- "components": [
678
- {
679
- "name": "numChequesPaidInPeriod",
680
- "type": "uint256"
681
- },
682
- {
683
- "name": "totalUsdValuePaidInPeriod",
684
- "type": "uint256"
685
- },
686
- {
687
- "name": "totalNumChequesPaid",
688
- "type": "uint256"
689
- },
690
- {
691
- "name": "totalUsdValuePaid",
692
- "type": "uint256"
693
- },
694
- {
695
- "name": "lastChequePaidBlock",
696
- "type": "uint256"
697
- },
698
- {
699
- "name": "numChequesCreatedInPeriod",
700
- "type": "uint256"
701
- },
702
- {
703
- "name": "totalUsdValueCreatedInPeriod",
704
- "type": "uint256"
705
- },
706
- {
707
- "name": "totalNumChequesCreated",
708
- "type": "uint256"
709
- },
710
- {
711
- "name": "totalUsdValueCreated",
712
- "type": "uint256"
713
- },
714
- {
715
- "name": "lastChequeCreatedBlock",
716
- "type": "uint256"
717
- },
718
- {
719
- "name": "periodStartBlock",
720
- "type": "uint256"
721
- }
722
- ]
723
- },
724
- {
725
- "name": "_isExistingCheque",
726
- "type": "bool"
727
- },
728
- {
729
- "name": "_numActiveCheques",
730
- "type": "uint256"
731
- },
732
- {
733
- "name": "_isExistingPayee",
734
- "type": "bool"
735
- },
736
- {
737
- "name": "_timeLock",
738
- "type": "uint256"
739
- },
740
- {
741
- "name": "_recipient",
742
- "type": "address"
743
- },
744
- {
745
- "name": "_asset",
746
- "type": "address"
747
- },
748
- {
749
- "name": "_amount",
750
- "type": "uint256"
751
- },
752
- {
753
- "name": "_unlockNumBlocks",
754
- "type": "uint256"
755
- },
756
- {
757
- "name": "_expiryNumBlocks",
758
- "type": "uint256"
759
- },
760
- {
761
- "name": "_canManagerPay",
762
- "type": "bool"
763
- },
764
- {
765
- "name": "_canBePulled",
766
- "type": "bool"
767
- },
768
- {
769
- "name": "_creator",
770
- "type": "address"
771
- },
772
- {
773
- "name": "_usdValue",
774
- "type": "uint256"
775
- }
776
- ],
777
- "outputs": [
778
- {
779
- "name": "",
780
- "type": "bool"
781
- }
782
- ]
783
- },
784
- {
785
- "stateMutability": "nonpayable",
786
- "type": "function",
787
- "name": "cancelCheque",
788
- "inputs": [
789
- {
790
- "name": "_userWallet",
791
- "type": "address"
792
- },
793
- {
794
- "name": "_recipient",
795
- "type": "address"
796
- }
797
- ],
798
- "outputs": [
799
- {
800
- "name": "",
801
- "type": "bool"
802
- }
803
- ]
804
- },
805
- {
806
- "stateMutability": "nonpayable",
807
- "type": "function",
808
- "name": "setChequeSettings",
809
- "inputs": [
810
- {
811
- "name": "_userWallet",
812
- "type": "address"
813
- },
814
- {
815
- "name": "_maxNumActiveCheques",
816
- "type": "uint256"
817
- },
818
- {
819
- "name": "_maxChequeUsdValue",
820
- "type": "uint256"
821
- },
822
- {
823
- "name": "_instantUsdThreshold",
824
- "type": "uint256"
825
- },
826
- {
827
- "name": "_perPeriodPaidUsdCap",
828
- "type": "uint256"
829
- },
830
- {
831
- "name": "_maxNumChequesPaidPerPeriod",
832
- "type": "uint256"
833
- },
834
- {
835
- "name": "_payCooldownBlocks",
836
- "type": "uint256"
837
- },
838
- {
839
- "name": "_perPeriodCreatedUsdCap",
840
- "type": "uint256"
841
- },
842
- {
843
- "name": "_maxNumChequesCreatedPerPeriod",
844
- "type": "uint256"
845
- },
846
- {
847
- "name": "_createCooldownBlocks",
848
- "type": "uint256"
849
- },
850
- {
851
- "name": "_periodLength",
852
- "type": "uint256"
853
- },
854
- {
855
- "name": "_expensiveDelayBlocks",
856
- "type": "uint256"
857
- },
858
- {
859
- "name": "_defaultExpiryBlocks",
860
- "type": "uint256"
861
- },
862
- {
863
- "name": "_allowedAssets",
864
- "type": "address[]"
865
- },
866
- {
867
- "name": "_canManagersCreateCheques",
868
- "type": "bool"
869
- },
870
- {
871
- "name": "_canManagerPay",
872
- "type": "bool"
873
- },
874
- {
875
- "name": "_canBePulled",
876
- "type": "bool"
877
- }
878
- ],
879
- "outputs": [
880
- {
881
- "name": "",
882
- "type": "bool"
883
- }
884
- ]
885
- },
886
- {
887
- "stateMutability": "view",
888
- "type": "function",
889
- "name": "isValidChequeSettings",
890
- "inputs": [
891
- {
892
- "name": "_maxNumActiveCheques",
893
- "type": "uint256"
894
- },
895
- {
896
- "name": "_maxChequeUsdValue",
897
- "type": "uint256"
898
- },
899
- {
900
- "name": "_instantUsdThreshold",
901
- "type": "uint256"
902
- },
903
- {
904
- "name": "_perPeriodPaidUsdCap",
905
- "type": "uint256"
906
- },
907
- {
908
- "name": "_maxNumChequesPaidPerPeriod",
909
- "type": "uint256"
910
- },
911
- {
912
- "name": "_payCooldownBlocks",
913
- "type": "uint256"
914
- },
915
- {
916
- "name": "_perPeriodCreatedUsdCap",
917
- "type": "uint256"
918
- },
919
- {
920
- "name": "_maxNumChequesCreatedPerPeriod",
921
- "type": "uint256"
922
- },
923
- {
924
- "name": "_createCooldownBlocks",
925
- "type": "uint256"
926
- },
927
- {
928
- "name": "_periodLength",
929
- "type": "uint256"
930
- },
931
- {
932
- "name": "_expensiveDelayBlocks",
933
- "type": "uint256"
934
- },
935
- {
936
- "name": "_defaultExpiryBlocks",
937
- "type": "uint256"
938
- },
939
- {
940
- "name": "_timeLock",
941
- "type": "uint256"
942
- }
943
- ],
944
- "outputs": [
945
- {
946
- "name": "",
947
- "type": "bool"
948
- }
949
- ]
950
- },
951
- {
952
- "stateMutability": "view",
953
- "type": "function",
954
- "name": "getChequeConfig",
955
- "inputs": [
956
- {
957
- "name": "_userWallet",
958
- "type": "address"
959
- },
960
- {
961
- "name": "_creator",
962
- "type": "address"
963
- },
964
- {
965
- "name": "_recipient",
966
- "type": "address"
967
- }
968
- ],
969
- "outputs": [
970
- {
971
- "name": "",
972
- "type": "tuple",
973
- "components": [
974
- {
975
- "name": "wallet",
976
- "type": "address"
977
- },
978
- {
979
- "name": "walletConfig",
980
- "type": "address"
981
- },
982
- {
983
- "name": "owner",
984
- "type": "address"
985
- },
986
- {
987
- "name": "isRecipientOnWhitelist",
988
- "type": "bool"
989
- },
990
- {
991
- "name": "isCreatorManager",
992
- "type": "bool"
993
- },
994
- {
995
- "name": "managerSettings",
996
- "type": "tuple",
997
- "components": [
998
- {
999
- "name": "startBlock",
1000
- "type": "uint256"
1001
- },
1002
- {
1003
- "name": "expiryBlock",
1004
- "type": "uint256"
1005
- },
1006
- {
1007
- "name": "limits",
1008
- "type": "tuple",
1009
- "components": [
1010
- {
1011
- "name": "maxUsdValuePerTx",
1012
- "type": "uint256"
1013
- },
1014
- {
1015
- "name": "maxUsdValuePerPeriod",
1016
- "type": "uint256"
1017
- },
1018
- {
1019
- "name": "maxUsdValueLifetime",
1020
- "type": "uint256"
1021
- },
1022
- {
1023
- "name": "maxNumTxsPerPeriod",
1024
- "type": "uint256"
1025
- },
1026
- {
1027
- "name": "txCooldownBlocks",
1028
- "type": "uint256"
1029
- },
1030
- {
1031
- "name": "failOnZeroPrice",
1032
- "type": "bool"
1033
- }
1034
- ]
1035
- },
1036
- {
1037
- "name": "legoPerms",
1038
- "type": "tuple",
1039
- "components": [
1040
- {
1041
- "name": "canManageYield",
1042
- "type": "bool"
1043
- },
1044
- {
1045
- "name": "canBuyAndSell",
1046
- "type": "bool"
1047
- },
1048
- {
1049
- "name": "canManageDebt",
1050
- "type": "bool"
1051
- },
1052
- {
1053
- "name": "canManageLiq",
1054
- "type": "bool"
1055
- },
1056
- {
1057
- "name": "canClaimRewards",
1058
- "type": "bool"
1059
- },
1060
- {
1061
- "name": "onlyApprovedYieldOpps",
1062
- "type": "bool"
1063
- },
1064
- {
1065
- "name": "allowedLegos",
1066
- "type": "uint256[]"
1067
- }
1068
- ]
1069
- },
1070
- {
1071
- "name": "swapPerms",
1072
- "type": "tuple",
1073
- "components": [
1074
- {
1075
- "name": "mustHaveUsdValue",
1076
- "type": "bool"
1077
- },
1078
- {
1079
- "name": "maxNumSwapsPerPeriod",
1080
- "type": "uint256"
1081
- },
1082
- {
1083
- "name": "maxSlippage",
1084
- "type": "uint256"
1085
- }
1086
- ]
1087
- },
1088
- {
1089
- "name": "whitelistPerms",
1090
- "type": "tuple",
1091
- "components": [
1092
- {
1093
- "name": "canAddPending",
1094
- "type": "bool"
1095
- },
1096
- {
1097
- "name": "canConfirm",
1098
- "type": "bool"
1099
- },
1100
- {
1101
- "name": "canCancel",
1102
- "type": "bool"
1103
- },
1104
- {
1105
- "name": "canRemove",
1106
- "type": "bool"
1107
- }
1108
- ]
1109
- },
1110
- {
1111
- "name": "transferPerms",
1112
- "type": "tuple",
1113
- "components": [
1114
- {
1115
- "name": "canTransfer",
1116
- "type": "bool"
1117
- },
1118
- {
1119
- "name": "canCreateCheque",
1120
- "type": "bool"
1121
- },
1122
- {
1123
- "name": "canAddPendingPayee",
1124
- "type": "bool"
1125
- },
1126
- {
1127
- "name": "allowedPayees",
1128
- "type": "address[]"
1129
- }
1130
- ]
1131
- },
1132
- {
1133
- "name": "allowedAssets",
1134
- "type": "address[]"
1135
- },
1136
- {
1137
- "name": "canClaimLoot",
1138
- "type": "bool"
1139
- }
1140
- ]
1141
- },
1142
- {
1143
- "name": "chequeSettings",
1144
- "type": "tuple",
1145
- "components": [
1146
- {
1147
- "name": "maxNumActiveCheques",
1148
- "type": "uint256"
1149
- },
1150
- {
1151
- "name": "maxChequeUsdValue",
1152
- "type": "uint256"
1153
- },
1154
- {
1155
- "name": "instantUsdThreshold",
1156
- "type": "uint256"
1157
- },
1158
- {
1159
- "name": "perPeriodPaidUsdCap",
1160
- "type": "uint256"
1161
- },
1162
- {
1163
- "name": "maxNumChequesPaidPerPeriod",
1164
- "type": "uint256"
1165
- },
1166
- {
1167
- "name": "payCooldownBlocks",
1168
- "type": "uint256"
1169
- },
1170
- {
1171
- "name": "perPeriodCreatedUsdCap",
1172
- "type": "uint256"
1173
- },
1174
- {
1175
- "name": "maxNumChequesCreatedPerPeriod",
1176
- "type": "uint256"
1177
- },
1178
- {
1179
- "name": "createCooldownBlocks",
1180
- "type": "uint256"
1181
- },
1182
- {
1183
- "name": "periodLength",
1184
- "type": "uint256"
1185
- },
1186
- {
1187
- "name": "expensiveDelayBlocks",
1188
- "type": "uint256"
1189
- },
1190
- {
1191
- "name": "defaultExpiryBlocks",
1192
- "type": "uint256"
1193
- },
1194
- {
1195
- "name": "allowedAssets",
1196
- "type": "address[]"
1197
- },
1198
- {
1199
- "name": "canManagersCreateCheques",
1200
- "type": "bool"
1201
- },
1202
- {
1203
- "name": "canManagerPay",
1204
- "type": "bool"
1205
- },
1206
- {
1207
- "name": "canBePulled",
1208
- "type": "bool"
1209
- }
1210
- ]
1211
- },
1212
- {
1213
- "name": "chequeData",
1214
- "type": "tuple",
1215
- "components": [
1216
- {
1217
- "name": "numChequesPaidInPeriod",
1218
- "type": "uint256"
1219
- },
1220
- {
1221
- "name": "totalUsdValuePaidInPeriod",
1222
- "type": "uint256"
1223
- },
1224
- {
1225
- "name": "totalNumChequesPaid",
1226
- "type": "uint256"
1227
- },
1228
- {
1229
- "name": "totalUsdValuePaid",
1230
- "type": "uint256"
1231
- },
1232
- {
1233
- "name": "lastChequePaidBlock",
1234
- "type": "uint256"
1235
- },
1236
- {
1237
- "name": "numChequesCreatedInPeriod",
1238
- "type": "uint256"
1239
- },
1240
- {
1241
- "name": "totalUsdValueCreatedInPeriod",
1242
- "type": "uint256"
1243
- },
1244
- {
1245
- "name": "totalNumChequesCreated",
1246
- "type": "uint256"
1247
- },
1248
- {
1249
- "name": "totalUsdValueCreated",
1250
- "type": "uint256"
1251
- },
1252
- {
1253
- "name": "lastChequeCreatedBlock",
1254
- "type": "uint256"
1255
- },
1256
- {
1257
- "name": "periodStartBlock",
1258
- "type": "uint256"
1259
- }
1260
- ]
1261
- },
1262
- {
1263
- "name": "isExistingCheque",
1264
- "type": "bool"
1265
- },
1266
- {
1267
- "name": "numActiveCheques",
1268
- "type": "uint256"
1269
- },
1270
- {
1271
- "name": "isExistingPayee",
1272
- "type": "bool"
1273
- },
1274
- {
1275
- "name": "timeLock",
1276
- "type": "uint256"
1277
- }
1278
- ]
1279
- }
1280
- ]
1281
- },
1282
- {
1283
- "stateMutability": "view",
1284
- "type": "function",
1285
- "name": "createDefaultChequeSettings",
1286
- "inputs": [
1287
- {
1288
- "name": "_maxNumActiveCheques",
1289
- "type": "uint256"
1290
- },
1291
- {
1292
- "name": "_instantUsdThreshold",
1293
- "type": "uint256"
1294
- },
1295
- {
1296
- "name": "_periodLength",
1297
- "type": "uint256"
1298
- },
1299
- {
1300
- "name": "_expensiveDelayBlocks",
1301
- "type": "uint256"
1302
- },
1303
- {
1304
- "name": "_defaultExpiryBlocks",
1305
- "type": "uint256"
1306
- }
1307
- ],
1308
- "outputs": [
1309
- {
1310
- "name": "",
1311
- "type": "tuple",
1312
- "components": [
1313
- {
1314
- "name": "maxNumActiveCheques",
1315
- "type": "uint256"
1316
- },
1317
- {
1318
- "name": "maxChequeUsdValue",
1319
- "type": "uint256"
1320
- },
1321
- {
1322
- "name": "instantUsdThreshold",
1323
- "type": "uint256"
1324
- },
1325
- {
1326
- "name": "perPeriodPaidUsdCap",
1327
- "type": "uint256"
1328
- },
1329
- {
1330
- "name": "maxNumChequesPaidPerPeriod",
1331
- "type": "uint256"
1332
- },
1333
- {
1334
- "name": "payCooldownBlocks",
1335
- "type": "uint256"
1336
- },
1337
- {
1338
- "name": "perPeriodCreatedUsdCap",
1339
- "type": "uint256"
1340
- },
1341
- {
1342
- "name": "maxNumChequesCreatedPerPeriod",
1343
- "type": "uint256"
1344
- },
1345
- {
1346
- "name": "createCooldownBlocks",
1347
- "type": "uint256"
1348
- },
1349
- {
1350
- "name": "periodLength",
1351
- "type": "uint256"
1352
- },
1353
- {
1354
- "name": "expensiveDelayBlocks",
1355
- "type": "uint256"
1356
- },
1357
- {
1358
- "name": "defaultExpiryBlocks",
1359
- "type": "uint256"
1360
- },
1361
- {
1362
- "name": "allowedAssets",
1363
- "type": "address[]"
1364
- },
1365
- {
1366
- "name": "canManagersCreateCheques",
1367
- "type": "bool"
1368
- },
1369
- {
1370
- "name": "canManagerPay",
1371
- "type": "bool"
1372
- },
1373
- {
1374
- "name": "canBePulled",
1375
- "type": "bool"
1376
- }
1377
- ]
1378
- }
1379
- ]
1380
- },
1381
- {
1382
- "stateMutability": "view",
1383
- "type": "function",
1384
- "name": "UNDY_HQ",
1385
- "inputs": [],
1386
- "outputs": [
1387
- {
1388
- "name": "",
1389
- "type": "address"
1390
- }
1391
- ]
1392
- },
1393
- {
1394
- "stateMutability": "view",
1395
- "type": "function",
1396
- "name": "MIN_CHEQUE_PERIOD",
1397
- "inputs": [],
1398
- "outputs": [
1399
- {
1400
- "name": "",
1401
- "type": "uint256"
1402
- }
1403
- ]
1404
- },
1405
- {
1406
- "stateMutability": "view",
1407
- "type": "function",
1408
- "name": "MAX_CHEQUE_PERIOD",
1409
- "inputs": [],
1410
- "outputs": [
1411
- {
1412
- "name": "",
1413
- "type": "uint256"
1414
- }
1415
- ]
1416
- },
1417
- {
1418
- "stateMutability": "view",
1419
- "type": "function",
1420
- "name": "MIN_EXPENSIVE_CHEQUE_DELAY",
1421
- "inputs": [],
1422
- "outputs": [
1423
- {
1424
- "name": "",
1425
- "type": "uint256"
1426
- }
1427
- ]
1428
- },
1429
- {
1430
- "stateMutability": "view",
1431
- "type": "function",
1432
- "name": "MAX_UNLOCK_BLOCKS",
1433
- "inputs": [],
1434
- "outputs": [
1435
- {
1436
- "name": "",
1437
- "type": "uint256"
1438
- }
1439
- ]
1440
- },
1441
- {
1442
- "stateMutability": "view",
1443
- "type": "function",
1444
- "name": "MAX_EXPIRY_BLOCKS",
1445
- "inputs": [],
1446
- "outputs": [
1447
- {
1448
- "name": "",
1449
- "type": "uint256"
1450
- }
1451
- ]
1452
- },
1453
- {
1454
- "stateMutability": "nonpayable",
1455
- "type": "constructor",
1456
- "inputs": [
1457
- {
1458
- "name": "_undyHq",
1459
- "type": "address"
1460
- },
1461
- {
1462
- "name": "_minChequePeriod",
1463
- "type": "uint256"
1464
- },
1465
- {
1466
- "name": "_maxChequePeriod",
1467
- "type": "uint256"
1468
- },
1469
- {
1470
- "name": "_minExpensiveChequeDelay",
1471
- "type": "uint256"
1472
- },
1473
- {
1474
- "name": "_maxUnlockBlocks",
1475
- "type": "uint256"
1476
- },
1477
- {
1478
- "name": "_maxExpiryBlocks",
1479
- "type": "uint256"
1480
- }
1481
- ],
1482
- "outputs": []
1483
- }
1484
- ];
1485
- export const deployAddress = '0x68ad259f7Fd1C734779EB4e8b94b826d7D11a61e';
1486
- function getRequest(method, args, contractAddressOrOptions) {
1487
- const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
1488
- const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
1489
- const call = {
1490
- contractName: 'ChequeBook',
1491
- method,
1492
- args,
1493
- address,
1494
- deployAddress,
1495
- defaultValue,
1496
- getAbi: () => abi,
1497
- with: (options) => {
1498
- call.address = options.contractAddress;
1499
- call.defaultValue = options.defaultValue;
1500
- return call;
1501
- },
1502
- defaultTo: (defaultValue) => {
1503
- call.defaultValue = defaultValue;
1504
- return call;
1505
- },
1506
- at: (address) => {
1507
- call.address = address;
1508
- return call;
1509
- },
1510
- };
1511
- return call;
1512
- }
1513
- export const call = {
1514
- canCreateCheque: (...args) => getRequest('canCreateCheque', args),
1515
- isValidNewCheque: (...args) => getRequest('isValidNewCheque', args),
1516
- isValidChequeSettings: (...args) => getRequest('isValidChequeSettings', args),
1517
- getChequeConfig: (...args) => getRequest('getChequeConfig', args),
1518
- createDefaultChequeSettings: (...args) => getRequest('createDefaultChequeSettings', args),
1519
- UNDY_HQ: (...args) => getRequest('UNDY_HQ', args),
1520
- MIN_CHEQUE_PERIOD: (...args) => getRequest('MIN_CHEQUE_PERIOD', args),
1521
- MAX_CHEQUE_PERIOD: (...args) => getRequest('MAX_CHEQUE_PERIOD', args),
1522
- MIN_EXPENSIVE_CHEQUE_DELAY: (...args) => getRequest('MIN_EXPENSIVE_CHEQUE_DELAY', args),
1523
- MAX_UNLOCK_BLOCKS: (...args) => getRequest('MAX_UNLOCK_BLOCKS', args),
1524
- MAX_EXPIRY_BLOCKS: (...args) => getRequest('MAX_EXPIRY_BLOCKS', args),
1525
- };
1526
- function getMutation(functionName) {
1527
- return {
1528
- contractName: 'ChequeBook',
1529
- functionName,
1530
- deployAddress,
1531
- argsType: undefined,
1532
- getAbi: () => abi,
1533
- };
1534
- }
1535
- export const mutation = {
1536
- createCheque: getMutation('createCheque'),
1537
- cancelCheque: getMutation('cancelCheque'),
1538
- setChequeSettings: getMutation('setChequeSettings'),
1539
- };
1540
- export function parseEvents(eventName, events) {
1541
- return events.map((event) => {
1542
- return {
1543
- event,
1544
- parsed: parseEventLogs({
1545
- abi,
1546
- eventName,
1547
- logs: [event],
1548
- }),
1549
- };
1550
- });
1551
- }
1552
- export function getEventTopic(eventName) {
1553
- return encodeEventTopics({ abi, eventName })[0];
1554
- }
1555
- export function toSdk(publicClient, walletClient, addressResolver) {
1556
- return {
1557
- deployAddress,
1558
- abi,
1559
- events: {
1560
- ChequeCreated: { topic: getEventTopic('ChequeCreated'), parse: (events) => parseEvents('ChequeCreated', events) },
1561
- ChequeCancelled: { topic: getEventTopic('ChequeCancelled'), parse: (events) => parseEvents('ChequeCancelled', events) },
1562
- ChequeSettingsModified: { topic: getEventTopic('ChequeSettingsModified'), parse: (events) => parseEvents('ChequeSettingsModified', events) },
1563
- },
1564
- // Queries
1565
- canCreateCheque: (...args) => singleQuery(publicClient, call.canCreateCheque(...args), {}, addressResolver),
1566
- isValidNewCheque: (...args) => singleQuery(publicClient, call.isValidNewCheque(...args), {}, addressResolver),
1567
- isValidChequeSettings: (...args) => singleQuery(publicClient, call.isValidChequeSettings(...args), {}, addressResolver),
1568
- getChequeConfig: (...args) => singleQuery(publicClient, call.getChequeConfig(...args), {}, addressResolver),
1569
- createDefaultChequeSettings: (...args) => singleQuery(publicClient, call.createDefaultChequeSettings(...args), {}, addressResolver),
1570
- UNDY_HQ: (...args) => singleQuery(publicClient, call.UNDY_HQ(...args), {}, addressResolver),
1571
- MIN_CHEQUE_PERIOD: (...args) => singleQuery(publicClient, call.MIN_CHEQUE_PERIOD(...args), {}, addressResolver),
1572
- MAX_CHEQUE_PERIOD: (...args) => singleQuery(publicClient, call.MAX_CHEQUE_PERIOD(...args), {}, addressResolver),
1573
- MIN_EXPENSIVE_CHEQUE_DELAY: (...args) => singleQuery(publicClient, call.MIN_EXPENSIVE_CHEQUE_DELAY(...args), {}, addressResolver),
1574
- MAX_UNLOCK_BLOCKS: (...args) => singleQuery(publicClient, call.MAX_UNLOCK_BLOCKS(...args), {}, addressResolver),
1575
- MAX_EXPIRY_BLOCKS: (...args) => singleQuery(publicClient, call.MAX_EXPIRY_BLOCKS(...args), {}, addressResolver),
1576
- // Mutations
1577
- createCheque: (...args) => mutate(walletClient, mutation.createCheque, { addressResolver })(...args),
1578
- cancelCheque: (...args) => mutate(walletClient, mutation.cancelCheque, { addressResolver })(...args),
1579
- setChequeSettings: (...args) => mutate(walletClient, mutation.setChequeSettings, { addressResolver })(...args),
1580
- };
1581
- }