@boostxyz/sdk 0.0.0-alpha.17 → 0.0.0-alpha.19

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 (205) 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 +13 -13
  4. package/dist/Actions/ContractAction.d.ts +9 -9
  5. package/dist/Actions/ContractAction.d.ts.map +1 -1
  6. package/dist/Actions/ERC721MintAction.d.ts +12 -12
  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 +32 -49
  11. package/dist/Actions/EventAction.d.ts.map +1 -1
  12. package/dist/Actions/EventAction.js +13 -962
  13. package/dist/Actions/EventAction.js.map +1 -1
  14. package/dist/AllowLists/AllowList.cjs +1 -1
  15. package/dist/AllowLists/AllowList.js +3 -3
  16. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  17. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  18. package/dist/AllowLists/SimpleAllowList.d.ts +5 -5
  19. package/dist/AllowLists/SimpleAllowList.js +24 -24
  20. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  21. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  22. package/dist/AllowLists/SimpleDenyList.d.ts +6 -6
  23. package/dist/AllowLists/SimpleDenyList.js +3 -3
  24. package/dist/Auth/PassthroughAuth.cjs +1 -1
  25. package/dist/Auth/PassthroughAuth.js +1 -1
  26. package/dist/Boost.cjs.map +1 -1
  27. package/dist/Boost.d.ts +18 -0
  28. package/dist/Boost.d.ts.map +1 -1
  29. package/dist/Boost.js.map +1 -1
  30. package/dist/BoostCore-BiPwp6SR.cjs +3 -0
  31. package/dist/BoostCore-BiPwp6SR.cjs.map +1 -0
  32. package/dist/BoostCore-kwoUw7YE.js +1477 -0
  33. package/dist/BoostCore-kwoUw7YE.js.map +1 -0
  34. package/dist/BoostCore.cjs +1 -2
  35. package/dist/BoostCore.cjs.map +1 -1
  36. package/dist/BoostCore.d.ts +86 -36
  37. package/dist/BoostCore.d.ts.map +1 -1
  38. package/dist/BoostCore.js +29 -1273
  39. package/dist/BoostCore.js.map +1 -1
  40. package/dist/BoostRegistry.cjs +1 -1
  41. package/dist/BoostRegistry.cjs.map +1 -1
  42. package/dist/BoostRegistry.d.ts +25 -19
  43. package/dist/BoostRegistry.d.ts.map +1 -1
  44. package/dist/BoostRegistry.js +30 -29
  45. package/dist/BoostRegistry.js.map +1 -1
  46. package/dist/Budgets/Budget.cjs +1 -1
  47. package/dist/Budgets/Budget.js +2 -2
  48. package/dist/Budgets/ManagedBudget.cjs +1 -1
  49. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  50. package/dist/Budgets/ManagedBudget.d.ts +18 -18
  51. package/dist/Budgets/ManagedBudget.js +48 -48
  52. package/dist/Budgets/ManagedBudget.js.map +1 -1
  53. package/dist/Budgets/VestingBudget.d.ts +23 -23
  54. package/dist/Deployable/Contract.cjs +1 -1
  55. package/dist/Deployable/Contract.cjs.map +1 -1
  56. package/dist/Deployable/Contract.d.ts +4 -5
  57. package/dist/Deployable/Contract.d.ts.map +1 -1
  58. package/dist/Deployable/Contract.js +4 -5
  59. package/dist/Deployable/Contract.js.map +1 -1
  60. package/dist/Deployable/Deployable.cjs.map +1 -1
  61. package/dist/Deployable/Deployable.d.ts +1 -1
  62. package/dist/Deployable/Deployable.js +1 -1
  63. package/dist/Deployable/Deployable.js.map +1 -1
  64. package/dist/Deployable/DeployableTarget.cjs +1 -1
  65. package/dist/Deployable/DeployableTarget.cjs.map +1 -1
  66. package/dist/Deployable/DeployableTarget.d.ts +5 -5
  67. package/dist/Deployable/DeployableTarget.js +6 -6
  68. package/dist/Deployable/DeployableTarget.js.map +1 -1
  69. package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
  70. package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -1
  71. package/dist/Deployable/DeployableTargetWithRBAC.d.ts +15 -15
  72. package/dist/Deployable/DeployableTargetWithRBAC.js +33 -33
  73. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -1
  74. package/dist/EventAction-D5tnm00s.js +1355 -0
  75. package/dist/EventAction-D5tnm00s.js.map +1 -0
  76. package/dist/EventAction-DBDRaG4A.cjs +2 -0
  77. package/dist/EventAction-DBDRaG4A.cjs.map +1 -0
  78. package/dist/{Incentive-DJf-vdyL.js → Incentive-Bp8Sez7M.js} +61 -62
  79. package/dist/Incentive-Bp8Sez7M.js.map +1 -0
  80. package/dist/{Incentive-DNwROd1r.cjs → Incentive-Djnzseoj.cjs} +2 -2
  81. package/dist/Incentive-Djnzseoj.cjs.map +1 -0
  82. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  83. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  84. package/dist/Incentives/AllowListIncentive.d.ts +12 -12
  85. package/dist/Incentives/AllowListIncentive.js +19 -19
  86. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  87. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  88. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  89. package/dist/Incentives/CGDAIncentive.d.ts +15 -15
  90. package/dist/Incentives/CGDAIncentive.js +18 -18
  91. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  92. package/dist/Incentives/ERC1155Incentive.d.ts +30 -30
  93. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  94. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  95. package/dist/Incentives/ERC20Incentive.d.ts +23 -23
  96. package/dist/Incentives/ERC20Incentive.js +25 -25
  97. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  98. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +523 -0
  99. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
  100. package/dist/Incentives/ERC20VariableIncentive.d.ts +19 -19
  101. package/dist/Incentives/Incentive.cjs +1 -1
  102. package/dist/Incentives/Incentive.d.ts +3 -3
  103. package/dist/Incentives/Incentive.d.ts.map +1 -1
  104. package/dist/Incentives/Incentive.js +3 -3
  105. package/dist/Incentives/PointsIncentive.cjs +1 -1
  106. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  107. package/dist/Incentives/PointsIncentive.d.ts +14 -14
  108. package/dist/Incentives/PointsIncentive.js +21 -21
  109. package/dist/Incentives/PointsIncentive.js.map +1 -1
  110. package/dist/{SimpleDenyList-DMlUkmAn.cjs → SimpleDenyList-BwfNjRsg.cjs} +2 -2
  111. package/dist/SimpleDenyList-BwfNjRsg.cjs.map +1 -0
  112. package/dist/{SimpleDenyList-DvUvmOeE.js → SimpleDenyList-Cn5WpNn0.js} +9 -9
  113. package/dist/SimpleDenyList-Cn5WpNn0.js.map +1 -0
  114. package/dist/Validators/SignerValidator.cjs +1 -1
  115. package/dist/Validators/SignerValidator.cjs.map +1 -1
  116. package/dist/Validators/SignerValidator.d.ts +14 -14
  117. package/dist/Validators/SignerValidator.js +19 -19
  118. package/dist/Validators/SignerValidator.js.map +1 -1
  119. package/dist/Validators/Validator.cjs +1 -1
  120. package/dist/Validators/Validator.cjs.map +1 -1
  121. package/dist/Validators/Validator.d.ts +1 -1
  122. package/dist/Validators/Validator.js +6 -6
  123. package/dist/Validators/Validator.js.map +1 -1
  124. package/dist/claiming.cjs.map +1 -1
  125. package/dist/claiming.d.ts +1 -1
  126. package/dist/claiming.js.map +1 -1
  127. package/dist/componentInterfaces-D09mhzxO.cjs +2 -0
  128. package/dist/componentInterfaces-D09mhzxO.cjs.map +1 -0
  129. package/dist/componentInterfaces-RXBMI5yH.js +14 -0
  130. package/dist/componentInterfaces-RXBMI5yH.js.map +1 -0
  131. package/dist/deployments-BM42vImE.js +43 -0
  132. package/dist/deployments-BM42vImE.js.map +1 -0
  133. package/dist/deployments-CMdF5uEC.cjs +2 -0
  134. package/dist/deployments-CMdF5uEC.cjs.map +1 -0
  135. package/dist/deployments.json +15 -12
  136. package/dist/errors.cjs +1 -1
  137. package/dist/errors.cjs.map +1 -1
  138. package/dist/errors.d.ts +132 -0
  139. package/dist/errors.d.ts.map +1 -1
  140. package/dist/errors.js +122 -36
  141. package/dist/errors.js.map +1 -1
  142. package/dist/generated-B0tk-c9b.cjs +3 -0
  143. package/dist/generated-B0tk-c9b.cjs.map +1 -0
  144. package/dist/{generated-C_7Jx3YG.js → generated-B7VaSah4.js} +631 -343
  145. package/dist/generated-B7VaSah4.js.map +1 -0
  146. package/dist/index.cjs +1 -1
  147. package/dist/index.d.ts +1 -0
  148. package/dist/index.d.ts.map +1 -1
  149. package/dist/index.js +135 -126
  150. package/dist/transfers.cjs.map +1 -1
  151. package/dist/transfers.d.ts +1 -1
  152. package/dist/transfers.js.map +1 -1
  153. package/dist/utils.cjs.map +1 -1
  154. package/dist/utils.d.ts +1 -1
  155. package/dist/utils.js.map +1 -1
  156. package/package.json +5 -5
  157. package/src/Actions/ContractAction.ts +9 -10
  158. package/src/Actions/ERC721MintAction.ts +12 -13
  159. package/src/Actions/EventAction.test.ts +45 -54
  160. package/src/Actions/EventAction.ts +100 -100
  161. package/src/AllowLists/SimpleAllowList.ts +5 -5
  162. package/src/AllowLists/SimpleDenyList.ts +6 -6
  163. package/src/Boost.ts +19 -0
  164. package/src/BoostCore.test.ts +117 -1
  165. package/src/BoostCore.ts +121 -57
  166. package/src/BoostRegistry.ts +29 -21
  167. package/src/Budgets/ManagedBudget.ts +18 -18
  168. package/src/Budgets/VestingBudget.ts +23 -23
  169. package/src/Deployable/Contract.ts +4 -5
  170. package/src/Deployable/Deployable.ts +1 -1
  171. package/src/Deployable/DeployableTarget.ts +5 -5
  172. package/src/Deployable/DeployableTargetWithRBAC.ts +15 -15
  173. package/src/Incentives/AllowListIncentive.ts +12 -12
  174. package/src/Incentives/CGDAIncentive.ts +15 -15
  175. package/src/Incentives/ERC1155Incentive.ts +26 -26
  176. package/src/Incentives/ERC20Incentive.ts +23 -23
  177. package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
  178. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +309 -0
  179. package/src/Incentives/ERC20VariableIncentive.ts +19 -19
  180. package/src/Incentives/Incentive.ts +6 -5
  181. package/src/Incentives/PointsIncentive.test.ts +21 -21
  182. package/src/Incentives/PointsIncentive.ts +14 -14
  183. package/src/Validators/SignerValidator.ts +14 -14
  184. package/src/Validators/Validator.ts +1 -1
  185. package/src/claiming.ts +1 -1
  186. package/src/errors.ts +165 -0
  187. package/src/index.test.ts +117 -33
  188. package/src/index.ts +1 -0
  189. package/src/transfers.ts +1 -1
  190. package/src/utils.ts +1 -1
  191. package/dist/Incentive-DJf-vdyL.js.map +0 -1
  192. package/dist/Incentive-DNwROd1r.cjs.map +0 -1
  193. package/dist/SimpleDenyList-DMlUkmAn.cjs.map +0 -1
  194. package/dist/SimpleDenyList-DvUvmOeE.js.map +0 -1
  195. package/dist/componentInterfaces-BPVR_Ykd.js +0 -13
  196. package/dist/componentInterfaces-BPVR_Ykd.js.map +0 -1
  197. package/dist/componentInterfaces-BfppSIl4.cjs +0 -2
  198. package/dist/componentInterfaces-BfppSIl4.cjs.map +0 -1
  199. package/dist/deployments-BvFcK_eR.js +0 -40
  200. package/dist/deployments-BvFcK_eR.js.map +0 -1
  201. package/dist/deployments-Ho4PnGCS.cjs +0 -2
  202. package/dist/deployments-Ho4PnGCS.cjs.map +0 -1
  203. package/dist/generated-CMQ6ZC2_.cjs +0 -3
  204. package/dist/generated-CMQ6ZC2_.cjs.map +0 -1
  205. package/dist/generated-C_7Jx3YG.js.map +0 -1
package/src/BoostCore.ts CHANGED
@@ -20,7 +20,12 @@ import {
20
20
  writeBoostCoreSetProtocolFeeReceiver,
21
21
  } from '@boostxyz/evm';
22
22
  import { bytecode } from '@boostxyz/evm/artifacts/contracts/BoostCore.sol/BoostCore.json';
23
- import { getAccount, waitForTransactionReceipt } from '@wagmi/core';
23
+ import {
24
+ type GetTransactionReceiptParameters,
25
+ getAccount,
26
+ getTransactionReceipt,
27
+ waitForTransactionReceipt,
28
+ } from '@wagmi/core';
24
29
  import { createWriteContract } from '@wagmi/core/codegen';
25
30
  import {
26
31
  type Address,
@@ -74,6 +79,10 @@ import {
74
79
  ERC20Incentive,
75
80
  type ERC20IncentivePayload,
76
81
  } from './Incentives/ERC20Incentive';
82
+ import {
83
+ ERC20VariableCriteriaIncentive,
84
+ type ERC20VariableCriteriaIncentivePayload,
85
+ } from './Incentives/ERC20VariableCriteriaIncentive';
77
86
  import type { ERC20VariableIncentivePayload } from './Incentives/ERC20VariableIncentive';
78
87
  import {
79
88
  ERC20VariableIncentive,
@@ -103,6 +112,11 @@ import {
103
112
  assertValidAddressByChainId,
104
113
  } from './utils';
105
114
 
115
+ /**
116
+ * The ABI of the BoostCore contract, if needed for low level operations
117
+ *
118
+ * @type {typeof boostCoreAbi}
119
+ */
106
120
  export { boostCoreAbi };
107
121
 
108
122
  /**
@@ -117,9 +131,9 @@ export const BOOST_CORE_CLAIM_FEE = parseEther('0.000075');
117
131
  *
118
132
  * @type {Address}
119
133
  */
120
- export const BOOST_CORE_ADDRESS = (BoostCoreBases as Record<string, Address>)[
121
- __DEFAULT_CHAIN_ID__
122
- ];
134
+ export const BOOST_CORE_ADDRESS =
135
+ (BoostCoreBases as Record<string, Address>)[__DEFAULT_CHAIN_ID__] ||
136
+ zeroAddress;
123
137
 
124
138
  /**
125
139
  * The fixed addresses for the deployed Boost Core.
@@ -228,7 +242,7 @@ export type BoostCoreConfig =
228
242
  export type CreateBoostPayload = {
229
243
  budget: Budget;
230
244
  action: Action;
231
- validator: Validator;
245
+ validator?: Validator;
232
246
  allowList: AllowList;
233
247
  incentives: Array<Incentive>;
234
248
  protocolFee?: bigint;
@@ -303,7 +317,7 @@ export class BoostCore extends Deployable<
303
317
  * @async
304
318
  * @param {CreateBoostPayload} _boostPayload
305
319
  * @param {?DeployableOptions} [_options]
306
- * @returns {Boost}
320
+ * @returns {Promise<Boost>}
307
321
  */
308
322
  public async createBoost(
309
323
  _boostPayload: CreateBoostPayload,
@@ -347,6 +361,13 @@ export class BoostCore extends Deployable<
347
361
  }
348
362
  }
349
363
 
364
+ if (!validator) {
365
+ validator = this.SignerValidator({
366
+ signers: [owner],
367
+ validatorCaller: coreAddress,
368
+ });
369
+ }
370
+
350
371
  let budgetPayload: BoostPayload['budget'] = zeroAddress;
351
372
  if (budget.address) {
352
373
  budgetPayload = budget.address;
@@ -394,28 +415,12 @@ export class BoostCore extends Deployable<
394
415
  isBase: isBase,
395
416
  instance: validator.address,
396
417
  parameters: isBase
397
- ? validator
398
- .buildParameters(
399
- {
400
- signers: [owner],
401
- validatorCaller: coreAddress,
402
- },
403
- options,
404
- )
405
- .args.at(0) || zeroHash
418
+ ? validator.buildParameters(undefined, options).args.at(0) || zeroHash
406
419
  : zeroHash,
407
420
  };
408
421
  } else {
409
422
  validatorPayload.parameters =
410
- validator
411
- .buildParameters(
412
- {
413
- signers: [owner],
414
- validatorCaller: coreAddress,
415
- },
416
- options,
417
- )
418
- .args.at(0) || zeroHash;
423
+ validator.buildParameters(undefined, options).args.at(0) || zeroHash;
419
424
  validatorPayload.instance = assertValidAddressByChainId(
420
425
  options.config,
421
426
  validator.bases,
@@ -536,8 +541,8 @@ export class BoostCore extends Deployable<
536
541
  * @param {bigint} incentiveId
537
542
  * @param {Address} address
538
543
  * @param {Hex} data
539
- * @param {?WriteParams<typeof boostCoreAbi, 'claimIncentive'>} [params]
540
- * @returns {unknown}
544
+ * @param {?WriteParams} [params]
545
+ * @returns {Promise<void>}
541
546
  */
542
547
  public async claimIncentive(
543
548
  boostId: bigint,
@@ -560,8 +565,8 @@ export class BoostCore extends Deployable<
560
565
  * @param {bigint} incentiveId - The ID of the Incentive
561
566
  * @param {Address} referrer - The address of the referrer (if any)
562
567
  * @param {Hex} data- The data for the claim
563
- * @param {?WriteParams<typeof boostCoreAbi, 'claimIncentive'>} [params]
564
- * @returns {unknown}
568
+ * @param {?WriteParams} [params]
569
+ * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
565
570
  */
566
571
  public async claimIncentiveRaw(
567
572
  boostId: bigint,
@@ -598,8 +603,8 @@ export class BoostCore extends Deployable<
598
603
  * @param {Address} referrer
599
604
  * @param {Hex} data
600
605
  * @param {Address} claimant
601
- * @param {?WriteParams<typeof boostCoreAbi, 'claimIncentiveFor'>} [params]
602
- * @returns {unknown}
606
+ * @param {?WriteParams} [params]
607
+ * @returns {Promise<void>}
603
608
  */
604
609
  public async claimIncentiveFor(
605
610
  boostId: bigint,
@@ -631,8 +636,8 @@ export class BoostCore extends Deployable<
631
636
  * @param {Address} referrer - The address of the referrer (if any)
632
637
  * @param {Hex} data - The data for the claim
633
638
  * @param {Address} claimant - The address of the user eligible for the incentive payout
634
- * @param {?WriteParams<typeof boostCoreAbi, 'claimIncentiveFor'>} [params]
635
- * @returns {unknown}
639
+ * @param {?WriteParams} [params]
640
+ * @returns {Promise<{ hash: Hex; result: void; }>}
636
641
  */
637
642
  public async claimIncentiveForRaw(
638
643
  boostId: bigint,
@@ -666,8 +671,8 @@ export class BoostCore extends Deployable<
666
671
  * @public
667
672
  * @async
668
673
  * @param {bigint} id
669
- * @param {?ReadParams<typeof boostCoreAbi, 'getBoost'>} [params]
670
- * @returns {unknown}
674
+ * @param {?ReadParams} [params]
675
+ * @returns {Promise<RawBoost>}
671
676
  */
672
677
  public async readBoost(
673
678
  id: bigint,
@@ -688,8 +693,8 @@ export class BoostCore extends Deployable<
688
693
  * @public
689
694
  * @async
690
695
  * @param {(string | bigint)} _id
691
- * @param {?ReadParams<typeof boostCoreAbi, 'getBoost'>} [params]
692
- * @returns {unknown}
696
+ * @param {?ReadParams} [params]
697
+ * @returns {Promise<Boost>}
693
698
  */
694
699
  public async getBoost(
695
700
  _id: string | bigint,
@@ -741,7 +746,7 @@ export class BoostCore extends Deployable<
741
746
  *
742
747
  * @public
743
748
  * @async
744
- * @param {?ReadParams<typeof boostCoreAbi, 'getBoostCount'>} [params]
749
+ * @param {?ReadParams} [params]
745
750
  * @returns {Promise<bigint>}
746
751
  */
747
752
  public async getBoostCount(
@@ -766,7 +771,7 @@ export class BoostCore extends Deployable<
766
771
  * @public
767
772
  * @async
768
773
  * @param {Address} address
769
- * @param {?ReadParams<typeof boostCoreAbi, 'createBoostAuth'> &
774
+ * @param {?ReadParams &
770
775
  * ReadParams<typeof iAuthAbi, 'isAuthorized'>} [params]
771
776
  * @returns {Promise<boolean>}
772
777
  */
@@ -790,8 +795,8 @@ export class BoostCore extends Deployable<
790
795
  *
791
796
  * @public
792
797
  * @async
793
- * @param {?ReadParams<typeof boostCoreAbi, 'createBoostAuth'>} [params]
794
- * @returns {unknown}
798
+ * @param {?ReadParams} [params]
799
+ * @returns {Promise<Address>}
795
800
  */
796
801
  public async createBoostAuth(
797
802
  params?: ReadParams<typeof boostCoreAbi, 'createBoostAuth'>,
@@ -815,8 +820,8 @@ export class BoostCore extends Deployable<
815
820
  * @public
816
821
  * @async
817
822
  * @param {Auth} auth
818
- * @param {?WriteParams<typeof boostCoreAbi, 'setCreateBoostAuth'>} [params]
819
- * @returns {unknown}
823
+ * @param {?WriteParams} [params]
824
+ * @returns {Promise<void>}
820
825
  */
821
826
  public async setCreateBoostAuth(
822
827
  auth: Auth,
@@ -835,8 +840,8 @@ export class BoostCore extends Deployable<
835
840
  * @public
836
841
  * @async
837
842
  * @param {Address} address
838
- * @param {?WriteParams<typeof boostCoreAbi, 'setCreateBoostAuth'>} [params]
839
- * @returns {unknown}
843
+ * @param {?WriteParams} [params]
844
+ * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
840
845
  */
841
846
  public async setCreateBoostAuthRaw(
842
847
  address: Address,
@@ -865,7 +870,7 @@ export class BoostCore extends Deployable<
865
870
  *
866
871
  * @public
867
872
  * @async
868
- * @param {?ReadParams<typeof boostCoreAbi, 'protocolFee'>} [params]
873
+ * @param {?ReadParams} [params]
869
874
  * @returns {unknown}
870
875
  */
871
876
  public async protocolFee(
@@ -889,8 +894,8 @@ export class BoostCore extends Deployable<
889
894
  *
890
895
  * @public
891
896
  * @async
892
- * @param {?ReadParams<typeof boostCoreAbi, 'protocolFeeReceiver'>} [params]
893
- * @returns {unknown}
897
+ * @param {?ReadParams} [params]
898
+ * @returns {Promise<Address>}
894
899
  */
895
900
  public async protocolFeeReceiver(
896
901
  params?: ReadParams<typeof boostCoreAbi, 'protocolFeeReceiver'>,
@@ -914,8 +919,8 @@ export class BoostCore extends Deployable<
914
919
  * @public
915
920
  * @async
916
921
  * @param {Address} address
917
- * @param {?WriteParams<typeof boostCoreAbi, 'setProtocolFeeReceiver'>} [params]
918
- * @returns {unknown}
922
+ * @param {?WriteParams} [params]
923
+ * @returns {Promise<void>}
919
924
  */
920
925
  public async setProcolFeeReceiver(
921
926
  address: Address,
@@ -934,8 +939,8 @@ export class BoostCore extends Deployable<
934
939
  * @public
935
940
  * @async
936
941
  * @param {Address} address
937
- * @param {?WriteParams<typeof boostCoreAbi, 'setProtocolFeeReceiver'>} [params]
938
- * @returns {unknown}
942
+ * @param {?WriteParams} [params]
943
+ * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
939
944
  */
940
945
  public async setProcolFeeReceiverRaw(
941
946
  address: Address,
@@ -967,8 +972,8 @@ export class BoostCore extends Deployable<
967
972
  *
968
973
  * @public
969
974
  * @async
970
- * @param {?ReadParams<typeof boostCoreAbi, 'claimFee'>} [params]
971
- * @returns {unknown}
975
+ * @param {?ReadParams} [params]
976
+ * @returns {Promise<bigint>}
972
977
  */
973
978
  public async claimFee(params?: ReadParams<typeof boostCoreAbi, 'claimFee'>) {
974
979
  return await readBoostCoreClaimFee(this._config, {
@@ -990,8 +995,8 @@ export class BoostCore extends Deployable<
990
995
  * @public
991
996
  * @async
992
997
  * @param {bigint} claimFee
993
- * @param {?WriteParams<typeof boostCoreAbi, 'setClaimFee'>} [params]
994
- * @returns {unknown}
998
+ * @param {?WriteParams} [params]
999
+ * @returns {Promise<void>}
995
1000
  */
996
1001
  public async setClaimFee(
997
1002
  claimFee: bigint,
@@ -1006,8 +1011,8 @@ export class BoostCore extends Deployable<
1006
1011
  * @public
1007
1012
  * @async
1008
1013
  * @param {bigint} claimFee
1009
- * @param {?WriteParams<typeof boostCoreAbi, 'setClaimFee'>} [params]
1010
- * @returns {unknown}
1014
+ * @param {?WriteParams} [params]
1015
+ * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
1011
1016
  */
1012
1017
  public async setClaimFeeRaw(
1013
1018
  claimFee: bigint,
@@ -1031,6 +1036,41 @@ export class BoostCore extends Deployable<
1031
1036
  return { hash, result };
1032
1037
  }
1033
1038
 
1039
+ /**
1040
+ * Retrieves the claim information from a transaction receipt.
1041
+ *
1042
+ * @param {GetTransactionReceiptParameters} params - The parameters required to get the transaction receipt.
1043
+ * @returns {Promise<{ boostId: bigint, incentiveId: bigint, claimer: Address, amount: bigint } | undefined>} The claim information if found, undefined otherwise.
1044
+ *
1045
+ * @description
1046
+ * This method retrieves the transaction receipt using the provided parameters,
1047
+ * then parses the logs to find the 'BoostClaimed' event.
1048
+ * If found, it returns the arguments of the event, which include the boost ID,
1049
+ * incentive ID, claimer address, and claimed amount.
1050
+ *
1051
+ * @example
1052
+ * ```ts
1053
+ * const claimInfo = await boostCore.getClaimFromTransaction({
1054
+ * hash: '0x...',
1055
+ * chainId: 1
1056
+ * });
1057
+ * if (claimInfo) {
1058
+ * console.log(`Boost ${claimInfo.boostId} claimed by ${claimInfo.claimer}`);
1059
+ * }
1060
+ * ```
1061
+ */
1062
+ public async getClaimFromTransaction(
1063
+ params: GetTransactionReceiptParameters,
1064
+ ) {
1065
+ const receipt = await getTransactionReceipt(this._config, params);
1066
+ const logs = parseEventLogs({
1067
+ abi: boostCoreAbi,
1068
+ eventName: 'BoostClaimed',
1069
+ logs: receipt.logs,
1070
+ });
1071
+ return logs.at(0)?.args;
1072
+ }
1073
+
1034
1074
  /**
1035
1075
  * Bound {@link PassthroughAuth} constructor that reuses the same configuration as the Boost Core instance.
1036
1076
  *
@@ -1334,6 +1374,30 @@ export class BoostCore extends Deployable<
1334
1374
  isBase,
1335
1375
  );
1336
1376
  }
1377
+
1378
+ /**
1379
+ * Bound {@link ERC20VariableCriteriaIncentive} constructor that reuses the same configuration as the Boost Core instance.
1380
+ *
1381
+ * @example
1382
+ * ```ts
1383
+ * const validator = core.ERC20VariableCrtieriaIncentive({ ... }) // is roughly equivalent to
1384
+ * const validator = new ERC20VariableCrtieriaIncentive({ config: core._config, account: core._account }, { ... })
1385
+ * ```
1386
+ * @param {DeployablePayloadOrAddress<ERC20VariableCrtieriaIncentivePayload>} options
1387
+ * @param {?boolean} [isBase]
1388
+ * @returns {ERC20VariableCrtieriaIncentive}
1389
+ * */
1390
+ ERC20VariableCriteriaIncentive(
1391
+ options: DeployablePayloadOrAddress<ERC20VariableCriteriaIncentivePayload>,
1392
+ isBase?: boolean,
1393
+ ) {
1394
+ return new ERC20VariableCriteriaIncentive(
1395
+ { config: this._config, account: this._account },
1396
+ options,
1397
+ isBase,
1398
+ );
1399
+ }
1400
+
1337
1401
  /**
1338
1402
  * Bound {@link ERC20VariableIncentive} constructor that reuses the same configuration as the Boost Core instance.
1339
1403
  *
@@ -14,6 +14,7 @@ import {
14
14
  type ContractEventName,
15
15
  type Hex,
16
16
  isAddress,
17
+ zeroAddress,
17
18
  } from 'viem';
18
19
  import { BoostRegistry as BoostRegistryBases } from '../dist/deployments.json';
19
20
  import {
@@ -31,14 +32,21 @@ import {
31
32
  assertValidAddressByChainId,
32
33
  } from './utils';
33
34
 
35
+ /**
36
+ * The ABI of the BoostRegistry contract, if needed for low level operations
37
+ *
38
+ * @type {typeof boostRegistryAbi}
39
+ */
40
+ export { boostRegistryAbi };
41
+
34
42
  /**
35
43
  * The address of the deployed `BoostRegistry` instance. In prerelease mode, this will be its sepolia address
36
44
  *
37
45
  * @type {Address}
38
46
  */
39
- export const BOOST_REGISTRY_ADDRESS = (
40
- BoostRegistryBases as Record<string, Address>
41
- )[__DEFAULT_CHAIN_ID__];
47
+ export const BOOST_REGISTRY_ADDRESS =
48
+ (BoostRegistryBases as Record<string, Address>)[__DEFAULT_CHAIN_ID__] ||
49
+ zeroAddress;
42
50
 
43
51
  /**
44
52
  * The fixed addresses for the deployed Boost Registry.
@@ -214,8 +222,8 @@ export class BoostRegistry extends Deployable<
214
222
  * @param {RegistryType} registryType - The base type for the implementation
215
223
  * @param {string} name - A name for the implementation (must be unique within the given type)
216
224
  * @param {Address} implementation - The address of the implementation contract
217
- * @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params] - Optional params to provide the underlying Viem contract call
218
- * @returns {unknown}
225
+ * @param {?WriteParams} [params] - Optional params to provide the underlying Viem contract call
226
+ * @returns {Promise<void>}
219
227
  * @example
220
228
  * ```ts
221
229
  * await registry.register(ContractAction.registryType, 'ContractAction', ContractAction.base)
@@ -239,8 +247,8 @@ export class BoostRegistry extends Deployable<
239
247
  * @param {RegistryType} registryType
240
248
  * @param {string} name
241
249
  * @param {Address} implementation
242
- * @param {?WriteParams<typeof boostRegistryAbi, 'register'>} [params]
243
- * @returns {unknown}
250
+ * @param {?WriteParams} [params]
251
+ * @returns {Promise<{ hash: `0x${string}`; result: void; }>}
244
252
  */
245
253
  public async registerRaw(
246
254
  registryType: RegistryType,
@@ -275,8 +283,8 @@ export class BoostRegistry extends Deployable<
275
283
  * @template {DeployableTarget} Target
276
284
  * @param {string} displayName - The display name for the clone
277
285
  * @param {Target} target - An instance of a target contract to clone and initialize
278
- * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
279
- * @returns {Target} - The provided instance, but with a new address attached.
286
+ * @param {?WriteParams} [params]
287
+ * @returns {Promise<Target>} - The provided instance, but with a new address attached.
280
288
  * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
281
289
  */
282
290
  public initialize<Target extends DeployableTarget<any, any>>(
@@ -295,8 +303,8 @@ export class BoostRegistry extends Deployable<
295
303
  * @template {DeployableTarget} Target
296
304
  * @param {string} displayName - The display name for the clone
297
305
  * @param {Target} target - An instance of a target contract to clone and initialize
298
- * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
299
- * @returns {Target} - The provided instance, but with a new address attached.
306
+ * @param {?WriteParams} [params]
307
+ * @returns {Promise<Target>} - The provided instance, but with a new address attached.
300
308
  * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
301
309
  */
302
310
  public async clone<Target extends DeployableTarget<any, any>>(
@@ -316,8 +324,8 @@ export class BoostRegistry extends Deployable<
316
324
  * @template {DeployableTarget} Target
317
325
  * @param {string} displayName
318
326
  * @param {Target} target
319
- * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
320
- * @returns {Target}
327
+ * @param {?WriteParams} [params]
328
+ * @returns {Promise<Address>}
321
329
  * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
322
330
  */
323
331
  public async deployClone<Target extends DeployableTarget<any, any>>(
@@ -336,8 +344,8 @@ export class BoostRegistry extends Deployable<
336
344
  * @async
337
345
  * @param {string} displayName
338
346
  * @param {DeployableTarget} target
339
- * @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
340
- * @returns {unknown} - The transaction hash
347
+ * @param {?WriteParams} [params]
348
+ * @returns {Promise<{ hash: Hex, result: Address }>} - The transaction hash
341
349
  * biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
342
350
  */
343
351
  public async deployCloneRaw<Target extends DeployableTarget<any, any>>(
@@ -379,8 +387,8 @@ export class BoostRegistry extends Deployable<
379
387
  * @public
380
388
  * @async
381
389
  * @param {Hex} identifier - The unique identifier for the implementation (see {getIdentifier})
382
- * @param {?ReadParams<typeof boostRegistryAbi, 'getBaseImplementation'>} [params]
383
- * @returns {unknown} - The address of the implementation
390
+ * @param {?ReadParams} [params]
391
+ * @returns {Promise<Address>} - The address of the implementation
384
392
  */
385
393
  public async getBaseImplementation(
386
394
  identifier: Hex,
@@ -405,7 +413,7 @@ export class BoostRegistry extends Deployable<
405
413
  * @public
406
414
  * @async
407
415
  * @param {Hex} identifier - The unique identifier for the deployed clone (see {getCloneIdentifier})
408
- * @param {?ReadParams<typeof boostRegistryAbi, 'getClone'>} [params]
416
+ * @param {?ReadParams} [params]
409
417
  * @returns {Promise<Address>} - The address of the deployed clone
410
418
  */
411
419
  public async getClone(
@@ -431,7 +439,7 @@ export class BoostRegistry extends Deployable<
431
439
  * @public
432
440
  * @async
433
441
  * @param {Address} deployer - The address of the deployer
434
- * @param {?ReadParams<typeof boostRegistryAbi, 'getClones'>} [params]
442
+ * @param {?ReadParams} [params]
435
443
  * @returns {Promise<Hex[]>} - The list of deployed clones for the given deployer
436
444
  */
437
445
  public async getClones(
@@ -460,7 +468,7 @@ export class BoostRegistry extends Deployable<
460
468
  * @param {Address} base - The address of the base implementation
461
469
  * @param {Address} deployer - The address of the deployer
462
470
  * @param {string} displayName - The display name of the clone
463
- * @param {?ReadParams<typeof boostRegistryAbi, 'getCloneIdentifier'>} [params]
471
+ * @param {?ReadParams} [params]
464
472
  * @returns {Promise<Hex>} - The unique identifier for the clone
465
473
  */
466
474
  public async getCloneIdentifier(
@@ -490,7 +498,7 @@ export class BoostRegistry extends Deployable<
490
498
  * @async
491
499
  * @param {RegistryType} registryType - The base type for the implementation
492
500
  * @param {string} displayName - The name of the implementation
493
- * @param {?ReadParams<typeof boostRegistryAbi, 'getIdentifier'>} [params]
501
+ * @param {?ReadParams} [params]
494
502
  * @returns {Promise<Hex>} - The unique identifier for the implementation
495
503
  */
496
504
  public async getIdentifier(
@@ -149,7 +149,7 @@ export function isERC1155TransferPayload(
149
149
  *
150
150
  * @export
151
151
  * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
152
- * @returns {*}
152
+ * @returns {Hex}
153
153
  * @throws {@link UnknownTransferPayloadSupplied}
154
154
  */
155
155
  export function prepareTransfer(
@@ -212,7 +212,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
212
212
  * @public
213
213
  * @async
214
214
  * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
215
- * @param {?WriteParams<typeof managedBudgetAbi, 'allocate'>} [params]
215
+ * @param {?WriteParams} [params]
216
216
  * @returns {Promise<boolean>} - True if the allocation was successful
217
217
  */
218
218
  public async allocate(
@@ -230,8 +230,8 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
230
230
  * @public
231
231
  * @async
232
232
  * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
233
- * @param {?WriteParams<typeof managedBudgetAbi, 'allocate'>} [params]
234
- * @returns {Promise<boolean>} - True if the allocation was successful
233
+ * @param {?WriteParams} [params]
234
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the allocation was successful
235
235
  */
236
236
  public async allocateRaw(
237
237
  transfer: FungibleTransferPayload | ERC1155TransferPayload,
@@ -260,7 +260,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
260
260
  * @public
261
261
  * @async
262
262
  * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
263
- * @param {?WriteParams<typeof managedBudgetAbi, 'clawback'>} [params]
263
+ * @param {?WriteParams} [params]
264
264
  * @returns {Promise<boolean>} - True if the request was successful
265
265
  */
266
266
  public async clawback(
@@ -279,8 +279,8 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
279
279
  * @public
280
280
  * @async
281
281
  * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
282
- * @param {?WriteParams<typeof managedBudgetAbi, 'clawback'>} [params]
283
- * @returns {Promise<boolean>} - True if the request was successful
282
+ * @param {?WriteParams} [params]
283
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the request was successful
284
284
  */
285
285
  public async clawbackRaw(
286
286
  transfer: FungibleTransferPayload | ERC1155TransferPayload,
@@ -307,7 +307,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
307
307
  * @public
308
308
  * @async
309
309
  * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
310
- * @param {?WriteParams<typeof managedBudgetAbi, 'disburse'>} [params]
310
+ * @param {?WriteParams} [params]
311
311
  * @returns {Promise<boolean>} - True if the disbursement was successful
312
312
  */
313
313
  public async disburse(
@@ -324,8 +324,8 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
324
324
  * @public
325
325
  * @async
326
326
  * @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
327
- * @param {?WriteParams<typeof managedBudgetAbi, 'disburse'>} [params]
328
- * @returns {Promise<boolean>} - True if the disbursement was successful
327
+ * @param {?WriteParams} [params]
328
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the disbursement was successful
329
329
  */
330
330
  public async disburseRaw(
331
331
  transfer: FungibleTransferPayload | ERC1155TransferPayload,
@@ -351,7 +351,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
351
351
  * @public
352
352
  * @async
353
353
  * @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers
354
- * @param {?WriteParams<typeof managedBudgetAbi, 'disburseBatch'>} [params]
354
+ * @param {?WriteParams} [params]
355
355
  * @returns {Promise<boolean>} - True if all disbursements were successful
356
356
  */
357
357
  public async disburseBatch(
@@ -367,8 +367,8 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
367
367
  * @public
368
368
  * @async
369
369
  * @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers
370
- * @param {?WriteParams<typeof managedBudgetAbi, 'disburseBatch'>} [params]
371
- * @returns {Promise<boolean>} - True if all disbursements were successful
370
+ * @param {?WriteParams} [params]
371
+ * @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if all disbursements were successful
372
372
  */
373
373
  public async disburseBatchRaw(
374
374
  transfers: Array<FungibleTransferPayload | ERC1155TransferPayload>,
@@ -392,7 +392,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
392
392
  * Get the owner of the budget
393
393
  *
394
394
  * @public
395
- * @param {?ReadParams<typeof managedBudgetAbi, 'owner'>} [params]
395
+ * @param {?ReadParams} [params]
396
396
  * @returns {Promise<Address>}
397
397
  */
398
398
  public owner(params?: ReadParams<typeof managedBudgetAbi, 'owner'>) {
@@ -411,7 +411,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
411
411
  * @public
412
412
  * @param {Address} [asset="0x0000000000000000000000000000000000000000"] - The address of the asset
413
413
  * @param {?(bigint | undefined)} [tokenId] - The ID of the token
414
- * @param {?ReadParams<typeof managedBudgetAbi, 'total'>} [params]
414
+ * @param {?ReadParams} [params]
415
415
  * @returns {Promise<bigint>} - The total amount of assets
416
416
  */
417
417
  public total(
@@ -434,7 +434,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
434
434
  * @public
435
435
  * @param {Address} [asset="0x0000000000000000000000000000000000000000"]
436
436
  * @param {?(bigint | undefined)} [tokenId]
437
- * @param {?ReadParams<typeof managedBudgetAbi, 'available'>} [params]
437
+ * @param {?ReadParams} [params]
438
438
  * @returns {Promise<bigint>} - The amount of assets available
439
439
  */
440
440
  public available(
@@ -457,7 +457,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
457
457
  * @public
458
458
  * @param {Address} [asset="0x0000000000000000000000000000000000000000"]
459
459
  * @param {?(bigint | undefined)} [tokenId]
460
- * @param {?ReadParams<typeof managedBudgetAbi, 'distributed'>} [params]
460
+ * @param {?ReadParams} [params]
461
461
  * @returns {Promise<bigint>} - The amount of assets distributed
462
462
  */
463
463
  public distributed(
@@ -517,7 +517,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
517
517
  * @param {Address} param0.owner - The budget's owner
518
518
  * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
519
519
  * @param {{}} param0.roles - List of roles to assign to the corresponding account by index.
520
- * @returns {*}
520
+ * @returns {Hex}
521
521
  */
522
522
  export const prepareManagedBudgetPayload = ({
523
523
  owner,