@boostxyz/sdk 0.0.0-alpha.16 → 0.0.0-alpha.18
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/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.cjs.map +1 -1
- package/dist/Actions/Action.js +7 -7
- package/dist/Actions/ContractAction.d.ts +9 -9
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +12 -12
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +32 -49
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +13 -779
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.cjs.map +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/OpenAllowList.d.ts +183 -0
- package/dist/AllowLists/OpenAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +82 -36
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +44 -80
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.d.ts +192 -9
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +5 -5
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.d.ts +18 -0
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore-BiPwp6SR.cjs +3 -0
- package/dist/BoostCore-BiPwp6SR.cjs.map +1 -0
- package/dist/BoostCore-C00iqvks.js +1477 -0
- package/dist/BoostCore-C00iqvks.js.map +1 -0
- package/dist/BoostCore.cjs +1 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +80 -35
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +29 -1273
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.cjs.map +1 -1
- package/dist/BoostRegistry.d.ts +18 -18
- package/dist/BoostRegistry.js +36 -36
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.cjs.map +1 -1
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/Budget.js.map +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +24 -174
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +76 -298
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +181 -77
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Contract.cjs +1 -1
- package/dist/Deployable/Contract.cjs.map +1 -1
- package/dist/Deployable/Contract.d.ts +4 -5
- package/dist/Deployable/Contract.d.ts.map +1 -1
- package/dist/Deployable/Contract.js +4 -5
- package/dist/Deployable/Contract.js.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +1 -1
- package/dist/Deployable/Deployable.js +1 -1
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -1
- package/dist/Deployable/DeployableTarget.d.ts +5 -5
- package/dist/Deployable/DeployableTarget.js +10 -10
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
- package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
- package/dist/EventAction-BO5WI_5s.js +1355 -0
- package/dist/EventAction-BO5WI_5s.js.map +1 -0
- package/dist/EventAction-DBDRaG4A.cjs +2 -0
- package/dist/EventAction-DBDRaG4A.cjs.map +1 -0
- package/dist/{Incentive-CtuAJAjG.js → Incentive-CF7kaz_9.js} +67 -68
- package/dist/Incentive-CF7kaz_9.js.map +1 -0
- package/dist/{Incentive-CqX3fYEd.cjs → Incentive-Djnzseoj.cjs} +2 -2
- package/dist/Incentive-Djnzseoj.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +12 -12
- package/dist/Incentives/AllowListIncentive.js +26 -26
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts +15 -15
- package/dist/Incentives/CGDAIncentive.js +25 -25
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC1155Incentive.d.ts +30 -30
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.d.ts +23 -23
- package/dist/Incentives/ERC20Incentive.js +45 -45
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts +523 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +19 -19
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +3 -3
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +3 -3
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.d.ts +14 -14
- package/dist/Incentives/PointsIncentive.js +20 -20
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-BwfNjRsg.cjs +2 -0
- package/dist/SimpleDenyList-BwfNjRsg.cjs.map +1 -0
- package/dist/SimpleDenyList-D9i4rw_F.js +132 -0
- package/dist/SimpleDenyList-D9i4rw_F.js.map +1 -0
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.d.ts +14 -14
- package/dist/Validators/SignerValidator.js +25 -25
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.cjs.map +1 -1
- package/dist/Validators/Validator.d.ts +1 -1
- package/dist/Validators/Validator.js +6 -6
- package/dist/Validators/Validator.js.map +1 -1
- package/dist/claiming.cjs.map +1 -1
- package/dist/claiming.d.ts +1 -1
- package/dist/claiming.js.map +1 -1
- package/dist/componentInterfaces-D09mhzxO.cjs +2 -0
- package/dist/componentInterfaces-D09mhzxO.cjs.map +1 -0
- package/dist/componentInterfaces-RXBMI5yH.js +14 -0
- package/dist/componentInterfaces-RXBMI5yH.js.map +1 -0
- package/dist/deployments-BM42vImE.js +43 -0
- package/dist/deployments-BM42vImE.js.map +1 -0
- package/dist/deployments-CMdF5uEC.cjs +2 -0
- package/dist/deployments-CMdF5uEC.cjs.map +1 -0
- package/dist/deployments.json +15 -12
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +132 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +122 -36
- package/dist/errors.js.map +1 -1
- package/dist/generated-B0tk-c9b.cjs +3 -0
- package/dist/generated-B0tk-c9b.cjs.map +1 -0
- package/dist/{generated-DLMdMwD1.js → generated-B8VWObPa.js} +2350 -1290
- package/dist/generated-B8VWObPa.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +134 -122
- package/dist/index.js.map +1 -1
- package/dist/transfers.cjs.map +1 -1
- package/dist/transfers.d.ts +1 -1
- package/dist/transfers.js.map +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +12 -5
- package/src/Actions/ContractAction.ts +9 -10
- package/src/Actions/ERC721MintAction.ts +12 -13
- package/src/Actions/EventAction.test.ts +182 -53
- package/src/Actions/EventAction.ts +128 -107
- package/src/AllowLists/SimpleAllowList.ts +14 -59
- package/src/AllowLists/SimpleDenyList.ts +12 -9
- package/src/Boost.ts +19 -0
- package/src/BoostCore.test.ts +117 -1
- package/src/BoostCore.ts +113 -54
- package/src/BoostRegistry.ts +18 -18
- package/src/Budgets/Budget.ts +1 -2
- package/src/Budgets/ManagedBudget.ts +21 -295
- package/src/Budgets/VestingBudget.ts +26 -97
- package/src/Deployable/Contract.ts +4 -5
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Deployable/DeployableTarget.ts +5 -5
- package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
- package/src/Incentives/AllowListIncentive.ts +12 -12
- package/src/Incentives/CGDAIncentive.ts +15 -15
- package/src/Incentives/ERC1155Incentive.ts +26 -26
- package/src/Incentives/ERC20Incentive.ts +23 -23
- package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +309 -0
- package/src/Incentives/ERC20VariableIncentive.ts +19 -19
- package/src/Incentives/Incentive.ts +6 -5
- package/src/Incentives/PointsIncentive.test.ts +21 -21
- package/src/Incentives/PointsIncentive.ts +14 -14
- package/src/Validators/SignerValidator.ts +14 -14
- package/src/Validators/Validator.ts +1 -1
- package/src/claiming.ts +1 -1
- package/src/errors.ts +165 -0
- package/src/index.test.ts +3 -4
- package/src/index.ts +2 -0
- package/src/transfers.ts +1 -1
- package/src/utils.ts +1 -1
- package/dist/Budgets/SimpleBudget.d.ts +0 -824
- package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
- package/dist/Incentive-CqX3fYEd.cjs.map +0 -1
- package/dist/Incentive-CtuAJAjG.js.map +0 -1
- package/dist/SimpleDenyList-9UIxZZKP.cjs +0 -2
- package/dist/SimpleDenyList-9UIxZZKP.cjs.map +0 -1
- package/dist/SimpleDenyList-DGPNc7ov.js +0 -132
- package/dist/SimpleDenyList-DGPNc7ov.js.map +0 -1
- package/dist/componentInterfaces-CKCBwG16.cjs +0 -2
- package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
- package/dist/componentInterfaces-Cmg8tUxq.js +0 -13
- package/dist/componentInterfaces-Cmg8tUxq.js.map +0 -1
- package/dist/deployments-BvFcK_eR.js +0 -40
- package/dist/deployments-BvFcK_eR.js.map +0 -1
- package/dist/deployments-Ho4PnGCS.cjs +0 -2
- package/dist/deployments-Ho4PnGCS.cjs.map +0 -1
- package/dist/generated-BLg7yPgI.cjs +0 -3
- package/dist/generated-BLg7yPgI.cjs.map +0 -1
- package/dist/generated-DLMdMwD1.js.map +0 -1
- package/src/Budgets/SimpleBudget.test.ts +0 -152
- package/src/Budgets/SimpleBudget.ts +0 -563
|
@@ -39,6 +39,7 @@ import type {
|
|
|
39
39
|
GenericDeployableParams,
|
|
40
40
|
} from '../Deployable/Deployable';
|
|
41
41
|
import { DeployableTarget } from '../Deployable/DeployableTarget';
|
|
42
|
+
import { DeployableTargetWithRBAC } from '../Deployable/DeployableTargetWithRBAC';
|
|
42
43
|
import {
|
|
43
44
|
DeployableUnknownOwnerProvidedError,
|
|
44
45
|
UnknownTransferPayloadSupplied,
|
|
@@ -148,7 +149,7 @@ export function isERC1155TransferPayload(
|
|
|
148
149
|
*
|
|
149
150
|
* @export
|
|
150
151
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
151
|
-
* @returns {
|
|
152
|
+
* @returns {Hex}
|
|
152
153
|
* @throws {@link UnknownTransferPayloadSupplied}
|
|
153
154
|
*/
|
|
154
155
|
export function prepareTransfer(
|
|
@@ -170,9 +171,9 @@ export function prepareTransfer(
|
|
|
170
171
|
* @export
|
|
171
172
|
* @class ManagedBudget
|
|
172
173
|
* @typedef {ManagedBudget}
|
|
173
|
-
* @extends {
|
|
174
|
+
* @extends {DeployableTargetWithRBAC<ManagedBudgetPayload>}
|
|
174
175
|
*/
|
|
175
|
-
export class ManagedBudget extends
|
|
176
|
+
export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
176
177
|
ManagedBudgetPayload,
|
|
177
178
|
typeof managedBudgetAbi
|
|
178
179
|
> {
|
|
@@ -211,7 +212,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
211
212
|
* @public
|
|
212
213
|
* @async
|
|
213
214
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
214
|
-
* @param {?WriteParams
|
|
215
|
+
* @param {?WriteParams} [params]
|
|
215
216
|
* @returns {Promise<boolean>} - True if the allocation was successful
|
|
216
217
|
*/
|
|
217
218
|
public async allocate(
|
|
@@ -229,8 +230,8 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
229
230
|
* @public
|
|
230
231
|
* @async
|
|
231
232
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
232
|
-
* @param {?WriteParams
|
|
233
|
-
* @returns {Promise<boolean>} - True if the allocation was successful
|
|
233
|
+
* @param {?WriteParams} [params]
|
|
234
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the allocation was successful
|
|
234
235
|
*/
|
|
235
236
|
public async allocateRaw(
|
|
236
237
|
transfer: FungibleTransferPayload | ERC1155TransferPayload,
|
|
@@ -259,7 +260,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
259
260
|
* @public
|
|
260
261
|
* @async
|
|
261
262
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
262
|
-
* @param {?WriteParams
|
|
263
|
+
* @param {?WriteParams} [params]
|
|
263
264
|
* @returns {Promise<boolean>} - True if the request was successful
|
|
264
265
|
*/
|
|
265
266
|
public async clawback(
|
|
@@ -278,8 +279,8 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
278
279
|
* @public
|
|
279
280
|
* @async
|
|
280
281
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
281
|
-
* @param {?WriteParams
|
|
282
|
-
* @returns {Promise<boolean>} - True if the request was successful
|
|
282
|
+
* @param {?WriteParams} [params]
|
|
283
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the request was successful
|
|
283
284
|
*/
|
|
284
285
|
public async clawbackRaw(
|
|
285
286
|
transfer: FungibleTransferPayload | ERC1155TransferPayload,
|
|
@@ -306,7 +307,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
306
307
|
* @public
|
|
307
308
|
* @async
|
|
308
309
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
309
|
-
* @param {?WriteParams
|
|
310
|
+
* @param {?WriteParams} [params]
|
|
310
311
|
* @returns {Promise<boolean>} - True if the disbursement was successful
|
|
311
312
|
*/
|
|
312
313
|
public async disburse(
|
|
@@ -323,8 +324,8 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
323
324
|
* @public
|
|
324
325
|
* @async
|
|
325
326
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
326
|
-
* @param {?WriteParams
|
|
327
|
-
* @returns {Promise<boolean>} - True if the disbursement was successful
|
|
327
|
+
* @param {?WriteParams} [params]
|
|
328
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the disbursement was successful
|
|
328
329
|
*/
|
|
329
330
|
public async disburseRaw(
|
|
330
331
|
transfer: FungibleTransferPayload | ERC1155TransferPayload,
|
|
@@ -350,7 +351,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
350
351
|
* @public
|
|
351
352
|
* @async
|
|
352
353
|
* @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers
|
|
353
|
-
* @param {?WriteParams
|
|
354
|
+
* @param {?WriteParams} [params]
|
|
354
355
|
* @returns {Promise<boolean>} - True if all disbursements were successful
|
|
355
356
|
*/
|
|
356
357
|
public async disburseBatch(
|
|
@@ -366,8 +367,8 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
366
367
|
* @public
|
|
367
368
|
* @async
|
|
368
369
|
* @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers
|
|
369
|
-
* @param {?WriteParams
|
|
370
|
-
* @returns {Promise<boolean>} - True if all disbursements were successful
|
|
370
|
+
* @param {?WriteParams} [params]
|
|
371
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if all disbursements were successful
|
|
371
372
|
*/
|
|
372
373
|
public async disburseBatchRaw(
|
|
373
374
|
transfers: Array<FungibleTransferPayload | ERC1155TransferPayload>,
|
|
@@ -387,286 +388,11 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
387
388
|
return { hash, result };
|
|
388
389
|
}
|
|
389
390
|
|
|
390
|
-
/**
|
|
391
|
-
* Set the authorized status of the given accounts
|
|
392
|
-
* The mechanism for managing authorization is left to the implementing contract
|
|
393
|
-
*
|
|
394
|
-
* @public
|
|
395
|
-
* @async
|
|
396
|
-
* @param {Address[]} addresses - The accounts to authorize or deauthorize
|
|
397
|
-
* @param {boolean[]} allowed - The authorization status for the given accounts
|
|
398
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'setAuthorized'>} [params]
|
|
399
|
-
* @returns {Promise<void>}
|
|
400
|
-
*/
|
|
401
|
-
public async setAuthorized(
|
|
402
|
-
addresses: Address[],
|
|
403
|
-
allowed: boolean[],
|
|
404
|
-
params?: WriteParams<typeof managedBudgetAbi, 'setAuthorized'>,
|
|
405
|
-
) {
|
|
406
|
-
return await this.awaitResult(
|
|
407
|
-
this.setAuthorizedRaw(addresses, allowed, params),
|
|
408
|
-
);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Set the authorized status of the given accounts
|
|
413
|
-
* The mechanism for managing authorization is left to the implementing contract
|
|
414
|
-
*
|
|
415
|
-
* @public
|
|
416
|
-
* @async
|
|
417
|
-
* @param {Address[]} addresses - The accounts to authorize or deauthorize
|
|
418
|
-
* @param {boolean[]} allowed - The authorization status for the given accounts
|
|
419
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'setAuthorized'>} [params]
|
|
420
|
-
* @returns {Promise<void>}
|
|
421
|
-
*/
|
|
422
|
-
public async setAuthorizedRaw(
|
|
423
|
-
addresses: Address[],
|
|
424
|
-
allowed: boolean[],
|
|
425
|
-
params?: WriteParams<typeof managedBudgetAbi, 'setAuthorized'>,
|
|
426
|
-
) {
|
|
427
|
-
const { request, result } = await simulateManagedBudgetSetAuthorized(
|
|
428
|
-
this._config,
|
|
429
|
-
{
|
|
430
|
-
address: this.assertValidAddress(),
|
|
431
|
-
args: [addresses, allowed],
|
|
432
|
-
...this.optionallyAttachAccount(),
|
|
433
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
434
|
-
...(params as any),
|
|
435
|
-
},
|
|
436
|
-
);
|
|
437
|
-
const hash = await writeManagedBudgetSetAuthorized(this._config, request);
|
|
438
|
-
return { hash, result };
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Grant many accounts permissions on the budget.
|
|
443
|
-
*
|
|
444
|
-
* @example
|
|
445
|
-
* ```ts
|
|
446
|
-
* await budget.grantRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])
|
|
447
|
-
* ```
|
|
448
|
-
* @public
|
|
449
|
-
* @async
|
|
450
|
-
* @param {Address[]} addresses
|
|
451
|
-
* @param {ManagedBudgetRoles[]} roles
|
|
452
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'grantRoles'>} [params]
|
|
453
|
-
* @returns {unknown}
|
|
454
|
-
*/
|
|
455
|
-
public async grantRoles(
|
|
456
|
-
addresses: Address[],
|
|
457
|
-
roles: ManagedBudgetRoles[],
|
|
458
|
-
params?: WriteParams<typeof managedBudgetAbi, 'grantRoles'>,
|
|
459
|
-
) {
|
|
460
|
-
return await this.awaitResult(this.grantRolesRaw(addresses, roles, params));
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* Grant many accounts permissions on the budget.
|
|
465
|
-
*
|
|
466
|
-
* @example
|
|
467
|
-
* ```ts
|
|
468
|
-
* await budget.grantRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])
|
|
469
|
-
*
|
|
470
|
-
* @public
|
|
471
|
-
* @async
|
|
472
|
-
* @param {Address[]} addresses
|
|
473
|
-
* @param {ManagedBudgetRoles[]} roles
|
|
474
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'grantRoles'>} [params]
|
|
475
|
-
* @returns {unknown}
|
|
476
|
-
*/
|
|
477
|
-
public async grantRolesRaw(
|
|
478
|
-
addresses: Address[],
|
|
479
|
-
roles: ManagedBudgetRoles[],
|
|
480
|
-
params?: WriteParams<typeof managedBudgetAbi, 'grantRoles'>,
|
|
481
|
-
) {
|
|
482
|
-
const { request, result } = await simulateManagedBudgetGrantRoles(
|
|
483
|
-
this._config,
|
|
484
|
-
{
|
|
485
|
-
address: this.assertValidAddress(),
|
|
486
|
-
args: [addresses, roles],
|
|
487
|
-
...this.optionallyAttachAccount(),
|
|
488
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
489
|
-
...(params as any),
|
|
490
|
-
},
|
|
491
|
-
);
|
|
492
|
-
const hash = await writeManagedBudgetGrantRoles(
|
|
493
|
-
this._config,
|
|
494
|
-
// biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection
|
|
495
|
-
request as any,
|
|
496
|
-
);
|
|
497
|
-
return { hash, result };
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Revoke many accounts' permissions on the budget.
|
|
502
|
-
*
|
|
503
|
-
* @example
|
|
504
|
-
* ```ts
|
|
505
|
-
* await budget.revokeRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])
|
|
506
|
-
*
|
|
507
|
-
* @public
|
|
508
|
-
* @async
|
|
509
|
-
* @param {Address[]} addresses
|
|
510
|
-
* @param {ManagedBudgetRoles[]} roles
|
|
511
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'revokeRoles'>} [params]
|
|
512
|
-
* @returns {unknown}
|
|
513
|
-
*/
|
|
514
|
-
public async revokeRoles(
|
|
515
|
-
addresses: Address[],
|
|
516
|
-
roles: ManagedBudgetRoles[],
|
|
517
|
-
params?: WriteParams<typeof managedBudgetAbi, 'revokeRoles'>,
|
|
518
|
-
) {
|
|
519
|
-
return await this.awaitResult(
|
|
520
|
-
this.revokeRolesRaw(addresses, roles, params),
|
|
521
|
-
);
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* Revoke many accounts' permissions on the budget.
|
|
526
|
-
*
|
|
527
|
-
* @example
|
|
528
|
-
* ```ts
|
|
529
|
-
* await budget.revokeRoles(['0xfoo', '0xbar], [ManagedBudgetRoles.MANAGER, ManagedBudgetRoles.ADMIN])
|
|
530
|
-
* @public
|
|
531
|
-
* @async
|
|
532
|
-
* @param {Address[]} addresses
|
|
533
|
-
* @param {ManagedBudgetRoles[]} roles
|
|
534
|
-
* @param {?WriteParams<typeof managedBudgetAbi, 'revokeRoles'>} [params]
|
|
535
|
-
* @returns {unknown}
|
|
536
|
-
*/
|
|
537
|
-
public async revokeRolesRaw(
|
|
538
|
-
addresses: Address[],
|
|
539
|
-
roles: ManagedBudgetRoles[],
|
|
540
|
-
params?: WriteParams<typeof managedBudgetAbi, 'revokeRoles'>,
|
|
541
|
-
) {
|
|
542
|
-
const { request, result } = await simulateManagedBudgetRevokeRoles(
|
|
543
|
-
this._config,
|
|
544
|
-
{
|
|
545
|
-
address: this.assertValidAddress(),
|
|
546
|
-
args: [addresses, roles],
|
|
547
|
-
...this.optionallyAttachAccount(),
|
|
548
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
549
|
-
...(params as any),
|
|
550
|
-
},
|
|
551
|
-
);
|
|
552
|
-
const hash = await writeManagedBudgetRevokeRoles(
|
|
553
|
-
this._config,
|
|
554
|
-
// biome-ignore lint/suspicious/noExplicitAny: negligible low level lack of type intersection
|
|
555
|
-
request as any,
|
|
556
|
-
);
|
|
557
|
-
return { hash, result };
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
/**
|
|
561
|
-
* Return an array of the roles assigned to the given account.
|
|
562
|
-
* @example
|
|
563
|
-
* ```ts
|
|
564
|
-
* (await budget.rolesOf(0xfoo)).includes(ManagedBudgetRoles.ADMIN)
|
|
565
|
-
* @public
|
|
566
|
-
* @param {Address} account
|
|
567
|
-
* @param {?ReadParams<typeof managedBudgetAbi, 'rolesOf'>} [params]
|
|
568
|
-
* @returns {Promise<Array<ManagedBudgetRoles>>}
|
|
569
|
-
*/
|
|
570
|
-
public async rolesOf(
|
|
571
|
-
account: Address,
|
|
572
|
-
params?: ReadParams<typeof managedBudgetAbi, 'rolesOf'>,
|
|
573
|
-
) {
|
|
574
|
-
const roles = await readManagedBudgetRolesOf(this._config, {
|
|
575
|
-
address: this.assertValidAddress(),
|
|
576
|
-
args: [account],
|
|
577
|
-
...this.optionallyAttachAccount(),
|
|
578
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
579
|
-
...(params as any),
|
|
580
|
-
});
|
|
581
|
-
return (
|
|
582
|
-
[
|
|
583
|
-
ManagedBudgetRoles.MANAGER,
|
|
584
|
-
ManagedBudgetRoles.ADMIN,
|
|
585
|
-
] as unknown as Array<bigint>
|
|
586
|
-
).filter(
|
|
587
|
-
(role) => (roles & role) === role,
|
|
588
|
-
) as unknown as ManagedBudgetRoles[];
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
/**
|
|
592
|
-
* Returns whether given account has any of the provided roles bitmap.
|
|
593
|
-
*
|
|
594
|
-
* @example
|
|
595
|
-
* ```ts
|
|
596
|
-
* await budget.hasAnyRole(0xfoo, ManagedBudgetRoles.ADMIN | ManagedBudgetRoles.MANAGER)
|
|
597
|
-
* @public
|
|
598
|
-
* @param {Address} account
|
|
599
|
-
* @param {ManagedBudgetRoles} roles
|
|
600
|
-
* @param {?ReadParams<typeof managedBudgetAbi, 'hasAnyRole'>} [params]
|
|
601
|
-
* @returns {Promise<boolean>}
|
|
602
|
-
*/
|
|
603
|
-
public hasAnyRole(
|
|
604
|
-
account: Address,
|
|
605
|
-
roles: ManagedBudgetRoles,
|
|
606
|
-
params?: ReadParams<typeof managedBudgetAbi, 'hasAnyRole'>,
|
|
607
|
-
) {
|
|
608
|
-
return readManagedBudgetHasAnyRole(this._config, {
|
|
609
|
-
address: this.assertValidAddress(),
|
|
610
|
-
args: [account, roles],
|
|
611
|
-
...this.optionallyAttachAccount(),
|
|
612
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
613
|
-
...(params as any),
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* Returns whether given account has all of the provided roles bitmap.
|
|
619
|
-
*
|
|
620
|
-
* @example
|
|
621
|
-
* ```ts
|
|
622
|
-
* await budget.hasAllRoles(0xfoo, ManagedBudgetRoles.ADMIN & ManagedBudgetRoles.MANAGER)
|
|
623
|
-
*
|
|
624
|
-
* @public
|
|
625
|
-
* @param {Address} account
|
|
626
|
-
* @param {ManagedBudgetRoles} roles
|
|
627
|
-
* @param {?ReadParams<typeof managedBudgetAbi, 'hasAllRoles'>} [params]
|
|
628
|
-
* @returns {*}
|
|
629
|
-
*/
|
|
630
|
-
public hasAllRoles(
|
|
631
|
-
account: Address,
|
|
632
|
-
roles: ManagedBudgetRoles,
|
|
633
|
-
params?: ReadParams<typeof managedBudgetAbi, 'hasAllRoles'>,
|
|
634
|
-
) {
|
|
635
|
-
return readManagedBudgetHasAllRoles(this._config, {
|
|
636
|
-
address: this.assertValidAddress(),
|
|
637
|
-
args: [account, roles],
|
|
638
|
-
...this.optionallyAttachAccount(),
|
|
639
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
640
|
-
...(params as any),
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
/**
|
|
645
|
-
* Check if the given account is authorized to use the budget
|
|
646
|
-
*
|
|
647
|
-
* @public
|
|
648
|
-
* @param {Address} account
|
|
649
|
-
* @param {?ReadParams<typeof managedBudgetAbi, 'isAuthorized'>} [params]
|
|
650
|
-
* @returns {Promise<boolean>} - True if the account is authorized
|
|
651
|
-
*/
|
|
652
|
-
public isAuthorized(
|
|
653
|
-
account: Address,
|
|
654
|
-
params?: ReadParams<typeof managedBudgetAbi, 'isAuthorized'>,
|
|
655
|
-
) {
|
|
656
|
-
return readManagedBudgetIsAuthorized(this._config, {
|
|
657
|
-
address: this.assertValidAddress(),
|
|
658
|
-
args: [account],
|
|
659
|
-
...this.optionallyAttachAccount(),
|
|
660
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
661
|
-
...(params as any),
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
|
|
665
391
|
/**
|
|
666
392
|
* Get the owner of the budget
|
|
667
393
|
*
|
|
668
394
|
* @public
|
|
669
|
-
* @param {?ReadParams
|
|
395
|
+
* @param {?ReadParams} [params]
|
|
670
396
|
* @returns {Promise<Address>}
|
|
671
397
|
*/
|
|
672
398
|
public owner(params?: ReadParams<typeof managedBudgetAbi, 'owner'>) {
|
|
@@ -685,7 +411,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
685
411
|
* @public
|
|
686
412
|
* @param {Address} [asset="0x0000000000000000000000000000000000000000"] - The address of the asset
|
|
687
413
|
* @param {?(bigint | undefined)} [tokenId] - The ID of the token
|
|
688
|
-
* @param {?ReadParams
|
|
414
|
+
* @param {?ReadParams} [params]
|
|
689
415
|
* @returns {Promise<bigint>} - The total amount of assets
|
|
690
416
|
*/
|
|
691
417
|
public total(
|
|
@@ -708,7 +434,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
708
434
|
* @public
|
|
709
435
|
* @param {Address} [asset="0x0000000000000000000000000000000000000000"]
|
|
710
436
|
* @param {?(bigint | undefined)} [tokenId]
|
|
711
|
-
* @param {?ReadParams
|
|
437
|
+
* @param {?ReadParams} [params]
|
|
712
438
|
* @returns {Promise<bigint>} - The amount of assets available
|
|
713
439
|
*/
|
|
714
440
|
public available(
|
|
@@ -731,7 +457,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
731
457
|
* @public
|
|
732
458
|
* @param {Address} [asset="0x0000000000000000000000000000000000000000"]
|
|
733
459
|
* @param {?(bigint | undefined)} [tokenId]
|
|
734
|
-
* @param {?ReadParams
|
|
460
|
+
* @param {?ReadParams} [params]
|
|
735
461
|
* @returns {Promise<bigint>} - The amount of assets distributed
|
|
736
462
|
*/
|
|
737
463
|
public distributed(
|
|
@@ -791,7 +517,7 @@ export class ManagedBudget extends DeployableTarget<
|
|
|
791
517
|
* @param {Address} param0.owner - The budget's owner
|
|
792
518
|
* @param {{}} param0.authorized - List of accounts authorized to use the budget. This list should include a Boost core address to interact with the protocol.
|
|
793
519
|
* @param {{}} param0.roles - List of roles to assign to the corresponding account by index.
|
|
794
|
-
* @returns {
|
|
520
|
+
* @returns {Hex}
|
|
795
521
|
*/
|
|
796
522
|
export const prepareManagedBudgetPayload = ({
|
|
797
523
|
owner,
|
|
@@ -34,7 +34,7 @@ import type {
|
|
|
34
34
|
DeployableOptions,
|
|
35
35
|
GenericDeployableParams,
|
|
36
36
|
} from '../Deployable/Deployable';
|
|
37
|
-
import {
|
|
37
|
+
import { DeployableTargetWithRBAC } from '../Deployable/DeployableTargetWithRBAC';
|
|
38
38
|
import { DeployableUnknownOwnerProvidedError } from '../errors';
|
|
39
39
|
import {
|
|
40
40
|
type FungibleTransferPayload,
|
|
@@ -115,9 +115,9 @@ export type VestingBudgetLog<
|
|
|
115
115
|
* @export
|
|
116
116
|
* @class VestingBudget
|
|
117
117
|
* @typedef {VestingBudget}
|
|
118
|
-
* @extends {
|
|
118
|
+
* @extends {DeployableTargetWithRBAC<VestingBudgetPayload>}
|
|
119
119
|
*/
|
|
120
|
-
export class VestingBudget extends
|
|
120
|
+
export class VestingBudget extends DeployableTargetWithRBAC<
|
|
121
121
|
VestingBudgetPayload,
|
|
122
122
|
typeof vestingBudgetAbi
|
|
123
123
|
> {
|
|
@@ -143,7 +143,7 @@ export class VestingBudget extends DeployableTarget<
|
|
|
143
143
|
* Get the owner of the budget
|
|
144
144
|
*
|
|
145
145
|
* @public
|
|
146
|
-
* @param {?ReadParams
|
|
146
|
+
* @param {?ReadParams} [params]
|
|
147
147
|
* @returns {Promise<Address>}
|
|
148
148
|
*/
|
|
149
149
|
public owner(params?: ReadParams<typeof vestingBudgetAbi, 'owner'>) {
|
|
@@ -159,8 +159,8 @@ export class VestingBudget extends DeployableTarget<
|
|
|
159
159
|
* The timestamp at which the vesting schedule begins
|
|
160
160
|
*
|
|
161
161
|
* @public
|
|
162
|
-
* @param {?ReadParams
|
|
163
|
-
* @returns {
|
|
162
|
+
* @param {?ReadParams} [params]
|
|
163
|
+
* @returns {Promise<bigint>}
|
|
164
164
|
*/
|
|
165
165
|
public start(params?: ReadParams<typeof vestingBudgetAbi, 'start'>) {
|
|
166
166
|
return readVestingBudgetStart(this._config, {
|
|
@@ -175,8 +175,8 @@ export class VestingBudget extends DeployableTarget<
|
|
|
175
175
|
* The duration of the vesting schedule (in seconds)
|
|
176
176
|
*
|
|
177
177
|
* @public
|
|
178
|
-
* @param {?ReadParams
|
|
179
|
-
* @returns {
|
|
178
|
+
* @param {?ReadParams} [params]
|
|
179
|
+
* @returns {Promise<bigint>}
|
|
180
180
|
*/
|
|
181
181
|
public duration(params?: ReadParams<typeof vestingBudgetAbi, 'duration'>) {
|
|
182
182
|
return readVestingBudgetDuration(this._config, {
|
|
@@ -191,8 +191,8 @@ export class VestingBudget extends DeployableTarget<
|
|
|
191
191
|
* The duration of the cliff period (in seconds)
|
|
192
192
|
*
|
|
193
193
|
* @public
|
|
194
|
-
* @param {?ReadParams
|
|
195
|
-
* @returns {
|
|
194
|
+
* @param {?ReadParams} [params]
|
|
195
|
+
* @returns {Promise<bigint>}
|
|
196
196
|
*/
|
|
197
197
|
public cliff(params?: ReadParams<typeof vestingBudgetAbi, 'cliff'>) {
|
|
198
198
|
return readVestingBudgetCliff(this._config, {
|
|
@@ -211,7 +211,7 @@ export class VestingBudget extends DeployableTarget<
|
|
|
211
211
|
* @public
|
|
212
212
|
* @async
|
|
213
213
|
* @param {(FungibleTransferPayload)} transfer
|
|
214
|
-
* @param {?WriteParams
|
|
214
|
+
* @param {?WriteParams} [params]
|
|
215
215
|
* @returns {Promise<boolean>} - True if the allocation was successful
|
|
216
216
|
*/
|
|
217
217
|
public async allocate(
|
|
@@ -229,8 +229,8 @@ export class VestingBudget extends DeployableTarget<
|
|
|
229
229
|
* @public
|
|
230
230
|
* @async
|
|
231
231
|
* @param {(FungibleTransferPayload)} transfer
|
|
232
|
-
* @param {?WriteParams
|
|
233
|
-
* @returns {Promise<boolean>} - True if the allocation was successful
|
|
232
|
+
* @param {?WriteParams} [params]
|
|
233
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the allocation was successful
|
|
234
234
|
*/
|
|
235
235
|
public async allocateRaw(
|
|
236
236
|
transfer: FungibleTransferPayload,
|
|
@@ -259,7 +259,7 @@ export class VestingBudget extends DeployableTarget<
|
|
|
259
259
|
* @public
|
|
260
260
|
* @async
|
|
261
261
|
* @param {(FungibleTransferPayload)} transfer
|
|
262
|
-
* @param {?WriteParams
|
|
262
|
+
* @param {?WriteParams} [params]
|
|
263
263
|
* @returns {Promise<boolean>} - True if the request was successful
|
|
264
264
|
*/
|
|
265
265
|
public async clawback(
|
|
@@ -278,8 +278,8 @@ export class VestingBudget extends DeployableTarget<
|
|
|
278
278
|
* @public
|
|
279
279
|
* @async
|
|
280
280
|
* @param {(FungibleTransferPayload)} transfer
|
|
281
|
-
* @param {?WriteParams
|
|
282
|
-
* @returns {Promise<boolean>} - True if the request was successful
|
|
281
|
+
* @param {?WriteParams} [params]
|
|
282
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the request was successful
|
|
283
283
|
*/
|
|
284
284
|
public async clawbackRaw(
|
|
285
285
|
transfer: FungibleTransferPayload,
|
|
@@ -306,7 +306,7 @@ export class VestingBudget extends DeployableTarget<
|
|
|
306
306
|
* @public
|
|
307
307
|
* @async
|
|
308
308
|
* @param {(FungibleTransferPayload)} transfer
|
|
309
|
-
* @param {?WriteParams
|
|
309
|
+
* @param {?WriteParams} [params]
|
|
310
310
|
* @returns {Promise<boolean>} - True if the disbursement was successful
|
|
311
311
|
*/
|
|
312
312
|
public async disburse(
|
|
@@ -323,8 +323,8 @@ export class VestingBudget extends DeployableTarget<
|
|
|
323
323
|
* @public
|
|
324
324
|
* @async
|
|
325
325
|
* @param {(FungibleTransferPayload)} transfer
|
|
326
|
-
* @param {?WriteParams
|
|
327
|
-
* @returns {Promise<boolean>} - True if the disbursement was successful
|
|
326
|
+
* @param {?WriteParams} [params]
|
|
327
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if the disbursement was successful
|
|
328
328
|
*/
|
|
329
329
|
public async disburseRaw(
|
|
330
330
|
transfer: FungibleTransferPayload,
|
|
@@ -350,7 +350,7 @@ export class VestingBudget extends DeployableTarget<
|
|
|
350
350
|
* @public
|
|
351
351
|
* @async
|
|
352
352
|
* @param {Array<FungibleTransferPayload>} transfers
|
|
353
|
-
* @param {?WriteParams
|
|
353
|
+
* @param {?WriteParams} [params]
|
|
354
354
|
* @returns {Promise<boolean>} - True if all disbursements were successful
|
|
355
355
|
*/
|
|
356
356
|
public async disburseBatch(
|
|
@@ -366,8 +366,8 @@ export class VestingBudget extends DeployableTarget<
|
|
|
366
366
|
* @public
|
|
367
367
|
* @async
|
|
368
368
|
* @param {Array<FungibleTransferPayload>} transfers
|
|
369
|
-
* @param {?WriteParams
|
|
370
|
-
* @returns {Promise<boolean>} - True if all disbursements were successful
|
|
369
|
+
* @param {?WriteParams} [params]
|
|
370
|
+
* @returns {Promise<{ hash: `0x${string}`; result: boolean; }>} - True if all disbursements were successful
|
|
371
371
|
*/
|
|
372
372
|
public async disburseBatchRaw(
|
|
373
373
|
transfers: FungibleTransferPayload[],
|
|
@@ -387,82 +387,11 @@ export class VestingBudget extends DeployableTarget<
|
|
|
387
387
|
return { hash, result };
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
/**
|
|
391
|
-
* Set the authorized status of the given accounts
|
|
392
|
-
* The mechanism for managing authorization is left to the implementing contract
|
|
393
|
-
*
|
|
394
|
-
* @public
|
|
395
|
-
* @async
|
|
396
|
-
* @param {Address[]} addresses - The accounts to authorize or deauthorize
|
|
397
|
-
* @param {boolean[]} allowed - The authorization status for the given accounts
|
|
398
|
-
* @param {?WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>} [params]
|
|
399
|
-
* @returns {Promise<void>}
|
|
400
|
-
*/
|
|
401
|
-
public async setAuthorized(
|
|
402
|
-
addresses: Address[],
|
|
403
|
-
allowed: boolean[],
|
|
404
|
-
params?: WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>,
|
|
405
|
-
) {
|
|
406
|
-
return await this.awaitResult(
|
|
407
|
-
this.setAuthorizedRaw(addresses, allowed, params),
|
|
408
|
-
);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Set the authorized status of the given accounts
|
|
413
|
-
* The mechanism for managing authorization is left to the implementing contract
|
|
414
|
-
*
|
|
415
|
-
* @public
|
|
416
|
-
* @async
|
|
417
|
-
* @param {Address[]} addresses - The accounts to authorize or deauthorize
|
|
418
|
-
* @param {boolean[]} allowed - The authorization status for the given accounts
|
|
419
|
-
* @param {?WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>} [params]
|
|
420
|
-
* @returns {Promise<void>}
|
|
421
|
-
*/
|
|
422
|
-
public async setAuthorizedRaw(
|
|
423
|
-
addresses: Address[],
|
|
424
|
-
allowed: boolean[],
|
|
425
|
-
params?: WriteParams<typeof vestingBudgetAbi, 'setAuthorized'>,
|
|
426
|
-
) {
|
|
427
|
-
const { request, result } = await simulateVestingBudgetSetAuthorized(
|
|
428
|
-
this._config,
|
|
429
|
-
{
|
|
430
|
-
address: this.assertValidAddress(),
|
|
431
|
-
args: [addresses, allowed],
|
|
432
|
-
...this.optionallyAttachAccount(),
|
|
433
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
434
|
-
...(params as any),
|
|
435
|
-
},
|
|
436
|
-
);
|
|
437
|
-
const hash = await writeVestingBudgetSetAuthorized(this._config, request);
|
|
438
|
-
return { hash, result };
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Check if the given account is authorized to use the budget
|
|
443
|
-
*
|
|
444
|
-
* @public
|
|
445
|
-
* @param {Address} account
|
|
446
|
-
* @param {?ReadParams<typeof vestingBudgetAbi, 'isAuthorized'>} [params]
|
|
447
|
-
* @returns {Promise<boolean>} - True if the account is authorized
|
|
448
|
-
*/
|
|
449
|
-
public isAuthorized(
|
|
450
|
-
account: Address,
|
|
451
|
-
params?: ReadParams<typeof vestingBudgetAbi, 'isAuthorized'>,
|
|
452
|
-
) {
|
|
453
|
-
return readVestingBudgetIsAuthorized(this._config, {
|
|
454
|
-
address: this.assertValidAddress(),
|
|
455
|
-
args: [account],
|
|
456
|
-
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
457
|
-
...(params as any),
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
|
|
461
390
|
/**
|
|
462
391
|
* Get the end time of the vesting schedule
|
|
463
392
|
*
|
|
464
393
|
* @public
|
|
465
|
-
* @param {?ReadParams
|
|
394
|
+
* @param {?ReadParams} [params]
|
|
466
395
|
* @returns {Promise<bigint>}
|
|
467
396
|
*/
|
|
468
397
|
public end(params?: ReadParams<typeof vestingBudgetAbi, 'end'>) {
|
|
@@ -480,7 +409,7 @@ export class VestingBudget extends DeployableTarget<
|
|
|
480
409
|
*
|
|
481
410
|
* @public
|
|
482
411
|
* @param {Address} [asset="0x0000000000000000000000000000000000000000"] - The address of the asset (or the zero address for native assets)
|
|
483
|
-
* @param {?ReadParams
|
|
412
|
+
* @param {?ReadParams} [params]
|
|
484
413
|
* @returns {Promise<bigint>}
|
|
485
414
|
*/
|
|
486
415
|
public total(
|
|
@@ -501,7 +430,7 @@ export class VestingBudget extends DeployableTarget<
|
|
|
501
430
|
*
|
|
502
431
|
* @public
|
|
503
432
|
* @param {Address} [asset="0x0000000000000000000000000000000000000000"] - The address of the asset (or the zero address for native assets)
|
|
504
|
-
* @param {?ReadParams
|
|
433
|
+
* @param {?ReadParams} [params]
|
|
505
434
|
* @returns {Promise<bigint>} - The amount of assets currently available for distribution
|
|
506
435
|
*/
|
|
507
436
|
public available(
|
|
@@ -521,7 +450,7 @@ export class VestingBudget extends DeployableTarget<
|
|
|
521
450
|
*
|
|
522
451
|
* @public
|
|
523
452
|
* @param {Address} [asset="0x0000000000000000000000000000000000000000"]
|
|
524
|
-
* @param {?ReadParams
|
|
453
|
+
* @param {?ReadParams} [params]
|
|
525
454
|
* @returns {Promise<bigint>} - The amount of assets distributed
|
|
526
455
|
*/
|
|
527
456
|
public distributed(
|