@boostxyz/sdk 0.0.0-alpha.2 → 0.0.0-alpha.21

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 (271) hide show
  1. package/dist/Actions/Action.cjs +2 -1
  2. package/dist/Actions/Action.cjs.map +1 -0
  3. package/dist/Actions/Action.d.ts +1 -1
  4. package/dist/Actions/Action.d.ts.map +1 -1
  5. package/dist/Actions/Action.js +14 -12
  6. package/dist/Actions/Action.js.map +1 -0
  7. package/dist/Actions/ContractAction.d.ts +57 -14
  8. package/dist/Actions/ContractAction.d.ts.map +1 -1
  9. package/dist/Actions/ERC721MintAction.d.ts +50 -23
  10. package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
  11. package/dist/Actions/EventAction.cjs +2 -1
  12. package/dist/Actions/EventAction.cjs.map +1 -0
  13. package/dist/Actions/EventAction.d.ts +405 -36
  14. package/dist/Actions/EventAction.d.ts.map +1 -1
  15. package/dist/Actions/EventAction.js +15 -209
  16. package/dist/Actions/EventAction.js.map +1 -0
  17. package/dist/AllowLists/AllowList.cjs +2 -1
  18. package/dist/AllowLists/AllowList.cjs.map +1 -0
  19. package/dist/AllowLists/AllowList.d.ts +6 -5
  20. package/dist/AllowLists/AllowList.d.ts.map +1 -1
  21. package/dist/AllowLists/AllowList.js +46 -22
  22. package/dist/AllowLists/AllowList.js.map +1 -0
  23. package/dist/AllowLists/OpenAllowList.d.ts +423 -0
  24. package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
  25. package/dist/AllowLists/SimpleAllowList.cjs +2 -1
  26. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
  27. package/dist/AllowLists/SimpleAllowList.d.ts +124 -40
  28. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  29. package/dist/AllowLists/SimpleAllowList.js +76 -76
  30. package/dist/AllowLists/SimpleAllowList.js.map +1 -0
  31. package/dist/AllowLists/SimpleDenyList.cjs +2 -1
  32. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
  33. package/dist/AllowLists/SimpleDenyList.d.ts +234 -13
  34. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  35. package/dist/AllowLists/SimpleDenyList.js +12 -200
  36. package/dist/AllowLists/SimpleDenyList.js.map +1 -0
  37. package/dist/Auth/Auth.cjs +1 -0
  38. package/dist/Auth/Auth.cjs.map +1 -0
  39. package/dist/Auth/Auth.js +1 -0
  40. package/dist/Auth/Auth.js.map +1 -0
  41. package/dist/Auth/PassthroughAuth.cjs +2 -1
  42. package/dist/Auth/PassthroughAuth.cjs.map +1 -0
  43. package/dist/Auth/PassthroughAuth.js +5 -4
  44. package/dist/Auth/PassthroughAuth.js.map +1 -0
  45. package/dist/Boost.cjs +2 -1
  46. package/dist/Boost.cjs.map +1 -0
  47. package/dist/Boost.d.ts +105 -14
  48. package/dist/Boost.d.ts.map +1 -1
  49. package/dist/Boost.js +138 -5
  50. package/dist/Boost.js.map +1 -0
  51. package/dist/BoostCore-DolmDuXW.cjs +3 -0
  52. package/dist/BoostCore-DolmDuXW.cjs.map +1 -0
  53. package/dist/BoostCore-Z97KVu4V.js +1448 -0
  54. package/dist/BoostCore-Z97KVu4V.js.map +1 -0
  55. package/dist/BoostCore.cjs +2 -2
  56. package/dist/BoostCore.cjs.map +1 -0
  57. package/dist/BoostCore.d.ts +788 -79
  58. package/dist/BoostCore.d.ts.map +1 -1
  59. package/dist/BoostCore.js +30 -1103
  60. package/dist/BoostCore.js.map +1 -0
  61. package/dist/BoostRegistry.cjs +2 -1
  62. package/dist/BoostRegistry.cjs.map +1 -0
  63. package/dist/BoostRegistry.d.ts +95 -26
  64. package/dist/BoostRegistry.d.ts.map +1 -1
  65. package/dist/BoostRegistry.js +183 -89
  66. package/dist/BoostRegistry.js.map +1 -0
  67. package/dist/Budgets/Budget.cjs +2 -1
  68. package/dist/Budgets/Budget.cjs.map +1 -0
  69. package/dist/Budgets/Budget.d.ts +1 -1
  70. package/dist/Budgets/Budget.d.ts.map +1 -1
  71. package/dist/Budgets/Budget.js +15 -13
  72. package/dist/Budgets/Budget.js.map +1 -0
  73. package/dist/Budgets/ManagedBudget.cjs +2 -1
  74. package/dist/Budgets/ManagedBudget.cjs.map +1 -0
  75. package/dist/Budgets/ManagedBudget.d.ts +112 -192
  76. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  77. package/dist/Budgets/ManagedBudget.js +91 -291
  78. package/dist/Budgets/ManagedBudget.js.map +1 -0
  79. package/dist/Budgets/VestingBudget.d.ts +277 -91
  80. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  81. package/dist/Deployable/Contract.cjs +2 -1
  82. package/dist/Deployable/Contract.cjs.map +1 -0
  83. package/dist/Deployable/Contract.d.ts +4 -5
  84. package/dist/Deployable/Contract.d.ts.map +1 -1
  85. package/dist/Deployable/Contract.js +7 -8
  86. package/dist/Deployable/Contract.js.map +1 -0
  87. package/dist/Deployable/Deployable.cjs +1 -0
  88. package/dist/Deployable/Deployable.cjs.map +1 -0
  89. package/dist/Deployable/Deployable.d.ts +9 -3
  90. package/dist/Deployable/Deployable.d.ts.map +1 -1
  91. package/dist/Deployable/Deployable.js +10 -5
  92. package/dist/Deployable/Deployable.js.map +1 -0
  93. package/dist/Deployable/DeployableTarget.cjs +2 -1
  94. package/dist/Deployable/DeployableTarget.cjs.map +1 -0
  95. package/dist/Deployable/DeployableTarget.d.ts +16 -15
  96. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  97. package/dist/Deployable/DeployableTarget.js +49 -42
  98. package/dist/Deployable/DeployableTarget.js.map +1 -0
  99. package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
  100. package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
  101. package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
  102. package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
  103. package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
  104. package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
  105. package/dist/EventAction-CBKzuNoN.cjs +2 -0
  106. package/dist/EventAction-CBKzuNoN.cjs.map +1 -0
  107. package/dist/EventAction-DWuuc_Qy.js +1528 -0
  108. package/dist/EventAction-DWuuc_Qy.js.map +1 -0
  109. package/dist/Incentive-BxzEtN26.js +298 -0
  110. package/dist/Incentive-BxzEtN26.js.map +1 -0
  111. package/dist/Incentive-CrF3-ayL.cjs +2 -0
  112. package/dist/Incentive-CrF3-ayL.cjs.map +1 -0
  113. package/dist/Incentives/AllowListIncentive.cjs +2 -1
  114. package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
  115. package/dist/Incentives/AllowListIncentive.d.ts +65 -21
  116. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  117. package/dist/Incentives/AllowListIncentive.js +52 -36
  118. package/dist/Incentives/AllowListIncentive.js.map +1 -0
  119. package/dist/Incentives/CGDAIncentive.cjs +2 -1
  120. package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
  121. package/dist/Incentives/CGDAIncentive.d.ts +315 -26
  122. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  123. package/dist/Incentives/CGDAIncentive.js +64 -39
  124. package/dist/Incentives/CGDAIncentive.js.map +1 -0
  125. package/dist/Incentives/ERC1155Incentive.d.ts +291 -43
  126. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  127. package/dist/Incentives/ERC20Incentive.cjs +2 -1
  128. package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
  129. package/dist/Incentives/ERC20Incentive.d.ts +270 -33
  130. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  131. package/dist/Incentives/ERC20Incentive.js +69 -46
  132. package/dist/Incentives/ERC20Incentive.js.map +1 -0
  133. package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +338 -421
  134. package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
  135. package/dist/Incentives/ERC20VariableIncentive.d.ts +262 -32
  136. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  137. package/dist/Incentives/Incentive.cjs +2 -1
  138. package/dist/Incentives/Incentive.cjs.map +1 -0
  139. package/dist/Incentives/Incentive.d.ts +5 -8
  140. package/dist/Incentives/Incentive.d.ts.map +1 -1
  141. package/dist/Incentives/Incentive.js +17 -278
  142. package/dist/Incentives/Incentive.js.map +1 -0
  143. package/dist/Incentives/PointsIncentive.cjs +2 -1
  144. package/dist/Incentives/PointsIncentive.cjs.map +1 -0
  145. package/dist/Incentives/PointsIncentive.d.ts +81 -23
  146. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  147. package/dist/Incentives/PointsIncentive.js +57 -36
  148. package/dist/Incentives/PointsIncentive.js.map +1 -0
  149. package/dist/SimpleDenyList-BUR17Tt1.cjs +2 -0
  150. package/dist/SimpleDenyList-BUR17Tt1.cjs.map +1 -0
  151. package/dist/SimpleDenyList-CGaWjuld.js +132 -0
  152. package/dist/SimpleDenyList-CGaWjuld.js.map +1 -0
  153. package/dist/Validators/SignerValidator.cjs +2 -1
  154. package/dist/Validators/SignerValidator.cjs.map +1 -0
  155. package/dist/Validators/SignerValidator.d.ts +310 -17
  156. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  157. package/dist/Validators/SignerValidator.js +165 -36
  158. package/dist/Validators/SignerValidator.js.map +1 -0
  159. package/dist/Validators/Validator.cjs +2 -1
  160. package/dist/Validators/Validator.cjs.map +1 -0
  161. package/dist/Validators/Validator.d.ts +2 -2
  162. package/dist/Validators/Validator.d.ts.map +1 -1
  163. package/dist/Validators/Validator.js +10 -8
  164. package/dist/Validators/Validator.js.map +1 -0
  165. package/dist/claiming.cjs +2 -0
  166. package/dist/claiming.cjs.map +1 -0
  167. package/dist/claiming.d.ts +43 -0
  168. package/dist/claiming.d.ts.map +1 -0
  169. package/dist/claiming.js +17 -0
  170. package/dist/claiming.js.map +1 -0
  171. package/dist/componentInterfaces-BBCFkrZv.js +14 -0
  172. package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
  173. package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
  174. package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
  175. package/dist/deployments-DVXioW2i.cjs +2 -0
  176. package/dist/deployments-DVXioW2i.cjs.map +1 -0
  177. package/dist/deployments-oykLv3_Z.js +43 -0
  178. package/dist/deployments-oykLv3_Z.js.map +1 -0
  179. package/dist/deployments.json +44 -0
  180. package/dist/errors.cjs +2 -1
  181. package/dist/errors.cjs.map +1 -0
  182. package/dist/errors.d.ts +421 -1
  183. package/dist/errors.d.ts.map +1 -1
  184. package/dist/errors.js +297 -39
  185. package/dist/errors.js.map +1 -0
  186. package/dist/{generated-x_abr3Yv.js → generated-CKt2yCQd.js} +3143 -3002
  187. package/dist/generated-CKt2yCQd.js.map +1 -0
  188. package/dist/generated-CyTNlOwM.cjs +3 -0
  189. package/dist/generated-CyTNlOwM.cjs.map +1 -0
  190. package/dist/index.cjs +2 -1
  191. package/dist/index.cjs.map +1 -0
  192. package/dist/index.d.ts +10 -9
  193. package/dist/index.d.ts.map +1 -1
  194. package/dist/index.js +144 -1353
  195. package/dist/index.js.map +1 -0
  196. package/dist/transfers.cjs +2 -0
  197. package/dist/transfers.cjs.map +1 -0
  198. package/dist/transfers.d.ts +198 -0
  199. package/dist/transfers.d.ts.map +1 -0
  200. package/dist/transfers.js +84 -0
  201. package/dist/transfers.js.map +1 -0
  202. package/dist/utils.cjs +2 -1
  203. package/dist/utils.cjs.map +1 -0
  204. package/dist/utils.d.ts +26 -1350
  205. package/dist/utils.d.ts.map +1 -1
  206. package/dist/utils.js +38 -636
  207. package/dist/utils.js.map +1 -0
  208. package/package.json +37 -11
  209. package/src/Actions/Action.test.ts +79 -0
  210. package/src/Actions/Action.ts +61 -0
  211. package/src/Actions/ContractAction.test.ts +197 -0
  212. package/src/Actions/ContractAction.ts +300 -0
  213. package/src/Actions/ERC721MintAction.test.ts +112 -0
  214. package/src/Actions/ERC721MintAction.ts +291 -0
  215. package/src/Actions/EventAction.test.ts +787 -0
  216. package/src/Actions/EventAction.ts +1218 -0
  217. package/src/AllowLists/AllowList.test.ts +64 -0
  218. package/src/AllowLists/AllowList.ts +62 -0
  219. package/src/AllowLists/OpenAllowList.test.ts +40 -0
  220. package/src/AllowLists/OpenAllowList.ts +45 -0
  221. package/src/AllowLists/SimpleAllowList.test.ts +52 -0
  222. package/src/AllowLists/SimpleAllowList.ts +262 -0
  223. package/src/AllowLists/SimpleDenyList.test.ts +52 -0
  224. package/src/AllowLists/SimpleDenyList.ts +250 -0
  225. package/src/Auth/Auth.ts +11 -0
  226. package/src/Auth/PassthroughAuth.test.ts +12 -0
  227. package/src/Auth/PassthroughAuth.ts +80 -0
  228. package/src/Boost.ts +287 -0
  229. package/src/BoostCore.test.ts +894 -0
  230. package/src/BoostCore.ts +1438 -0
  231. package/src/BoostRegistry.test.ts +53 -0
  232. package/src/BoostRegistry.ts +588 -0
  233. package/src/Budgets/Budget.test.ts +27 -0
  234. package/src/Budgets/Budget.ts +60 -0
  235. package/src/Budgets/ManagedBudget.test.ts +217 -0
  236. package/src/Budgets/ManagedBudget.ts +534 -0
  237. package/src/Budgets/VestingBudget.test.ts +123 -0
  238. package/src/Budgets/VestingBudget.ts +530 -0
  239. package/src/Deployable/Contract.ts +228 -0
  240. package/src/Deployable/Deployable.ts +250 -0
  241. package/src/Deployable/DeployableTarget.ts +234 -0
  242. package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
  243. package/src/Incentives/AllowListIncentive.test.ts +143 -0
  244. package/src/Incentives/AllowListIncentive.ts +336 -0
  245. package/src/Incentives/CGDAIncentive.test.ts +135 -0
  246. package/src/Incentives/CGDAIncentive.ts +476 -0
  247. package/src/Incentives/ERC1155Incentive.test.ts +87 -0
  248. package/src/Incentives/ERC1155Incentive.ts +465 -0
  249. package/src/Incentives/ERC20Incentive.test.ts +133 -0
  250. package/src/Incentives/ERC20Incentive.ts +490 -0
  251. package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
  252. package/src/Incentives/ERC20VariableCriteriaIncentive.ts +309 -0
  253. package/src/Incentives/ERC20VariableIncentive.test.ts +139 -0
  254. package/src/Incentives/ERC20VariableIncentive.ts +428 -0
  255. package/src/Incentives/Incentive.test.ts +95 -0
  256. package/src/Incentives/Incentive.ts +86 -0
  257. package/src/Incentives/PointsIncentive.test.ts +138 -0
  258. package/src/Incentives/PointsIncentive.ts +367 -0
  259. package/src/Validators/SignerValidator.test.ts +159 -0
  260. package/src/Validators/SignerValidator.ts +683 -0
  261. package/src/Validators/Validator.test.ts +21 -0
  262. package/src/Validators/Validator.ts +55 -0
  263. package/src/claiming.ts +56 -0
  264. package/src/errors.ts +866 -0
  265. package/src/index.test.ts +122 -0
  266. package/src/index.ts +58 -0
  267. package/src/transfers.ts +284 -0
  268. package/src/utils.test.ts +44 -0
  269. package/src/utils.ts +247 -0
  270. package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
  271. package/dist/generated-BaaleHW-.cjs +0 -2
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,20 @@
1
1
  import { type Config, type ReadContractParameters, type WatchContractEventParameters, type WriteContractParameters } from '@wagmi/core';
2
2
  import type { ExtractAbiEvent } from 'abitype';
3
- import type { Abi, AbiEvent, Address, ContractEventName, ContractFunctionName, GetLogsParameters, Hash, Hex, Log, PrivateKeyAccount, WaitForTransactionReceiptParameters } from 'viem';
3
+ import type { Abi, AbiEvent, Address, ContractEventName, ContractFunctionName, GetLogsParameters, Hash, Log, WaitForTransactionReceiptParameters } from 'viem';
4
+ export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
5
+ /**
6
+ * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.
7
+ *
8
+ * @export
9
+ * @enum {number}
10
+ */
11
+ export declare enum RegistryType {
12
+ ACTION = 0,
13
+ ALLOW_LIST = 1,
14
+ BUDGET = 2,
15
+ INCENTIVE = 3,
16
+ VALIDATOR = 4
17
+ }
4
18
  /**
5
19
  * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
6
20
  * See (writeContract)[https://viem.sh/docs/contract/writeContract]
@@ -10,7 +24,7 @@ import type { Abi, AbiEvent, Address, ContractEventName, ContractFunctionName, G
10
24
  * @template {Abi} abi
11
25
  * @template {ContractFunctionName<abi>} functionName
12
26
  */
13
- export type WriteParams<abi extends Abi, functionName extends ContractFunctionName<abi>> = Partial<Omit<WriteContractParameters<abi, functionName>, 'address' | 'args' | 'functionName' | 'abi'>>;
27
+ export type WriteParams<abi extends Abi = Abi, functionName extends ContractFunctionName<abi> = ContractFunctionName<abi>> = Partial<Omit<WriteContractParameters<abi, functionName>, 'address' | 'args' | 'functionName' | 'abi'>>;
14
28
  /**
15
29
  * Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
16
30
  * See (readContract)[https://viem.sh/docs/contract/readContract]
@@ -63,7 +77,7 @@ export type GenericLog<abi extends Abi, event extends ContractEventName<abi> = C
63
77
  * @param {string} input
64
78
  * @returns {Hex}
65
79
  */
66
- export declare function bytes4(input: Hex): `0x${string}`;
80
+ export declare function bytes4(input: string): `0x${string}`;
67
81
  /**
68
82
  * Utility function to wait for a transaction receipt, and extract the contractAddress
69
83
  *
@@ -72,7 +86,7 @@ export declare function bytes4(input: Hex): `0x${string}`;
72
86
  * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)
73
87
  * @param {Promise<Hash>} hash - A transaction hash promise
74
88
  * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}
75
- * @returns {unknown}
89
+ * @returns {Promise<Address>}
76
90
  * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received
77
91
  */
78
92
  export declare function getDeployedContractAddress(config: Config, hash: Promise<Hash>, waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>): Promise<`0x${string}`>;
@@ -100,1355 +114,17 @@ export type HashAndSimulatedResult<T = unknown> = {
100
114
  */
101
115
  export declare function awaitResult<Result = unknown>(config: Config, hashPromise: Promise<HashAndSimulatedResult<Result>>, waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>): Promise<Result>;
102
116
  /**
103
- * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.
104
- *
105
- * @export
106
- * @enum {number}
107
- */
108
- export declare enum RegistryType {
109
- ACTION = 0,
110
- ALLOW_LIST = 1,
111
- BUDGET = 2,
112
- INCENTIVE = 3,
113
- VALIDATOR = 4
114
- }
115
- /**
116
- * Enum representing incentive disbursement strategies.
117
- *
118
- * @export
119
- * @enum {number}
120
- */
121
- export declare enum StrategyType {
122
- POOL = 0,
123
- MINT = 1,
124
- RAFFLE = 2
125
- }
126
- /**
127
- * Enum representing inventive disbursement strategies for {@link ERC1155Incentive}
128
- *
129
- * @export
130
- * @enum {number}
131
- */
132
- export declare enum ERC1155StrategyType {
133
- POOL = 0,
134
- MINT = 1
135
- }
136
- /**
137
- * Object representation of `BoostLib.Target` struct. Used for low level Boost creation operations.
138
- * This is used to pass the base contract and its initialization parameters in an efficient manner
139
- *
140
- * @export
141
- * @typedef {Target}
142
- */
143
- export type Target = {
144
- isBase: boolean;
145
- instance: Address;
146
- parameters: Hex;
147
- };
148
- /**
149
- * Filter types used to determine how criteria are evaluated.
117
+ * 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.
150
118
  *
151
119
  * @export
152
- * @enum {number}
120
+ * @param {Config} config
121
+ * @param {Record<string, Address>} addressByChainId
122
+ * @param {number} desiredChainId
123
+ * @returns {{ chainId: number, address: Address }}
124
+ * @throws {@link InvalidProtocolChainIdError}
153
125
  */
154
- export declare enum FilterType {
155
- EQUAL = 0,
156
- NOT_EQUAL = 1,
157
- GREATER_THAN = 2,
158
- LESS_THAN = 3,
159
- CONTAINS = 4
160
- }
161
- /**
162
- * The primitive types supported for filtering.
163
- *
164
- * @export
165
- * @enum {number}
166
- */
167
- export declare enum PrimitiveType {
168
- UINT = 0,
169
- ADDRESS = 1,
170
- BYTES = 2,
171
- STRING = 3
172
- }
173
- /**
174
- * Object representation of a `Criteria` struct used in event actions.
175
- *
176
- * @export
177
- * @interface Criteria
178
- * @typedef {Criteria}
179
- */
180
- export interface Criteria {
181
- /**
182
- * The filter type used in this criteria.
183
- *
184
- * @type {FilterType}
185
- */
186
- filterType: FilterType;
187
- /**
188
- * The primitive type of the field being filtered.
189
- *
190
- * @type {PrimitiveType}
191
- */
192
- fieldType: PrimitiveType;
193
- /**
194
- * The index in the logs argument array where the field is located.
195
- *
196
- * @type {number}
197
- */
198
- fieldIndex: number;
199
- /**
200
- * The filter data used for complex filtering.
201
- *
202
- * @type {Hex}
203
- */
204
- filterData: Hex;
205
- }
206
- /**
207
- * Whether a given signature is an event or function
208
- *
209
- * @export
210
- * @enum {number}
211
- */
212
- export declare enum SignatureType {
213
- EVENT = 0,
214
- FUNC = 1
215
- }
216
- /**
217
- * The payload describing how claimants are identified
218
- *
219
- * @export
220
- * @interface ActionClaimant
221
- * @typedef {ActionClaimant}
222
- */
223
- export interface ActionClaimant {
224
- /**
225
- * Whether claimaint is inferred from event or function
226
- *
227
- * @type {SignatureType}
228
- */
229
- signatureType: SignatureType;
230
- /**
231
- * The 4 byte signature of the event or function
232
- *
233
- * @type {Hex}
234
- */
235
- signature: Hex;
236
- /**
237
- * The index corresponding to claimant.
238
- *
239
- * @type {number}
240
- */
241
- fieldIndex: number;
242
- /**
243
- * The address of the target contract
244
- *
245
- * @type {Address}
246
- */
247
- targetContract: Address;
248
- }
249
- /**
250
- * Object representation of an `ActionStep` struct used in event actions.
251
- *
252
- * @export
253
- * @interface ActionStep
254
- * @typedef {ActionStep}
255
- */
256
- export interface ActionStep {
257
- /**
258
- * The signature of the event.
259
- *
260
- * @type {Hex}
261
- */
262
- signature: Hex;
263
- /**
264
- * Whether claimaint is inferred from event or function
265
- *
266
- * @type {SignatureType}
267
- */
268
- signatureType: SignatureType;
269
- /**
270
- * The type of action being performed.
271
- *
272
- * @type {number}
273
- */
274
- actionType: number;
275
- /**
276
- * The address of the target contract.
277
- *
278
- * @type {Address}
279
- */
280
- targetContract: Address;
281
- /**
282
- * The criteria used for this action event.
283
- *
284
- * @type {Criteria}
285
- */
286
- actionParameter: Criteria;
287
- }
288
- /**
289
- * Object representation of an `InitPayload` struct used to initialize event actions.
290
- *
291
- * @export
292
- * @interface EventActionPayload
293
- * @typedef {EventActionPayload}
294
- */
295
- export interface EventActionPayload {
296
- /**
297
- * The payload describing how claimants are identified
298
- *
299
- * @type {ActionClaimant}
300
- */
301
- actionClaimant: ActionClaimant;
302
- /**
303
- * The first action event.
304
- *
305
- * @type {ActionStep}
306
- */
307
- actionStepOne: ActionStep;
308
- /**
309
- * The second action event.
310
- *
311
- * @type {ActionStep}
312
- */
313
- actionStepTwo: ActionStep;
314
- /**
315
- * The third action event.
316
- *
317
- * @type {ActionStep}
318
- */
319
- actionStepThree: ActionStep;
320
- /**
321
- * The fourth action event.
322
- *
323
- * @type {ActionStep}
324
- */
325
- actionStepFour: ActionStep;
326
- }
327
- /**
328
- * Function to properly encode an event action payload.
329
- *
330
- * @param {InitPayload} param0
331
- * @param {ActionStep} param0.actionStepOne - The first action event to initialize.
332
- * @param {ActionStep} param0.actionStepTwo - The second action event to initialize.
333
- * @param {ActionStep} param0.actionStepThree - The third action event to initialize.
334
- * @param {ActionStep} param0.actionStepFour - The fourth action event to initialize.
335
- * @returns {Hex}
336
- */
337
- export declare const prepareEventActionPayload: ({ actionClaimant, actionStepOne, actionStepTwo, actionStepThree, actionStepFour, }: EventActionPayload) => `0x${string}`;
338
- /**
339
- * Object representation of the `ERC20Incentive.InitPayload`.
340
- *
341
- * @export
342
- * @interface ERC20IncentivePayload
343
- * @typedef {ERC20IncentivePayload}
344
- */
345
- export interface ERC20IncentivePayload {
346
- /**
347
- * The address of the incentivized asset.
348
- *
349
- * @type {Address}
350
- */
351
- asset: Address;
352
- /**
353
- * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`
354
- *
355
- * @type {StrategyType}
356
- */
357
- strategy: StrategyType;
358
- /**
359
- * The amount of the asset to distribute.
360
- *
361
- * @type {bigint}
362
- */
363
- reward: bigint;
364
- /**
365
- * How many times can this incentive be claimed.
366
- *
367
- * @type {bigint}
368
- */
369
- limit: bigint;
370
- }
371
- /**
372
- * Object representing the payload for signing before validaton.
373
- *
374
- * @export
375
- * @interface SignerValidatorSignaturePayload
376
- * @typedef {SignerValidatorSignaturePayload}
377
- */
378
- export interface SignerValidatorSignaturePayload {
379
- /**
380
- * The ID of the boost.
381
- *
382
- * @type {bigint}
383
- */
384
- boostId: bigint;
385
- /**
386
- * The ID of the incentive.
387
- *
388
- * @type {number}
389
- */
390
- incentiveQuantity: number;
391
- /**
392
- * The address of the claimant.
393
- *
394
- * @type {Address}
395
- */
396
- claimant: Address;
397
- /**
398
- * The claim data.
399
- *
400
- * @type {Hex}
401
- */
402
- incentiveData: Hex;
403
- }
404
- /**
405
- * Object reprentation of a {@link SignerValidator} initialization payload
406
- *
407
- * @export
408
- * @interface SignerValidatorPayload
409
- * @typedef {SignerValidatorPayload}
410
- */
411
- export interface SignerValidatorPayload {
412
- /**
413
- * The list of authorized signers. The first address in the list will be the initial owner of the contract.
414
- *
415
- * @type {Address[]}
416
- */
417
- signers: Address[];
418
- /**
419
- * The authorized caller of the {@link prepareSignerValidator} function
420
- * @type {Address}
421
- */
422
- validatorCaller: Address;
423
- }
424
- /**
425
- * Description placeholder
426
- *
427
- * @export
428
- * @interface SignerValidatorValidatePayload
429
- * @typedef {SignerValidatorValidatePayload}
430
- */
431
- export interface SignerValidatorValidatePayload {
432
- /**
433
- * The ID of the boost.
434
- *
435
- * @type {bigint}
436
- */
437
- boostId: bigint;
438
- /**
439
- * The ID of the incentive.
440
- *
441
- * @type {bigint}
442
- */
443
- incentiveId: bigint;
444
- /**
445
- * The address of the claimant.
446
- *
447
- * @type {Address}
448
- */
449
- claimant: Address;
450
- /**
451
- * The claim data.
452
- *
453
- * @type {Hex}
454
- */
455
- claimData: Hex;
456
- }
457
- /**
458
- * Given a {@link SignerValidatorPayload}, properly encode the initialization payload.
459
- *
460
- * @param {SignerValidatorPayload} param0
461
- * @param {Address[]} param0.signers
462
- * @param {Address} param0.validatorCaller
463
- * @returns {Hex}
464
- */
465
- export declare const prepareSignerValidatorPayload: ({ signers, validatorCaller, }: SignerValidatorPayload) => `0x${string}`;
466
- /**
467
- * Object representation of a {@link BoostClaimData} initialization payload
468
- *
469
- * @export
470
- * @interface BoostClaimData
471
- * @typedef {BoostClaimData}
472
- */
473
- export interface BoostClaimData {
474
- /**
475
- * The validator data.
476
- *
477
- * @type {Hex}
478
- */
479
- validatorData: Hex;
480
- /**
481
- * The incentive data.
482
- *
483
- * @type {Hex}
484
- */
485
- incentiveData: Hex;
486
- }
487
- /**
488
- * Given a {@link BoostClaimData}, properly encode the initialization payload.
489
- *
490
- * @param {BoostClaimData} param0
491
- * @param {Hex} param0.validatorData
492
- * @param {Hex} param0.incentiveData
493
- * @returns {Hex}
494
- */
495
- export declare const prepareBoostClaimData: ({ validatorData, incentiveData, }: BoostClaimData) => `0x${string}`;
496
- /**
497
- * Object representation of a {@link SignerValidatorInputParams} initialization payload
498
- *
499
- * @export
500
- * @interface SignerValidatorInputParams
501
- * @typedef {SignerValidatorInputParams}
502
- */
503
- export interface SignerValidatorInputParams {
504
- /**
505
- * The signer address.
506
- *
507
- * @type {Address}
508
- */
509
- signer: Address;
510
- /**
511
- * The signature data.
512
- *
513
- * @type {string}
514
- */
515
- signature: Hex;
516
- /**
517
- * The incentive quantity.
518
- *
519
- * @type {number}
520
- */
521
- incentiveQuantity: number;
522
- }
523
- /**
524
- * Given a {@link SignerValidatorInputParams}, properly encode the initialization payload.
525
- *
526
- * @param {SignerValidatorInputParams} param0
527
- * @param {Address} param0.signer
528
- * @param {Hex} param0.signature
529
- * @param {number} param0.incentiveQuantity
530
- * @returns {Hex}
531
- */
532
- export declare const prepareSignerValidatorInputParams: ({ signer, signature, incentiveQuantity, }: SignerValidatorInputParams) => `0x${string}`;
533
- /**
534
- * Signer Validator Claim Data Payload
535
- *
536
- * @export
537
- * @interface SignerValidatorClaimDataParams
538
- * @typedef {SignerValidatorClaimDataParams}
539
- */
540
- export interface SignerValidatorClaimDataParams {
541
- /**
542
- * The signer with which to sign the input
543
- *
544
- * @type {{
545
- * account: Address;
546
- * key: Hex;
547
- * privateKey: PrivateKeyAccount;
548
- * }}
549
- */
550
- signer: {
551
- account: Address;
552
- key: Hex;
553
- privateKey: PrivateKeyAccount;
554
- };
555
- /**
556
- * The encoded data to provide the underlying incentive. You can use {@link prepareAllowListIncentivePayload}, {@link prepareCGDAIncentivePayload}, {@link prepareERC20IncentivePayload}, {@link prepareERC1155IncentivePayload}, or {@link preparePointsIncentivePayload}
557
- *
558
- * @type {Hex}
559
- */
560
- incentiveData: Hex;
561
- /**
562
- * The chain id to target
563
- *
564
- * @type {number}
565
- */
126
+ export declare function assertValidAddressByChainId(config: Config, addressByChainId: Record<number, Address>, desiredChainId?: number): {
566
127
  chainId: number;
567
- /**
568
- * The address of the validator
569
- *
570
- * @type {Address}
571
- */
572
- validator: Address;
573
- /**
574
- * The incentive quantity.
575
- *
576
- * @type {number}
577
- */
578
- incentiveQuantity: number;
579
- /**
580
- * The address of the claimant
581
- *
582
- * @type {Address}
583
- */
584
- claimant: Address;
585
- /**
586
- * The ID of the boost
587
- *
588
- * @type {bigint}
589
- */
590
- boostId: bigint;
591
- }
592
- /**
593
- * Signer Validator Claim Data Payload Preparation
594
- *
595
- * @export
596
- * @async
597
- * @param {SignerValidatorClaimDataParams} param0
598
- * @param {{ account: Address; key: Hex; privateKey: PrivateKeyAccount; }} param0.signer
599
- * @param {Hex} param0.incentiveData
600
- * @param {number} param0.chainId
601
- * @param {Address} param0.validator
602
- * @param {number} param0.incentiveQuantity
603
- * @param {Address} param0.claimant
604
- * @param {bigint} param0.boostId
605
- * @returns {Promise<Hex>}
606
- */
607
- export declare function prepareSignerValidatorClaimDataPayload({ signer, incentiveData, chainId, validator, incentiveQuantity, claimant, boostId, }: SignerValidatorClaimDataParams): Promise<Hex>;
608
- /**
609
- * Object representation of a {@link SimpleAllowList} initialization payload.
610
- *
611
- * @export
612
- * @interface SimpleAllowListPayload
613
- * @typedef {SimpleAllowListPayload}
614
- */
615
- export interface SimpleAllowListPayload {
616
- /**
617
- * The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.
618
- *
619
- * @type {Address}
620
- */
621
- owner: Address;
622
- /**
623
- * List of allowed addresses.
624
- *
625
- * @type {Address[]}
626
- */
627
- allowed: Address[];
628
- }
629
- /**
630
- * Given a {@link SimpleAllowListPayload}, properly encode the initialization payload.
631
- *
632
- * @param {SimpleAllowListPayload} param0
633
- * @param {Address} param0.owner - The allow list's owner, given the {@link LIST_MANAGER_ROLE} role.
634
- * @param {Address[]} param0.allowed - List of allowed addresses.
635
- * @returns {Hex}
636
- */
637
- export declare const prepareSimpleAllowListPayload: ({ owner, allowed, }: SimpleAllowListPayload) => `0x${string}`;
638
- /**
639
- * Object representation of a {@link SimpleDenyList} initialization payload.
640
- *
641
- * @export
642
- * @interface SimpleDenyListPayload
643
- * @typedef {SimpleDenyListPayload}
644
- */
645
- export interface SimpleDenyListPayload {
646
- /**
647
- * The allow list's owner
648
- *
649
- * @type {Address}
650
- */
651
- owner: Address;
652
- /**
653
- * List of denied addresses.
654
- *
655
- * @type {Address[]}
656
- */
657
- denied: Address[];
658
- }
659
- /**
660
- * Given a {@link SimpleDenyListPayload}, properly encode the initialization payload.
661
- *
662
- * @param {SimpleDenyListPayload} param0
663
- * @param {Address} param0.owner - The allow list's owner
664
- * @param {Address[]} param0.denied - List of denied addresses.
665
- * @returns {Hex}
666
- */
667
- export declare const prepareSimpleDenyListPayload: ({ owner, denied, }: SimpleDenyListPayload) => `0x${string}`;
668
- /**
669
- * Object representation of `BoostCore.InitPayload` struct.
670
- *
671
- * @export
672
- * @interface BoostPayload
673
- * @typedef {BoostPayload}
674
- */
675
- export interface BoostPayload {
676
- /**
677
- * Address to valid budget.
678
- *
679
- * @type {Address}
680
- */
681
- budget: Address;
682
- /**
683
- * Target for existing action, or base with initialization payload.
684
- *
685
- * @type {Target}
686
- */
687
- action: Target;
688
- /**
689
- * Target for existing validator, or base with initialization payload.
690
- *
691
- * @type {Target}
692
- */
693
- validator: Target;
694
- /**
695
- * Target for existing allowList, or base with initialization payload.
696
- *
697
- * @type {Target}
698
- */
699
- allowList: Target;
700
- /**
701
- * Targets for new incentives, with initialization payloads.
702
- *
703
- * @type {Target[]}
704
- */
705
- incentives: Target[];
706
- /**
707
- * The base protocol fee (in bps)
708
- *
709
- * @type {?bigint}
710
- */
711
- protocolFee?: bigint;
712
- /**
713
- * The base referral fee (in bps)
714
- *
715
- * @type {?bigint}
716
- */
717
- referralFee?: bigint;
718
- /**
719
- * Optional maximum amount of participants in the Boost.
720
- *
721
- * @type {?bigint}
722
- */
723
- maxParticipants?: bigint;
724
- /**
725
- * The owner of the Boost.
726
- *
727
- * @type {Address}
728
- */
729
- owner: Address;
730
- }
731
- /**
732
- * Given a valid {@link BoostPayload}, properly encode and compress the payload for use with `createBoost`
733
- *
734
- * @export
735
- * @param {BoostPayload} param0
736
- * @param {Address} param0.budget - Address to valid budget.
737
- * @param {Target} param0.action - Target for existing action, or base with initialization payload.
738
- * @param {Target} param0.validator - Target for existing validator, or base with initialization payload.
739
- * @param {Target} param0.allowList - Target for existing allowList, or base with initialization payload.
740
- * @param {Target[]} param0.incentives - Targets for new incentives, with initialization payloads.
741
- * @param {bigint} [param0.protocolFee=0n] - The base protocol fee (in bps)
742
- * @param {bigint} [param0.referralFee=0n] - The base referral fee (in bps)
743
- * @param {bigint} [param0.maxParticipants=0n] - Optional maximum amount of participants in the Boost.
744
- * @param {Address} param0.owner - The owner of the Boost.
745
- * @returns {Hex}
746
- */
747
- export declare function prepareBoostPayload({ budget, action, validator, allowList, incentives, protocolFee, referralFee, maxParticipants, owner, }: BoostPayload): Hex;
748
- /**
749
- * Object representation of
750
- *
751
- * @export
752
- * @interface ERC1155Payload
753
- * @typedef {ERC1155Payload}
754
- */
755
- export interface ERC1155Payload {
756
- /**
757
- * The ERC1155 token ID for the incentive
758
- *
759
- * @type {bigint}
760
- */
761
- tokenId: bigint;
762
- /**
763
- * The amount to transfer
764
- *
765
- * @type {bigint}
766
- */
767
- amount: bigint;
768
- }
769
- /**
770
- * Given a token ID and amount, properly encode a `ERC1155Incentive.ERC1155Payload` for use with {@link ERC1155Incentive} initialization.
771
- *
772
- * @export
773
- * @param {ERC1155Payload} param0
774
- * @param {bigint} param0.tokenId - The ERC1155 token ID for the incentive
775
- * @param {bigint} param0.amount - The amount to transfer
776
- * @returns {Hex}
777
- */
778
- export declare function prepareERC1155Payload({ tokenId, amount }: ERC1155Payload): `0x${string}`;
779
- /**
780
- * The object representation of a `PointsIncentive.InitPayload`
781
- *
782
- * @export
783
- * @interface PointsIncentivePayload
784
- * @typedef {PointsIncentivePayload}
785
- */
786
- export interface PointsIncentivePayload {
787
- /**
788
- * The address of the points contract
789
- *
790
- * @type {Address}
791
- */
792
- venue: Address;
793
- /**
794
- * The selector for the issuance function on the points contract
795
- *
796
- * @type {Hex}
797
- */
798
- selector: Hex;
799
- /**
800
- * The reward amount issued for each claim
801
- *
802
- * @type {bigint}
803
- */
804
- reward: bigint;
805
- /**
806
- * The maximum number of claims that can be made (one per address)
807
- *
808
- * @type {bigint}
809
- */
810
- limit: bigint;
811
- }
812
- /**
813
- * Given a {@link PointsIncentivePayload}, properly encode a `PointsIncentive.InitPayload` for use with {@link PointsIncentive} initialization.
814
- *
815
- * @param {PointsIncentivePayload} param0
816
- * @param {Address} param0.venue - The address of the points contract
817
- * @param {Hex} param0.selector - The selector for the issuance function on the points contract
818
- * @param {bigint} param0.reward - The reward amount issued for each claim
819
- * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)
820
- * @returns {*}
821
- */
822
- export declare const preparePointsIncentivePayload: ({ venue, selector, reward, limit, }: PointsIncentivePayload) => `0x${string}`;
823
- /**
824
- * The configuration parameters for the CGDAIncentive
825
- *
826
- * @export
827
- * @interface CGDAParameters
828
- * @typedef {CGDAParameters}
829
- */
830
- export interface CGDAParameters {
831
- /**
832
- * The amount to subtract from the current reward after each claim
833
- *
834
- * @type {bigint}
835
- */
836
- rewardDecay: bigint;
837
- /**
838
- * The amount by which the reward increases for each hour without a claim (continuous linear increase)
839
- *
840
- * @type {bigint}
841
- */
842
- rewardBoost: bigint;
843
- /**
844
- * The timestamp of the last claim
845
- *
846
- * @type {bigint}
847
- */
848
- lastClaimTime: bigint;
849
- /**
850
- * The current reward amount
851
- *
852
- * @type {bigint}
853
- */
854
- currentReward: bigint;
855
- }
856
- /**
857
- * The object representation of a `CGDAIncentive.InitPayload`
858
- *
859
- * @export
860
- * @interface CGDAIncentivePayload
861
- * @typedef {CGDAIncentivePayload}
862
- */
863
- export interface CGDAIncentivePayload {
864
- /**
865
- * The address of the ERC20-like token
866
- *
867
- * @type {Address}
868
- */
869
- asset: Address;
870
- /**
871
- * The initial reward amount
872
- *
873
- * @type {bigint}
874
- */
875
- initialReward: bigint;
876
- /**
877
- * The amount to subtract from the current reward after each claim
878
- *
879
- * @type {bigint}
880
- */
881
- rewardDecay: bigint;
882
- /**
883
- * The amount by which the reward increases for each hour without a claim (continuous linear increase)
884
- *
885
- * @type {bigint}
886
- */
887
- rewardBoost: bigint;
888
- /**
889
- * The total budget for the incentive
890
- *
891
- * @type {bigint}
892
- */
893
- totalBudget: bigint;
894
- }
895
- /**
896
- * Given a {@link CGDAIncentivePayload}, properly encode a `CGDAIncentive.InitPayload` for use with {@link CGDAIncentive} initialization.
897
- *
898
- * @param {CGDAIncentivePayload} param0
899
- * @param {Address} param0.asset - The address of the ERC20-like token
900
- * @param {bigint} param0.initialReward - The initial reward amount
901
- * @param {bigint} param0.rewardDecay - The amount to subtract from the current reward after each claim
902
- * @param {bigint} param0.rewardBoost - The amount by which the reward increases for each hour without a claim (continuous linear increase)
903
- * @param {bigint} param0.totalBudget - The total budget for the incentive
904
- * @returns {Hex}
905
- */
906
- export declare const prepareCGDAIncentivePayload: ({ asset, initialReward, rewardDecay, rewardBoost, totalBudget, }: CGDAIncentivePayload) => `0x${string}`;
907
- /**
908
- * The object representation of a `ERC1155Incentive.InitPayload`
909
- *
910
- * @export
911
- * @interface ERC1155IncentivePayload
912
- * @typedef {ERC1155IncentivePayload}
913
- */
914
- export interface ERC1155IncentivePayload {
915
- /**
916
- * The address of the `ERC1155` asset
917
- *
918
- * @type {Address}
919
- */
920
- asset: Address;
921
- /**
922
- * Should be `Strategy.POOL`
923
- *
924
- * @type {ERC1155StrategyType}
925
- */
926
- strategy: ERC1155StrategyType;
927
- /**
928
- * The token ID to target
929
- *
930
- * @type {bigint}
931
- */
932
- tokenId: bigint;
933
- /**
934
- * The maximum number of claims that can be made (one per address)
935
- *
936
- * @type {bigint}
937
- */
938
- limit: bigint;
939
- /**
940
- * Any extra data to accompany the claim, if applicable.
941
- *
942
- * @type {Hex}
943
- */
944
- extraData: Hex;
945
- }
946
- /**
947
- * Given a {@link ERC1155IncentivePayload}, properly encode a `ERC1155Incentive.InitPayload` for use with {@link ERC1155Incentive} initialization.
948
- *
949
- * @param {ERC1155IncentivePayload} param0
950
- * @param {Address} param0.asset - The address of the `ERC1155` asset
951
- * @param {ERC1155StrategyType} param0.strategy - Should be `Strategy.POOL`
952
- * @param {bigint} param0.tokenId - The token ID to target
953
- * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)
954
- * @param {Hex} param0.extraData - Any extra data to accompany the claim, if applicable.
955
- * @returns {Hex}
956
- */
957
- export declare const prepareERC1155IncentivePayload: ({ asset, strategy, tokenId, limit, extraData, }: ERC1155IncentivePayload) => `0x${string}`;
958
- /**
959
- * The object representation of a `AllowListIncentive.InitPayload`
960
- *
961
- * @export
962
- * @interface AllowListIncentivePayload
963
- * @typedef {AllowListIncentivePayload}
964
- */
965
- export interface AllowListIncentivePayload {
966
- /**
967
- * The address to the allowlist to add claimers to.
968
- *
969
- * @type {Address}
970
- */
971
- allowList: Address;
972
- /**
973
- * The maximum number of claims that can be made (one per address)
974
- *
975
- * @type {bigint}
976
- */
977
- limit: bigint;
978
- }
979
- /**
980
- * Given a {@link AllowListIncentivePayload}, properly encode a `AllowListIncentive.InitPayload` for use with {@link AllowListIncentive} initialization.
981
- *
982
- * @param {AllowListIncentivePayload} param0
983
- * @param {Address} param0.allowList - The address to the allowlist to add claimers to.
984
- * @param {bigint} param0.limit - The maximum number of claims that can be made (one per address)
985
- * @returns {Hex}
986
- */
987
- export declare const prepareAllowListIncentivePayload: ({ allowList, limit, }: AllowListIncentivePayload) => `0x${string}`;
988
- /**
989
- * The object representation of a `ERC20Incentive.InitPayload`
990
- *
991
- * @export
992
- * @interface ERC20IncentivePayload
993
- * @typedef {ERC20IncentivePayload}
994
- */
995
- export interface ERC20IncentivePayload {
996
- /**
997
- * The address of the incentivized asset.
998
- *
999
- * @type {Address}
1000
- */
1001
- asset: Address;
1002
- /**
1003
- * The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`
1004
- *
1005
- * @type {StrategyType}
1006
- */
1007
- strategy: StrategyType;
1008
- /**
1009
- * The amount of the asset to distribute.
1010
- *
1011
- * @type {bigint}
1012
- */
1013
- reward: bigint;
1014
- /**
1015
- * How many times can this incentive be claimed.
1016
- *
1017
- * @type {bigint}
1018
- */
1019
- limit: bigint;
1020
- }
1021
- /**
1022
- * Given a {@link ERC20IncentivePayload}, properly encode a `ERC20Incentive.InitPayload` for use with {@link ERC20Incentive} initialization.
1023
- *
1024
- * @param {ERC20IncentivePayload} param0
1025
- * @param {Address} param0.asset - The address of the incentivized asset.
1026
- * @param {StrategyType} param0.strategy - The type of disbursement strategy for the incentive. `StrategyType.MINT` is not supported for `ERC20Incentives`
1027
- * @param {bigint} param0.reward - The amount of the asset to distribute.
1028
- * @param {bigint} param0.limit - How many times can this incentive be claimed.
1029
- * @returns {*}
1030
- */
1031
- export declare const prepareERC20IncentivePayload: ({ asset, strategy, reward, limit, }: ERC20IncentivePayload) => `0x${string}`;
1032
- /**
1033
- * The object representation of a `ERC20VariableIncentivePayload.InitPayload`
1034
- *
1035
- * @export
1036
- * @interface ERC20VariableIncentivePayload
1037
- * @typedef {ERC20VariableIncentivePayload}
1038
- */
1039
- export interface ERC20VariableIncentivePayload {
1040
- /**
1041
- * The address of the incentivized asset.
1042
- *
1043
- * @type {Address}
1044
- */
1045
- asset: Address;
1046
- /**
1047
- * The amount of the asset to distribute.
1048
- *
1049
- * @type {bigint}
1050
- */
1051
- reward: bigint;
1052
- /**
1053
- * How many times can this incentive be claimed.
1054
- *
1055
- * @type {bigint}
1056
- */
1057
- limit: bigint;
1058
- }
1059
- /**
1060
- * Given a {@link ERC20VariableIncentivePayload}, properly encode a ` ERC20VariableIncentive.InitPayload` for use with {@link ERC20VariableIncentive} initialization.
1061
- *
1062
- * @param {ERC20VariableIncentivePayload} param0
1063
- * @param {Address} param0.asset - The address of the incentivized asset.
1064
- * @param {bigint} param0.reward - The amount of the asset to distribute.
1065
- * @param {bigint} param0.limit - How many times can this incentive be claimed.
1066
- * @returns {*}
1067
- */
1068
- export declare const prepareERC20VariableIncentivePayload: ({ asset, reward, limit, }: ERC20VariableIncentivePayload) => `0x${string}`;
1069
- /**
1070
- * The object representation of a `ContractAction.InitPayload`
1071
- *
1072
- * @export
1073
- * @interface ContractActionPayload
1074
- * @typedef {ContractActionPayload}
1075
- */
1076
- export interface ContractActionPayload {
1077
- /**
1078
- * The chain ID on which the target exists
1079
- *
1080
- * @type {bigint}
1081
- */
1082
- chainId: bigint;
1083
- /**
1084
- * The target contract address
1085
- *
1086
- * @type {Address}
1087
- */
1088
- target: Address;
1089
- /**
1090
- * The selector for the function to be called
1091
- *
1092
- * @type {Hex}
1093
- */
1094
- selector: Hex;
1095
- /**
1096
- * The native token value to send with the function call
1097
- *
1098
- * @type {bigint}
1099
- */
1100
- value: bigint;
1101
- }
1102
- /**
1103
- * `ERC721MintActionPayload` is a re-exported `ContractActionPayload`
1104
- *
1105
- * @export
1106
- * @typedef {ERC721MintActionPayload}
1107
- */
1108
- export type ERC721MintActionPayload = ContractActionPayload;
1109
- /**
1110
- * The object representation of a `SimpleBudgetPayload.InitPayload`
1111
- *
1112
- * @export
1113
- * @interface SimpleBudgetPayload
1114
- * @typedef {SimpleBudgetPayload}
1115
- */
1116
- export interface SimpleBudgetPayload {
1117
- /**
1118
- * The budget's owner
1119
- *
1120
- * @type {Address}
1121
- */
1122
- owner: Address;
1123
- /**
1124
- * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
1125
- *
1126
- * @type {Address[]}
1127
- */
1128
- authorized: Address[];
1129
- }
1130
- /**
1131
- * Given a {@link SimpleBudgetPayload}, properly encode a `SimpleBudget.InitPayload` for use with {@link SimpleBudget} initialization.
1132
- *
1133
- * @param {SimpleBudgetPayload} param0
1134
- * @param {Address} param0.owner - The budget's owner
1135
- * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
1136
- * @returns {*}
1137
- */
1138
- export declare const prepareSimpleBudgetPayload: ({ owner, authorized, }: SimpleBudgetPayload) => `0x${string}`;
1139
- /**
1140
- * The object representation of a `ManagedBudgetPayload.InitPayload`
1141
- *
1142
- * @export
1143
- * @interface ManagedBudgetPayload
1144
- * @typedef {ManagedBudgetPayload}
1145
- */
1146
- export interface ManagedBudgetPayload {
1147
- /**
1148
- * The budget's owner
1149
- *
1150
- * @type {Address}
1151
- */
1152
- owner: Address;
1153
- /**
1154
- * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
1155
- *
1156
- * @type {Address[]}
1157
- */
1158
- authorized: Address[];
1159
- /**
1160
- * List of roles to assign to the corresponding account by index.
1161
- *
1162
- * @type {bigint[]}
1163
- */
1164
- roles: bigint[];
1165
- }
1166
- /**
1167
- * Given a {@link ManagedBudgetPayload}, properly encode a `ManagedBudget.InitPayload` for use with {@link ManagedBudget} initialization.
1168
- *
1169
- * @param {ManagedBudgetPayload} param0
1170
- * @param {Address} param0.owner - The budget's owner
1171
- * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
1172
- * @param {{}} param0.roles - List of roles to assign to the corresponding account by index.
1173
- * @returns {*}
1174
- */
1175
- export declare const prepareManagedBudgetPayload: ({ owner, authorized, roles, }: ManagedBudgetPayload) => `0x${string}`;
1176
- /**
1177
- * The object representation of a `VestingBudget.InitPayload`
1178
- *
1179
- * @export
1180
- * @interface VestingBudgetPayload
1181
- * @typedef {VestingBudgetPayload}
1182
- */
1183
- export interface VestingBudgetPayload {
1184
- /**
1185
- * The budget's owner.
1186
- *
1187
- * @type {Address}
1188
- */
1189
- owner: Address;
1190
- /**
1191
- * List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
1192
- *
1193
- * @type {Address[]}
1194
- */
1195
- authorized: Address[];
1196
- /**
1197
- * The timestamp at which the vesting schedule begins
1198
- *
1199
- * @type {bigint}
1200
- */
1201
- start: bigint;
1202
- /**
1203
- * The duration of the vesting schedule (in seconds)
1204
- *
1205
- * @type {bigint}
1206
- */
1207
- duration: bigint;
1208
- /**
1209
- * The duration of the cliff period (in seconds)
1210
- *
1211
- * @type {bigint}
1212
- */
1213
- cliff: bigint;
1214
- }
1215
- /**
1216
- * Given a {@link VestingBudgetPayload}, properly encode a `VestingBudget.InitPayload` for use with {@link VestingBudget} initialization.
1217
- *
1218
- * @param {VestingBudgetPayload} param0
1219
- * @param {Address} param0.owner - The budget's owner.
1220
- * @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
1221
- * @param {bigint} param0.start - The timestamp at which the vesting schedule begins
1222
- * @param {bigint} param0.duration - The duration of the vesting schedule (in seconds)
1223
- * @param {bigint} param0.cliff - The duration of the cliff period (in seconds)
1224
- * @returns {Hex}
1225
- */
1226
- export declare const prepareVestingBudgetPayload: ({ owner, authorized, start, duration, cliff, }: VestingBudgetPayload) => `0x${string}`;
1227
- /**
1228
- * Given a {@link ContractActionPayload}, properly encode a `ContractAction.InitPayload` for use with {@link ContractAction} initialization.
1229
- *
1230
- * @param {ContractActionPayload} param0
1231
- * @param {bigint} param0.chainId - The chain ID on which the target exists
1232
- * @param {Address} param0.target - The target contract address
1233
- * @param {Hex} param0.selector - The selector for the function to be called
1234
- * @param {bigint} param0.value - The native token value to send with the function call
1235
- * @returns {Hex}
1236
- */
1237
- export declare const prepareContractActionPayload: ({ chainId, target, selector, value, }: ContractActionPayload) => `0x${string}`;
1238
- /**
1239
- * Given a {@link ContractActionPayload}, properly encode a `ContractAction.InitPayload` for use with {@link ERC721MintAction} initialization.
1240
- *
1241
- * @param {ContractActionPayload} param0
1242
- * @param {bigint} param0.chainId - The chain ID on which the target exists
1243
- * @param {Address} param0.target - The target contract address
1244
- * @param {Hex} param0.selector - The selector for the function to be called
1245
- * @param {bigint} param0.value - The native token value to send with the function call
1246
- * @returns {*}
1247
- */
1248
- export declare const prepareERC721MintActionPayload: ({ chainId, target, selector, value, }: ContractActionPayload) => `0x${string}`;
1249
- /**
1250
- * The object representation of an `Incentive.ClaimPayload`
1251
- *
1252
- * @export
1253
- * @interface ClaimPayload
1254
- * @typedef {ClaimPayload}
1255
- */
1256
- export interface ClaimPayload {
1257
- /**
1258
- * The address of the recipient
1259
- *
1260
- * @type {Address}
1261
- */
1262
- target: Address;
1263
- /**
1264
- * The implementation-specific data for the claim, if needed
1265
- *
1266
- * @type {?Hex}
1267
- */
1268
- data?: Hex;
1269
- }
1270
- /**
1271
- * Given a valid {@link ClaimPayload}, encode the payload for use with Incentive operations.
1272
- *
1273
- * @param {ClaimPayload} param0
1274
- * @param {Address} param0.target - The address of the recipient
1275
- * @param {Hex} [param0.data=zeroHash] - The implementation-specific data for the claim, if needed
1276
- * @returns {*}
1277
- */
1278
- export declare const prepareClaimPayload: ({ target, data, }: ClaimPayload) => `0x${string}`;
1279
- /**
1280
- * The various types of assets supported in Budgets and Incentives.
1281
- *
1282
- * @export
1283
- * @enum {number}
1284
- */
1285
- export declare enum AssetType {
1286
- ETH = 0,
1287
- ERC20 = 1,
1288
- ERC1155 = 2
1289
- }
1290
- /**
1291
- * Object representation of a generic `Transfer` struct.
1292
- *
1293
- * @export
1294
- * @interface TransferPayload
1295
- * @typedef {TransferPayload}
1296
- */
1297
- export interface TransferPayload {
1298
- /**
1299
- * The type of the asset being transferred.
1300
- *
1301
- * @type {AssetType}
1302
- */
1303
- assetType: AssetType;
1304
- /**
1305
- * The address of the asset to transfer, zero address for ETH.
1306
- *
1307
- * @type {Address}
1308
- */
1309
128
  address: Address;
1310
- /**
1311
- * The account from which to transfer the assets.
1312
- *
1313
- * @type {Address}
1314
- */
1315
- target: Address;
1316
- /**
1317
- * An encoded {@link FungiblePayload}, use {@link prepareFungiblePayload} to construct.
1318
- *
1319
- * @type {Hex}
1320
- */
1321
- data: Hex;
1322
- }
1323
- /**
1324
- * Encodes parameters for transferring the transfer of Fungible and ERC1155 assets, used for {@link Budget} operations.
1325
- * Typically you'd use {@link prepareFungibleTransfer} or {@link prepareERC1155Transfer}
1326
- *
1327
- * @param {TransferPayload} param0
1328
- * @param {AssetType} param0.assetType - The asset type being transferred.
1329
- * @param {Address} param0.address - The address of the asset, use zero address for ETH transfers.
1330
- * @param {Address} param0.target - The address of the account being transferred from
1331
- * @param {Hex} param0.data - Use {@link prepareFungiblePayload} to properly encode an amount to transfer
1332
- * @returns {Hex}
1333
- */
1334
- export declare const prepareTransferPayload: ({ assetType, address, target, data, }: TransferPayload) => `0x${string}`;
1335
- /**
1336
- * An object representation of the `Budget.Transfer` contract struct for transfers of ERC1155 assets.
1337
- *
1338
- * @export
1339
- * @interface ERC1155TransferPayload
1340
- * @typedef {ERC1155TransferPayload}
1341
- */
1342
- export interface ERC1155TransferPayload {
1343
- /**
1344
- * The token ID to transfer
1345
- *
1346
- * @type {bigint}
1347
- */
1348
- tokenId: bigint;
1349
- /**
1350
- * The amount to transfer
1351
- *
1352
- * @type {bigint}
1353
- */
1354
- amount: bigint;
1355
- /**
1356
- * The address of the asset to target
1357
- *
1358
- * @type {Address}
1359
- */
1360
- asset: Address;
1361
- /**
1362
- * The account to transfer from
1363
- *
1364
- * @type {Address}
1365
- */
1366
- target: Address;
1367
- }
1368
- /**
1369
- * Encodes parameters for transferring the transfer of ERC1155 assets, used for {@link Budget} operations.
1370
- * The caller must have already approved the contract to transfer the asset.
1371
- *
1372
- * @export
1373
- * @param {ERC1155TransferPayload} param0
1374
- * @param {bigint} param0.tokenId - The token ID to transfer
1375
- * @param {bigint} param0.amount - The amount to transfer
1376
- * @param {Address} param0.asset - The address of the asset to target
1377
- * @param {Address} param0.target - The account to transfer from
1378
- * @returns {Hex}
1379
- */
1380
- export declare function prepareERC1155Transfer({ tokenId, amount, asset, target, }: ERC1155TransferPayload): `0x${string}`;
1381
- /**
1382
- * An object representation of the `FungiblePayload` struct
1383
- *
1384
- * @export
1385
- * @interface FungiblePayload
1386
- * @typedef {FungiblePayload}
1387
- */
1388
- export interface FungiblePayload {
1389
- /**
1390
- * The amount being transferred
1391
- *
1392
- * @type {bigint}
1393
- */
1394
- amount: bigint;
1395
- }
1396
- /**
1397
- * Encodes an amount for the `FungiblePayload` struct
1398
- *
1399
- * @export
1400
- * @param {FungiblePayload} param0
1401
- * @param {bigint} param0.amount - The amount being transferred
1402
- * @returns {*}
1403
- */
1404
- export declare function prepareFungiblePayload({ amount }: FungiblePayload): `0x${string}`;
1405
- /**
1406
- * An object representation of the `Budget.Transfer` contract struct for transfers of fungible assets.
1407
- *
1408
- * @export
1409
- * @interface FungibleTransferPayload
1410
- * @typedef {FungibleTransferPayload}
1411
- */
1412
- export interface FungibleTransferPayload {
1413
- /**
1414
- * The amount to transfer
1415
- *
1416
- * @type {bigint}
1417
- */
1418
- amount: bigint;
1419
- /**
1420
- * The address of the asset. Use zero address for ETH transfers.
1421
- *
1422
- * @type {Address}
1423
- */
1424
- asset: Address;
1425
- /**
1426
- * The account to transfer from
1427
- *
1428
- * @type {Address}
1429
- */
1430
- target: Address;
1431
- }
1432
- /**
1433
- * Encodes parameters for a Fungible transfer, used for Budget allocations.
1434
- * The caller must have already approved the contract to transfer the asset.
1435
- *
1436
- * @export
1437
- * @param {FungibleTransferPayload} param0
1438
- * @param {bigint} param0.amount - The amount to transfer
1439
- * @param {Address} param0.asset - The address of the asset. Use zero address for ETH transfers.
1440
- * @param {Address} param0.target - The account to transfer from
1441
- * @returns {Hex}
1442
- */
1443
- export declare function prepareFungibleTransfer({ amount, asset, target, }: FungibleTransferPayload): `0x${string}`;
1444
- /**
1445
- * Encodes a payload to validate that an action has been completed successfully.
1446
- *
1447
- *
1448
- * @export
1449
- * @param {Address} holder - The holder address
1450
- * @param {bigint} payload - The token ID
1451
- * @returns {Hex} - The first 20 bytes of the payload will be the holder address and the remaining bytes must be an encoded token ID (uint256)
1452
- */
1453
- export declare function prepareERC721MintActionValidate(holder: Address, payload: bigint): `0x${string}`;
129
+ };
1454
130
  //# sourceMappingURL=utils.d.ts.map