@boostxyz/sdk 0.0.0-alpha.9 → 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 (257) 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 +11 -11
  5. package/dist/Actions/ContractAction.d.ts.map +1 -1
  6. package/dist/Actions/ERC721MintAction.d.ts +14 -14
  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 +171 -41
  11. package/dist/Actions/EventAction.d.ts.map +1 -1
  12. package/dist/Actions/EventAction.js +15 -392
  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 +92 -37
  25. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  26. package/dist/AllowLists/SimpleAllowList.js +55 -71
  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 +203 -11
  31. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  32. package/dist/AllowLists/SimpleDenyList.js +11 -112
  33. package/dist/AllowLists/SimpleDenyList.js.map +1 -1
  34. package/dist/Auth/PassthroughAuth.cjs +1 -1
  35. package/dist/Auth/PassthroughAuth.js +1 -1
  36. package/dist/Boost.cjs +1 -1
  37. package/dist/Boost.cjs.map +1 -1
  38. package/dist/Boost.d.ts +20 -21
  39. package/dist/Boost.d.ts.map +1 -1
  40. package/dist/Boost.js +43 -57
  41. package/dist/Boost.js.map +1 -1
  42. package/dist/BoostCore-BVZExPPu.js +1462 -0
  43. package/dist/BoostCore-BVZExPPu.js.map +1 -0
  44. package/dist/BoostCore-D-E-cnGI.cjs +3 -0
  45. package/dist/BoostCore-D-E-cnGI.cjs.map +1 -0
  46. package/dist/BoostCore.cjs +1 -2
  47. package/dist/BoostCore.cjs.map +1 -1
  48. package/dist/BoostCore.d.ts +748 -77
  49. package/dist/BoostCore.d.ts.map +1 -1
  50. package/dist/BoostCore.js +29 -1150
  51. package/dist/BoostCore.js.map +1 -1
  52. package/dist/BoostRegistry.cjs +1 -1
  53. package/dist/BoostRegistry.cjs.map +1 -1
  54. package/dist/BoostRegistry.d.ts +80 -25
  55. package/dist/BoostRegistry.d.ts.map +1 -1
  56. package/dist/BoostRegistry.js +165 -83
  57. package/dist/BoostRegistry.js.map +1 -1
  58. package/dist/Budgets/Budget.cjs +1 -1
  59. package/dist/Budgets/Budget.cjs.map +1 -1
  60. package/dist/Budgets/Budget.d.ts.map +1 -1
  61. package/dist/Budgets/Budget.js +2 -2
  62. package/dist/Budgets/Budget.js.map +1 -1
  63. package/dist/Budgets/ManagedBudget.cjs +1 -1
  64. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  65. package/dist/Budgets/ManagedBudget.d.ts +75 -193
  66. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  67. package/dist/Budgets/ManagedBudget.js +80 -298
  68. package/dist/Budgets/ManagedBudget.js.map +1 -1
  69. package/dist/Budgets/VestingBudget.d.ts +223 -89
  70. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  71. package/dist/Deployable/Contract.cjs +1 -1
  72. package/dist/Deployable/Contract.cjs.map +1 -1
  73. package/dist/Deployable/Contract.d.ts +4 -5
  74. package/dist/Deployable/Contract.d.ts.map +1 -1
  75. package/dist/Deployable/Contract.js +5 -7
  76. package/dist/Deployable/Contract.js.map +1 -1
  77. package/dist/Deployable/Deployable.cjs.map +1 -1
  78. package/dist/Deployable/Deployable.d.ts +1 -1
  79. package/dist/Deployable/Deployable.d.ts.map +1 -1
  80. package/dist/Deployable/Deployable.js +3 -5
  81. package/dist/Deployable/Deployable.js.map +1 -1
  82. package/dist/Deployable/DeployableTarget.cjs +1 -1
  83. package/dist/Deployable/DeployableTarget.cjs.map +1 -1
  84. package/dist/Deployable/DeployableTarget.d.ts +13 -13
  85. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  86. package/dist/Deployable/DeployableTarget.js +28 -25
  87. package/dist/Deployable/DeployableTarget.js.map +1 -1
  88. package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
  89. package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
  90. package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
  91. package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
  92. package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
  93. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
  94. package/dist/EventAction-BZt5cjbe.cjs +2 -0
  95. package/dist/EventAction-BZt5cjbe.cjs.map +1 -0
  96. package/dist/EventAction-C_-hJXWm.js +1541 -0
  97. package/dist/EventAction-C_-hJXWm.js.map +1 -0
  98. package/dist/Incentive-BhHaK3PZ.cjs +2 -0
  99. package/dist/Incentive-BhHaK3PZ.cjs.map +1 -0
  100. package/dist/Incentive-Cqg1w6wD.js +312 -0
  101. package/dist/Incentive-Cqg1w6wD.js.map +1 -0
  102. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  103. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  104. package/dist/Incentives/AllowListIncentive.d.ts +38 -16
  105. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  106. package/dist/Incentives/AllowListIncentive.js +42 -29
  107. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  108. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  109. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  110. package/dist/Incentives/CGDAIncentive.d.ts +234 -21
  111. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  112. package/dist/Incentives/CGDAIncentive.js +45 -32
  113. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  114. package/dist/Incentives/ERC1155Incentive.d.ts +224 -37
  115. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  116. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  117. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  118. package/dist/Incentives/ERC20Incentive.d.ts +230 -29
  119. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  120. package/dist/Incentives/ERC20Incentive.js +56 -43
  121. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  122. package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +335 -440
  123. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
  124. package/dist/Incentives/ERC20VariableIncentive.d.ts +231 -29
  125. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  126. package/dist/Incentives/Incentive.cjs +1 -1
  127. package/dist/Incentives/Incentive.cjs.map +1 -1
  128. package/dist/Incentives/Incentive.d.ts +4 -4
  129. package/dist/Incentives/Incentive.d.ts.map +1 -1
  130. package/dist/Incentives/Incentive.js +16 -296
  131. package/dist/Incentives/Incentive.js.map +1 -1
  132. package/dist/Incentives/PointsIncentive.cjs +1 -1
  133. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  134. package/dist/Incentives/PointsIncentive.d.ts +40 -18
  135. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  136. package/dist/Incentives/PointsIncentive.js +37 -24
  137. package/dist/Incentives/PointsIncentive.js.map +1 -1
  138. package/dist/SimpleDenyList-BUR17Tt1.cjs +2 -0
  139. package/dist/SimpleDenyList-BUR17Tt1.cjs.map +1 -0
  140. package/dist/SimpleDenyList-CGaWjuld.js +132 -0
  141. package/dist/SimpleDenyList-CGaWjuld.js.map +1 -0
  142. package/dist/Validators/SignerValidator.cjs +1 -1
  143. package/dist/Validators/SignerValidator.cjs.map +1 -1
  144. package/dist/Validators/SignerValidator.d.ts +16 -16
  145. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  146. package/dist/Validators/SignerValidator.js +30 -27
  147. package/dist/Validators/SignerValidator.js.map +1 -1
  148. package/dist/Validators/Validator.cjs +1 -1
  149. package/dist/Validators/Validator.cjs.map +1 -1
  150. package/dist/Validators/Validator.d.ts +1 -1
  151. package/dist/Validators/Validator.js +2 -2
  152. package/dist/Validators/Validator.js.map +1 -1
  153. package/dist/claiming.cjs.map +1 -1
  154. package/dist/claiming.d.ts +1 -1
  155. package/dist/claiming.js.map +1 -1
  156. package/dist/componentInterfaces-BBCFkrZv.js +14 -0
  157. package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
  158. package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
  159. package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
  160. package/dist/deployments-DVXioW2i.cjs +2 -0
  161. package/dist/deployments-DVXioW2i.cjs.map +1 -0
  162. package/dist/deployments-oykLv3_Z.js +43 -0
  163. package/dist/deployments-oykLv3_Z.js.map +1 -0
  164. package/dist/deployments.json +44 -0
  165. package/dist/errors.cjs +1 -1
  166. package/dist/errors.cjs.map +1 -1
  167. package/dist/errors.d.ts +256 -20
  168. package/dist/errors.d.ts.map +1 -1
  169. package/dist/errors.js +183 -26
  170. package/dist/errors.js.map +1 -1
  171. package/dist/{generated-57_Kffpz.js → generated-CKt2yCQd.js} +3613 -1869
  172. package/dist/generated-CKt2yCQd.js.map +1 -0
  173. package/dist/generated-CyTNlOwM.cjs +3 -0
  174. package/dist/generated-CyTNlOwM.cjs.map +1 -0
  175. package/dist/index.cjs +1 -1
  176. package/dist/index.d.ts +5 -0
  177. package/dist/index.d.ts.map +1 -1
  178. package/dist/index.js +142 -108
  179. package/dist/index.js.map +1 -1
  180. package/dist/transfers.cjs.map +1 -1
  181. package/dist/transfers.d.ts +1 -1
  182. package/dist/transfers.js.map +1 -1
  183. package/dist/utils.cjs +1 -1
  184. package/dist/utils.cjs.map +1 -1
  185. package/dist/utils.d.ts +26 -12
  186. package/dist/utils.d.ts.map +1 -1
  187. package/dist/utils.js +38 -23
  188. package/dist/utils.js.map +1 -1
  189. package/package.json +20 -10
  190. package/src/Actions/Action.test.ts +14 -13
  191. package/src/Actions/ContractAction.test.ts +10 -10
  192. package/src/Actions/ContractAction.ts +11 -12
  193. package/src/Actions/ERC721MintAction.test.ts +6 -6
  194. package/src/Actions/ERC721MintAction.ts +14 -15
  195. package/src/Actions/EventAction.test.ts +729 -109
  196. package/src/Actions/EventAction.ts +542 -84
  197. package/src/AllowLists/AllowList.test.ts +7 -7
  198. package/src/AllowLists/AllowList.ts +5 -3
  199. package/src/AllowLists/OpenAllowList.test.ts +40 -0
  200. package/src/AllowLists/OpenAllowList.ts +45 -0
  201. package/src/AllowLists/SimpleAllowList.test.ts +4 -4
  202. package/src/AllowLists/SimpleAllowList.ts +39 -61
  203. package/src/AllowLists/SimpleDenyList.test.ts +4 -4
  204. package/src/AllowLists/SimpleDenyList.ts +40 -17
  205. package/src/Auth/PassthroughAuth.test.ts +1 -1
  206. package/src/Boost.ts +21 -24
  207. package/src/BoostCore.test.ts +323 -268
  208. package/src/BoostCore.ts +396 -219
  209. package/src/BoostRegistry.test.ts +53 -0
  210. package/src/BoostRegistry.ts +161 -40
  211. package/src/Budgets/Budget.test.ts +2 -2
  212. package/src/Budgets/Budget.ts +1 -2
  213. package/src/Budgets/ManagedBudget.test.ts +82 -19
  214. package/src/Budgets/ManagedBudget.ts +48 -310
  215. package/src/Budgets/VestingBudget.test.ts +7 -7
  216. package/src/Budgets/VestingBudget.ts +34 -106
  217. package/src/Deployable/Contract.ts +4 -5
  218. package/src/Deployable/Deployable.ts +1 -1
  219. package/src/Deployable/DeployableTarget.ts +30 -19
  220. package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
  221. package/src/Incentives/AllowListIncentive.test.ts +5 -5
  222. package/src/Incentives/AllowListIncentive.ts +29 -15
  223. package/src/Incentives/CGDAIncentive.test.ts +9 -6
  224. package/src/Incentives/CGDAIncentive.ts +38 -18
  225. package/src/Incentives/ERC1155Incentive.test.ts +3 -3
  226. package/src/Incentives/ERC1155Incentive.ts +28 -29
  227. package/src/Incentives/ERC20Incentive.test.ts +9 -6
  228. package/src/Incentives/ERC20Incentive.ts +46 -26
  229. package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
  230. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +324 -0
  231. package/src/Incentives/ERC20VariableIncentive.test.ts +8 -11
  232. package/src/Incentives/ERC20VariableIncentive.ts +49 -26
  233. package/src/Incentives/Incentive.test.ts +4 -1
  234. package/src/Incentives/Incentive.ts +7 -6
  235. package/src/Incentives/PointsIncentive.test.ts +24 -25
  236. package/src/Incentives/PointsIncentive.ts +31 -17
  237. package/src/Validators/SignerValidator.test.ts +6 -6
  238. package/src/Validators/SignerValidator.ts +19 -17
  239. package/src/Validators/Validator.test.ts +2 -2
  240. package/src/Validators/Validator.ts +1 -1
  241. package/src/claiming.ts +1 -1
  242. package/src/errors.ts +345 -21
  243. package/src/index.test.ts +118 -36
  244. package/src/index.ts +5 -0
  245. package/src/transfers.ts +1 -1
  246. package/src/utils.test.ts +2 -2
  247. package/src/utils.ts +61 -12
  248. package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
  249. package/dist/componentInterfaces-CKCBwG16.cjs +0 -2
  250. package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
  251. package/dist/componentInterfaces-DYkaxBda.js +0 -13
  252. package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
  253. package/dist/generated-57_Kffpz.js.map +0 -1
  254. package/dist/generated-wKBNvm48.cjs +0 -3
  255. package/dist/generated-wKBNvm48.cjs.map +0 -1
  256. package/src/Budgets/SimpleBudget.test.ts +0 -152
  257. package/src/Budgets/SimpleBudget.ts +0 -564
package/src/index.test.ts CHANGED
@@ -1,40 +1,122 @@
1
- import { describe, expect, test } from 'vitest';
2
- import * as SDK from './index';
1
+ import { describe, expect, test } from "vitest";
2
+ import * as SDK from "./index";
3
3
 
4
- describe('sdk exports', () => {
5
- test(`should export all public API`, () => {
6
- expect(SDK.BoostRegistry).toBeDefined();
7
- expect(SDK.BoostCore).toBeDefined();
8
- expect(SDK.Boost).toBeDefined();
9
-
10
- // interfaces
11
- expect(SDK.PassthroughAuth).toBeDefined();
12
- // expect(SDK.ContractAction).toBeDefined();
13
- // expect(SDK.ERC721MintAction).toBeDefined();
14
- expect(SDK.SimpleAllowList).toBeDefined();
15
- expect(SDK.SimpleDenyList).toBeDefined();
16
- expect(SDK.ManagedBudget).toBeDefined();
17
- // expect(SDK.SimpleBudget).toBeDefined();
18
- // expect(SDK.VestingBudget).toBeDefined();
19
- expect(SDK.AllowListIncentive).toBeDefined();
20
- expect(SDK.CGDAIncentive).toBeDefined();
21
- expect(SDK.ERC20Incentive).toBeDefined();
22
- // expect(SDK.ERC1155Incentive).toBeDefined();
23
- expect(SDK.PointsIncentive).toBeDefined();
24
- expect(SDK.SignerValidator).toBeDefined();
4
+ // Please add any public interface you'd like to verify exists on the root export here
5
+ // Types don't exist in .js so only list objects, constants, classes, etc, no interfaces
6
+ const allExports = [
7
+ "BoostRegistry",
8
+ "BoostCore",
9
+ "Boost",
10
+ "EventAction",
11
+ "OpenAllowList",
12
+ "SimpleAllowList",
13
+ "SimpleDenyList",
14
+ "ManagedBudget",
15
+ "Deployable",
16
+ "Contract",
17
+ "DeployableTarget",
18
+ "DeployableTargetWithRBAC",
19
+ "AllowListIncentive",
20
+ "CGDAIncentive",
21
+ "ERC20Incentive",
22
+ "ERC20VariableIncentive",
23
+ "ERC20VariableCriteriaIncentive",
24
+ "PointsIncentive",
25
+ "SignerValidator",
26
+ "BoostCoreNoIdentifierEmitted",
27
+ "ContractAddressRequiredError",
28
+ "DeployableAlreadyDeployedError",
29
+ "DeployableBuildParametersUnspecifiedError",
30
+ "DeployableUnknownOwnerProvidedError",
31
+ "DeployableWagmiConfigurationRequiredError",
32
+ "DeployableMissingPayloadError",
33
+ "NoContractAddressUponReceiptError",
34
+ "InvalidComponentInterfaceError",
35
+ "UnparseableAbiParamError",
36
+ "UnknownTransferPayloadSupplied",
37
+ "BudgetMustAuthorizeBoostCore",
38
+ "MustInitializeBudgetError",
39
+ "IncentiveNotCloneableError",
40
+ "NoEventActionStepsProvidedError",
41
+ "TooManyEventActionStepsProvidedError",
42
+ "ValidationAbiMissingError",
43
+ "FieldActionValidationError",
44
+ "DecodedArgsMalformedError",
45
+ "FieldValueUndefinedError",
46
+ "InvalidNumericalCriteriaError",
47
+ "FunctionDataDecodeError",
48
+ "FieldValueNotComparableError",
49
+ "UnrecognizedFilterTypeError",
50
+ "NoConnectedChainIdError",
51
+ "InvalidProtocolChainIdError",
52
+ "IncentiveCriteriaNotFoundError",
53
+ "NoMatchingLogsError",
54
+ "InvalidCriteriaTypeError",
55
+ "DecodedArgsError",
56
+ "PassthroughAuth",
57
+ "prepareBoostPayload",
58
+ "actionFromAddress",
59
+ "isEventActionPayloadSimple",
60
+ "prepareEventActionPayload",
61
+ "allowListFromAddress",
62
+ "prepareSimpleAllowListPayload",
63
+ "prepareSimpleDenyListPayload",
64
+ "budgetFromAddress",
65
+ "isFungibleTransfer",
66
+ "isERC1155TransferPayload",
67
+ "prepareTransfer",
68
+ "prepareManagedBudgetPayload",
69
+ "prepareAllowListIncentivePayload",
70
+ "prepareCGDAIncentivePayload",
71
+ "prepareERC20IncentivePayload",
72
+ "prepareERC20VariableIncentivePayload",
73
+ "prepareERC20VariableCriteriaIncentivePayload",
74
+ "incentiveFromAddress",
75
+ "preparePointsIncentivePayload",
76
+ "prepareSignerValidatorClaimDataPayload",
77
+ "prepareSignerValidatorInputParams",
78
+ "prepareSignerValidatorPayload",
79
+ "validatorFromAddress",
80
+ "bytes4",
81
+ "getDeployedContractAddress",
82
+ "awaitResult",
83
+ "assertValidAddressByChainId",
84
+ "prepareClaimPayload",
85
+ "prepareERC1155Payload",
86
+ "prepareERC1155Transfer",
87
+ "prepareFungiblePayload",
88
+ "prepareFungibleTransfer",
89
+ "prepareTransferPayload",
90
+ "BOOST_REGISTRY_ADDRESS",
91
+ "BOOST_REGISTRY_ADDRESSES",
92
+ "boostCoreAbi",
93
+ "boostRegistryAbi",
94
+ "BOOST_CORE_CLAIM_FEE",
95
+ "BOOST_CORE_ADDRESS",
96
+ "BOOST_CORE_ADDRESSES",
97
+ "ActionByComponentInterface",
98
+ "AllowListByComponentInterface",
99
+ "simpleAllowListAbi",
100
+ "LIST_MANAGER_ROLE",
101
+ "simpleDenyListAbi",
102
+ "BudgetByComponentInterface",
103
+ "managedBudgetAbi",
104
+ "rbacAbi",
105
+ "allowListIncentiveAbi",
106
+ "cgdaIncentiveAbi",
107
+ "erc20IncentiveAbi",
108
+ "erc20VariableIncentiveAbi",
109
+ "IncentiveByComponentInterface",
110
+ "pointsIncentiveAbi",
111
+ "signerValidatorAbi",
112
+ "ValidatorByComponentInterface",
113
+ "passthroughAuthAbi"
114
+ ]
25
115
 
26
- // errors
27
- expect(SDK.BoostCoreNoIdentifierEmitted).toBeDefined();
28
- expect(SDK.ContractAddressRequiredError).toBeDefined();
29
- expect(SDK.DeployableAlreadyDeployedError).toBeDefined();
30
- expect(SDK.DeployableBuildParametersUnspecifiedError).toBeDefined();
31
- expect(SDK.DeployableUnknownOwnerProvidedError).toBeDefined();
32
- expect(SDK.DeployableWagmiConfigurationRequiredError).toBeDefined();
33
- expect(SDK.DeployableMissingPayloadError).toBeDefined();
34
- expect(SDK.NoContractAddressUponReceiptError).toBeDefined();
35
- expect(SDK.InvalidComponentInterfaceError).toBeDefined();
36
- expect(SDK.UnknownTransferPayloadSupplied).toBeDefined();
37
- expect(SDK.BudgetMustAuthorizeBoostCore).toBeDefined();
38
- expect(SDK.IncentiveNotCloneableError).toBeDefined();
116
+ describe("SDK exports", () => {
117
+ test(`should export all public API`, () => {
118
+ for(let exp of allExports) {
119
+ expect((SDK as any)[exp]).toBeDefined()
120
+ }
39
121
  });
40
122
  });
package/src/index.ts CHANGED
@@ -27,12 +27,15 @@ export * from './Budgets/ManagedBudget';
27
27
  export * from './Deployable/Deployable';
28
28
  export * from './Deployable/Contract';
29
29
  export * from './Deployable/DeployableTarget';
30
+ export * from './Deployable/DeployableTargetWithRBAC';
30
31
 
31
32
  // Incentives
32
33
 
33
34
  export * from './Incentives/AllowListIncentive';
34
35
  export * from './Incentives/CGDAIncentive';
35
36
  export * from './Incentives/ERC20Incentive';
37
+ export * from './Incentives/ERC20VariableIncentive';
38
+ export * from './Incentives/ERC20VariableCriteriaIncentive';
36
39
  // export * from './Incentives/ERC1155Incentive';
37
40
  export * from './Incentives/Incentive';
38
41
  export * from './Incentives/PointsIncentive';
@@ -46,6 +49,8 @@ export * from './Validators/Validator';
46
49
 
47
50
  export * from './errors';
48
51
  export * from './utils';
52
+ export * from './claiming';
53
+ export * from './transfers';
49
54
 
50
55
  // Auth
51
56
 
package/src/transfers.ts CHANGED
@@ -211,7 +211,7 @@ export interface FungiblePayload {
211
211
  * @export
212
212
  * @param {FungiblePayload} param0
213
213
  * @param {bigint} param0.amount - The amount being transferred
214
- * @returns {*}
214
+ * @returns {Hex}
215
215
  */
216
216
  export function prepareFungiblePayload({ amount }: FungiblePayload) {
217
217
  return encodeAbiParameters(
package/src/utils.test.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { simulateMockErc20Mint, writeMockErc20Mint } from '@boostxyz/evm';
2
2
  import { isAddress } from 'viem';
3
3
  import { describe, expect, test } from 'vitest';
4
- import { MockERC20 } from '../test/MockERC20';
5
- import { defaultOptions } from '../test/helpers';
4
+ import { MockERC20 } from '@boostxyz/test/MockERC20';
5
+ import { defaultOptions } from '@boostxyz/test/helpers';
6
6
  import { awaitResult, bytes4, getDeployedContractAddress } from './utils';
7
7
 
8
8
  describe('bytes4', () => {
package/src/utils.ts CHANGED
@@ -3,12 +3,15 @@ import {
3
3
  type ReadContractParameters,
4
4
  type WatchContractEventParameters,
5
5
  type WriteContractParameters,
6
+ getAccount,
7
+ getClient,
6
8
  waitForTransactionReceipt,
7
9
  } from '@wagmi/core';
8
10
  import type { ExtractAbiEvent } from 'abitype';
9
11
  import type {
10
12
  Abi,
11
13
  AbiEvent,
14
+ Address,
12
15
  ContractEventName,
13
16
  ContractFunctionName,
14
17
  GetLogsParameters,
@@ -18,10 +21,28 @@ import type {
18
21
  WaitForTransactionReceiptParameters,
19
22
  } from 'viem';
20
23
  import { isHex, keccak256, slice, toHex } from 'viem';
21
- import { NoContractAddressUponReceiptError } from './errors';
24
+ import {
25
+ InvalidProtocolChainIdError,
26
+ NoConnectedChainIdError,
27
+ NoContractAddressUponReceiptError,
28
+ } from './errors';
22
29
 
23
30
  export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
24
31
 
32
+ /**
33
+ * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.
34
+ *
35
+ * @export
36
+ * @enum {number}
37
+ */
38
+ export enum RegistryType {
39
+ ACTION = 0,
40
+ ALLOW_LIST = 1,
41
+ BUDGET = 2,
42
+ INCENTIVE = 3,
43
+ VALIDATOR = 4,
44
+ }
45
+
25
46
  /**
26
47
  * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
27
48
  * See (writeContract)[https://viem.sh/docs/contract/writeContract]
@@ -32,8 +53,8 @@ export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
32
53
  * @template {ContractFunctionName<abi>} functionName
33
54
  */
34
55
  export type WriteParams<
35
- abi extends Abi,
36
- functionName extends ContractFunctionName<abi>,
56
+ abi extends Abi = Abi,
57
+ functionName extends ContractFunctionName<abi> = ContractFunctionName<abi>,
37
58
  > = Partial<
38
59
  Omit<
39
60
  WriteContractParameters<abi, functionName>,
@@ -133,7 +154,7 @@ export function bytes4(input: string) {
133
154
  * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)
134
155
  * @param {Promise<Hash>} hash - A transaction hash promise
135
156
  * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}
136
- * @returns {unknown}
157
+ * @returns {Promise<Address>}
137
158
  * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received
138
159
  */
139
160
  export async function getDeployedContractAddress(
@@ -184,15 +205,43 @@ export async function awaitResult<Result = unknown>(
184
205
  }
185
206
 
186
207
  /**
187
- * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.
208
+ * Given a wagmi config and a map of chain id's to addresses, determine an address/chainId combo that maps to the currently connected chain id, or throw a typed error.
188
209
  *
189
210
  * @export
190
- * @enum {number}
211
+ * @param {Config} config
212
+ * @param {Record<string, Address>} addressByChainId
213
+ * @param {number} desiredChainId
214
+ * @returns {{ chainId: number, address: Address }}
215
+ * @throws {@link InvalidProtocolChainIdError}
191
216
  */
192
- export enum RegistryType {
193
- ACTION = 0,
194
- ALLOW_LIST = 1,
195
- BUDGET = 2,
196
- INCENTIVE = 3,
197
- VALIDATOR = 4,
217
+ export function assertValidAddressByChainId(
218
+ config: Config,
219
+ addressByChainId: Record<number, Address>,
220
+ desiredChainId?: number,
221
+ ): { chainId: number; address: Address } {
222
+ let chainId: number | undefined = undefined;
223
+ const wagmiAccount = getAccount(config);
224
+ // if manually providing a chain id for some contract operation, try to use it
225
+ if (desiredChainId !== undefined) {
226
+ if (addressByChainId[desiredChainId]) chainId = desiredChainId;
227
+ } else if (wagmiAccount.chainId !== undefined) {
228
+ // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it
229
+ if (addressByChainId[wagmiAccount.chainId]) chainId = wagmiAccount.chainId;
230
+ }
231
+ // chainId is still undefined, try to get chain id off viem client
232
+ if (chainId === undefined) {
233
+ const client = getClient(config);
234
+ if (client?.chain.id && addressByChainId[client?.chain.id])
235
+ chainId = client.chain.id;
236
+ }
237
+ // if chainId is STILL undefined, use our default addresses
238
+ // TODO: update this when on prod network
239
+ if (chainId === undefined) chainId = Number(__DEFAULT_CHAIN_ID__);
240
+ if (!addressByChainId[chainId])
241
+ throw new InvalidProtocolChainIdError(
242
+ chainId,
243
+ Object.keys(addressByChainId).map(Number),
244
+ );
245
+ // biome-ignore lint/style/noNonNullAssertion: this type should be narrowed by the above statement but isn't?
246
+ return { chainId, address: addressByChainId[chainId]! };
198
247
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"SimpleBudget.d.ts","sourceRoot":"","sources":["../../src/Budgets/SimpleBudget.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,eAAe,EAWhB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAKvB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAKlE,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAG7B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAC;AAEhE;;;;;;GAMG;AACH,MA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,CAAC,OAAO,eAAe,EAAE,aAAa,CAAC;IAU5D;;;;;;;OAOG;IACa,eAAe,CAC7B,QAAQ,CAAC,EAAE,mBAAmB,EAC9B,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,uBAAuB;CAwB3B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,2BAGpC,mBAAmB,kBAQrB,CAAC"}
@@ -1,2 +0,0 @@
1
- "use strict";const e="0xa39e44d9",n="0x8c901437",t="0x6060409d",i="0x7687b0ed",c="0xa0109882",A="0xc5b24b8e",o="0xb8ce7b22",s="0x8ba1fc24",a="0x3d30a22c";exports.ACGDAIncentive=e;exports.AERC20Incentive=n;exports.AERC20VariableIncentive=t;exports.AEventAction=i;exports.AManagedBudget=c;exports.APointsIncentive=A;exports.ASignerValidator=o;exports.ASimpleAllowList=s;exports.ASimpleDenyList=a;
2
- //# sourceMappingURL=componentInterfaces-CKCBwG16.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"componentInterfaces-CKCBwG16.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- const n = "0xa39e44d9", e = "0x8c901437", s = "0x6060409d", t = "0x7687b0ed", a = "0xa0109882", c = "0xc5b24b8e", o = "0xb8ce7b22", i = "0x8ba1fc24", A = "0x3d30a22c";
2
- export {
3
- t as A,
4
- i as a,
5
- A as b,
6
- a as c,
7
- o as d,
8
- c as e,
9
- e as f,
10
- n as g,
11
- s as h
12
- };
13
- //# sourceMappingURL=componentInterfaces-DYkaxBda.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"componentInterfaces-DYkaxBda.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}