@boostxyz/sdk 0.0.0-alpha.2
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.
- package/LICENSE +674 -0
- package/README.md +7 -0
- package/dist/Actions/Action.cjs +1 -0
- package/dist/Actions/Action.d.ts +31 -0
- package/dist/Actions/Action.d.ts.map +1 -0
- package/dist/Actions/Action.js +27 -0
- package/dist/Actions/ContractAction.d.ts +327 -0
- package/dist/Actions/ContractAction.d.ts.map +1 -0
- package/dist/Actions/ERC721MintAction.d.ts +486 -0
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -0
- package/dist/Actions/EventAction.cjs +1 -0
- package/dist/Actions/EventAction.d.ts +433 -0
- package/dist/Actions/EventAction.d.ts.map +1 -0
- package/dist/Actions/EventAction.js +211 -0
- package/dist/AllowLists/AllowList.cjs +1 -0
- package/dist/AllowLists/AllowList.d.ts +33 -0
- package/dist/AllowLists/AllowList.d.ts.map +1 -0
- package/dist/AllowLists/AllowList.js +28 -0
- package/dist/AllowLists/SimpleAllowList.cjs +1 -0
- package/dist/AllowLists/SimpleAllowList.d.ts +452 -0
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.js +138 -0
- package/dist/AllowLists/SimpleDenyList.cjs +1 -0
- package/dist/AllowLists/SimpleDenyList.d.ts +306 -0
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleDenyList.js +202 -0
- package/dist/Auth/Auth.cjs +1 -0
- package/dist/Auth/Auth.d.ts +10 -0
- package/dist/Auth/Auth.d.ts.map +1 -0
- package/dist/Auth/Auth.js +4 -0
- package/dist/Auth/PassthroughAuth.cjs +1 -0
- package/dist/Auth/PassthroughAuth.d.ts +51 -0
- package/dist/Auth/PassthroughAuth.d.ts.map +1 -0
- package/dist/Auth/PassthroughAuth.js +38 -0
- package/dist/Boost.cjs +1 -0
- package/dist/Boost.d.ts +142 -0
- package/dist/Boost.d.ts.map +1 -0
- package/dist/Boost.js +15 -0
- package/dist/BoostCore.cjs +2 -0
- package/dist/BoostCore.d.ts +460 -0
- package/dist/BoostCore.d.ts.map +1 -0
- package/dist/BoostCore.js +1105 -0
- package/dist/BoostRegistry.cjs +1 -0
- package/dist/BoostRegistry.d.ts +229 -0
- package/dist/BoostRegistry.d.ts.map +1 -0
- package/dist/BoostRegistry.js +250 -0
- package/dist/Budgets/Budget.cjs +1 -0
- package/dist/Budgets/Budget.d.ts +31 -0
- package/dist/Budgets/Budget.d.ts.map +1 -0
- package/dist/Budgets/Budget.js +27 -0
- package/dist/Budgets/ManagedBudget.cjs +1 -0
- package/dist/Budgets/ManagedBudget.d.ts +1065 -0
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -0
- package/dist/Budgets/ManagedBudget.js +498 -0
- package/dist/Budgets/SimpleBudget.d.ts +793 -0
- package/dist/Budgets/SimpleBudget.d.ts.map +1 -0
- package/dist/Budgets/VestingBudget.d.ts +726 -0
- package/dist/Budgets/VestingBudget.d.ts.map +1 -0
- package/dist/Deployable/Contract.cjs +1 -0
- package/dist/Deployable/Contract.d.ts +125 -0
- package/dist/Deployable/Contract.d.ts.map +1 -0
- package/dist/Deployable/Contract.js +149 -0
- package/dist/Deployable/Deployable.cjs +1 -0
- package/dist/Deployable/Deployable.d.ts +155 -0
- package/dist/Deployable/Deployable.d.ts.map +1 -0
- package/dist/Deployable/Deployable.js +124 -0
- package/dist/Deployable/DeployableTarget.cjs +1 -0
- package/dist/Deployable/DeployableTarget.d.ts +115 -0
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -0
- package/dist/Deployable/DeployableTarget.js +128 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -0
- package/dist/Incentives/AllowListIncentive.d.ts +483 -0
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -0
- package/dist/Incentives/AllowListIncentive.js +188 -0
- package/dist/Incentives/CGDAIncentive.cjs +1 -0
- package/dist/Incentives/CGDAIncentive.d.ts +560 -0
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -0
- package/dist/Incentives/CGDAIncentive.js +249 -0
- package/dist/Incentives/ERC1155Incentive.d.ts +652 -0
- package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20Incentive.cjs +1 -0
- package/dist/Incentives/ERC20Incentive.d.ts +622 -0
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20Incentive.js +292 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +545 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -0
- package/dist/Incentives/Incentive.cjs +1 -0
- package/dist/Incentives/Incentive.d.ts +39 -0
- package/dist/Incentives/Incentive.d.ts.map +1 -0
- package/dist/Incentives/Incentive.js +280 -0
- package/dist/Incentives/PointsIncentive.cjs +1 -0
- package/dist/Incentives/PointsIncentive.d.ts +615 -0
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -0
- package/dist/Incentives/PointsIncentive.js +197 -0
- package/dist/Validators/SignerValidator.cjs +1 -0
- package/dist/Validators/SignerValidator.d.ts +452 -0
- package/dist/Validators/SignerValidator.d.ts.map +1 -0
- package/dist/Validators/SignerValidator.js +167 -0
- package/dist/Validators/Validator.cjs +1 -0
- package/dist/Validators/Validator.d.ts +31 -0
- package/dist/Validators/Validator.d.ts.map +1 -0
- package/dist/Validators/Validator.js +25 -0
- package/dist/errors.cjs +1 -0
- package/dist/errors.d.ts +257 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +161 -0
- package/dist/generated-BaaleHW-.cjs +2 -0
- package/dist/generated-x_abr3Yv.js +6228 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1355 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +1454 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +643 -0
- package/package.json +197 -0
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,1454 @@
|
|
|
1
|
+
import { type Config, type ReadContractParameters, type WatchContractEventParameters, type WriteContractParameters } from '@wagmi/core';
|
|
2
|
+
import type { ExtractAbiEvent } from 'abitype';
|
|
3
|
+
import type { Abi, AbiEvent, Address, ContractEventName, ContractFunctionName, GetLogsParameters, Hash, Hex, Log, PrivateKeyAccount, WaitForTransactionReceiptParameters } from 'viem';
|
|
4
|
+
/**
|
|
5
|
+
* Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
|
|
6
|
+
* See (writeContract)[https://viem.sh/docs/contract/writeContract]
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @typedef {WriteParams}
|
|
10
|
+
* @template {Abi} abi
|
|
11
|
+
* @template {ContractFunctionName<abi>} functionName
|
|
12
|
+
*/
|
|
13
|
+
export type WriteParams<abi extends Abi, functionName extends ContractFunctionName<abi>> = Partial<Omit<WriteContractParameters<abi, functionName>, 'address' | 'args' | 'functionName' | 'abi'>>;
|
|
14
|
+
/**
|
|
15
|
+
* Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
|
|
16
|
+
* See (readContract)[https://viem.sh/docs/contract/readContract]
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @typedef {ReadParams}
|
|
20
|
+
* @template {Abi} abi
|
|
21
|
+
* @template {ContractFunctionName<abi>} functionName
|
|
22
|
+
*/
|
|
23
|
+
export type ReadParams<abi extends Abi, functionName extends ContractFunctionName<abi>> = Partial<Omit<ReadContractParameters<abi, functionName>, 'address' | 'args' | 'functionName' | 'abi'>>;
|
|
24
|
+
/**
|
|
25
|
+
* Helper type that encapsulates common `watchContractEvent` parameters without fields like `address`, and `abi` that are expected to be provided the SDK.
|
|
26
|
+
* See (watchContractEvent)[https://wagmi.sh/core/api/actions/watchContractEvent]
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
* @typedef {WatchParams}
|
|
30
|
+
* @template {Abi} abi
|
|
31
|
+
* @template {ContractEventName<abi> | undefined} [eventName=undefined]
|
|
32
|
+
*/
|
|
33
|
+
export type WatchParams<abi extends Abi, eventName extends ContractEventName<abi> | undefined = undefined> = Partial<Omit<WatchContractEventParameters<abi, eventName>, 'address' | 'abi'>>;
|
|
34
|
+
/**
|
|
35
|
+
* Helper type that encapsulates common `getLogs` parameters without fields like `address` that are expected to be provided the SDK.
|
|
36
|
+
* See (getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
* @typedef {GetLogsParams}
|
|
40
|
+
* @template {Abi} abi
|
|
41
|
+
* @template {ContractEventName<abi>} event
|
|
42
|
+
* @template {ExtractAbiEvent<abi, event>} [abiEvent=ExtractAbiEvent<abi, event>]
|
|
43
|
+
* @template {| readonly AbiEvent[]
|
|
44
|
+
* | readonly unknown[]
|
|
45
|
+
* | undefined} [abiEvents=abiEvent extends AbiEvent ? [abiEvent] : undefined]
|
|
46
|
+
*/
|
|
47
|
+
export type GetLogsParams<abi extends Abi, event extends ContractEventName<abi>, abiEvent extends ExtractAbiEvent<abi, event> = ExtractAbiEvent<abi, event>, abiEvents extends readonly AbiEvent[] | readonly unknown[] | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined> = Partial<Omit<GetLogsParameters<abiEvent, abiEvents>, 'address'>> & {
|
|
48
|
+
chainId?: number | undefined;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* A generic `viem.Log` event with typed `args` support via a given `Abi` and `ContractEventName`
|
|
52
|
+
*
|
|
53
|
+
* @export
|
|
54
|
+
* @typedef {GenericLog}
|
|
55
|
+
* @template {Abi} abi
|
|
56
|
+
* @template {ContractEventName<abi>} [event=ContractEventName<abi>]
|
|
57
|
+
*/
|
|
58
|
+
export type GenericLog<abi extends Abi, event extends ContractEventName<abi> = ContractEventName<abi>> = Log<bigint, number, false, ExtractAbiEvent<abi, event>, false>;
|
|
59
|
+
/**
|
|
60
|
+
* Helper utility to convert a string to a `bytes4` type
|
|
61
|
+
*
|
|
62
|
+
* @export
|
|
63
|
+
* @param {string} input
|
|
64
|
+
* @returns {Hex}
|
|
65
|
+
*/
|
|
66
|
+
export declare function bytes4(input: Hex): `0x${string}`;
|
|
67
|
+
/**
|
|
68
|
+
* Utility function to wait for a transaction receipt, and extract the contractAddress
|
|
69
|
+
*
|
|
70
|
+
* @export
|
|
71
|
+
* @async
|
|
72
|
+
* @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)
|
|
73
|
+
* @param {Promise<Hash>} hash - A transaction hash promise
|
|
74
|
+
* @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}
|
|
75
|
+
* @returns {unknown}
|
|
76
|
+
* @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received
|
|
77
|
+
*/
|
|
78
|
+
export declare function getDeployedContractAddress(config: Config, hash: Promise<Hash>, waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>): Promise<`0x${string}`>;
|
|
79
|
+
/**
|
|
80
|
+
* Utility type to encapsulate a transaction hash, and the simulated result prior to submitting the transaction.
|
|
81
|
+
*
|
|
82
|
+
* @export
|
|
83
|
+
* @typedef {HashAndSimulatedResult}
|
|
84
|
+
* @template [T=unknown]
|
|
85
|
+
*/
|
|
86
|
+
export type HashAndSimulatedResult<T = unknown> = {
|
|
87
|
+
hash: Hash;
|
|
88
|
+
result: T;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Helper function to wait for a transaction receipt given a hash promise.
|
|
92
|
+
*
|
|
93
|
+
* @export
|
|
94
|
+
* @async
|
|
95
|
+
* @template [Result=unknown]
|
|
96
|
+
* @param {WagmiConfig} config
|
|
97
|
+
* @param {Promise<HashAndSimulatedResult<Result>>} hashPromise
|
|
98
|
+
* @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]
|
|
99
|
+
* @returns {Promise<Result>}
|
|
100
|
+
*/
|
|
101
|
+
export declare function awaitResult<Result = unknown>(config: Config, hashPromise: Promise<HashAndSimulatedResult<Result>>, waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>): Promise<Result>;
|
|
102
|
+
/**
|
|
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.
|
|
150
|
+
*
|
|
151
|
+
* @export
|
|
152
|
+
* @enum {number}
|
|
153
|
+
*/
|
|
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
|
+
*/
|
|
566
|
+
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
|
+
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}`;
|
|
1454
|
+
//# sourceMappingURL=utils.d.ts.map
|