@boostxyz/sdk 0.0.0-alpha.8 → 1.1.0-alpha.22

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 (266) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.cjs.map +1 -1
  3. package/dist/Actions/Action.js +7 -7
  4. package/dist/Actions/ContractAction.d.ts +57 -14
  5. package/dist/Actions/ContractAction.d.ts.map +1 -1
  6. package/dist/Actions/ERC721MintAction.d.ts +50 -23
  7. package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
  8. package/dist/Actions/EventAction.cjs +1 -1
  9. package/dist/Actions/EventAction.cjs.map +1 -1
  10. package/dist/Actions/EventAction.d.ts +420 -45
  11. package/dist/Actions/EventAction.d.ts.map +1 -1
  12. package/dist/Actions/EventAction.js +15 -225
  13. package/dist/Actions/EventAction.js.map +1 -1
  14. package/dist/AllowLists/AllowList.cjs +1 -1
  15. package/dist/AllowLists/AllowList.cjs.map +1 -1
  16. package/dist/AllowLists/AllowList.d.ts +6 -4
  17. package/dist/AllowLists/AllowList.d.ts.map +1 -1
  18. package/dist/AllowLists/AllowList.js +45 -23
  19. package/dist/AllowLists/AllowList.js.map +1 -1
  20. package/dist/AllowLists/OpenAllowList.d.ts +423 -0
  21. package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
  22. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  23. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  24. package/dist/AllowLists/SimpleAllowList.d.ts +123 -39
  25. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  26. package/dist/AllowLists/SimpleAllowList.js +75 -76
  27. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  28. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  29. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -1
  30. package/dist/AllowLists/SimpleDenyList.d.ts +234 -13
  31. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  32. package/dist/AllowLists/SimpleDenyList.js +11 -200
  33. package/dist/AllowLists/SimpleDenyList.js.map +1 -1
  34. package/dist/Auth/PassthroughAuth.cjs +1 -1
  35. package/dist/Auth/PassthroughAuth.cjs.map +1 -1
  36. package/dist/Auth/PassthroughAuth.js +4 -4
  37. package/dist/Auth/PassthroughAuth.js.map +1 -1
  38. package/dist/Boost.cjs +1 -1
  39. package/dist/Boost.cjs.map +1 -1
  40. package/dist/Boost.d.ts +105 -14
  41. package/dist/Boost.d.ts.map +1 -1
  42. package/dist/Boost.js +137 -5
  43. package/dist/Boost.js.map +1 -1
  44. package/dist/BoostCore-BVZExPPu.js +1462 -0
  45. package/dist/BoostCore-BVZExPPu.js.map +1 -0
  46. package/dist/BoostCore-D-E-cnGI.cjs +3 -0
  47. package/dist/BoostCore-D-E-cnGI.cjs.map +1 -0
  48. package/dist/BoostCore.cjs +1 -2
  49. package/dist/BoostCore.cjs.map +1 -1
  50. package/dist/BoostCore.d.ts +759 -82
  51. package/dist/BoostCore.d.ts.map +1 -1
  52. package/dist/BoostCore.js +29 -1148
  53. package/dist/BoostCore.js.map +1 -1
  54. package/dist/BoostRegistry.cjs +1 -1
  55. package/dist/BoostRegistry.cjs.map +1 -1
  56. package/dist/BoostRegistry.d.ts +83 -28
  57. package/dist/BoostRegistry.d.ts.map +1 -1
  58. package/dist/BoostRegistry.js +170 -93
  59. package/dist/BoostRegistry.js.map +1 -1
  60. package/dist/Budgets/Budget.cjs +1 -1
  61. package/dist/Budgets/Budget.cjs.map +1 -1
  62. package/dist/Budgets/Budget.d.ts.map +1 -1
  63. package/dist/Budgets/Budget.js +2 -2
  64. package/dist/Budgets/Budget.js.map +1 -1
  65. package/dist/Budgets/ManagedBudget.cjs +1 -1
  66. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  67. package/dist/Budgets/ManagedBudget.d.ts +112 -192
  68. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  69. package/dist/Budgets/ManagedBudget.js +89 -290
  70. package/dist/Budgets/ManagedBudget.js.map +1 -1
  71. package/dist/Budgets/VestingBudget.d.ts +277 -91
  72. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  73. package/dist/Deployable/Contract.cjs +1 -1
  74. package/dist/Deployable/Contract.cjs.map +1 -1
  75. package/dist/Deployable/Contract.d.ts +4 -5
  76. package/dist/Deployable/Contract.d.ts.map +1 -1
  77. package/dist/Deployable/Contract.js +6 -8
  78. package/dist/Deployable/Contract.js.map +1 -1
  79. package/dist/Deployable/Deployable.cjs.map +1 -1
  80. package/dist/Deployable/Deployable.d.ts +1 -1
  81. package/dist/Deployable/Deployable.d.ts.map +1 -1
  82. package/dist/Deployable/Deployable.js +3 -5
  83. package/dist/Deployable/Deployable.js.map +1 -1
  84. package/dist/Deployable/DeployableTarget.cjs +1 -1
  85. package/dist/Deployable/DeployableTarget.cjs.map +1 -1
  86. package/dist/Deployable/DeployableTarget.d.ts +13 -13
  87. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  88. package/dist/Deployable/DeployableTarget.js +30 -27
  89. package/dist/Deployable/DeployableTarget.js.map +1 -1
  90. package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
  91. package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
  92. package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
  93. package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
  94. package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
  95. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
  96. package/dist/EventAction-BZt5cjbe.cjs +2 -0
  97. package/dist/EventAction-BZt5cjbe.cjs.map +1 -0
  98. package/dist/EventAction-C_-hJXWm.js +1541 -0
  99. package/dist/EventAction-C_-hJXWm.js.map +1 -0
  100. package/dist/Incentive-BhHaK3PZ.cjs +2 -0
  101. package/dist/Incentive-BhHaK3PZ.cjs.map +1 -0
  102. package/dist/Incentive-Cqg1w6wD.js +312 -0
  103. package/dist/Incentive-Cqg1w6wD.js.map +1 -0
  104. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  105. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  106. package/dist/Incentives/AllowListIncentive.d.ts +73 -21
  107. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  108. package/dist/Incentives/AllowListIncentive.js +61 -36
  109. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  110. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  111. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  112. package/dist/Incentives/CGDAIncentive.d.ts +323 -26
  113. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  114. package/dist/Incentives/CGDAIncentive.js +73 -39
  115. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  116. package/dist/Incentives/ERC1155Incentive.d.ts +291 -43
  117. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  118. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  119. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  120. package/dist/Incentives/ERC20Incentive.d.ts +278 -33
  121. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  122. package/dist/Incentives/ERC20Incentive.js +79 -47
  123. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  124. package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +346 -420
  125. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
  126. package/dist/Incentives/ERC20VariableIncentive.d.ts +271 -32
  127. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  128. package/dist/Incentives/Incentive.cjs +1 -1
  129. package/dist/Incentives/Incentive.cjs.map +1 -1
  130. package/dist/Incentives/Incentive.d.ts +4 -4
  131. package/dist/Incentives/Incentive.d.ts.map +1 -1
  132. package/dist/Incentives/Incentive.js +16 -280
  133. package/dist/Incentives/Incentive.js.map +1 -1
  134. package/dist/Incentives/PointsIncentive.cjs +1 -1
  135. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  136. package/dist/Incentives/PointsIncentive.d.ts +89 -23
  137. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  138. package/dist/Incentives/PointsIncentive.js +66 -36
  139. package/dist/Incentives/PointsIncentive.js.map +1 -1
  140. package/dist/SimpleDenyList-BUR17Tt1.cjs +2 -0
  141. package/dist/SimpleDenyList-BUR17Tt1.cjs.map +1 -0
  142. package/dist/SimpleDenyList-CGaWjuld.js +132 -0
  143. package/dist/SimpleDenyList-CGaWjuld.js.map +1 -0
  144. package/dist/Validators/SignerValidator.cjs +1 -1
  145. package/dist/Validators/SignerValidator.cjs.map +1 -1
  146. package/dist/Validators/SignerValidator.d.ts +310 -17
  147. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  148. package/dist/Validators/SignerValidator.js +164 -36
  149. package/dist/Validators/SignerValidator.js.map +1 -1
  150. package/dist/Validators/Validator.cjs +1 -1
  151. package/dist/Validators/Validator.cjs.map +1 -1
  152. package/dist/Validators/Validator.d.ts +1 -1
  153. package/dist/Validators/Validator.js +2 -2
  154. package/dist/Validators/Validator.js.map +1 -1
  155. package/dist/claiming.cjs +2 -0
  156. package/dist/claiming.cjs.map +1 -0
  157. package/dist/claiming.d.ts +43 -0
  158. package/dist/claiming.d.ts.map +1 -0
  159. package/dist/claiming.js +17 -0
  160. package/dist/claiming.js.map +1 -0
  161. package/dist/componentInterfaces-BBCFkrZv.js +14 -0
  162. package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
  163. package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
  164. package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
  165. package/dist/deployments-DVXioW2i.cjs +2 -0
  166. package/dist/deployments-DVXioW2i.cjs.map +1 -0
  167. package/dist/deployments-oykLv3_Z.js +43 -0
  168. package/dist/deployments-oykLv3_Z.js.map +1 -0
  169. package/dist/deployments.json +44 -0
  170. package/dist/errors.cjs +1 -1
  171. package/dist/errors.cjs.map +1 -1
  172. package/dist/errors.d.ts +257 -21
  173. package/dist/errors.d.ts.map +1 -1
  174. package/dist/errors.js +183 -26
  175. package/dist/errors.js.map +1 -1
  176. package/dist/{generated-Cbv8zFkf.js → generated-CKt2yCQd.js} +3615 -1868
  177. package/dist/generated-CKt2yCQd.js.map +1 -0
  178. package/dist/generated-CyTNlOwM.cjs +3 -0
  179. package/dist/generated-CyTNlOwM.cjs.map +1 -0
  180. package/dist/index.cjs +1 -1
  181. package/dist/index.d.ts +9 -4
  182. package/dist/index.d.ts.map +1 -1
  183. package/dist/index.js +143 -126
  184. package/dist/index.js.map +1 -1
  185. package/dist/transfers.cjs +2 -0
  186. package/dist/transfers.cjs.map +1 -0
  187. package/dist/transfers.d.ts +198 -0
  188. package/dist/transfers.d.ts.map +1 -0
  189. package/dist/transfers.js +84 -0
  190. package/dist/transfers.js.map +1 -0
  191. package/dist/utils.cjs +1 -1
  192. package/dist/utils.cjs.map +1 -1
  193. package/dist/utils.d.ts +25 -1380
  194. package/dist/utils.d.ts.map +1 -1
  195. package/dist/utils.js +36 -648
  196. package/dist/utils.js.map +1 -1
  197. package/package.json +34 -10
  198. package/src/Actions/Action.test.ts +19 -17
  199. package/src/Actions/ContractAction.test.ts +14 -16
  200. package/src/Actions/ContractAction.ts +84 -22
  201. package/src/Actions/ERC721MintAction.test.ts +8 -8
  202. package/src/Actions/ERC721MintAction.ts +83 -30
  203. package/src/Actions/EventAction.test.ts +759 -113
  204. package/src/Actions/EventAction.ts +991 -116
  205. package/src/AllowLists/AllowList.test.ts +7 -7
  206. package/src/AllowLists/AllowList.ts +5 -3
  207. package/src/AllowLists/OpenAllowList.test.ts +40 -0
  208. package/src/AllowLists/OpenAllowList.ts +45 -0
  209. package/src/AllowLists/SimpleAllowList.test.ts +4 -4
  210. package/src/AllowLists/SimpleAllowList.ts +86 -65
  211. package/src/AllowLists/SimpleDenyList.test.ts +4 -4
  212. package/src/AllowLists/SimpleDenyList.ts +87 -126
  213. package/src/Auth/PassthroughAuth.test.ts +1 -1
  214. package/src/Auth/PassthroughAuth.ts +1 -1
  215. package/src/Boost.ts +147 -15
  216. package/src/BoostCore.test.ts +326 -278
  217. package/src/BoostCore.ts +425 -242
  218. package/src/BoostRegistry.test.ts +53 -0
  219. package/src/BoostRegistry.ts +168 -50
  220. package/src/Budgets/Budget.test.ts +2 -2
  221. package/src/Budgets/Budget.ts +1 -2
  222. package/src/Budgets/ManagedBudget.test.ts +82 -19
  223. package/src/Budgets/ManagedBudget.ts +106 -315
  224. package/src/Budgets/VestingBudget.test.ts +7 -7
  225. package/src/Budgets/VestingBudget.ts +110 -112
  226. package/src/Deployable/Contract.ts +5 -6
  227. package/src/Deployable/Deployable.ts +1 -1
  228. package/src/Deployable/DeployableTarget.ts +32 -21
  229. package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
  230. package/src/Incentives/AllowListIncentive.test.ts +7 -10
  231. package/src/Incentives/AllowListIncentive.ts +88 -30
  232. package/src/Incentives/CGDAIncentive.test.ts +11 -12
  233. package/src/Incentives/CGDAIncentive.ts +161 -37
  234. package/src/Incentives/ERC1155Incentive.test.ts +5 -16
  235. package/src/Incentives/ERC1155Incentive.ts +132 -51
  236. package/src/Incentives/ERC20Incentive.test.ts +15 -23
  237. package/src/Incentives/ERC20Incentive.ts +131 -46
  238. package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
  239. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +324 -0
  240. package/src/Incentives/ERC20VariableIncentive.test.ts +12 -35
  241. package/src/Incentives/ERC20VariableIncentive.ts +118 -43
  242. package/src/Incentives/Incentive.test.ts +5 -2
  243. package/src/Incentives/Incentive.ts +7 -6
  244. package/src/Incentives/PointsIncentive.test.ts +26 -30
  245. package/src/Incentives/PointsIncentive.ts +110 -34
  246. package/src/Validators/SignerValidator.test.ts +9 -13
  247. package/src/Validators/SignerValidator.ts +437 -26
  248. package/src/Validators/Validator.test.ts +2 -2
  249. package/src/Validators/Validator.ts +1 -1
  250. package/src/claiming.ts +56 -0
  251. package/src/errors.ts +346 -22
  252. package/src/index.test.ts +118 -36
  253. package/src/index.ts +15 -7
  254. package/src/transfers.ts +284 -0
  255. package/src/utils.test.ts +2 -2
  256. package/src/utils.ts +61 -2061
  257. package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
  258. package/dist/componentInterfaces-CKCBwG16.cjs +0 -2
  259. package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
  260. package/dist/componentInterfaces-DYkaxBda.js +0 -13
  261. package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
  262. package/dist/generated-BzszviNp.cjs +0 -3
  263. package/dist/generated-BzszviNp.cjs.map +0 -1
  264. package/dist/generated-Cbv8zFkf.js.map +0 -1
  265. package/src/Budgets/SimpleBudget.test.ts +0 -152
  266. package/src/Budgets/SimpleBudget.ts +0 -521
@@ -1,10 +1,50 @@
1
1
  import { vestingBudgetAbi } from '@boostxyz/evm';
2
2
  import { type Address, type ContractEventName } from 'viem';
3
3
  import type { DeployableOptions, GenericDeployableParams } from '../Deployable/Deployable';
4
- import { DeployableTarget } from '../Deployable/DeployableTarget';
5
- import { type FungibleTransferPayload, type GenericLog, type ReadParams, RegistryType, type VestingBudgetPayload, type WriteParams } from '../utils';
4
+ import { DeployableTargetWithRBAC } from '../Deployable/DeployableTargetWithRBAC';
5
+ import { type FungibleTransferPayload } from '../transfers';
6
+ import { type GenericLog, type ReadParams, RegistryType, type WriteParams } from '../utils';
6
7
  export { vestingBudgetAbi };
7
- export type { VestingBudgetPayload };
8
+ export type { FungibleTransferPayload };
9
+ /**
10
+ * The object representation of a `VestingBudget.InitPayload`
11
+ *
12
+ * @export
13
+ * @interface VestingBudgetPayload
14
+ * @typedef {VestingBudgetPayload}
15
+ */
16
+ export interface VestingBudgetPayload {
17
+ /**
18
+ * The budget's owner.
19
+ *
20
+ * @type {Address}
21
+ */
22
+ owner: Address;
23
+ /**
24
+ * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
25
+ *
26
+ * @type {Address[]}
27
+ */
28
+ authorized: Address[];
29
+ /**
30
+ * The timestamp at which the vesting schedule begins
31
+ *
32
+ * @type {bigint}
33
+ */
34
+ start: bigint;
35
+ /**
36
+ * The duration of the vesting schedule (in seconds)
37
+ *
38
+ * @type {bigint}
39
+ */
40
+ duration: bigint;
41
+ /**
42
+ * The duration of the cliff period (in seconds)
43
+ *
44
+ * @type {bigint}
45
+ */
46
+ cliff: bigint;
47
+ }
8
48
  /**
9
49
  * A generic `viem.Log` event with support for `VestingBudget` event types.
10
50
  *
@@ -26,9 +66,9 @@ export type VestingBudgetLog<event extends ContractEventName<typeof vestingBudge
26
66
  * @export
27
67
  * @class VestingBudget
28
68
  * @typedef {VestingBudget}
29
- * @extends {DeployableTarget<VestingBudgetPayload>}
69
+ * @extends {DeployableTargetWithRBAC<VestingBudgetPayload>}
30
70
  */
31
- export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload, typeof vestingBudgetAbi> {
71
+ export declare class VestingBudget extends DeployableTargetWithRBAC<VestingBudgetPayload, typeof vestingBudgetAbi> {
32
72
  readonly abi: readonly [{
33
73
  readonly type: "constructor";
34
74
  readonly inputs: readonly [];
@@ -126,20 +166,9 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
126
166
  readonly inputs: readonly [];
127
167
  readonly name: "Unauthorized";
128
168
  }, {
129
- readonly type: "event";
130
- readonly anonymous: false;
131
- readonly inputs: readonly [{
132
- readonly name: "account";
133
- readonly internalType: "address";
134
- readonly type: "address";
135
- readonly indexed: true;
136
- }, {
137
- readonly name: "isAuthorized";
138
- readonly internalType: "bool";
139
- readonly type: "bool";
140
- readonly indexed: false;
141
- }];
142
- readonly name: "Authorized";
169
+ readonly type: "error";
170
+ readonly inputs: readonly [];
171
+ readonly name: "Unauthorized";
143
172
  }, {
144
173
  readonly type: "event";
145
174
  readonly anonymous: false;
@@ -205,9 +234,44 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
205
234
  readonly indexed: true;
206
235
  }];
207
236
  readonly name: "OwnershipTransferred";
237
+ }, {
238
+ readonly type: "event";
239
+ readonly anonymous: false;
240
+ readonly inputs: readonly [{
241
+ readonly name: "user";
242
+ readonly internalType: "address";
243
+ readonly type: "address";
244
+ readonly indexed: true;
245
+ }, {
246
+ readonly name: "roles";
247
+ readonly internalType: "uint256";
248
+ readonly type: "uint256";
249
+ readonly indexed: true;
250
+ }];
251
+ readonly name: "RolesUpdated";
208
252
  }, {
209
253
  readonly type: "fallback";
210
254
  readonly stateMutability: "payable";
255
+ }, {
256
+ readonly type: "function";
257
+ readonly inputs: readonly [];
258
+ readonly name: "ADMIN_ROLE";
259
+ readonly outputs: readonly [{
260
+ readonly name: "";
261
+ readonly internalType: "uint256";
262
+ readonly type: "uint256";
263
+ }];
264
+ readonly stateMutability: "view";
265
+ }, {
266
+ readonly type: "function";
267
+ readonly inputs: readonly [];
268
+ readonly name: "MANAGER_ROLE";
269
+ readonly outputs: readonly [{
270
+ readonly name: "";
271
+ readonly internalType: "uint256";
272
+ readonly type: "uint256";
273
+ }];
274
+ readonly stateMutability: "view";
211
275
  }, {
212
276
  readonly type: "function";
213
277
  readonly inputs: readonly [{
@@ -252,8 +316,38 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
252
316
  readonly name: "clawback";
253
317
  readonly outputs: readonly [{
254
318
  readonly name: "";
255
- readonly internalType: "bool";
256
- readonly type: "bool";
319
+ readonly internalType: "uint256";
320
+ readonly type: "uint256";
321
+ }];
322
+ readonly stateMutability: "nonpayable";
323
+ }, {
324
+ readonly type: "function";
325
+ readonly inputs: readonly [{
326
+ readonly name: "target";
327
+ readonly internalType: "address";
328
+ readonly type: "address";
329
+ }, {
330
+ readonly name: "data_";
331
+ readonly internalType: "bytes";
332
+ readonly type: "bytes";
333
+ }, {
334
+ readonly name: "boostId";
335
+ readonly internalType: "uint256";
336
+ readonly type: "uint256";
337
+ }, {
338
+ readonly name: "incentiveId";
339
+ readonly internalType: "uint256";
340
+ readonly type: "uint256";
341
+ }];
342
+ readonly name: "clawbackFromTarget";
343
+ readonly outputs: readonly [{
344
+ readonly name: "";
345
+ readonly internalType: "uint256";
346
+ readonly type: "uint256";
347
+ }, {
348
+ readonly name: "";
349
+ readonly internalType: "address";
350
+ readonly type: "address";
257
351
  }];
258
352
  readonly stateMutability: "nonpayable";
259
353
  }, {
@@ -348,6 +442,70 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
348
442
  readonly type: "bytes4";
349
443
  }];
350
444
  readonly stateMutability: "pure";
445
+ }, {
446
+ readonly type: "function";
447
+ readonly inputs: readonly [{
448
+ readonly name: "user";
449
+ readonly internalType: "address";
450
+ readonly type: "address";
451
+ }, {
452
+ readonly name: "roles";
453
+ readonly internalType: "uint256";
454
+ readonly type: "uint256";
455
+ }];
456
+ readonly name: "grantRoles";
457
+ readonly outputs: readonly [];
458
+ readonly stateMutability: "payable";
459
+ }, {
460
+ readonly type: "function";
461
+ readonly inputs: readonly [{
462
+ readonly name: "accounts_";
463
+ readonly internalType: "address[]";
464
+ readonly type: "address[]";
465
+ }, {
466
+ readonly name: "roles_";
467
+ readonly internalType: "uint256[]";
468
+ readonly type: "uint256[]";
469
+ }];
470
+ readonly name: "grantRoles";
471
+ readonly outputs: readonly [];
472
+ readonly stateMutability: "nonpayable";
473
+ }, {
474
+ readonly type: "function";
475
+ readonly inputs: readonly [{
476
+ readonly name: "user";
477
+ readonly internalType: "address";
478
+ readonly type: "address";
479
+ }, {
480
+ readonly name: "roles";
481
+ readonly internalType: "uint256";
482
+ readonly type: "uint256";
483
+ }];
484
+ readonly name: "hasAllRoles";
485
+ readonly outputs: readonly [{
486
+ readonly name: "";
487
+ readonly internalType: "bool";
488
+ readonly type: "bool";
489
+ }];
490
+ readonly stateMutability: "view";
491
+ }, {
492
+ readonly type: "function";
493
+ readonly inputs: readonly [{
494
+ readonly name: "user";
495
+ readonly internalType: "address";
496
+ readonly type: "address";
497
+ }, {
498
+ readonly name: "roles";
499
+ readonly internalType: "uint256";
500
+ readonly type: "uint256";
501
+ }];
502
+ readonly name: "hasAnyRole";
503
+ readonly outputs: readonly [{
504
+ readonly name: "";
505
+ readonly internalType: "bool";
506
+ readonly type: "bool";
507
+ }];
508
+ readonly stateMutability: "view";
351
509
  }, {
352
510
  readonly type: "function";
353
511
  readonly inputs: readonly [{
@@ -416,6 +574,16 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
416
574
  readonly name: "renounceOwnership";
417
575
  readonly outputs: readonly [];
418
576
  readonly stateMutability: "payable";
577
+ }, {
578
+ readonly type: "function";
579
+ readonly inputs: readonly [{
580
+ readonly name: "roles";
581
+ readonly internalType: "uint256";
582
+ readonly type: "uint256";
583
+ }];
584
+ readonly name: "renounceRoles";
585
+ readonly outputs: readonly [];
586
+ readonly stateMutability: "payable";
419
587
  }, {
420
588
  readonly type: "function";
421
589
  readonly inputs: readonly [];
@@ -425,7 +593,49 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
425
593
  }, {
426
594
  readonly type: "function";
427
595
  readonly inputs: readonly [{
428
- readonly name: "account_";
596
+ readonly name: "user";
597
+ readonly internalType: "address";
598
+ readonly type: "address";
599
+ }, {
600
+ readonly name: "roles";
601
+ readonly internalType: "uint256";
602
+ readonly type: "uint256";
603
+ }];
604
+ readonly name: "revokeRoles";
605
+ readonly outputs: readonly [];
606
+ readonly stateMutability: "payable";
607
+ }, {
608
+ readonly type: "function";
609
+ readonly inputs: readonly [{
610
+ readonly name: "accounts_";
611
+ readonly internalType: "address[]";
612
+ readonly type: "address[]";
613
+ }, {
614
+ readonly name: "roles_";
615
+ readonly internalType: "uint256[]";
616
+ readonly type: "uint256[]";
617
+ }];
618
+ readonly name: "revokeRoles";
619
+ readonly outputs: readonly [];
620
+ readonly stateMutability: "nonpayable";
621
+ }, {
622
+ readonly type: "function";
623
+ readonly inputs: readonly [{
624
+ readonly name: "user";
625
+ readonly internalType: "address";
626
+ readonly type: "address";
627
+ }];
628
+ readonly name: "rolesOf";
629
+ readonly outputs: readonly [{
630
+ readonly name: "roles";
631
+ readonly internalType: "uint256";
632
+ readonly type: "uint256";
633
+ }];
634
+ readonly stateMutability: "view";
635
+ }, {
636
+ readonly type: "function";
637
+ readonly inputs: readonly [{
638
+ readonly name: "accounts_";
429
639
  readonly internalType: "address[]";
430
640
  readonly type: "address[]";
431
641
  }, {
@@ -493,9 +703,9 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
493
703
  *
494
704
  * @public
495
705
  * @static
496
- * @type {Address}
706
+ * @type {Record<number, Address>}
497
707
  */
498
- static base: Address;
708
+ static bases: Record<number, Address>;
499
709
  /**
500
710
  * @inheritdoc
501
711
  *
@@ -508,7 +718,7 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
508
718
  * Get the owner of the budget
509
719
  *
510
720
  * @public
511
- * @param {?ReadParams<typeof vestingBudgetAbi, 'owner'>} [params]
721
+ * @param {?ReadParams} [params]
512
722
  * @returns {Promise<Address>}
513
723
  */
514
724
  owner(params?: ReadParams<typeof vestingBudgetAbi, 'owner'>): Promise<`0x${string}`>;
@@ -516,24 +726,24 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
516
726
  * The timestamp at which the vesting schedule begins
517
727
  *
518
728
  * @public
519
- * @param {?ReadParams<typeof vestingBudgetAbi, 'start'>} [params]
520
- * @returns {*}
729
+ * @param {?ReadParams} [params]
730
+ * @returns {Promise<bigint>}
521
731
  */
522
732
  start(params?: ReadParams<typeof vestingBudgetAbi, 'start'>): Promise<bigint>;
523
733
  /**
524
734
  * The duration of the vesting schedule (in seconds)
525
735
  *
526
736
  * @public
527
- * @param {?ReadParams<typeof vestingBudgetAbi, 'duration'>} [params]
528
- * @returns {*}
737
+ * @param {?ReadParams} [params]
738
+ * @returns {Promise<bigint>}
529
739
  */
530
740
  duration(params?: ReadParams<typeof vestingBudgetAbi, 'duration'>): Promise<bigint>;
531
741
  /**
532
742
  * The duration of the cliff period (in seconds)
533
743
  *
534
744
  * @public
535
- * @param {?ReadParams<typeof vestingBudgetAbi, 'cliff'>} [params]
536
- * @returns {*}
745
+ * @param {?ReadParams} [params]
746
+ * @returns {Promise<bigint>}
537
747
  */
538
748
  cliff(params?: ReadParams<typeof vestingBudgetAbi, 'cliff'>): Promise<bigint>;
539
749
  /**
@@ -544,7 +754,7 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
544
754
  * @public
545
755
  * @async
546
756
  * @param {(FungibleTransferPayload)} transfer
547
- * @param {?WriteParams<typeof vestingBudgetAbi, 'allocate'>} [params]
757
+ * @param {?WriteParams} [params]
548
758
  * @returns {Promise<boolean>} - True if the allocation was successful
549
759
  */
550
760
  allocate(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'allocate'>): Promise<boolean>;
@@ -556,8 +766,8 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
556
766
  * @public
557
767
  * @async
558
768
  * @param {(FungibleTransferPayload)} transfer
559
- * @param {?WriteParams<typeof vestingBudgetAbi, 'allocate'>} [params]
560
- * @returns {Promise<boolean>} - True if the allocation was successful
769
+ * @param {?WriteParams} [params]
770
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the allocation was successful
561
771
  */
562
772
  allocateRaw(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'allocate'>): Promise<{
563
773
  hash: `0x${string}`;
@@ -572,10 +782,10 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
572
782
  * @public
573
783
  * @async
574
784
  * @param {(FungibleTransferPayload)} transfer
575
- * @param {?WriteParams<typeof vestingBudgetAbi, 'clawback'>} [params]
785
+ * @param {?WriteParams} [params]
576
786
  * @returns {Promise<boolean>} - True if the request was successful
577
787
  */
578
- clawback(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'clawback'>): Promise<boolean>;
788
+ clawback(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'clawback'>): Promise<bigint>;
579
789
  /**
580
790
  * Clawbacks assets from the budget.
581
791
  * Only the owner can directly clawback assets from the budget
@@ -585,12 +795,12 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
585
795
  * @public
586
796
  * @async
587
797
  * @param {(FungibleTransferPayload)} transfer
588
- * @param {?WriteParams<typeof vestingBudgetAbi, 'clawback'>} [params]
589
- * @returns {Promise<boolean>} - True if the request was successful
798
+ * @param {?WriteParams} [params]
799
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the request was successful
590
800
  */
591
801
  clawbackRaw(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'clawback'>): Promise<{
592
802
  hash: `0x${string}`;
593
- result: boolean;
803
+ result: bigint;
594
804
  }>;
595
805
  /**
596
806
  * Disburses assets from the budget to a single recipient
@@ -599,7 +809,7 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
599
809
  * @public
600
810
  * @async
601
811
  * @param {(FungibleTransferPayload)} transfer
602
- * @param {?WriteParams<typeof vestingBudgetAbi, 'disburse'>} [params]
812
+ * @param {?WriteParams} [params]
603
813
  * @returns {Promise<boolean>} - True if the disbursement was successful
604
814
  */
605
815
  disburse(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'disburse'>): Promise<boolean>;
@@ -610,8 +820,8 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
610
820
  * @public
611
821
  * @async
612
822
  * @param {(FungibleTransferPayload)} transfer
613
- * @param {?WriteParams<typeof vestingBudgetAbi, 'disburse'>} [params]
614
- * @returns {Promise<boolean>} - True if the disbursement was successful
823
+ * @param {?WriteParams} [params]
824
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the disbursement was successful
615
825
  */
616
826
  disburseRaw(transfer: FungibleTransferPayload, params?: WriteParams<typeof vestingBudgetAbi, 'disburse'>): Promise<{
617
827
  hash: `0x${string}`;
@@ -623,7 +833,7 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
623
833
  * @public
624
834
  * @async
625
835
  * @param {Array<FungibleTransferPayload>} transfers
626
- * @param {?WriteParams<typeof vestingBudgetAbi, 'disburseBatch'>} [params]
836
+ * @param {?WriteParams} [params]
627
837
  * @returns {Promise<boolean>} - True if all disbursements were successful
628
838
  */
629
839
  disburseBatch(transfers: FungibleTransferPayload[], params?: WriteParams<typeof vestingBudgetAbi, 'disburseBatch'>): Promise<boolean>;
@@ -633,54 +843,18 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
633
843
  * @public
634
844
  * @async
635
845
  * @param {Array<FungibleTransferPayload>} transfers
636
- * @param {?WriteParams<typeof vestingBudgetAbi, 'disburseBatch'>} [params]
637
- * @returns {Promise<boolean>} - True if all disbursements were successful
846
+ * @param {?WriteParams} [params]
847
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if all disbursements were successful
638
848
  */
639
849
  disburseBatchRaw(transfers: FungibleTransferPayload[], params?: WriteParams<typeof vestingBudgetAbi, 'disburseBatch'>): Promise<{
640
850
  hash: `0x${string}`;
641
851
  result: boolean;
642
852
  }>;
643
- /**
644
- * Set the authorized status of the given accounts
645
- * The mechanism for managing authorization is left to the implementing contract
646
- *
647
- * @public
648
- * @async
649
- * @param {Address[]} addresses - The accounts to authorize or deauthorize
650
- * @param {boolean[]} allowed - The authorization status for the given accounts
651
- * @param {?WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>} [params]
652
- * @returns {Promise<void>}
653
- */
654
- setAuthorized(addresses: Address[], allowed: boolean[], params?: WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>): Promise<void>;
655
- /**
656
- * Set the authorized status of the given accounts
657
- * The mechanism for managing authorization is left to the implementing contract
658
- *
659
- * @public
660
- * @async
661
- * @param {Address[]} addresses - The accounts to authorize or deauthorize
662
- * @param {boolean[]} allowed - The authorization status for the given accounts
663
- * @param {?WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>} [params]
664
- * @returns {Promise<void>}
665
- */
666
- setAuthorizedRaw(addresses: Address[], allowed: boolean[], params?: WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>): Promise<{
667
- hash: `0x${string}`;
668
- result: void;
669
- }>;
670
- /**
671
- * Check if the given account is authorized to use the budget
672
- *
673
- * @public
674
- * @param {Address} account
675
- * @param {?ReadParams<typeof vestingBudgetAbi, 'isAuthorized'>} [params]
676
- * @returns {Promise<boolean>} - True if the account is authorized
677
- */
678
- isAuthorized(account: Address, params?: ReadParams<typeof vestingBudgetAbi, 'isAuthorized'>): Promise<boolean>;
679
853
  /**
680
854
  * Get the end time of the vesting schedule
681
855
  *
682
856
  * @public
683
- * @param {?ReadParams<typeof vestingBudgetAbi, 'end'>} [params]
857
+ * @param {?ReadParams} [params]
684
858
  * @returns {Promise<bigint>}
685
859
  */
686
860
  end(params?: ReadParams<typeof vestingBudgetAbi, 'end'>): Promise<bigint>;
@@ -689,30 +863,30 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
689
863
  * This is equal to the sum of the total current balance and the total distributed amount
690
864
  *
691
865
  * @public
692
- * @param {Address} asset - The address of the asset (or the zero address for native assets)
693
- * @param {?ReadParams<typeof vestingBudgetAbi, 'total'>} [params]
866
+ * @param {Address} [asset="0x0000000000000000000000000000000000000000"] - The address of the asset (or the zero address for native assets)
867
+ * @param {?ReadParams} [params]
694
868
  * @returns {Promise<bigint>}
695
869
  */
696
- total(asset: Address, params?: ReadParams<typeof vestingBudgetAbi, 'total'>): Promise<bigint>;
870
+ total(asset?: Address, params?: ReadParams<typeof vestingBudgetAbi, 'total'>): Promise<bigint>;
697
871
  /**
698
872
  * Get the amount of assets available for distribution from the budget as of the current block timestamp
699
873
  * This is equal to the total vested amount minus any already distributed
700
874
  *
701
875
  * @public
702
- * @param {Address} asset - The address of the asset (or the zero address for native assets)
703
- * @param {?ReadParams<typeof vestingBudgetAbi, 'available'>} [params]
876
+ * @param {Address} [asset="0x0000000000000000000000000000000000000000"] - The address of the asset (or the zero address for native assets)
877
+ * @param {?ReadParams} [params]
704
878
  * @returns {Promise<bigint>} - The amount of assets currently available for distribution
705
879
  */
706
- available(asset: Address, params?: ReadParams<typeof vestingBudgetAbi, 'available'>): Promise<bigint>;
880
+ available(asset?: Address, params?: ReadParams<typeof vestingBudgetAbi, 'available'>): Promise<bigint>;
707
881
  /**
708
882
  * Get the amount of assets that have been distributed from the budget
709
883
  *
710
884
  * @public
711
- * @param {Address} asset
712
- * @param {?ReadParams<typeof vestingBudgetAbi, 'distributed'>} [params]
885
+ * @param {Address} [asset="0x0000000000000000000000000000000000000000"]
886
+ * @param {?ReadParams} [params]
713
887
  * @returns {Promise<bigint>} - The amount of assets distributed
714
888
  */
715
- distributed(asset: Address, params?: ReadParams<typeof vestingBudgetAbi, 'distributed'>): Promise<bigint>;
889
+ distributed(asset?: Address, params?: ReadParams<typeof vestingBudgetAbi, 'distributed'>): Promise<bigint>;
716
890
  /**
717
891
  * @inheritdoc
718
892
  *
@@ -723,4 +897,16 @@ export declare class VestingBudget extends DeployableTarget<VestingBudgetPayload
723
897
  */
724
898
  buildParameters(_payload?: VestingBudgetPayload, _options?: DeployableOptions): GenericDeployableParams;
725
899
  }
900
+ /**
901
+ * Given a {@link VestingBudgetPayload}, properly encode a `VestingBudget.InitPayload` for use with {@link VestingBudget} initialization.
902
+ *
903
+ * @param {VestingBudgetPayload} param0
904
+ * @param {Address} param0.owner - The budget's owner.
905
+ * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
906
+ * @param {bigint} param0.start - The timestamp at which the vesting schedule begins
907
+ * @param {bigint} param0.duration - The duration of the vesting schedule (in seconds)
908
+ * @param {bigint} param0.cliff - The duration of the cliff period (in seconds)
909
+ * @returns {Hex}
910
+ */
911
+ export declare function prepareVestingBudgetPayload({ owner, authorized, start, duration, cliff, }: VestingBudgetPayload): `0x${string}`;
726
912
  //# sourceMappingURL=VestingBudget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VestingBudget.d.ts","sourceRoot":"","sources":["../../src/Budgets/VestingBudget.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,gBAAgB,EAMjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAGvB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAGjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,CAC1B,KAAK,SAAS,iBAAiB,CAAC,OAAO,gBAAgB,CAAC,GAAG,iBAAiB,CAC1E,OAAO,gBAAgB,CACxB,IACC,UAAU,CAAC,OAAO,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAE/C;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAc,SAAQ,gBAAgB,CACjD,oBAAoB,EACpB,OAAO,gBAAgB,CACxB;IACC,SAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,aAAa,CACxB,SAAS,EAAE,uBAAuB,EAAE,EACpC,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,gBAAgB,EAAE,eAAe,CAAC;IAKhE;;;;;;;;OAQG;IACU,gBAAgB,CAC3B,SAAS,EAAE,uBAAuB,EAAE,EACpC,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,gBAAgB,EAAE,eAAe,CAAC;;;;IAgBhE;;;;;;OAMG;IACI,GAAG,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,KAAK,CAAC;IAS9D;;;;;;;;OAQG;IACI,KAAK,CACV,KAAK,GAAE,OAAqB,EAC5B,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,OAAO,CAAC;IAUvD;;;;;;;;OAQG;IACI,SAAS,CACd,KAAK,GAAE,OAAqB,EAC5B,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,WAAW,CAAC;IAU3D;;;;;;;OAOG;IACI,WAAW,CAChB,KAAK,GAAE,OAAqB,EAC5B,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,EAAE,aAAa,CAAC;IAU7D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,oBAAoB,EAC/B,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;CAwB3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,KAAK,EACL,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,GACN,EAAE,oBAAoB,iBAQtB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@wagmi/core"),i=require("viem"),o=require("viem/actions"),d=require("../errors.cjs"),c=require("../utils.cjs");class h{constructor(e,t){this._config=e,this._address=t}get address(){return this._address}at(e){return this._address=e,this}withConfig(e){return this._config=e,this}assertValidAddress(){const e=this.address;if(!e)throw new d.ContractAddressRequiredError;return e}async getLogs(e){return o.getLogs(this._config.getClient({chainId:e==null?void 0:e.chainId}),{...e,...e!=null&&e.eventName?{event:i.getAbiItem({abi:this.abi,name:e.eventName})}:{},...e!=null&&e.eventNames?{events:e.eventNames.map(t=>i.getAbiItem({abi:this.abi,name:t}))}:{},address:this.assertValidAddress()})}async subscribe(e,t){return r.watchContractEvent(this._config,{...t,eventName:t==null?void 0:t.eventName,abi:this.abi,address:this.assertValidAddress(),onLogs:s=>{for(let n of s)e(n)}})}async awaitResult(e,t){return c.awaitResult(this._config,e,t)}}exports.Contract=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@wagmi/core"),i=require("viem"),o=require("viem/actions"),d=require("../errors.cjs"),c=require("../utils.cjs");class h{constructor(e,t){this._config=e,this._address=t}get address(){return this._address}at(e){return this._address=e,this}withConfig(e){return this._config=e,this}assertValidAddress(){const e=this.address;if(!e)throw new d.ContractAddressRequiredError;return e}async getLogs(e){return o.getLogs(this._config.getClient({chainId:e==null?void 0:e.chainId}),{...e,...e!=null&&e.eventName?{event:i.getAbiItem({abi:this.abi,name:e.eventName})}:{},...e!=null&&e.eventNames?{events:e.eventNames.map(t=>i.getAbiItem({abi:this.abi,name:t}))}:{},address:this.assertValidAddress()})}subscribe(e,t){return r.watchContractEvent(this._config,{...t,eventName:t==null?void 0:t.eventName,abi:this.abi,address:this.assertValidAddress(),onLogs:s=>{for(let n of s)e(n)}})}async awaitResult(e,t){return await c.awaitResult(this._config,e,t)}}exports.Contract=h;
2
2
  //# sourceMappingURL=Contract.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Contract.cjs","sources":["../../src/Deployable/Contract.ts"],"sourcesContent":["import { type Config, watchContractEvent } from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type GetLogsReturnType,\n type WaitForTransactionReceiptParameters,\n type WatchContractEventOnLogsParameter,\n getAbiItem,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport { ContractAddressRequiredError } from '../errors';\nimport {\n type GetLogsParams,\n type HashAndSimulatedResult,\n type WatchParams,\n awaitResult,\n} from '../utils';\n\n/**\n * A basic Contract class to encapsulate configuration and a potential address\n *\n * @export\n * @class Contract\n * @typedef {Contract}\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=any]\n */\nexport class Contract<ContractAbi extends Abi> {\n //@ts-expect-error this should always be set by implementing contract\n public readonly abi: ContractAbi;\n /**\n * @see [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @protected\n * @type {WagmiConfig}\n */\n protected _config: Config;\n /**\n * The internally managed address for this contract\n *\n * @protected\n * @type {(Address | undefined)}\n */\n protected _address: Address | undefined;\n\n /**\n * Creates an instance of Contract.\n *\n * @constructor\n * @param {Config} config\n * @param {(Address | undefined)} address\n */\n constructor(config: Config, address: Address | undefined) {\n this._config = config;\n this._address = address;\n }\n\n /**\n * A getter returning this contract's deployed address, if it exists.\n *\n * @public\n * @readonly\n * @type {*}\n */\n public get address() {\n return this._address;\n }\n\n /**\n * Will set this contract's address and return the instance for chaining. Does not verify that provided address is valid.\n *\n * @public\n * @param {Address} address\n * @returns {this}\n */\n public at(address: Address) {\n this._address = address;\n return this;\n }\n\n /**\n * Will set this contract's internal [Wagmi Configuration](https://en.wikipedia.org/wiki/Factorial) and return the instance for chaining.\n *\n * @public\n * @param {Config} config\n * @returns {this}\n */\n public withConfig(config: Config) {\n this._config = config;\n return this;\n }\n\n /**\n * Utility function to validate the existence of an address on this Contract.\n *\n * @public\n * @returns {Address}\n * @throws {@link ContractAddressRequiredError} if no address exists on this Contract instance\n */\n public assertValidAddress() {\n const address = this.address;\n if (!address) throw new ContractAddressRequiredError();\n return address;\n }\n\n /**\n * A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs].\n * Accepts `eventName` and `eventNames` as optional parameters to narrow the returned log types.\n * @example\n * ```ts\n * const logs = contract.getLogs({ eventName: 'EventName' })\n * const logs = contract.getLogs({ eventNames: ['EventName'] })\n *\n * @public\n * @async\n * @template {ContractEvent} event\n * @template {ExtractAbiEvent<\n * ContractAbi,\n * event\n * >} [abiEvent=ExtractAbiEvent<ContractAbi, event>]\n * @param {?Omit<\n * GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n * 'event' | 'events'\n * > & {\n * eventName?: event;\n * eventNames?: event[];\n * }} [params]\n * @returns {Promise<GetLogsReturnType<abiEvent, abiEvent[]>>}\n */\n public async getLogs<\n event extends ContractEventName<ContractAbi>,\n const abiEvent extends ExtractAbiEvent<\n ContractAbi,\n event\n > = ExtractAbiEvent<ContractAbi, event>,\n >(\n params?: Omit<\n GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n 'event' | 'events'\n > & {\n eventName?: event;\n eventNames?: event[];\n },\n ): Promise<GetLogsReturnType<abiEvent, abiEvent[]>> {\n return getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wag\n ...(params as any),\n ...(params?.eventName\n ? {\n event: getAbiItem({\n abi: this.abi,\n name: params.eventName,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n }\n : {}),\n ...(params?.eventNames\n ? {\n events: params.eventNames.map((name) =>\n getAbiItem({\n abi: this.abi,\n name,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n ),\n }\n : {}),\n address: this.assertValidAddress(),\n });\n }\n\n /**\n * A typed wrapper for `wagmi.watchContractEvent`\n *\n * @public\n * @async\n * @template {ContractEvent} event\n * @param {(\n * log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n * ) => unknown} cb\n * @param {?WatchParams<ContractAbi, event> & {\n * eventName?: event;\n * }} [params]\n * @returns {unknown, params?: any) => unknown}\n */\n public async subscribe<event extends ContractEventName<ContractAbi>>(\n cb: (\n log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n ) => unknown,\n params?: WatchParams<ContractAbi, event> & {\n eventName?: event;\n },\n ) {\n return watchContractEvent<\n typeof this._config,\n (typeof this._config)['chains'][number]['id'],\n ContractAbi,\n event\n >(this._config, {\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n eventName: params?.eventName,\n abi: this.abi,\n address: this.assertValidAddress(),\n onLogs: (logs) => {\n for (let l of logs) {\n cb(l);\n }\n },\n });\n }\n\n /**\n * @see {@link awaitResult}\n * @protected\n * @async\n * @template [Result=unknown]\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {unknown}\n */\n protected async awaitResult<Result = unknown>(\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n return awaitResult(this._config, hashPromise, waitParams);\n }\n}\n"],"names":["Contract","config","address","ContractAddressRequiredError","params","getLogs","getAbiItem","name","cb","watchContractEvent","logs","l","hashPromise","waitParams","awaitResult"],"mappings":"gNA6BO,MAAMA,CAAkC,CAwB7C,YAAYC,EAAgBC,EAA8B,CACxD,KAAK,QAAUD,EACf,KAAK,SAAWC,CAClB,CASA,IAAW,SAAU,CACnB,OAAO,KAAK,QACd,CASO,GAAGA,EAAkB,CAC1B,YAAK,SAAWA,EACT,IACT,CASO,WAAWD,EAAgB,CAChC,YAAK,QAAUA,EACR,IACT,CASO,oBAAqB,CAC1B,MAAMC,EAAU,KAAK,QACrB,GAAI,CAACA,EAAS,MAAM,IAAIC,EAA6B,6BAC9C,OAAAD,CACT,CA0BA,MAAa,QAOXE,EAOkD,CAC3C,OAAAC,EAAA,QAAQ,KAAK,QAAQ,UAAU,CAAE,QAASD,GAAA,YAAAA,EAAQ,OAAQ,CAAC,EAAG,CAEnE,GAAIA,EACJ,GAAIA,GAAA,MAAAA,EAAQ,UACR,CACE,MAAOE,EAAAA,WAAW,CAChB,IAAK,KAAK,IACV,KAAMF,EAAO,SAAA,CAEP,CAAA,EAEV,CAAC,EACL,GAAIA,GAAA,MAAAA,EAAQ,WACR,CACE,OAAQA,EAAO,WAAW,IAAKG,GAC7BD,EAAAA,WAAW,CACT,IAAK,KAAK,IACV,KAAAC,CAAA,CAEM,CACV,CAAA,EAEF,CAAC,EACL,QAAS,KAAK,mBAAmB,CAAA,CAClC,CACH,CAgBA,MAAa,UACXC,EAGAJ,EAGA,CACO,OAAAK,EAAA,mBAKL,KAAK,QAAS,CAEd,GAAIL,EACJ,UAAWA,GAAA,YAAAA,EAAQ,UACnB,IAAK,KAAK,IACV,QAAS,KAAK,mBAAmB,EACjC,OAASM,GAAS,CAChB,QAASC,KAAKD,EACZF,EAAGG,CAAC,CAER,CAAA,CACD,CACH,CAWA,MAAgB,YACdC,EACAC,EACA,CACA,OAAOC,EAAY,YAAA,KAAK,QAASF,EAAaC,CAAU,CAC1D,CACF"}
1
+ {"version":3,"file":"Contract.cjs","sources":["../../src/Deployable/Contract.ts"],"sourcesContent":["import { type Config, watchContractEvent } from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport {\n type Abi,\n type Address,\n type ContractEventName,\n type GetLogsReturnType,\n type WaitForTransactionReceiptParameters,\n type WatchContractEventOnLogsParameter,\n getAbiItem,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport { ContractAddressRequiredError } from '../errors';\nimport {\n type GetLogsParams,\n type HashAndSimulatedResult,\n type WatchParams,\n awaitResult,\n} from '../utils';\n\n/**\n * A basic Contract class to encapsulate configuration and a potential address\n *\n * @export\n * @class Contract\n * @typedef {Contract}\n * @template {Abi} [ContractAbi=[]]\n * @template {ContractEventName<ContractAbi>} [ContractEvent=any]\n */\nexport class Contract<ContractAbi extends Abi> {\n //@ts-expect-error this should always be set by implementing contract\n public readonly abi: ContractAbi;\n /**\n * @see [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @protected\n * @type {WagmiConfig}\n */\n protected _config: Config;\n /**\n * The internally managed address for this contract\n *\n * @protected\n * @type {(Address | undefined)}\n */\n protected _address: Address | undefined;\n\n /**\n * Creates an instance of Contract.\n *\n * @constructor\n * @param {Config} config\n * @param {(Address | undefined)} address\n */\n constructor(config: Config, address: Address | undefined) {\n this._config = config;\n this._address = address;\n }\n\n /**\n * A getter returning this contract's deployed address, if it exists.\n *\n * @public\n * @readonly\n * @type {Address | undefined}\n */\n public get address() {\n return this._address;\n }\n\n /**\n * Will set this contract's address and return the instance for chaining. Does not verify that provided address is valid.\n *\n * @public\n * @param {Address} address\n * @returns {this}\n */\n public at(address: Address) {\n this._address = address;\n return this;\n }\n\n /**\n * Will set this contract's internal [Wagmi Configuration](https://en.wikipedia.org/wiki/Factorial) and return the instance for chaining.\n *\n * @public\n * @param {Config} config\n * @returns {this}\n */\n public withConfig(config: Config) {\n this._config = config;\n return this;\n }\n\n /**\n * Utility function to validate the existence of an address on this Contract.\n *\n * @public\n * @returns {Address}\n * @throws {@link ContractAddressRequiredError} if no address exists on this Contract instance\n */\n public assertValidAddress() {\n const address = this.address;\n if (!address) throw new ContractAddressRequiredError();\n return address;\n }\n\n /**\n * A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs].\n * Accepts `eventName` and `eventNames` as optional parameters to narrow the returned log types.\n * @example\n * ```ts\n * const logs = contract.getLogs({ eventName: 'EventName' })\n * const logs = contract.getLogs({ eventNames: ['EventName'] })\n *\n * @public\n * @async\n * @template {ContractEvent} event\n * @template {ExtractAbiEvent<\n * ContractAbi,\n * event\n * >} [abiEvent=ExtractAbiEvent<ContractAbi, event>]\n * @param {?Omit<\n * GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n * 'event' | 'events'\n * > & {\n * eventName?: event;\n * eventNames?: event[];\n * }} [params]\n * @returns {Promise<GetLogsReturnType<abiEvent, abiEvent[]>>}\n */\n public async getLogs<\n event extends ContractEventName<ContractAbi>,\n const abiEvent extends ExtractAbiEvent<\n ContractAbi,\n event\n > = ExtractAbiEvent<ContractAbi, event>,\n >(\n params?: Omit<\n GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,\n 'event' | 'events'\n > & {\n eventName?: event;\n eventNames?: event[];\n },\n ): Promise<GetLogsReturnType<abiEvent, abiEvent[]>> {\n return getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wag\n ...(params as any),\n ...(params?.eventName\n ? {\n event: getAbiItem({\n abi: this.abi,\n name: params.eventName,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n }\n : {}),\n ...(params?.eventNames\n ? {\n events: params.eventNames.map((name) =>\n getAbiItem({\n abi: this.abi,\n name,\n // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n } as any),\n ),\n }\n : {}),\n address: this.assertValidAddress(),\n });\n }\n\n /**\n * A typed wrapper for `wagmi.watchContractEvent`\n *\n * @public\n * @template {ContractEvent} event\n * @param {(\n * log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n * ) => unknown} cb\n * @param {?WatchParams<ContractAbi, event> & {\n * eventName?: event;\n * }} [params]\n * @returns {() => void}\n */\n public subscribe<event extends ContractEventName<ContractAbi>>(\n cb: (\n log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],\n ) => unknown,\n params?: WatchParams<ContractAbi, event> & {\n eventName?: event;\n },\n ) {\n return watchContractEvent<\n typeof this._config,\n (typeof this._config)['chains'][number]['id'],\n ContractAbi,\n event\n >(this._config, {\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n eventName: params?.eventName,\n abi: this.abi,\n address: this.assertValidAddress(),\n onLogs: (logs) => {\n for (let l of logs) {\n cb(l);\n }\n },\n });\n }\n\n /**\n * @see {@link awaitResult}\n * @protected\n * @async\n * @template [Result=unknown]\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\n protected async awaitResult<Result = unknown>(\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n ) {\n return await awaitResult(this._config, hashPromise, waitParams);\n }\n}\n"],"names":["Contract","config","address","ContractAddressRequiredError","params","getLogs","getAbiItem","name","cb","watchContractEvent","logs","l","hashPromise","waitParams","awaitResult"],"mappings":"gNA6BO,MAAMA,CAAkC,CAwB7C,YAAYC,EAAgBC,EAA8B,CACxD,KAAK,QAAUD,EACf,KAAK,SAAWC,CAClB,CASA,IAAW,SAAU,CACnB,OAAO,KAAK,QACd,CASO,GAAGA,EAAkB,CAC1B,YAAK,SAAWA,EACT,IACT,CASO,WAAWD,EAAgB,CAChC,YAAK,QAAUA,EACR,IACT,CASO,oBAAqB,CAC1B,MAAMC,EAAU,KAAK,QACrB,GAAI,CAACA,EAAe,MAAA,IAAIC,EAAAA,6BACjB,OAAAD,CACT,CA0BA,MAAa,QAOXE,EAOkD,CAC3C,OAAAC,EAAA,QAAQ,KAAK,QAAQ,UAAU,CAAE,QAASD,GAAA,YAAAA,EAAQ,OAAQ,CAAC,EAAG,CAEnE,GAAIA,EACJ,GAAIA,GAAA,MAAAA,EAAQ,UACR,CACE,MAAOE,EAAAA,WAAW,CAChB,IAAK,KAAK,IACV,KAAMF,EAAO,SAAA,CAEP,CAAA,EAEV,CAAC,EACL,GAAIA,GAAA,MAAAA,EAAQ,WACR,CACE,OAAQA,EAAO,WAAW,IAAKG,GAC7BD,EAAAA,WAAW,CACT,IAAK,KAAK,IACV,KAAAC,CAAA,CAEM,CACV,CAAA,EAEF,CAAC,EACL,QAAS,KAAK,mBAAmB,CAAA,CAClC,CACH,CAeO,UACLC,EAGAJ,EAGA,CACO,OAAAK,EAAA,mBAKL,KAAK,QAAS,CAEd,GAAIL,EACJ,UAAWA,GAAA,YAAAA,EAAQ,UACnB,IAAK,KAAK,IACV,QAAS,KAAK,mBAAmB,EACjC,OAASM,GAAS,CAChB,QAASC,KAAKD,EACZF,EAAGG,CAAC,CAER,CAAA,CACD,CACH,CAWA,MAAgB,YACdC,EACAC,EACA,CACA,OAAO,MAAMC,EAAA,YAAY,KAAK,QAASF,EAAaC,CAAU,CAChE,CACF"}
@@ -39,7 +39,7 @@ export declare class Contract<ContractAbi extends Abi> {
39
39
  *
40
40
  * @public
41
41
  * @readonly
42
- * @type {*}
42
+ * @type {Address | undefined}
43
43
  */
44
44
  get address(): `0x${string}` | undefined;
45
45
  /**
@@ -98,7 +98,6 @@ export declare class Contract<ContractAbi extends Abi> {
98
98
  * A typed wrapper for `wagmi.watchContractEvent`
99
99
  *
100
100
  * @public
101
- * @async
102
101
  * @template {ContractEvent} event
103
102
  * @param {(
104
103
  * log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number],
@@ -106,11 +105,11 @@ export declare class Contract<ContractAbi extends Abi> {
106
105
  * @param {?WatchParams<ContractAbi, event> & {
107
106
  * eventName?: event;
108
107
  * }} [params]
109
- * @returns {unknown, params?: any) => unknown}
108
+ * @returns {() => void}
110
109
  */
111
110
  subscribe<event extends ContractEventName<ContractAbi>>(cb: (log: WatchContractEventOnLogsParameter<ContractAbi, event, true>[number]) => unknown, params?: WatchParams<ContractAbi, event> & {
112
111
  eventName?: event;
113
- }): Promise<() => void>;
112
+ }): () => void;
114
113
  /**
115
114
  * @see {@link awaitResult}
116
115
  * @protected
@@ -118,7 +117,7 @@ export declare class Contract<ContractAbi extends Abi> {
118
117
  * @template [Result=unknown]
119
118
  * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise
120
119
  * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]
121
- * @returns {unknown}
120
+ * @returns {Promise<Result>}
122
121
  */
123
122
  protected awaitResult<Result = unknown>(hashPromise: Promise<HashAndSimulatedResult<Result>>, waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>): Promise<Result>;
124
123
  }