@boostxyz/sdk 0.0.0-alpha.10

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 (242) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +7 -0
  3. package/dist/Actions/Action.cjs +2 -0
  4. package/dist/Actions/Action.cjs.map +1 -0
  5. package/dist/Actions/Action.d.ts +31 -0
  6. package/dist/Actions/Action.d.ts.map +1 -0
  7. package/dist/Actions/Action.js +29 -0
  8. package/dist/Actions/Action.js.map +1 -0
  9. package/dist/Actions/ContractAction.d.ts +370 -0
  10. package/dist/Actions/ContractAction.d.ts.map +1 -0
  11. package/dist/Actions/ERC721MintAction.d.ts +513 -0
  12. package/dist/Actions/ERC721MintAction.d.ts.map +1 -0
  13. package/dist/Actions/EventAction.cjs +2 -0
  14. package/dist/Actions/EventAction.cjs.map +1 -0
  15. package/dist/Actions/EventAction.d.ts +694 -0
  16. package/dist/Actions/EventAction.d.ts.map +1 -0
  17. package/dist/Actions/EventAction.js +491 -0
  18. package/dist/Actions/EventAction.js.map +1 -0
  19. package/dist/AllowLists/AllowList.cjs +2 -0
  20. package/dist/AllowLists/AllowList.cjs.map +1 -0
  21. package/dist/AllowLists/AllowList.d.ts +32 -0
  22. package/dist/AllowLists/AllowList.d.ts.map +1 -0
  23. package/dist/AllowLists/AllowList.js +30 -0
  24. package/dist/AllowLists/AllowList.js.map +1 -0
  25. package/dist/AllowLists/SimpleAllowList.cjs +2 -0
  26. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
  27. package/dist/AllowLists/SimpleAllowList.d.ts +481 -0
  28. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -0
  29. package/dist/AllowLists/SimpleAllowList.js +154 -0
  30. package/dist/AllowLists/SimpleAllowList.js.map +1 -0
  31. package/dist/AllowLists/SimpleDenyList.cjs +2 -0
  32. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
  33. package/dist/AllowLists/SimpleDenyList.d.ts +335 -0
  34. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -0
  35. package/dist/AllowLists/SimpleDenyList.js +115 -0
  36. package/dist/AllowLists/SimpleDenyList.js.map +1 -0
  37. package/dist/Auth/Auth.cjs +2 -0
  38. package/dist/Auth/Auth.cjs.map +1 -0
  39. package/dist/Auth/Auth.d.ts +10 -0
  40. package/dist/Auth/Auth.d.ts.map +1 -0
  41. package/dist/Auth/Auth.js +5 -0
  42. package/dist/Auth/Auth.js.map +1 -0
  43. package/dist/Auth/PassthroughAuth.cjs +2 -0
  44. package/dist/Auth/PassthroughAuth.cjs.map +1 -0
  45. package/dist/Auth/PassthroughAuth.d.ts +51 -0
  46. package/dist/Auth/PassthroughAuth.d.ts.map +1 -0
  47. package/dist/Auth/PassthroughAuth.js +39 -0
  48. package/dist/Auth/PassthroughAuth.js.map +1 -0
  49. package/dist/Boost.cjs +2 -0
  50. package/dist/Boost.cjs.map +1 -0
  51. package/dist/Boost.d.ts +234 -0
  52. package/dist/Boost.d.ts.map +1 -0
  53. package/dist/Boost.js +162 -0
  54. package/dist/Boost.js.map +1 -0
  55. package/dist/BoostCore.cjs +3 -0
  56. package/dist/BoostCore.cjs.map +1 -0
  57. package/dist/BoostCore.d.ts +498 -0
  58. package/dist/BoostCore.d.ts.map +1 -0
  59. package/dist/BoostCore.js +1153 -0
  60. package/dist/BoostCore.js.map +1 -0
  61. package/dist/BoostRegistry.cjs +2 -0
  62. package/dist/BoostRegistry.cjs.map +1 -0
  63. package/dist/BoostRegistry.d.ts +243 -0
  64. package/dist/BoostRegistry.d.ts.map +1 -0
  65. package/dist/BoostRegistry.js +262 -0
  66. package/dist/BoostRegistry.js.map +1 -0
  67. package/dist/Budgets/Budget.cjs +2 -0
  68. package/dist/Budgets/Budget.cjs.map +1 -0
  69. package/dist/Budgets/Budget.d.ts +31 -0
  70. package/dist/Budgets/Budget.d.ts.map +1 -0
  71. package/dist/Budgets/Budget.js +29 -0
  72. package/dist/Budgets/Budget.js.map +1 -0
  73. package/dist/Budgets/ManagedBudget.cjs +2 -0
  74. package/dist/Budgets/ManagedBudget.cjs.map +1 -0
  75. package/dist/Budgets/ManagedBudget.d.ts +1103 -0
  76. package/dist/Budgets/ManagedBudget.d.ts.map +1 -0
  77. package/dist/Budgets/ManagedBudget.js +516 -0
  78. package/dist/Budgets/ManagedBudget.js.map +1 -0
  79. package/dist/Budgets/SimpleBudget.d.ts +824 -0
  80. package/dist/Budgets/SimpleBudget.d.ts.map +1 -0
  81. package/dist/Budgets/VestingBudget.d.ts +778 -0
  82. package/dist/Budgets/VestingBudget.d.ts.map +1 -0
  83. package/dist/Deployable/Contract.cjs +2 -0
  84. package/dist/Deployable/Contract.cjs.map +1 -0
  85. package/dist/Deployable/Contract.d.ts +125 -0
  86. package/dist/Deployable/Contract.d.ts.map +1 -0
  87. package/dist/Deployable/Contract.js +150 -0
  88. package/dist/Deployable/Contract.js.map +1 -0
  89. package/dist/Deployable/Deployable.cjs +2 -0
  90. package/dist/Deployable/Deployable.cjs.map +1 -0
  91. package/dist/Deployable/Deployable.d.ts +161 -0
  92. package/dist/Deployable/Deployable.d.ts.map +1 -0
  93. package/dist/Deployable/Deployable.js +131 -0
  94. package/dist/Deployable/Deployable.js.map +1 -0
  95. package/dist/Deployable/DeployableTarget.cjs +2 -0
  96. package/dist/Deployable/DeployableTarget.cjs.map +1 -0
  97. package/dist/Deployable/DeployableTarget.d.ts +116 -0
  98. package/dist/Deployable/DeployableTarget.d.ts.map +1 -0
  99. package/dist/Deployable/DeployableTarget.js +132 -0
  100. package/dist/Deployable/DeployableTarget.js.map +1 -0
  101. package/dist/Incentives/AllowListIncentive.cjs +2 -0
  102. package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
  103. package/dist/Incentives/AllowListIncentive.d.ts +513 -0
  104. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -0
  105. package/dist/Incentives/AllowListIncentive.js +201 -0
  106. package/dist/Incentives/AllowListIncentive.js.map +1 -0
  107. package/dist/Incentives/CGDAIncentive.cjs +2 -0
  108. package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
  109. package/dist/Incentives/CGDAIncentive.d.ts +644 -0
  110. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -0
  111. package/dist/Incentives/CGDAIncentive.js +271 -0
  112. package/dist/Incentives/CGDAIncentive.js.map +1 -0
  113. package/dist/Incentives/ERC1155Incentive.d.ts +713 -0
  114. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -0
  115. package/dist/Incentives/ERC20Incentive.cjs +2 -0
  116. package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
  117. package/dist/Incentives/ERC20Incentive.d.ts +666 -0
  118. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -0
  119. package/dist/Incentives/ERC20Incentive.js +312 -0
  120. package/dist/Incentives/ERC20Incentive.js.map +1 -0
  121. package/dist/Incentives/ERC20VariableIncentive.d.ts +582 -0
  122. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -0
  123. package/dist/Incentives/Incentive.cjs +2 -0
  124. package/dist/Incentives/Incentive.cjs.map +1 -0
  125. package/dist/Incentives/Incentive.d.ts +36 -0
  126. package/dist/Incentives/Incentive.d.ts.map +1 -0
  127. package/dist/Incentives/Incentive.js +299 -0
  128. package/dist/Incentives/Incentive.js.map +1 -0
  129. package/dist/Incentives/PointsIncentive.cjs +2 -0
  130. package/dist/Incentives/PointsIncentive.cjs.map +1 -0
  131. package/dist/Incentives/PointsIncentive.d.ts +659 -0
  132. package/dist/Incentives/PointsIncentive.d.ts.map +1 -0
  133. package/dist/Incentives/PointsIncentive.js +215 -0
  134. package/dist/Incentives/PointsIncentive.js.map +1 -0
  135. package/dist/Validators/SignerValidator.cjs +2 -0
  136. package/dist/Validators/SignerValidator.cjs.map +1 -0
  137. package/dist/Validators/SignerValidator.d.ts +745 -0
  138. package/dist/Validators/SignerValidator.d.ts.map +1 -0
  139. package/dist/Validators/SignerValidator.js +293 -0
  140. package/dist/Validators/SignerValidator.js.map +1 -0
  141. package/dist/Validators/Validator.cjs +2 -0
  142. package/dist/Validators/Validator.cjs.map +1 -0
  143. package/dist/Validators/Validator.d.ts +31 -0
  144. package/dist/Validators/Validator.d.ts.map +1 -0
  145. package/dist/Validators/Validator.js +27 -0
  146. package/dist/Validators/Validator.js.map +1 -0
  147. package/dist/claiming.cjs +2 -0
  148. package/dist/claiming.cjs.map +1 -0
  149. package/dist/claiming.d.ts +43 -0
  150. package/dist/claiming.d.ts.map +1 -0
  151. package/dist/claiming.js +17 -0
  152. package/dist/claiming.js.map +1 -0
  153. package/dist/componentInterfaces-CKCBwG16.cjs +2 -0
  154. package/dist/componentInterfaces-CKCBwG16.cjs.map +1 -0
  155. package/dist/componentInterfaces-DYkaxBda.js +13 -0
  156. package/dist/componentInterfaces-DYkaxBda.js.map +1 -0
  157. package/dist/errors.cjs +2 -0
  158. package/dist/errors.cjs.map +1 -0
  159. package/dist/errors.d.ts +441 -0
  160. package/dist/errors.d.ts.map +1 -0
  161. package/dist/errors.js +262 -0
  162. package/dist/errors.js.map +1 -0
  163. package/dist/generated-BDeDiaCK.js +4625 -0
  164. package/dist/generated-BDeDiaCK.js.map +1 -0
  165. package/dist/generated-wKBNvm48.cjs +3 -0
  166. package/dist/generated-wKBNvm48.cjs.map +1 -0
  167. package/dist/index.cjs +2 -0
  168. package/dist/index.cjs.map +1 -0
  169. package/dist/index.d.ts +25 -0
  170. package/dist/index.d.ts.map +1 -0
  171. package/dist/index.js +113 -0
  172. package/dist/index.js.map +1 -0
  173. package/dist/transfers.cjs +2 -0
  174. package/dist/transfers.cjs.map +1 -0
  175. package/dist/transfers.d.ts +198 -0
  176. package/dist/transfers.d.ts.map +1 -0
  177. package/dist/transfers.js +84 -0
  178. package/dist/transfers.js.map +1 -0
  179. package/dist/utils.cjs +2 -0
  180. package/dist/utils.cjs.map +1 -0
  181. package/dist/utils.d.ts +116 -0
  182. package/dist/utils.d.ts.map +1 -0
  183. package/dist/utils.js +30 -0
  184. package/dist/utils.js.map +1 -0
  185. package/package.json +211 -0
  186. package/src/Actions/Action.test.ts +75 -0
  187. package/src/Actions/Action.ts +61 -0
  188. package/src/Actions/ContractAction.test.ts +197 -0
  189. package/src/Actions/ContractAction.ts +301 -0
  190. package/src/Actions/ERC721MintAction.test.ts +112 -0
  191. package/src/Actions/ERC721MintAction.ts +292 -0
  192. package/src/Actions/EventAction.test.ts +205 -0
  193. package/src/Actions/EventAction.ts +811 -0
  194. package/src/AllowLists/AllowList.test.ts +64 -0
  195. package/src/AllowLists/AllowList.ts +60 -0
  196. package/src/AllowLists/SimpleAllowList.test.ts +52 -0
  197. package/src/AllowLists/SimpleAllowList.ts +284 -0
  198. package/src/AllowLists/SimpleDenyList.test.ts +52 -0
  199. package/src/AllowLists/SimpleDenyList.ts +227 -0
  200. package/src/Auth/Auth.ts +11 -0
  201. package/src/Auth/PassthroughAuth.test.ts +12 -0
  202. package/src/Auth/PassthroughAuth.ts +80 -0
  203. package/src/Boost.ts +290 -0
  204. package/src/BoostCore.test.ts +773 -0
  205. package/src/BoostCore.ts +1261 -0
  206. package/src/BoostRegistry.ts +467 -0
  207. package/src/Budgets/Budget.test.ts +27 -0
  208. package/src/Budgets/Budget.ts +61 -0
  209. package/src/Budgets/ManagedBudget.test.ts +154 -0
  210. package/src/Budgets/ManagedBudget.ts +796 -0
  211. package/src/Budgets/SimpleBudget.test.ts +152 -0
  212. package/src/Budgets/SimpleBudget.ts +564 -0
  213. package/src/Budgets/VestingBudget.test.ts +123 -0
  214. package/src/Budgets/VestingBudget.ts +602 -0
  215. package/src/Deployable/Contract.ts +229 -0
  216. package/src/Deployable/Deployable.ts +250 -0
  217. package/src/Deployable/DeployableTarget.ts +223 -0
  218. package/src/Incentives/AllowListIncentive.test.ts +143 -0
  219. package/src/Incentives/AllowListIncentive.ts +334 -0
  220. package/src/Incentives/CGDAIncentive.test.ts +132 -0
  221. package/src/Incentives/CGDAIncentive.ts +468 -0
  222. package/src/Incentives/ERC1155Incentive.test.ts +87 -0
  223. package/src/Incentives/ERC1155Incentive.ts +466 -0
  224. package/src/Incentives/ERC20Incentive.test.ts +130 -0
  225. package/src/Incentives/ERC20Incentive.ts +482 -0
  226. package/src/Incentives/ERC20VariableIncentive.test.ts +136 -0
  227. package/src/Incentives/ERC20VariableIncentive.ts +420 -0
  228. package/src/Incentives/Incentive.test.ts +92 -0
  229. package/src/Incentives/Incentive.ts +85 -0
  230. package/src/Incentives/PointsIncentive.test.ts +139 -0
  231. package/src/Incentives/PointsIncentive.ts +365 -0
  232. package/src/Validators/SignerValidator.test.ts +159 -0
  233. package/src/Validators/SignerValidator.ts +681 -0
  234. package/src/Validators/Validator.test.ts +21 -0
  235. package/src/Validators/Validator.ts +55 -0
  236. package/src/claiming.ts +56 -0
  237. package/src/errors.ts +542 -0
  238. package/src/index.test.ts +40 -0
  239. package/src/index.ts +53 -0
  240. package/src/transfers.ts +284 -0
  241. package/src/utils.test.ts +44 -0
  242. package/src/utils.ts +198 -0
@@ -0,0 +1,644 @@
1
+ import { cgdaIncentiveAbi } from '@boostxyz/evm';
2
+ import { type Address, type ContractEventName } from 'viem';
3
+ import type { DeployableOptions, GenericDeployableParams } from '../Deployable/Deployable';
4
+ import { DeployableTarget } from '../Deployable/DeployableTarget';
5
+ import { type ClaimPayload } from '../claiming';
6
+ import { type GenericLog, type ReadParams, RegistryType, type WriteParams } from '../utils';
7
+ export { cgdaIncentiveAbi };
8
+ /**
9
+ * The object representation of a `CGDAIncentive.InitPayload`
10
+ *
11
+ * @export
12
+ * @interface CGDAIncentivePayload
13
+ * @typedef {CGDAIncentivePayload}
14
+ */
15
+ export interface CGDAIncentivePayload {
16
+ /**
17
+ * The address of the ERC20-like token
18
+ *
19
+ * @type {Address}
20
+ */
21
+ asset: Address;
22
+ /**
23
+ * The initial reward amount
24
+ *
25
+ * @type {bigint}
26
+ */
27
+ initialReward: bigint;
28
+ /**
29
+ * The amount to subtract from the current reward after each claim
30
+ *
31
+ * @type {bigint}
32
+ */
33
+ rewardDecay: bigint;
34
+ /**
35
+ * The amount by which the reward increases for each hour without a claim (continuous linear increase)
36
+ *
37
+ * @type {bigint}
38
+ */
39
+ rewardBoost: bigint;
40
+ /**
41
+ * The total budget for the incentive
42
+ *
43
+ * @type {bigint}
44
+ */
45
+ totalBudget: bigint;
46
+ }
47
+ /**
48
+ * The configuration parameters for the CGDAIncentive
49
+ *
50
+ * @export
51
+ * @interface CGDAParameters
52
+ * @typedef {CGDAParameters}
53
+ */
54
+ export interface CGDAParameters {
55
+ /**
56
+ * The amount to subtract from the current reward after each claim
57
+ *
58
+ * @type {bigint}
59
+ */
60
+ rewardDecay: bigint;
61
+ /**
62
+ * The amount by which the reward increases for each hour without a claim (continuous linear increase)
63
+ *
64
+ * @type {bigint}
65
+ */
66
+ rewardBoost: bigint;
67
+ /**
68
+ * The timestamp of the last claim
69
+ *
70
+ * @type {bigint}
71
+ */
72
+ lastClaimTime: bigint;
73
+ /**
74
+ * The current reward amount
75
+ *
76
+ * @type {bigint}
77
+ */
78
+ currentReward: bigint;
79
+ }
80
+ /**
81
+ * A generic `viem.Log` event with support for `CGDAIncentive` event types.
82
+ *
83
+ * @export
84
+ * @typedef {CGDAIncentiveLog}
85
+ * @template {ContractEventName<typeof cgdaIncentiveAbi>} [event=ContractEventName<
86
+ * typeof cgdaIncentiveAbi
87
+ * >]
88
+ */
89
+ export type CGDAIncentiveLog<event extends ContractEventName<typeof cgdaIncentiveAbi> = ContractEventName<typeof cgdaIncentiveAbi>> = GenericLog<typeof cgdaIncentiveAbi, event>;
90
+ /**
91
+ * Continuous Gradual Dutch Auction Incentive.
92
+ * An CGDA incentive implementation with reward amounts adjusting dynamically based on claim volume.
93
+ *
94
+ * @export
95
+ * @class CGDAIncentive
96
+ * @typedef {CGDAIncentive}
97
+ * @extends {DeployableTarget<CGDAIncentivePayload>}
98
+ */
99
+ export declare class CGDAIncentive extends DeployableTarget<CGDAIncentivePayload, typeof cgdaIncentiveAbi> {
100
+ readonly abi: readonly [{
101
+ readonly type: "constructor";
102
+ readonly inputs: readonly [];
103
+ readonly stateMutability: "nonpayable";
104
+ }, {
105
+ readonly type: "error";
106
+ readonly inputs: readonly [];
107
+ readonly name: "AlreadyInitialized";
108
+ }, {
109
+ readonly type: "error";
110
+ readonly inputs: readonly [];
111
+ readonly name: "ClaimFailed";
112
+ }, {
113
+ readonly type: "error";
114
+ readonly inputs: readonly [];
115
+ readonly name: "CloneAlreadyInitialized";
116
+ }, {
117
+ readonly type: "error";
118
+ readonly inputs: readonly [];
119
+ readonly name: "InitializerNotImplemented";
120
+ }, {
121
+ readonly type: "error";
122
+ readonly inputs: readonly [{
123
+ readonly name: "asset";
124
+ readonly internalType: "address";
125
+ readonly type: "address";
126
+ }, {
127
+ readonly name: "available";
128
+ readonly internalType: "uint256";
129
+ readonly type: "uint256";
130
+ }, {
131
+ readonly name: "required";
132
+ readonly internalType: "uint256";
133
+ readonly type: "uint256";
134
+ }];
135
+ readonly name: "InsufficientFunds";
136
+ }, {
137
+ readonly type: "error";
138
+ readonly inputs: readonly [];
139
+ readonly name: "InvalidInitialization";
140
+ }, {
141
+ readonly type: "error";
142
+ readonly inputs: readonly [];
143
+ readonly name: "InvalidInitialization";
144
+ }, {
145
+ readonly type: "error";
146
+ readonly inputs: readonly [];
147
+ readonly name: "InvalidInitializationData";
148
+ }, {
149
+ readonly type: "error";
150
+ readonly inputs: readonly [];
151
+ readonly name: "NewOwnerIsZeroAddress";
152
+ }, {
153
+ readonly type: "error";
154
+ readonly inputs: readonly [];
155
+ readonly name: "NoHandoverRequest";
156
+ }, {
157
+ readonly type: "error";
158
+ readonly inputs: readonly [];
159
+ readonly name: "NotClaimable";
160
+ }, {
161
+ readonly type: "error";
162
+ readonly inputs: readonly [];
163
+ readonly name: "NotInitializing";
164
+ }, {
165
+ readonly type: "error";
166
+ readonly inputs: readonly [];
167
+ readonly name: "Unauthorized";
168
+ }, {
169
+ readonly type: "event";
170
+ readonly anonymous: false;
171
+ readonly inputs: readonly [{
172
+ readonly name: "recipient";
173
+ readonly internalType: "address";
174
+ readonly type: "address";
175
+ readonly indexed: true;
176
+ }, {
177
+ readonly name: "data";
178
+ readonly internalType: "bytes";
179
+ readonly type: "bytes";
180
+ readonly indexed: false;
181
+ }];
182
+ readonly name: "Claimed";
183
+ }, {
184
+ readonly type: "event";
185
+ readonly anonymous: false;
186
+ readonly inputs: readonly [{
187
+ readonly name: "version";
188
+ readonly internalType: "uint64";
189
+ readonly type: "uint64";
190
+ readonly indexed: false;
191
+ }];
192
+ readonly name: "Initialized";
193
+ }, {
194
+ readonly type: "event";
195
+ readonly anonymous: false;
196
+ readonly inputs: readonly [{
197
+ readonly name: "pendingOwner";
198
+ readonly internalType: "address";
199
+ readonly type: "address";
200
+ readonly indexed: true;
201
+ }];
202
+ readonly name: "OwnershipHandoverCanceled";
203
+ }, {
204
+ readonly type: "event";
205
+ readonly anonymous: false;
206
+ readonly inputs: readonly [{
207
+ readonly name: "pendingOwner";
208
+ readonly internalType: "address";
209
+ readonly type: "address";
210
+ readonly indexed: true;
211
+ }];
212
+ readonly name: "OwnershipHandoverRequested";
213
+ }, {
214
+ readonly type: "event";
215
+ readonly anonymous: false;
216
+ readonly inputs: readonly [{
217
+ readonly name: "oldOwner";
218
+ readonly internalType: "address";
219
+ readonly type: "address";
220
+ readonly indexed: true;
221
+ }, {
222
+ readonly name: "newOwner";
223
+ readonly internalType: "address";
224
+ readonly type: "address";
225
+ readonly indexed: true;
226
+ }];
227
+ readonly name: "OwnershipTransferred";
228
+ }, {
229
+ readonly type: "function";
230
+ readonly inputs: readonly [];
231
+ readonly name: "asset";
232
+ readonly outputs: readonly [{
233
+ readonly name: "";
234
+ readonly internalType: "address";
235
+ readonly type: "address";
236
+ }];
237
+ readonly stateMutability: "view";
238
+ }, {
239
+ readonly type: "function";
240
+ readonly inputs: readonly [];
241
+ readonly name: "cancelOwnershipHandover";
242
+ readonly outputs: readonly [];
243
+ readonly stateMutability: "payable";
244
+ }, {
245
+ readonly type: "function";
246
+ readonly inputs: readonly [];
247
+ readonly name: "cgdaParams";
248
+ readonly outputs: readonly [{
249
+ readonly name: "rewardDecay";
250
+ readonly internalType: "uint256";
251
+ readonly type: "uint256";
252
+ }, {
253
+ readonly name: "rewardBoost";
254
+ readonly internalType: "uint256";
255
+ readonly type: "uint256";
256
+ }, {
257
+ readonly name: "lastClaimTime";
258
+ readonly internalType: "uint256";
259
+ readonly type: "uint256";
260
+ }, {
261
+ readonly name: "currentReward";
262
+ readonly internalType: "uint256";
263
+ readonly type: "uint256";
264
+ }];
265
+ readonly stateMutability: "view";
266
+ }, {
267
+ readonly type: "function";
268
+ readonly inputs: readonly [{
269
+ readonly name: "claimTarget";
270
+ readonly internalType: "address";
271
+ readonly type: "address";
272
+ }, {
273
+ readonly name: "";
274
+ readonly internalType: "bytes";
275
+ readonly type: "bytes";
276
+ }];
277
+ readonly name: "claim";
278
+ readonly outputs: readonly [{
279
+ readonly name: "";
280
+ readonly internalType: "bool";
281
+ readonly type: "bool";
282
+ }];
283
+ readonly stateMutability: "nonpayable";
284
+ }, {
285
+ readonly type: "function";
286
+ readonly inputs: readonly [{
287
+ readonly name: "";
288
+ readonly internalType: "address";
289
+ readonly type: "address";
290
+ }];
291
+ readonly name: "claimed";
292
+ readonly outputs: readonly [{
293
+ readonly name: "";
294
+ readonly internalType: "bool";
295
+ readonly type: "bool";
296
+ }];
297
+ readonly stateMutability: "view";
298
+ }, {
299
+ readonly type: "function";
300
+ readonly inputs: readonly [];
301
+ readonly name: "claims";
302
+ readonly outputs: readonly [{
303
+ readonly name: "";
304
+ readonly internalType: "uint256";
305
+ readonly type: "uint256";
306
+ }];
307
+ readonly stateMutability: "view";
308
+ }, {
309
+ readonly type: "function";
310
+ readonly inputs: readonly [{
311
+ readonly name: "data_";
312
+ readonly internalType: "bytes";
313
+ readonly type: "bytes";
314
+ }];
315
+ readonly name: "clawback";
316
+ readonly outputs: readonly [{
317
+ readonly name: "";
318
+ readonly internalType: "bool";
319
+ readonly type: "bool";
320
+ }];
321
+ readonly stateMutability: "nonpayable";
322
+ }, {
323
+ readonly type: "function";
324
+ readonly inputs: readonly [{
325
+ readonly name: "pendingOwner";
326
+ readonly internalType: "address";
327
+ readonly type: "address";
328
+ }];
329
+ readonly name: "completeOwnershipHandover";
330
+ readonly outputs: readonly [];
331
+ readonly stateMutability: "payable";
332
+ }, {
333
+ readonly type: "function";
334
+ readonly inputs: readonly [];
335
+ readonly name: "currentReward";
336
+ readonly outputs: readonly [{
337
+ readonly name: "";
338
+ readonly internalType: "uint256";
339
+ readonly type: "uint256";
340
+ }];
341
+ readonly stateMutability: "view";
342
+ }, {
343
+ readonly type: "function";
344
+ readonly inputs: readonly [];
345
+ readonly name: "getComponentInterface";
346
+ readonly outputs: readonly [{
347
+ readonly name: "";
348
+ readonly internalType: "bytes4";
349
+ readonly type: "bytes4";
350
+ }];
351
+ readonly stateMutability: "pure";
352
+ }, {
353
+ readonly type: "function";
354
+ readonly inputs: readonly [{
355
+ readonly name: "data_";
356
+ readonly internalType: "bytes";
357
+ readonly type: "bytes";
358
+ }];
359
+ readonly name: "initialize";
360
+ readonly outputs: readonly [];
361
+ readonly stateMutability: "nonpayable";
362
+ }, {
363
+ readonly type: "function";
364
+ readonly inputs: readonly [{
365
+ readonly name: "claimTarget";
366
+ readonly internalType: "address";
367
+ readonly type: "address";
368
+ }, {
369
+ readonly name: "";
370
+ readonly internalType: "bytes";
371
+ readonly type: "bytes";
372
+ }];
373
+ readonly name: "isClaimable";
374
+ readonly outputs: readonly [{
375
+ readonly name: "";
376
+ readonly internalType: "bool";
377
+ readonly type: "bool";
378
+ }];
379
+ readonly stateMutability: "view";
380
+ }, {
381
+ readonly type: "function";
382
+ readonly inputs: readonly [];
383
+ readonly name: "owner";
384
+ readonly outputs: readonly [{
385
+ readonly name: "result";
386
+ readonly internalType: "address";
387
+ readonly type: "address";
388
+ }];
389
+ readonly stateMutability: "view";
390
+ }, {
391
+ readonly type: "function";
392
+ readonly inputs: readonly [{
393
+ readonly name: "pendingOwner";
394
+ readonly internalType: "address";
395
+ readonly type: "address";
396
+ }];
397
+ readonly name: "ownershipHandoverExpiresAt";
398
+ readonly outputs: readonly [{
399
+ readonly name: "result";
400
+ readonly internalType: "uint256";
401
+ readonly type: "uint256";
402
+ }];
403
+ readonly stateMutability: "view";
404
+ }, {
405
+ readonly type: "function";
406
+ readonly inputs: readonly [{
407
+ readonly name: "data_";
408
+ readonly internalType: "bytes";
409
+ readonly type: "bytes";
410
+ }];
411
+ readonly name: "preflight";
412
+ readonly outputs: readonly [{
413
+ readonly name: "";
414
+ readonly internalType: "bytes";
415
+ readonly type: "bytes";
416
+ }];
417
+ readonly stateMutability: "view";
418
+ }, {
419
+ readonly type: "function";
420
+ readonly inputs: readonly [];
421
+ readonly name: "renounceOwnership";
422
+ readonly outputs: readonly [];
423
+ readonly stateMutability: "payable";
424
+ }, {
425
+ readonly type: "function";
426
+ readonly inputs: readonly [];
427
+ readonly name: "requestOwnershipHandover";
428
+ readonly outputs: readonly [];
429
+ readonly stateMutability: "payable";
430
+ }, {
431
+ readonly type: "function";
432
+ readonly inputs: readonly [];
433
+ readonly name: "reward";
434
+ readonly outputs: readonly [{
435
+ readonly name: "";
436
+ readonly internalType: "uint256";
437
+ readonly type: "uint256";
438
+ }];
439
+ readonly stateMutability: "view";
440
+ }, {
441
+ readonly type: "function";
442
+ readonly inputs: readonly [{
443
+ readonly name: "interfaceId";
444
+ readonly internalType: "bytes4";
445
+ readonly type: "bytes4";
446
+ }];
447
+ readonly name: "supportsInterface";
448
+ readonly outputs: readonly [{
449
+ readonly name: "";
450
+ readonly internalType: "bool";
451
+ readonly type: "bool";
452
+ }];
453
+ readonly stateMutability: "view";
454
+ }, {
455
+ readonly type: "function";
456
+ readonly inputs: readonly [];
457
+ readonly name: "totalBudget";
458
+ readonly outputs: readonly [{
459
+ readonly name: "";
460
+ readonly internalType: "uint256";
461
+ readonly type: "uint256";
462
+ }];
463
+ readonly stateMutability: "view";
464
+ }, {
465
+ readonly type: "function";
466
+ readonly inputs: readonly [{
467
+ readonly name: "newOwner";
468
+ readonly internalType: "address";
469
+ readonly type: "address";
470
+ }];
471
+ readonly name: "transferOwnership";
472
+ readonly outputs: readonly [];
473
+ readonly stateMutability: "payable";
474
+ }];
475
+ /**
476
+ * @inheritdoc
477
+ *
478
+ * @public
479
+ * @static
480
+ * @type {Address}
481
+ */
482
+ static base: Address;
483
+ /**
484
+ * @inheritdoc
485
+ *
486
+ * @public
487
+ * @static
488
+ * @type {RegistryType}
489
+ */
490
+ static registryType: RegistryType;
491
+ /**
492
+ * The incentive's owner.
493
+ *
494
+ * @public
495
+ * @async
496
+ * @param {?ReadParams<typeof cgdaIncentiveAbi, 'owner'>} [params]
497
+ * @returns {unknown}
498
+ */
499
+ owner(params?: ReadParams<typeof cgdaIncentiveAbi, 'owner'>): Promise<`0x${string}`>;
500
+ /**
501
+ * The number of claims that have been made
502
+ *
503
+ * @public
504
+ * @async
505
+ * @param {?ReadParams<typeof cgdaIncentiveAbi, 'claims'>} [params]
506
+ * @returns {Promise<bigint>}
507
+ */
508
+ claims(params?: ReadParams<typeof cgdaIncentiveAbi, 'claims'>): Promise<bigint>;
509
+ /**
510
+ * The reward amount issued for each claim
511
+ *
512
+ * @public
513
+ * @async
514
+ * @param {?ReadParams<typeof allowListIncentiveAbi, 'reward'>} [params]
515
+ * @returns {Promise<bigint>}
516
+ */
517
+ reward(params?: ReadParams<typeof cgdaIncentiveAbi, 'reward'>): Promise<bigint>;
518
+ /**
519
+ * Get the claim status for a user
520
+ *
521
+ * @public
522
+ * @async
523
+ * @param {Address} address
524
+ * @param {?ReadParams<typeof cgdaIncentiveAbi, 'claimed'>} [params]
525
+ * @returns {Promise<boolean>}
526
+ */
527
+ claimed(address: Address, params?: ReadParams<typeof cgdaIncentiveAbi, 'claimed'>): Promise<boolean>;
528
+ /**
529
+ * The CGDA-like token used for the incentive
530
+ *
531
+ * @public
532
+ * @async
533
+ * @param {?ReadParams<typeof cgdaIncentiveAbi, 'asset'>} [params]
534
+ * @returns {unknown}
535
+ */
536
+ asset(params?: ReadParams<typeof cgdaIncentiveAbi, 'asset'>): Promise<`0x${string}`>;
537
+ /**
538
+ * The configuration parameters for the CGDAIncentive
539
+ *
540
+ * @public
541
+ * @async
542
+ * @param {?ReadParams<typeof cgdaIncentiveAbi, 'cgdaParams'>} [params]
543
+ * @returns {Promise<CGDAParameters>}
544
+ */
545
+ cgdaParams(params?: ReadParams<typeof cgdaIncentiveAbi, 'cgdaParams'>): Promise<CGDAParameters>;
546
+ /**
547
+ * The total budget of the incentive
548
+ *
549
+ * @public
550
+ * @async
551
+ * @param {?ReadParams<typeof cgdaIncentiveAbi, 'totalBudget'>} [params]
552
+ * @returns {Promise<bigint>}
553
+ */
554
+ totalBudget(params?: ReadParams<typeof cgdaIncentiveAbi, 'totalBudget'>): Promise<bigint>;
555
+ /**
556
+ * Claim the incentive
557
+ *
558
+ * @public
559
+ * @async
560
+ * @param {ClaimPayload} payload
561
+ * @param {?WriteParams<typeof cgdaIncentiveAbi, 'claim'>} [params]
562
+ * @returns {Promise<boolean>} - Returns true if successfully claimed
563
+ */
564
+ protected claim(payload: ClaimPayload, params?: WriteParams<typeof cgdaIncentiveAbi, 'claim'>): Promise<boolean>;
565
+ /**
566
+ * Claim the incentive
567
+ *
568
+ * @public
569
+ * @async
570
+ * @param {ClaimPayload} payload
571
+ * @param {?WriteParams<typeof cgdaIncentiveAbi, 'claim'>} [params]
572
+ * @returns {Promise<boolean>} - Returns true if successfully claimed
573
+ */
574
+ protected claimRaw(payload: ClaimPayload, params?: WriteParams<typeof cgdaIncentiveAbi, 'claim'>): Promise<{
575
+ hash: `0x${string}`;
576
+ result: boolean;
577
+ }>;
578
+ /**
579
+ * Clawback assets from the incentive
580
+ *
581
+ * @public
582
+ * @async
583
+ * @param {ClaimPayload} payload
584
+ * @param {?WriteParams<typeof cgdaIncentiveAbi, 'clawback'>} [params]
585
+ * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
586
+ */
587
+ clawback(payload: ClaimPayload, params?: WriteParams<typeof cgdaIncentiveAbi, 'clawback'>): Promise<boolean>;
588
+ /**
589
+ * Clawback assets from the incentive
590
+ *
591
+ * @public
592
+ * @async
593
+ * @param {ClaimPayload} payload
594
+ * @param {?WriteParams<typeof cgdaIncentiveAbi, 'clawback'>} [params]
595
+ * @returns {Promise<boolean>} - True if the assets were successfully clawbacked
596
+ */
597
+ clawbackRaw(payload: ClaimPayload, params?: WriteParams<typeof cgdaIncentiveAbi, 'clawback'>): Promise<{
598
+ hash: `0x${string}`;
599
+ result: boolean;
600
+ }>;
601
+ /**
602
+ * Check if an incentive is claimable
603
+ *
604
+ * @public
605
+ * @async
606
+ * @param {ClaimPayload} payload
607
+ * @param {?ReadParams<typeof cgdaIncentiveAbi, 'isClaimable'>} [params]
608
+ * @returns {Promise<boolean>} - True if the incentive is claimable based on the data payload
609
+ */
610
+ isClaimable(payload: ClaimPayload, params?: ReadParams<typeof cgdaIncentiveAbi, 'isClaimable'>): Promise<boolean>;
611
+ /**
612
+ * Calculates the current reward based on the time since the last claim.
613
+ * The reward is calculated based on the time since the last claim, the available budget, and the reward parameters. It increases linearly over time in the absence of claims, with each hour adding `rewardBoost` to the current reward, up to the available budget.
614
+ * For example, if there is one claim in the first hour, then no claims for three hours, the claimable reward would be `initialReward - rewardDecay + (rewardBoost * 3)`
615
+ *
616
+ * @public
617
+ * @async
618
+ * @param {?ReadParams<typeof cgdaIncentiveAbi, 'currentReward'>} [params]
619
+ * @returns {Promise<bigint>} - The current reward
620
+ */
621
+ currentReward(params?: ReadParams<typeof cgdaIncentiveAbi, 'currentReward'>): Promise<bigint>;
622
+ /**
623
+ * @inheritdoc
624
+ *
625
+ * @public
626
+ * @param {?CGDAIncentivePayload} [_payload]
627
+ * @param {?DeployableOptions} [_options]
628
+ * @returns {GenericDeployableParams}
629
+ */
630
+ buildParameters(_payload?: CGDAIncentivePayload, _options?: DeployableOptions): GenericDeployableParams;
631
+ }
632
+ /**
633
+ * Given a {@link CGDAIncentivePayload}, properly encode a `CGDAIncentive.InitPayload` for use with {@link CGDAIncentive} initialization.
634
+ *
635
+ * @param {CGDAIncentivePayload} param0
636
+ * @param {Address} param0.asset - The address of the ERC20-like token
637
+ * @param {bigint} param0.initialReward - The initial reward amount
638
+ * @param {bigint} param0.rewardDecay - The amount to subtract from the current reward after each claim
639
+ * @param {bigint} param0.rewardBoost - The amount by which the reward increases for each hour without a claim (continuous linear increase)
640
+ * @param {bigint} param0.totalBudget - The total budget for the incentive
641
+ * @returns {Hex}
642
+ */
643
+ export declare function prepareCGDAIncentivePayload({ asset, initialReward, rewardDecay, rewardBoost, totalBudget, }: CGDAIncentivePayload): `0x${string}`;
644
+ //# sourceMappingURL=CGDAIncentive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CGDAIncentive.d.ts","sourceRoot":"","sources":["../../src/Incentives/CGDAIncentive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAcjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAGvB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW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