@boostxyz/sdk 0.0.0-alpha.17 → 0.0.0-alpha.19
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 +13 -13
- 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 -962
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +5 -5
- package/dist/AllowLists/SimpleAllowList.js +24 -24
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.d.ts +6 -6
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- 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-kwoUw7YE.js +1477 -0
- package/dist/BoostCore-kwoUw7YE.js.map +1 -0
- package/dist/BoostCore.cjs +1 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +86 -36
- 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 +25 -19
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +30 -29
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +18 -18
- package/dist/Budgets/ManagedBudget.js +48 -48
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +23 -23
- 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 +6 -6
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts +15 -15
- package/dist/Deployable/DeployableTargetWithRBAC.js +33 -33
- package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -1
- package/dist/EventAction-D5tnm00s.js +1355 -0
- package/dist/EventAction-D5tnm00s.js.map +1 -0
- package/dist/EventAction-DBDRaG4A.cjs +2 -0
- package/dist/EventAction-DBDRaG4A.cjs.map +1 -0
- package/dist/{Incentive-DJf-vdyL.js → Incentive-Bp8Sez7M.js} +61 -62
- package/dist/Incentive-Bp8Sez7M.js.map +1 -0
- package/dist/{Incentive-DNwROd1r.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 +19 -19
- 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 +18 -18
- 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 +25 -25
- 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 +21 -21
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/{SimpleDenyList-DMlUkmAn.cjs → SimpleDenyList-BwfNjRsg.cjs} +2 -2
- package/dist/SimpleDenyList-BwfNjRsg.cjs.map +1 -0
- package/dist/{SimpleDenyList-DvUvmOeE.js → SimpleDenyList-Cn5WpNn0.js} +9 -9
- package/dist/SimpleDenyList-Cn5WpNn0.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 +19 -19
- 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-C_7Jx3YG.js → generated-B7VaSah4.js} +631 -343
- package/dist/generated-B7VaSah4.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +135 -126
- 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 +5 -5
- package/src/Actions/ContractAction.ts +9 -10
- package/src/Actions/ERC721MintAction.ts +12 -13
- package/src/Actions/EventAction.test.ts +45 -54
- package/src/Actions/EventAction.ts +100 -100
- package/src/AllowLists/SimpleAllowList.ts +5 -5
- package/src/AllowLists/SimpleDenyList.ts +6 -6
- package/src/Boost.ts +19 -0
- package/src/BoostCore.test.ts +117 -1
- package/src/BoostCore.ts +121 -57
- package/src/BoostRegistry.ts +29 -21
- package/src/Budgets/ManagedBudget.ts +18 -18
- package/src/Budgets/VestingBudget.ts +23 -23
- 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 +15 -15
- 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 +117 -33
- package/src/index.ts +1 -0
- package/src/transfers.ts +1 -1
- package/src/utils.ts +1 -1
- package/dist/Incentive-DJf-vdyL.js.map +0 -1
- package/dist/Incentive-DNwROd1r.cjs.map +0 -1
- package/dist/SimpleDenyList-DMlUkmAn.cjs.map +0 -1
- package/dist/SimpleDenyList-DvUvmOeE.js.map +0 -1
- package/dist/componentInterfaces-BPVR_Ykd.js +0 -13
- package/dist/componentInterfaces-BPVR_Ykd.js.map +0 -1
- package/dist/componentInterfaces-BfppSIl4.cjs +0 -2
- package/dist/componentInterfaces-BfppSIl4.cjs.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-CMQ6ZC2_.cjs +0 -3
- package/dist/generated-CMQ6ZC2_.cjs.map +0 -1
- package/dist/generated-C_7Jx3YG.js.map +0 -1
package/src/BoostCore.ts
CHANGED
|
@@ -20,7 +20,12 @@ import {
|
|
|
20
20
|
writeBoostCoreSetProtocolFeeReceiver,
|
|
21
21
|
} from '@boostxyz/evm';
|
|
22
22
|
import { bytecode } from '@boostxyz/evm/artifacts/contracts/BoostCore.sol/BoostCore.json';
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
type GetTransactionReceiptParameters,
|
|
25
|
+
getAccount,
|
|
26
|
+
getTransactionReceipt,
|
|
27
|
+
waitForTransactionReceipt,
|
|
28
|
+
} from '@wagmi/core';
|
|
24
29
|
import { createWriteContract } from '@wagmi/core/codegen';
|
|
25
30
|
import {
|
|
26
31
|
type Address,
|
|
@@ -74,6 +79,10 @@ import {
|
|
|
74
79
|
ERC20Incentive,
|
|
75
80
|
type ERC20IncentivePayload,
|
|
76
81
|
} from './Incentives/ERC20Incentive';
|
|
82
|
+
import {
|
|
83
|
+
ERC20VariableCriteriaIncentive,
|
|
84
|
+
type ERC20VariableCriteriaIncentivePayload,
|
|
85
|
+
} from './Incentives/ERC20VariableCriteriaIncentive';
|
|
77
86
|
import type { ERC20VariableIncentivePayload } from './Incentives/ERC20VariableIncentive';
|
|
78
87
|
import {
|
|
79
88
|
ERC20VariableIncentive,
|
|
@@ -103,6 +112,11 @@ import {
|
|
|
103
112
|
assertValidAddressByChainId,
|
|
104
113
|
} from './utils';
|
|
105
114
|
|
|
115
|
+
/**
|
|
116
|
+
* The ABI of the BoostCore contract, if needed for low level operations
|
|
117
|
+
*
|
|
118
|
+
* @type {typeof boostCoreAbi}
|
|
119
|
+
*/
|
|
106
120
|
export { boostCoreAbi };
|
|
107
121
|
|
|
108
122
|
/**
|
|
@@ -117,9 +131,9 @@ export const BOOST_CORE_CLAIM_FEE = parseEther('0.000075');
|
|
|
117
131
|
*
|
|
118
132
|
* @type {Address}
|
|
119
133
|
*/
|
|
120
|
-
export const BOOST_CORE_ADDRESS =
|
|
121
|
-
__DEFAULT_CHAIN_ID__
|
|
122
|
-
|
|
134
|
+
export const BOOST_CORE_ADDRESS =
|
|
135
|
+
(BoostCoreBases as Record<string, Address>)[__DEFAULT_CHAIN_ID__] ||
|
|
136
|
+
zeroAddress;
|
|
123
137
|
|
|
124
138
|
/**
|
|
125
139
|
* The fixed addresses for the deployed Boost Core.
|
|
@@ -228,7 +242,7 @@ export type BoostCoreConfig =
|
|
|
228
242
|
export type CreateBoostPayload = {
|
|
229
243
|
budget: Budget;
|
|
230
244
|
action: Action;
|
|
231
|
-
validator
|
|
245
|
+
validator?: Validator;
|
|
232
246
|
allowList: AllowList;
|
|
233
247
|
incentives: Array<Incentive>;
|
|
234
248
|
protocolFee?: bigint;
|
|
@@ -303,7 +317,7 @@ export class BoostCore extends Deployable<
|
|
|
303
317
|
* @async
|
|
304
318
|
* @param {CreateBoostPayload} _boostPayload
|
|
305
319
|
* @param {?DeployableOptions} [_options]
|
|
306
|
-
* @returns {Boost}
|
|
320
|
+
* @returns {Promise<Boost>}
|
|
307
321
|
*/
|
|
308
322
|
public async createBoost(
|
|
309
323
|
_boostPayload: CreateBoostPayload,
|
|
@@ -347,6 +361,13 @@ export class BoostCore extends Deployable<
|
|
|
347
361
|
}
|
|
348
362
|
}
|
|
349
363
|
|
|
364
|
+
if (!validator) {
|
|
365
|
+
validator = this.SignerValidator({
|
|
366
|
+
signers: [owner],
|
|
367
|
+
validatorCaller: coreAddress,
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
|
|
350
371
|
let budgetPayload: BoostPayload['budget'] = zeroAddress;
|
|
351
372
|
if (budget.address) {
|
|
352
373
|
budgetPayload = budget.address;
|
|
@@ -394,28 +415,12 @@ export class BoostCore extends Deployable<
|
|
|
394
415
|
isBase: isBase,
|
|
395
416
|
instance: validator.address,
|
|
396
417
|
parameters: isBase
|
|
397
|
-
? validator
|
|
398
|
-
.buildParameters(
|
|
399
|
-
{
|
|
400
|
-
signers: [owner],
|
|
401
|
-
validatorCaller: coreAddress,
|
|
402
|
-
},
|
|
403
|
-
options,
|
|
404
|
-
)
|
|
405
|
-
.args.at(0) || zeroHash
|
|
418
|
+
? validator.buildParameters(undefined, options).args.at(0) || zeroHash
|
|
406
419
|
: zeroHash,
|
|
407
420
|
};
|
|
408
421
|
} else {
|
|
409
422
|
validatorPayload.parameters =
|
|
410
|
-
validator
|
|
411
|
-
.buildParameters(
|
|
412
|
-
{
|
|
413
|
-
signers: [owner],
|
|
414
|
-
validatorCaller: coreAddress,
|
|
415
|
-
},
|
|
416
|
-
options,
|
|
417
|
-
)
|
|
418
|
-
.args.at(0) || zeroHash;
|
|
423
|
+
validator.buildParameters(undefined, options).args.at(0) || zeroHash;
|
|
419
424
|
validatorPayload.instance = assertValidAddressByChainId(
|
|
420
425
|
options.config,
|
|
421
426
|
validator.bases,
|
|
@@ -536,8 +541,8 @@ export class BoostCore extends Deployable<
|
|
|
536
541
|
* @param {bigint} incentiveId
|
|
537
542
|
* @param {Address} address
|
|
538
543
|
* @param {Hex} data
|
|
539
|
-
* @param {?WriteParams
|
|
540
|
-
* @returns {
|
|
544
|
+
* @param {?WriteParams} [params]
|
|
545
|
+
* @returns {Promise<void>}
|
|
541
546
|
*/
|
|
542
547
|
public async claimIncentive(
|
|
543
548
|
boostId: bigint,
|
|
@@ -560,8 +565,8 @@ export class BoostCore extends Deployable<
|
|
|
560
565
|
* @param {bigint} incentiveId - The ID of the Incentive
|
|
561
566
|
* @param {Address} referrer - The address of the referrer (if any)
|
|
562
567
|
* @param {Hex} data- The data for the claim
|
|
563
|
-
* @param {?WriteParams
|
|
564
|
-
* @returns {
|
|
568
|
+
* @param {?WriteParams} [params]
|
|
569
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
565
570
|
*/
|
|
566
571
|
public async claimIncentiveRaw(
|
|
567
572
|
boostId: bigint,
|
|
@@ -598,8 +603,8 @@ export class BoostCore extends Deployable<
|
|
|
598
603
|
* @param {Address} referrer
|
|
599
604
|
* @param {Hex} data
|
|
600
605
|
* @param {Address} claimant
|
|
601
|
-
* @param {?WriteParams
|
|
602
|
-
* @returns {
|
|
606
|
+
* @param {?WriteParams} [params]
|
|
607
|
+
* @returns {Promise<void>}
|
|
603
608
|
*/
|
|
604
609
|
public async claimIncentiveFor(
|
|
605
610
|
boostId: bigint,
|
|
@@ -631,8 +636,8 @@ export class BoostCore extends Deployable<
|
|
|
631
636
|
* @param {Address} referrer - The address of the referrer (if any)
|
|
632
637
|
* @param {Hex} data - The data for the claim
|
|
633
638
|
* @param {Address} claimant - The address of the user eligible for the incentive payout
|
|
634
|
-
* @param {?WriteParams
|
|
635
|
-
* @returns {
|
|
639
|
+
* @param {?WriteParams} [params]
|
|
640
|
+
* @returns {Promise<{ hash: Hex; result: void; }>}
|
|
636
641
|
*/
|
|
637
642
|
public async claimIncentiveForRaw(
|
|
638
643
|
boostId: bigint,
|
|
@@ -666,8 +671,8 @@ export class BoostCore extends Deployable<
|
|
|
666
671
|
* @public
|
|
667
672
|
* @async
|
|
668
673
|
* @param {bigint} id
|
|
669
|
-
* @param {?ReadParams
|
|
670
|
-
* @returns {
|
|
674
|
+
* @param {?ReadParams} [params]
|
|
675
|
+
* @returns {Promise<RawBoost>}
|
|
671
676
|
*/
|
|
672
677
|
public async readBoost(
|
|
673
678
|
id: bigint,
|
|
@@ -688,8 +693,8 @@ export class BoostCore extends Deployable<
|
|
|
688
693
|
* @public
|
|
689
694
|
* @async
|
|
690
695
|
* @param {(string | bigint)} _id
|
|
691
|
-
* @param {?ReadParams
|
|
692
|
-
* @returns {
|
|
696
|
+
* @param {?ReadParams} [params]
|
|
697
|
+
* @returns {Promise<Boost>}
|
|
693
698
|
*/
|
|
694
699
|
public async getBoost(
|
|
695
700
|
_id: string | bigint,
|
|
@@ -741,7 +746,7 @@ export class BoostCore extends Deployable<
|
|
|
741
746
|
*
|
|
742
747
|
* @public
|
|
743
748
|
* @async
|
|
744
|
-
* @param {?ReadParams
|
|
749
|
+
* @param {?ReadParams} [params]
|
|
745
750
|
* @returns {Promise<bigint>}
|
|
746
751
|
*/
|
|
747
752
|
public async getBoostCount(
|
|
@@ -766,7 +771,7 @@ export class BoostCore extends Deployable<
|
|
|
766
771
|
* @public
|
|
767
772
|
* @async
|
|
768
773
|
* @param {Address} address
|
|
769
|
-
* @param {?ReadParams
|
|
774
|
+
* @param {?ReadParams &
|
|
770
775
|
* ReadParams<typeof iAuthAbi, 'isAuthorized'>} [params]
|
|
771
776
|
* @returns {Promise<boolean>}
|
|
772
777
|
*/
|
|
@@ -790,8 +795,8 @@ export class BoostCore extends Deployable<
|
|
|
790
795
|
*
|
|
791
796
|
* @public
|
|
792
797
|
* @async
|
|
793
|
-
* @param {?ReadParams
|
|
794
|
-
* @returns {
|
|
798
|
+
* @param {?ReadParams} [params]
|
|
799
|
+
* @returns {Promise<Address>}
|
|
795
800
|
*/
|
|
796
801
|
public async createBoostAuth(
|
|
797
802
|
params?: ReadParams<typeof boostCoreAbi, 'createBoostAuth'>,
|
|
@@ -815,8 +820,8 @@ export class BoostCore extends Deployable<
|
|
|
815
820
|
* @public
|
|
816
821
|
* @async
|
|
817
822
|
* @param {Auth} auth
|
|
818
|
-
* @param {?WriteParams
|
|
819
|
-
* @returns {
|
|
823
|
+
* @param {?WriteParams} [params]
|
|
824
|
+
* @returns {Promise<void>}
|
|
820
825
|
*/
|
|
821
826
|
public async setCreateBoostAuth(
|
|
822
827
|
auth: Auth,
|
|
@@ -835,8 +840,8 @@ export class BoostCore extends Deployable<
|
|
|
835
840
|
* @public
|
|
836
841
|
* @async
|
|
837
842
|
* @param {Address} address
|
|
838
|
-
* @param {?WriteParams
|
|
839
|
-
* @returns {
|
|
843
|
+
* @param {?WriteParams} [params]
|
|
844
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
840
845
|
*/
|
|
841
846
|
public async setCreateBoostAuthRaw(
|
|
842
847
|
address: Address,
|
|
@@ -865,7 +870,7 @@ export class BoostCore extends Deployable<
|
|
|
865
870
|
*
|
|
866
871
|
* @public
|
|
867
872
|
* @async
|
|
868
|
-
* @param {?ReadParams
|
|
873
|
+
* @param {?ReadParams} [params]
|
|
869
874
|
* @returns {unknown}
|
|
870
875
|
*/
|
|
871
876
|
public async protocolFee(
|
|
@@ -889,8 +894,8 @@ export class BoostCore extends Deployable<
|
|
|
889
894
|
*
|
|
890
895
|
* @public
|
|
891
896
|
* @async
|
|
892
|
-
* @param {?ReadParams
|
|
893
|
-
* @returns {
|
|
897
|
+
* @param {?ReadParams} [params]
|
|
898
|
+
* @returns {Promise<Address>}
|
|
894
899
|
*/
|
|
895
900
|
public async protocolFeeReceiver(
|
|
896
901
|
params?: ReadParams<typeof boostCoreAbi, 'protocolFeeReceiver'>,
|
|
@@ -914,8 +919,8 @@ export class BoostCore extends Deployable<
|
|
|
914
919
|
* @public
|
|
915
920
|
* @async
|
|
916
921
|
* @param {Address} address
|
|
917
|
-
* @param {?WriteParams
|
|
918
|
-
* @returns {
|
|
922
|
+
* @param {?WriteParams} [params]
|
|
923
|
+
* @returns {Promise<void>}
|
|
919
924
|
*/
|
|
920
925
|
public async setProcolFeeReceiver(
|
|
921
926
|
address: Address,
|
|
@@ -934,8 +939,8 @@ export class BoostCore extends Deployable<
|
|
|
934
939
|
* @public
|
|
935
940
|
* @async
|
|
936
941
|
* @param {Address} address
|
|
937
|
-
* @param {?WriteParams
|
|
938
|
-
* @returns {
|
|
942
|
+
* @param {?WriteParams} [params]
|
|
943
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
939
944
|
*/
|
|
940
945
|
public async setProcolFeeReceiverRaw(
|
|
941
946
|
address: Address,
|
|
@@ -967,8 +972,8 @@ export class BoostCore extends Deployable<
|
|
|
967
972
|
*
|
|
968
973
|
* @public
|
|
969
974
|
* @async
|
|
970
|
-
* @param {?ReadParams
|
|
971
|
-
* @returns {
|
|
975
|
+
* @param {?ReadParams} [params]
|
|
976
|
+
* @returns {Promise<bigint>}
|
|
972
977
|
*/
|
|
973
978
|
public async claimFee(params?: ReadParams<typeof boostCoreAbi, 'claimFee'>) {
|
|
974
979
|
return await readBoostCoreClaimFee(this._config, {
|
|
@@ -990,8 +995,8 @@ export class BoostCore extends Deployable<
|
|
|
990
995
|
* @public
|
|
991
996
|
* @async
|
|
992
997
|
* @param {bigint} claimFee
|
|
993
|
-
* @param {?WriteParams
|
|
994
|
-
* @returns {
|
|
998
|
+
* @param {?WriteParams} [params]
|
|
999
|
+
* @returns {Promise<void>}
|
|
995
1000
|
*/
|
|
996
1001
|
public async setClaimFee(
|
|
997
1002
|
claimFee: bigint,
|
|
@@ -1006,8 +1011,8 @@ export class BoostCore extends Deployable<
|
|
|
1006
1011
|
* @public
|
|
1007
1012
|
* @async
|
|
1008
1013
|
* @param {bigint} claimFee
|
|
1009
|
-
* @param {?WriteParams
|
|
1010
|
-
* @returns {
|
|
1014
|
+
* @param {?WriteParams} [params]
|
|
1015
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
1011
1016
|
*/
|
|
1012
1017
|
public async setClaimFeeRaw(
|
|
1013
1018
|
claimFee: bigint,
|
|
@@ -1031,6 +1036,41 @@ export class BoostCore extends Deployable<
|
|
|
1031
1036
|
return { hash, result };
|
|
1032
1037
|
}
|
|
1033
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* Retrieves the claim information from a transaction receipt.
|
|
1041
|
+
*
|
|
1042
|
+
* @param {GetTransactionReceiptParameters} params - The parameters required to get the transaction receipt.
|
|
1043
|
+
* @returns {Promise<{ boostId: bigint, incentiveId: bigint, claimer: Address, amount: bigint } | undefined>} The claim information if found, undefined otherwise.
|
|
1044
|
+
*
|
|
1045
|
+
* @description
|
|
1046
|
+
* This method retrieves the transaction receipt using the provided parameters,
|
|
1047
|
+
* then parses the logs to find the 'BoostClaimed' event.
|
|
1048
|
+
* If found, it returns the arguments of the event, which include the boost ID,
|
|
1049
|
+
* incentive ID, claimer address, and claimed amount.
|
|
1050
|
+
*
|
|
1051
|
+
* @example
|
|
1052
|
+
* ```ts
|
|
1053
|
+
* const claimInfo = await boostCore.getClaimFromTransaction({
|
|
1054
|
+
* hash: '0x...',
|
|
1055
|
+
* chainId: 1
|
|
1056
|
+
* });
|
|
1057
|
+
* if (claimInfo) {
|
|
1058
|
+
* console.log(`Boost ${claimInfo.boostId} claimed by ${claimInfo.claimer}`);
|
|
1059
|
+
* }
|
|
1060
|
+
* ```
|
|
1061
|
+
*/
|
|
1062
|
+
public async getClaimFromTransaction(
|
|
1063
|
+
params: GetTransactionReceiptParameters,
|
|
1064
|
+
) {
|
|
1065
|
+
const receipt = await getTransactionReceipt(this._config, params);
|
|
1066
|
+
const logs = parseEventLogs({
|
|
1067
|
+
abi: boostCoreAbi,
|
|
1068
|
+
eventName: 'BoostClaimed',
|
|
1069
|
+
logs: receipt.logs,
|
|
1070
|
+
});
|
|
1071
|
+
return logs.at(0)?.args;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1034
1074
|
/**
|
|
1035
1075
|
* Bound {@link PassthroughAuth} constructor that reuses the same configuration as the Boost Core instance.
|
|
1036
1076
|
*
|
|
@@ -1334,6 +1374,30 @@ export class BoostCore extends Deployable<
|
|
|
1334
1374
|
isBase,
|
|
1335
1375
|
);
|
|
1336
1376
|
}
|
|
1377
|
+
|
|
1378
|
+
/**
|
|
1379
|
+
* Bound {@link ERC20VariableCriteriaIncentive} constructor that reuses the same configuration as the Boost Core instance.
|
|
1380
|
+
*
|
|
1381
|
+
* @example
|
|
1382
|
+
* ```ts
|
|
1383
|
+
* const validator = core.ERC20VariableCrtieriaIncentive({ ... }) // is roughly equivalent to
|
|
1384
|
+
* const validator = new ERC20VariableCrtieriaIncentive({ config: core._config, account: core._account }, { ... })
|
|
1385
|
+
* ```
|
|
1386
|
+
* @param {DeployablePayloadOrAddress<ERC20VariableCrtieriaIncentivePayload>} options
|
|
1387
|
+
* @param {?boolean} [isBase]
|
|
1388
|
+
* @returns {ERC20VariableCrtieriaIncentive}
|
|
1389
|
+
* */
|
|
1390
|
+
ERC20VariableCriteriaIncentive(
|
|
1391
|
+
options: DeployablePayloadOrAddress<ERC20VariableCriteriaIncentivePayload>,
|
|
1392
|
+
isBase?: boolean,
|
|
1393
|
+
) {
|
|
1394
|
+
return new ERC20VariableCriteriaIncentive(
|
|
1395
|
+
{ config: this._config, account: this._account },
|
|
1396
|
+
options,
|
|
1397
|
+
isBase,
|
|
1398
|
+
);
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1337
1401
|
/**
|
|
1338
1402
|
* Bound {@link ERC20VariableIncentive} constructor that reuses the same configuration as the Boost Core instance.
|
|
1339
1403
|
*
|
package/src/BoostRegistry.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
type ContractEventName,
|
|
15
15
|
type Hex,
|
|
16
16
|
isAddress,
|
|
17
|
+
zeroAddress,
|
|
17
18
|
} from 'viem';
|
|
18
19
|
import { BoostRegistry as BoostRegistryBases } from '../dist/deployments.json';
|
|
19
20
|
import {
|
|
@@ -31,14 +32,21 @@ import {
|
|
|
31
32
|
assertValidAddressByChainId,
|
|
32
33
|
} from './utils';
|
|
33
34
|
|
|
35
|
+
/**
|
|
36
|
+
* The ABI of the BoostRegistry contract, if needed for low level operations
|
|
37
|
+
*
|
|
38
|
+
* @type {typeof boostRegistryAbi}
|
|
39
|
+
*/
|
|
40
|
+
export { boostRegistryAbi };
|
|
41
|
+
|
|
34
42
|
/**
|
|
35
43
|
* The address of the deployed `BoostRegistry` instance. In prerelease mode, this will be its sepolia address
|
|
36
44
|
*
|
|
37
45
|
* @type {Address}
|
|
38
46
|
*/
|
|
39
|
-
export const BOOST_REGISTRY_ADDRESS =
|
|
40
|
-
BoostRegistryBases as Record<string, Address>
|
|
41
|
-
|
|
47
|
+
export const BOOST_REGISTRY_ADDRESS =
|
|
48
|
+
(BoostRegistryBases as Record<string, Address>)[__DEFAULT_CHAIN_ID__] ||
|
|
49
|
+
zeroAddress;
|
|
42
50
|
|
|
43
51
|
/**
|
|
44
52
|
* The fixed addresses for the deployed Boost Registry.
|
|
@@ -214,8 +222,8 @@ export class BoostRegistry extends Deployable<
|
|
|
214
222
|
* @param {RegistryType} registryType - The base type for the implementation
|
|
215
223
|
* @param {string} name - A name for the implementation (must be unique within the given type)
|
|
216
224
|
* @param {Address} implementation - The address of the implementation contract
|
|
217
|
-
* @param {?WriteParams
|
|
218
|
-
* @returns {
|
|
225
|
+
* @param {?WriteParams} [params] - Optional params to provide the underlying Viem contract call
|
|
226
|
+
* @returns {Promise<void>}
|
|
219
227
|
* @example
|
|
220
228
|
* ```ts
|
|
221
229
|
* await registry.register(ContractAction.registryType, 'ContractAction', ContractAction.base)
|
|
@@ -239,8 +247,8 @@ export class BoostRegistry extends Deployable<
|
|
|
239
247
|
* @param {RegistryType} registryType
|
|
240
248
|
* @param {string} name
|
|
241
249
|
* @param {Address} implementation
|
|
242
|
-
* @param {?WriteParams
|
|
243
|
-
* @returns {
|
|
250
|
+
* @param {?WriteParams} [params]
|
|
251
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
244
252
|
*/
|
|
245
253
|
public async registerRaw(
|
|
246
254
|
registryType: RegistryType,
|
|
@@ -275,8 +283,8 @@ export class BoostRegistry extends Deployable<
|
|
|
275
283
|
* @template {DeployableTarget} Target
|
|
276
284
|
* @param {string} displayName - The display name for the clone
|
|
277
285
|
* @param {Target} target - An instance of a target contract to clone and initialize
|
|
278
|
-
* @param {?WriteParams
|
|
279
|
-
* @returns {Target} - The provided instance, but with a new address attached.
|
|
286
|
+
* @param {?WriteParams} [params]
|
|
287
|
+
* @returns {Promise<Target>} - The provided instance, but with a new address attached.
|
|
280
288
|
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
281
289
|
*/
|
|
282
290
|
public initialize<Target extends DeployableTarget<any, any>>(
|
|
@@ -295,8 +303,8 @@ export class BoostRegistry extends Deployable<
|
|
|
295
303
|
* @template {DeployableTarget} Target
|
|
296
304
|
* @param {string} displayName - The display name for the clone
|
|
297
305
|
* @param {Target} target - An instance of a target contract to clone and initialize
|
|
298
|
-
* @param {?WriteParams
|
|
299
|
-
* @returns {Target} - The provided instance, but with a new address attached.
|
|
306
|
+
* @param {?WriteParams} [params]
|
|
307
|
+
* @returns {Promise<Target>} - The provided instance, but with a new address attached.
|
|
300
308
|
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
301
309
|
*/
|
|
302
310
|
public async clone<Target extends DeployableTarget<any, any>>(
|
|
@@ -316,8 +324,8 @@ export class BoostRegistry extends Deployable<
|
|
|
316
324
|
* @template {DeployableTarget} Target
|
|
317
325
|
* @param {string} displayName
|
|
318
326
|
* @param {Target} target
|
|
319
|
-
* @param {?WriteParams
|
|
320
|
-
* @returns {
|
|
327
|
+
* @param {?WriteParams} [params]
|
|
328
|
+
* @returns {Promise<Address>}
|
|
321
329
|
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
322
330
|
*/
|
|
323
331
|
public async deployClone<Target extends DeployableTarget<any, any>>(
|
|
@@ -336,8 +344,8 @@ export class BoostRegistry extends Deployable<
|
|
|
336
344
|
* @async
|
|
337
345
|
* @param {string} displayName
|
|
338
346
|
* @param {DeployableTarget} target
|
|
339
|
-
* @param {?WriteParams
|
|
340
|
-
* @returns {
|
|
347
|
+
* @param {?WriteParams} [params]
|
|
348
|
+
* @returns {Promise<{ hash: Hex, result: Address }>} - The transaction hash
|
|
341
349
|
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
342
350
|
*/
|
|
343
351
|
public async deployCloneRaw<Target extends DeployableTarget<any, any>>(
|
|
@@ -379,8 +387,8 @@ export class BoostRegistry extends Deployable<
|
|
|
379
387
|
* @public
|
|
380
388
|
* @async
|
|
381
389
|
* @param {Hex} identifier - The unique identifier for the implementation (see {getIdentifier})
|
|
382
|
-
* @param {?ReadParams
|
|
383
|
-
* @returns {
|
|
390
|
+
* @param {?ReadParams} [params]
|
|
391
|
+
* @returns {Promise<Address>} - The address of the implementation
|
|
384
392
|
*/
|
|
385
393
|
public async getBaseImplementation(
|
|
386
394
|
identifier: Hex,
|
|
@@ -405,7 +413,7 @@ export class BoostRegistry extends Deployable<
|
|
|
405
413
|
* @public
|
|
406
414
|
* @async
|
|
407
415
|
* @param {Hex} identifier - The unique identifier for the deployed clone (see {getCloneIdentifier})
|
|
408
|
-
* @param {?ReadParams
|
|
416
|
+
* @param {?ReadParams} [params]
|
|
409
417
|
* @returns {Promise<Address>} - The address of the deployed clone
|
|
410
418
|
*/
|
|
411
419
|
public async getClone(
|
|
@@ -431,7 +439,7 @@ export class BoostRegistry extends Deployable<
|
|
|
431
439
|
* @public
|
|
432
440
|
* @async
|
|
433
441
|
* @param {Address} deployer - The address of the deployer
|
|
434
|
-
* @param {?ReadParams
|
|
442
|
+
* @param {?ReadParams} [params]
|
|
435
443
|
* @returns {Promise<Hex[]>} - The list of deployed clones for the given deployer
|
|
436
444
|
*/
|
|
437
445
|
public async getClones(
|
|
@@ -460,7 +468,7 @@ export class BoostRegistry extends Deployable<
|
|
|
460
468
|
* @param {Address} base - The address of the base implementation
|
|
461
469
|
* @param {Address} deployer - The address of the deployer
|
|
462
470
|
* @param {string} displayName - The display name of the clone
|
|
463
|
-
* @param {?ReadParams
|
|
471
|
+
* @param {?ReadParams} [params]
|
|
464
472
|
* @returns {Promise<Hex>} - The unique identifier for the clone
|
|
465
473
|
*/
|
|
466
474
|
public async getCloneIdentifier(
|
|
@@ -490,7 +498,7 @@ export class BoostRegistry extends Deployable<
|
|
|
490
498
|
* @async
|
|
491
499
|
* @param {RegistryType} registryType - The base type for the implementation
|
|
492
500
|
* @param {string} displayName - The name of the implementation
|
|
493
|
-
* @param {?ReadParams
|
|
501
|
+
* @param {?ReadParams} [params]
|
|
494
502
|
* @returns {Promise<Hex>} - The unique identifier for the implementation
|
|
495
503
|
*/
|
|
496
504
|
public async getIdentifier(
|
|
@@ -149,7 +149,7 @@ export function isERC1155TransferPayload(
|
|
|
149
149
|
*
|
|
150
150
|
* @export
|
|
151
151
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
152
|
-
* @returns {
|
|
152
|
+
* @returns {Hex}
|
|
153
153
|
* @throws {@link UnknownTransferPayloadSupplied}
|
|
154
154
|
*/
|
|
155
155
|
export function prepareTransfer(
|
|
@@ -212,7 +212,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
212
212
|
* @public
|
|
213
213
|
* @async
|
|
214
214
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
215
|
-
* @param {?WriteParams
|
|
215
|
+
* @param {?WriteParams} [params]
|
|
216
216
|
* @returns {Promise<boolean>} - True if the allocation was successful
|
|
217
217
|
*/
|
|
218
218
|
public async allocate(
|
|
@@ -230,8 +230,8 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
230
230
|
* @public
|
|
231
231
|
* @async
|
|
232
232
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
233
|
-
* @param {?WriteParams
|
|
234
|
-
* @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
|
|
235
235
|
*/
|
|
236
236
|
public async allocateRaw(
|
|
237
237
|
transfer: FungibleTransferPayload | ERC1155TransferPayload,
|
|
@@ -260,7 +260,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
260
260
|
* @public
|
|
261
261
|
* @async
|
|
262
262
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
263
|
-
* @param {?WriteParams
|
|
263
|
+
* @param {?WriteParams} [params]
|
|
264
264
|
* @returns {Promise<boolean>} - True if the request was successful
|
|
265
265
|
*/
|
|
266
266
|
public async clawback(
|
|
@@ -279,8 +279,8 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
279
279
|
* @public
|
|
280
280
|
* @async
|
|
281
281
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
282
|
-
* @param {?WriteParams
|
|
283
|
-
* @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
|
|
284
284
|
*/
|
|
285
285
|
public async clawbackRaw(
|
|
286
286
|
transfer: FungibleTransferPayload | ERC1155TransferPayload,
|
|
@@ -307,7 +307,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
307
307
|
* @public
|
|
308
308
|
* @async
|
|
309
309
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
310
|
-
* @param {?WriteParams
|
|
310
|
+
* @param {?WriteParams} [params]
|
|
311
311
|
* @returns {Promise<boolean>} - True if the disbursement was successful
|
|
312
312
|
*/
|
|
313
313
|
public async disburse(
|
|
@@ -324,8 +324,8 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
324
324
|
* @public
|
|
325
325
|
* @async
|
|
326
326
|
* @param {(FungibleTransferPayload | ERC1155TransferPayload)} transfer
|
|
327
|
-
* @param {?WriteParams
|
|
328
|
-
* @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
|
|
329
329
|
*/
|
|
330
330
|
public async disburseRaw(
|
|
331
331
|
transfer: FungibleTransferPayload | ERC1155TransferPayload,
|
|
@@ -351,7 +351,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
351
351
|
* @public
|
|
352
352
|
* @async
|
|
353
353
|
* @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers
|
|
354
|
-
* @param {?WriteParams
|
|
354
|
+
* @param {?WriteParams} [params]
|
|
355
355
|
* @returns {Promise<boolean>} - True if all disbursements were successful
|
|
356
356
|
*/
|
|
357
357
|
public async disburseBatch(
|
|
@@ -367,8 +367,8 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
367
367
|
* @public
|
|
368
368
|
* @async
|
|
369
369
|
* @param {Array<FungibleTransferPayload | ERC1155TransferPayload>} transfers
|
|
370
|
-
* @param {?WriteParams
|
|
371
|
-
* @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
|
|
372
372
|
*/
|
|
373
373
|
public async disburseBatchRaw(
|
|
374
374
|
transfers: Array<FungibleTransferPayload | ERC1155TransferPayload>,
|
|
@@ -392,7 +392,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
392
392
|
* Get the owner of the budget
|
|
393
393
|
*
|
|
394
394
|
* @public
|
|
395
|
-
* @param {?ReadParams
|
|
395
|
+
* @param {?ReadParams} [params]
|
|
396
396
|
* @returns {Promise<Address>}
|
|
397
397
|
*/
|
|
398
398
|
public owner(params?: ReadParams<typeof managedBudgetAbi, 'owner'>) {
|
|
@@ -411,7 +411,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
411
411
|
* @public
|
|
412
412
|
* @param {Address} [asset="0x0000000000000000000000000000000000000000"] - The address of the asset
|
|
413
413
|
* @param {?(bigint | undefined)} [tokenId] - The ID of the token
|
|
414
|
-
* @param {?ReadParams
|
|
414
|
+
* @param {?ReadParams} [params]
|
|
415
415
|
* @returns {Promise<bigint>} - The total amount of assets
|
|
416
416
|
*/
|
|
417
417
|
public total(
|
|
@@ -434,7 +434,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
434
434
|
* @public
|
|
435
435
|
* @param {Address} [asset="0x0000000000000000000000000000000000000000"]
|
|
436
436
|
* @param {?(bigint | undefined)} [tokenId]
|
|
437
|
-
* @param {?ReadParams
|
|
437
|
+
* @param {?ReadParams} [params]
|
|
438
438
|
* @returns {Promise<bigint>} - The amount of assets available
|
|
439
439
|
*/
|
|
440
440
|
public available(
|
|
@@ -457,7 +457,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
457
457
|
* @public
|
|
458
458
|
* @param {Address} [asset="0x0000000000000000000000000000000000000000"]
|
|
459
459
|
* @param {?(bigint | undefined)} [tokenId]
|
|
460
|
-
* @param {?ReadParams
|
|
460
|
+
* @param {?ReadParams} [params]
|
|
461
461
|
* @returns {Promise<bigint>} - The amount of assets distributed
|
|
462
462
|
*/
|
|
463
463
|
public distributed(
|
|
@@ -517,7 +517,7 @@ export class ManagedBudget extends DeployableTargetWithRBAC<
|
|
|
517
517
|
* @param {Address} param0.owner - The budget's owner
|
|
518
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.
|
|
519
519
|
* @param {{}} param0.roles - List of roles to assign to the corresponding account by index.
|
|
520
|
-
* @returns {
|
|
520
|
+
* @returns {Hex}
|
|
521
521
|
*/
|
|
522
522
|
export const prepareManagedBudgetPayload = ({
|
|
523
523
|
owner,
|