@boostxyz/sdk 0.0.0-alpha.17 → 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 +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-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 +28 -28
- 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 +10 -10
- 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 +32 -32
- package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -1
- 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-DJf-vdyL.js → Incentive-CF7kaz_9.js} +61 -62
- package/dist/Incentive-CF7kaz_9.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-D9i4rw_F.js} +9 -9
- 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 +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-B8VWObPa.js} +631 -343
- package/dist/generated-B8VWObPa.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 +133 -125
- 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 +113 -54
- package/src/BoostRegistry.ts +18 -18
- 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.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,
|
|
@@ -228,7 +237,7 @@ export type BoostCoreConfig =
|
|
|
228
237
|
export type CreateBoostPayload = {
|
|
229
238
|
budget: Budget;
|
|
230
239
|
action: Action;
|
|
231
|
-
validator
|
|
240
|
+
validator?: Validator;
|
|
232
241
|
allowList: AllowList;
|
|
233
242
|
incentives: Array<Incentive>;
|
|
234
243
|
protocolFee?: bigint;
|
|
@@ -303,7 +312,7 @@ export class BoostCore extends Deployable<
|
|
|
303
312
|
* @async
|
|
304
313
|
* @param {CreateBoostPayload} _boostPayload
|
|
305
314
|
* @param {?DeployableOptions} [_options]
|
|
306
|
-
* @returns {Boost}
|
|
315
|
+
* @returns {Promise<Boost>}
|
|
307
316
|
*/
|
|
308
317
|
public async createBoost(
|
|
309
318
|
_boostPayload: CreateBoostPayload,
|
|
@@ -347,6 +356,13 @@ export class BoostCore extends Deployable<
|
|
|
347
356
|
}
|
|
348
357
|
}
|
|
349
358
|
|
|
359
|
+
if (!validator) {
|
|
360
|
+
validator = this.SignerValidator({
|
|
361
|
+
signers: [owner],
|
|
362
|
+
validatorCaller: coreAddress,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
|
|
350
366
|
let budgetPayload: BoostPayload['budget'] = zeroAddress;
|
|
351
367
|
if (budget.address) {
|
|
352
368
|
budgetPayload = budget.address;
|
|
@@ -394,28 +410,12 @@ export class BoostCore extends Deployable<
|
|
|
394
410
|
isBase: isBase,
|
|
395
411
|
instance: validator.address,
|
|
396
412
|
parameters: isBase
|
|
397
|
-
? validator
|
|
398
|
-
.buildParameters(
|
|
399
|
-
{
|
|
400
|
-
signers: [owner],
|
|
401
|
-
validatorCaller: coreAddress,
|
|
402
|
-
},
|
|
403
|
-
options,
|
|
404
|
-
)
|
|
405
|
-
.args.at(0) || zeroHash
|
|
413
|
+
? validator.buildParameters(undefined, options).args.at(0) || zeroHash
|
|
406
414
|
: zeroHash,
|
|
407
415
|
};
|
|
408
416
|
} else {
|
|
409
417
|
validatorPayload.parameters =
|
|
410
|
-
validator
|
|
411
|
-
.buildParameters(
|
|
412
|
-
{
|
|
413
|
-
signers: [owner],
|
|
414
|
-
validatorCaller: coreAddress,
|
|
415
|
-
},
|
|
416
|
-
options,
|
|
417
|
-
)
|
|
418
|
-
.args.at(0) || zeroHash;
|
|
418
|
+
validator.buildParameters(undefined, options).args.at(0) || zeroHash;
|
|
419
419
|
validatorPayload.instance = assertValidAddressByChainId(
|
|
420
420
|
options.config,
|
|
421
421
|
validator.bases,
|
|
@@ -536,8 +536,8 @@ export class BoostCore extends Deployable<
|
|
|
536
536
|
* @param {bigint} incentiveId
|
|
537
537
|
* @param {Address} address
|
|
538
538
|
* @param {Hex} data
|
|
539
|
-
* @param {?WriteParams
|
|
540
|
-
* @returns {
|
|
539
|
+
* @param {?WriteParams} [params]
|
|
540
|
+
* @returns {Promise<void>}
|
|
541
541
|
*/
|
|
542
542
|
public async claimIncentive(
|
|
543
543
|
boostId: bigint,
|
|
@@ -560,8 +560,8 @@ export class BoostCore extends Deployable<
|
|
|
560
560
|
* @param {bigint} incentiveId - The ID of the Incentive
|
|
561
561
|
* @param {Address} referrer - The address of the referrer (if any)
|
|
562
562
|
* @param {Hex} data- The data for the claim
|
|
563
|
-
* @param {?WriteParams
|
|
564
|
-
* @returns {
|
|
563
|
+
* @param {?WriteParams} [params]
|
|
564
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
565
565
|
*/
|
|
566
566
|
public async claimIncentiveRaw(
|
|
567
567
|
boostId: bigint,
|
|
@@ -598,8 +598,8 @@ export class BoostCore extends Deployable<
|
|
|
598
598
|
* @param {Address} referrer
|
|
599
599
|
* @param {Hex} data
|
|
600
600
|
* @param {Address} claimant
|
|
601
|
-
* @param {?WriteParams
|
|
602
|
-
* @returns {
|
|
601
|
+
* @param {?WriteParams} [params]
|
|
602
|
+
* @returns {Promise<void>}
|
|
603
603
|
*/
|
|
604
604
|
public async claimIncentiveFor(
|
|
605
605
|
boostId: bigint,
|
|
@@ -631,8 +631,8 @@ export class BoostCore extends Deployable<
|
|
|
631
631
|
* @param {Address} referrer - The address of the referrer (if any)
|
|
632
632
|
* @param {Hex} data - The data for the claim
|
|
633
633
|
* @param {Address} claimant - The address of the user eligible for the incentive payout
|
|
634
|
-
* @param {?WriteParams
|
|
635
|
-
* @returns {
|
|
634
|
+
* @param {?WriteParams} [params]
|
|
635
|
+
* @returns {Promise<{ hash: Hex; result: void; }>}
|
|
636
636
|
*/
|
|
637
637
|
public async claimIncentiveForRaw(
|
|
638
638
|
boostId: bigint,
|
|
@@ -666,8 +666,8 @@ export class BoostCore extends Deployable<
|
|
|
666
666
|
* @public
|
|
667
667
|
* @async
|
|
668
668
|
* @param {bigint} id
|
|
669
|
-
* @param {?ReadParams
|
|
670
|
-
* @returns {
|
|
669
|
+
* @param {?ReadParams} [params]
|
|
670
|
+
* @returns {Promise<RawBoost>}
|
|
671
671
|
*/
|
|
672
672
|
public async readBoost(
|
|
673
673
|
id: bigint,
|
|
@@ -688,8 +688,8 @@ export class BoostCore extends Deployable<
|
|
|
688
688
|
* @public
|
|
689
689
|
* @async
|
|
690
690
|
* @param {(string | bigint)} _id
|
|
691
|
-
* @param {?ReadParams
|
|
692
|
-
* @returns {
|
|
691
|
+
* @param {?ReadParams} [params]
|
|
692
|
+
* @returns {Promise<Boost>}
|
|
693
693
|
*/
|
|
694
694
|
public async getBoost(
|
|
695
695
|
_id: string | bigint,
|
|
@@ -741,7 +741,7 @@ export class BoostCore extends Deployable<
|
|
|
741
741
|
*
|
|
742
742
|
* @public
|
|
743
743
|
* @async
|
|
744
|
-
* @param {?ReadParams
|
|
744
|
+
* @param {?ReadParams} [params]
|
|
745
745
|
* @returns {Promise<bigint>}
|
|
746
746
|
*/
|
|
747
747
|
public async getBoostCount(
|
|
@@ -766,7 +766,7 @@ export class BoostCore extends Deployable<
|
|
|
766
766
|
* @public
|
|
767
767
|
* @async
|
|
768
768
|
* @param {Address} address
|
|
769
|
-
* @param {?ReadParams
|
|
769
|
+
* @param {?ReadParams &
|
|
770
770
|
* ReadParams<typeof iAuthAbi, 'isAuthorized'>} [params]
|
|
771
771
|
* @returns {Promise<boolean>}
|
|
772
772
|
*/
|
|
@@ -790,8 +790,8 @@ export class BoostCore extends Deployable<
|
|
|
790
790
|
*
|
|
791
791
|
* @public
|
|
792
792
|
* @async
|
|
793
|
-
* @param {?ReadParams
|
|
794
|
-
* @returns {
|
|
793
|
+
* @param {?ReadParams} [params]
|
|
794
|
+
* @returns {Promise<Address>}
|
|
795
795
|
*/
|
|
796
796
|
public async createBoostAuth(
|
|
797
797
|
params?: ReadParams<typeof boostCoreAbi, 'createBoostAuth'>,
|
|
@@ -815,8 +815,8 @@ export class BoostCore extends Deployable<
|
|
|
815
815
|
* @public
|
|
816
816
|
* @async
|
|
817
817
|
* @param {Auth} auth
|
|
818
|
-
* @param {?WriteParams
|
|
819
|
-
* @returns {
|
|
818
|
+
* @param {?WriteParams} [params]
|
|
819
|
+
* @returns {Promise<void>}
|
|
820
820
|
*/
|
|
821
821
|
public async setCreateBoostAuth(
|
|
822
822
|
auth: Auth,
|
|
@@ -835,8 +835,8 @@ export class BoostCore extends Deployable<
|
|
|
835
835
|
* @public
|
|
836
836
|
* @async
|
|
837
837
|
* @param {Address} address
|
|
838
|
-
* @param {?WriteParams
|
|
839
|
-
* @returns {
|
|
838
|
+
* @param {?WriteParams} [params]
|
|
839
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
840
840
|
*/
|
|
841
841
|
public async setCreateBoostAuthRaw(
|
|
842
842
|
address: Address,
|
|
@@ -865,7 +865,7 @@ export class BoostCore extends Deployable<
|
|
|
865
865
|
*
|
|
866
866
|
* @public
|
|
867
867
|
* @async
|
|
868
|
-
* @param {?ReadParams
|
|
868
|
+
* @param {?ReadParams} [params]
|
|
869
869
|
* @returns {unknown}
|
|
870
870
|
*/
|
|
871
871
|
public async protocolFee(
|
|
@@ -889,8 +889,8 @@ export class BoostCore extends Deployable<
|
|
|
889
889
|
*
|
|
890
890
|
* @public
|
|
891
891
|
* @async
|
|
892
|
-
* @param {?ReadParams
|
|
893
|
-
* @returns {
|
|
892
|
+
* @param {?ReadParams} [params]
|
|
893
|
+
* @returns {Promise<Address>}
|
|
894
894
|
*/
|
|
895
895
|
public async protocolFeeReceiver(
|
|
896
896
|
params?: ReadParams<typeof boostCoreAbi, 'protocolFeeReceiver'>,
|
|
@@ -914,8 +914,8 @@ export class BoostCore extends Deployable<
|
|
|
914
914
|
* @public
|
|
915
915
|
* @async
|
|
916
916
|
* @param {Address} address
|
|
917
|
-
* @param {?WriteParams
|
|
918
|
-
* @returns {
|
|
917
|
+
* @param {?WriteParams} [params]
|
|
918
|
+
* @returns {Promise<void>}
|
|
919
919
|
*/
|
|
920
920
|
public async setProcolFeeReceiver(
|
|
921
921
|
address: Address,
|
|
@@ -934,8 +934,8 @@ export class BoostCore extends Deployable<
|
|
|
934
934
|
* @public
|
|
935
935
|
* @async
|
|
936
936
|
* @param {Address} address
|
|
937
|
-
* @param {?WriteParams
|
|
938
|
-
* @returns {
|
|
937
|
+
* @param {?WriteParams} [params]
|
|
938
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
939
939
|
*/
|
|
940
940
|
public async setProcolFeeReceiverRaw(
|
|
941
941
|
address: Address,
|
|
@@ -967,8 +967,8 @@ export class BoostCore extends Deployable<
|
|
|
967
967
|
*
|
|
968
968
|
* @public
|
|
969
969
|
* @async
|
|
970
|
-
* @param {?ReadParams
|
|
971
|
-
* @returns {
|
|
970
|
+
* @param {?ReadParams} [params]
|
|
971
|
+
* @returns {Promise<bigint>}
|
|
972
972
|
*/
|
|
973
973
|
public async claimFee(params?: ReadParams<typeof boostCoreAbi, 'claimFee'>) {
|
|
974
974
|
return await readBoostCoreClaimFee(this._config, {
|
|
@@ -990,8 +990,8 @@ export class BoostCore extends Deployable<
|
|
|
990
990
|
* @public
|
|
991
991
|
* @async
|
|
992
992
|
* @param {bigint} claimFee
|
|
993
|
-
* @param {?WriteParams
|
|
994
|
-
* @returns {
|
|
993
|
+
* @param {?WriteParams} [params]
|
|
994
|
+
* @returns {Promise<void>}
|
|
995
995
|
*/
|
|
996
996
|
public async setClaimFee(
|
|
997
997
|
claimFee: bigint,
|
|
@@ -1006,8 +1006,8 @@ export class BoostCore extends Deployable<
|
|
|
1006
1006
|
* @public
|
|
1007
1007
|
* @async
|
|
1008
1008
|
* @param {bigint} claimFee
|
|
1009
|
-
* @param {?WriteParams
|
|
1010
|
-
* @returns {
|
|
1009
|
+
* @param {?WriteParams} [params]
|
|
1010
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
1011
1011
|
*/
|
|
1012
1012
|
public async setClaimFeeRaw(
|
|
1013
1013
|
claimFee: bigint,
|
|
@@ -1031,6 +1031,41 @@ export class BoostCore extends Deployable<
|
|
|
1031
1031
|
return { hash, result };
|
|
1032
1032
|
}
|
|
1033
1033
|
|
|
1034
|
+
/**
|
|
1035
|
+
* Retrieves the claim information from a transaction receipt.
|
|
1036
|
+
*
|
|
1037
|
+
* @param {GetTransactionReceiptParameters} params - The parameters required to get the transaction receipt.
|
|
1038
|
+
* @returns {Promise<{ boostId: bigint, incentiveId: bigint, claimer: Address, amount: bigint } | undefined>} The claim information if found, undefined otherwise.
|
|
1039
|
+
*
|
|
1040
|
+
* @description
|
|
1041
|
+
* This method retrieves the transaction receipt using the provided parameters,
|
|
1042
|
+
* then parses the logs to find the 'BoostClaimed' event.
|
|
1043
|
+
* If found, it returns the arguments of the event, which include the boost ID,
|
|
1044
|
+
* incentive ID, claimer address, and claimed amount.
|
|
1045
|
+
*
|
|
1046
|
+
* @example
|
|
1047
|
+
* ```ts
|
|
1048
|
+
* const claimInfo = await boostCore.getClaimFromTransaction({
|
|
1049
|
+
* hash: '0x...',
|
|
1050
|
+
* chainId: 1
|
|
1051
|
+
* });
|
|
1052
|
+
* if (claimInfo) {
|
|
1053
|
+
* console.log(`Boost ${claimInfo.boostId} claimed by ${claimInfo.claimer}`);
|
|
1054
|
+
* }
|
|
1055
|
+
* ```
|
|
1056
|
+
*/
|
|
1057
|
+
public async getClaimFromTransaction(
|
|
1058
|
+
params: GetTransactionReceiptParameters,
|
|
1059
|
+
) {
|
|
1060
|
+
const receipt = await getTransactionReceipt(this._config, params);
|
|
1061
|
+
const logs = parseEventLogs({
|
|
1062
|
+
abi: boostCoreAbi,
|
|
1063
|
+
eventName: 'BoostClaimed',
|
|
1064
|
+
logs: receipt.logs,
|
|
1065
|
+
});
|
|
1066
|
+
return logs.at(0)?.args;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1034
1069
|
/**
|
|
1035
1070
|
* Bound {@link PassthroughAuth} constructor that reuses the same configuration as the Boost Core instance.
|
|
1036
1071
|
*
|
|
@@ -1334,6 +1369,30 @@ export class BoostCore extends Deployable<
|
|
|
1334
1369
|
isBase,
|
|
1335
1370
|
);
|
|
1336
1371
|
}
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* Bound {@link ERC20VariableCriteriaIncentive} constructor that reuses the same configuration as the Boost Core instance.
|
|
1375
|
+
*
|
|
1376
|
+
* @example
|
|
1377
|
+
* ```ts
|
|
1378
|
+
* const validator = core.ERC20VariableCrtieriaIncentive({ ... }) // is roughly equivalent to
|
|
1379
|
+
* const validator = new ERC20VariableCrtieriaIncentive({ config: core._config, account: core._account }, { ... })
|
|
1380
|
+
* ```
|
|
1381
|
+
* @param {DeployablePayloadOrAddress<ERC20VariableCrtieriaIncentivePayload>} options
|
|
1382
|
+
* @param {?boolean} [isBase]
|
|
1383
|
+
* @returns {ERC20VariableCrtieriaIncentive}
|
|
1384
|
+
* */
|
|
1385
|
+
ERC20VariableCriteriaIncentive(
|
|
1386
|
+
options: DeployablePayloadOrAddress<ERC20VariableCriteriaIncentivePayload>,
|
|
1387
|
+
isBase?: boolean,
|
|
1388
|
+
) {
|
|
1389
|
+
return new ERC20VariableCriteriaIncentive(
|
|
1390
|
+
{ config: this._config, account: this._account },
|
|
1391
|
+
options,
|
|
1392
|
+
isBase,
|
|
1393
|
+
);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1337
1396
|
/**
|
|
1338
1397
|
* Bound {@link ERC20VariableIncentive} constructor that reuses the same configuration as the Boost Core instance.
|
|
1339
1398
|
*
|
package/src/BoostRegistry.ts
CHANGED
|
@@ -214,8 +214,8 @@ export class BoostRegistry extends Deployable<
|
|
|
214
214
|
* @param {RegistryType} registryType - The base type for the implementation
|
|
215
215
|
* @param {string} name - A name for the implementation (must be unique within the given type)
|
|
216
216
|
* @param {Address} implementation - The address of the implementation contract
|
|
217
|
-
* @param {?WriteParams
|
|
218
|
-
* @returns {
|
|
217
|
+
* @param {?WriteParams} [params] - Optional params to provide the underlying Viem contract call
|
|
218
|
+
* @returns {Promise<void>}
|
|
219
219
|
* @example
|
|
220
220
|
* ```ts
|
|
221
221
|
* await registry.register(ContractAction.registryType, 'ContractAction', ContractAction.base)
|
|
@@ -239,8 +239,8 @@ export class BoostRegistry extends Deployable<
|
|
|
239
239
|
* @param {RegistryType} registryType
|
|
240
240
|
* @param {string} name
|
|
241
241
|
* @param {Address} implementation
|
|
242
|
-
* @param {?WriteParams
|
|
243
|
-
* @returns {
|
|
242
|
+
* @param {?WriteParams} [params]
|
|
243
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
244
244
|
*/
|
|
245
245
|
public async registerRaw(
|
|
246
246
|
registryType: RegistryType,
|
|
@@ -275,8 +275,8 @@ export class BoostRegistry extends Deployable<
|
|
|
275
275
|
* @template {DeployableTarget} Target
|
|
276
276
|
* @param {string} displayName - The display name for the clone
|
|
277
277
|
* @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.
|
|
278
|
+
* @param {?WriteParams} [params]
|
|
279
|
+
* @returns {Promise<Target>} - The provided instance, but with a new address attached.
|
|
280
280
|
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
281
281
|
*/
|
|
282
282
|
public initialize<Target extends DeployableTarget<any, any>>(
|
|
@@ -295,8 +295,8 @@ export class BoostRegistry extends Deployable<
|
|
|
295
295
|
* @template {DeployableTarget} Target
|
|
296
296
|
* @param {string} displayName - The display name for the clone
|
|
297
297
|
* @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.
|
|
298
|
+
* @param {?WriteParams} [params]
|
|
299
|
+
* @returns {Promise<Target>} - The provided instance, but with a new address attached.
|
|
300
300
|
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
301
301
|
*/
|
|
302
302
|
public async clone<Target extends DeployableTarget<any, any>>(
|
|
@@ -316,8 +316,8 @@ export class BoostRegistry extends Deployable<
|
|
|
316
316
|
* @template {DeployableTarget} Target
|
|
317
317
|
* @param {string} displayName
|
|
318
318
|
* @param {Target} target
|
|
319
|
-
* @param {?WriteParams
|
|
320
|
-
* @returns {
|
|
319
|
+
* @param {?WriteParams} [params]
|
|
320
|
+
* @returns {Promise<Address>}
|
|
321
321
|
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
322
322
|
*/
|
|
323
323
|
public async deployClone<Target extends DeployableTarget<any, any>>(
|
|
@@ -336,8 +336,8 @@ export class BoostRegistry extends Deployable<
|
|
|
336
336
|
* @async
|
|
337
337
|
* @param {string} displayName
|
|
338
338
|
* @param {DeployableTarget} target
|
|
339
|
-
* @param {?WriteParams
|
|
340
|
-
* @returns {
|
|
339
|
+
* @param {?WriteParams} [params]
|
|
340
|
+
* @returns {Promise<{ hash: Hex, result: Address }>} - The transaction hash
|
|
341
341
|
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
342
342
|
*/
|
|
343
343
|
public async deployCloneRaw<Target extends DeployableTarget<any, any>>(
|
|
@@ -379,8 +379,8 @@ export class BoostRegistry extends Deployable<
|
|
|
379
379
|
* @public
|
|
380
380
|
* @async
|
|
381
381
|
* @param {Hex} identifier - The unique identifier for the implementation (see {getIdentifier})
|
|
382
|
-
* @param {?ReadParams
|
|
383
|
-
* @returns {
|
|
382
|
+
* @param {?ReadParams} [params]
|
|
383
|
+
* @returns {Promise<Address>} - The address of the implementation
|
|
384
384
|
*/
|
|
385
385
|
public async getBaseImplementation(
|
|
386
386
|
identifier: Hex,
|
|
@@ -405,7 +405,7 @@ export class BoostRegistry extends Deployable<
|
|
|
405
405
|
* @public
|
|
406
406
|
* @async
|
|
407
407
|
* @param {Hex} identifier - The unique identifier for the deployed clone (see {getCloneIdentifier})
|
|
408
|
-
* @param {?ReadParams
|
|
408
|
+
* @param {?ReadParams} [params]
|
|
409
409
|
* @returns {Promise<Address>} - The address of the deployed clone
|
|
410
410
|
*/
|
|
411
411
|
public async getClone(
|
|
@@ -431,7 +431,7 @@ export class BoostRegistry extends Deployable<
|
|
|
431
431
|
* @public
|
|
432
432
|
* @async
|
|
433
433
|
* @param {Address} deployer - The address of the deployer
|
|
434
|
-
* @param {?ReadParams
|
|
434
|
+
* @param {?ReadParams} [params]
|
|
435
435
|
* @returns {Promise<Hex[]>} - The list of deployed clones for the given deployer
|
|
436
436
|
*/
|
|
437
437
|
public async getClones(
|
|
@@ -460,7 +460,7 @@ export class BoostRegistry extends Deployable<
|
|
|
460
460
|
* @param {Address} base - The address of the base implementation
|
|
461
461
|
* @param {Address} deployer - The address of the deployer
|
|
462
462
|
* @param {string} displayName - The display name of the clone
|
|
463
|
-
* @param {?ReadParams
|
|
463
|
+
* @param {?ReadParams} [params]
|
|
464
464
|
* @returns {Promise<Hex>} - The unique identifier for the clone
|
|
465
465
|
*/
|
|
466
466
|
public async getCloneIdentifier(
|
|
@@ -490,7 +490,7 @@ export class BoostRegistry extends Deployable<
|
|
|
490
490
|
* @async
|
|
491
491
|
* @param {RegistryType} registryType - The base type for the implementation
|
|
492
492
|
* @param {string} displayName - The name of the implementation
|
|
493
|
-
* @param {?ReadParams
|
|
493
|
+
* @param {?ReadParams} [params]
|
|
494
494
|
* @returns {Promise<Hex>} - The unique identifier for the implementation
|
|
495
495
|
*/
|
|
496
496
|
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,
|