@boostxyz/sdk 0.0.0-alpha.7 → 0.0.0-alpha.8
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.js +1 -1
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +3 -2
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +10 -10
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.d.ts +2 -2
- package/dist/AllowLists/AllowList.js +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +3 -3
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +1 -1
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +1 -1
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +33 -1
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +286 -241
- 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 +14 -0
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +21 -5
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.js +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +8 -2
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +6 -0
- 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 +4 -3
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +30 -27
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.js +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.js +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.js +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.js +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.js +1 -1
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +1 -1
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +14 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +30 -21
- package/dist/errors.js.map +1 -1
- package/dist/{generated-Cd-Fe7W7.cjs → generated-BzszviNp.cjs} +3 -3
- package/dist/{generated-Cd-Fe7W7.cjs.map → generated-BzszviNp.cjs.map} +1 -1
- package/dist/{generated-DGpIVcv5.js → generated-Cbv8zFkf.js} +286 -278
- package/dist/{generated-DGpIVcv5.js.map → generated-Cbv8zFkf.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +105 -104
- package/package.json +1 -1
- package/src/Actions/EventAction.ts +10 -2
- package/src/AllowLists/SimpleAllowList.ts +3 -2
- package/src/BoostCore.ts +76 -13
- package/src/BoostRegistry.ts +21 -0
- package/src/Deployable/Deployable.ts +8 -2
- package/src/Deployable/DeployableTarget.ts +17 -4
- package/src/errors.ts +18 -0
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./BoostRegistry.cjs"),i=require("./BoostCore.cjs"),y=require("./Boost.cjs"),r=require("./errors.cjs"),e=require("./utils.cjs"),u=require("./Auth/PassthroughAuth.cjs"),l=require("./Actions/Action.cjs"),A=require("./Actions/EventAction.cjs"),p=require("./AllowLists/AllowList.cjs"),d=require("./AllowLists/SimpleAllowList.cjs"),E=require("./AllowLists/SimpleDenyList.cjs"),s=require("./Budgets/Budget.cjs"),o=require("./Budgets/ManagedBudget.cjs"),g=require("./Deployable/Deployable.cjs"),C=require("./Deployable/Contract.cjs"),P=require("./Deployable/DeployableTarget.cjs"),v=require("./Incentives/AllowListIncentive.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./BoostRegistry.cjs"),i=require("./BoostCore.cjs"),y=require("./Boost.cjs"),r=require("./errors.cjs"),e=require("./utils.cjs"),u=require("./Auth/PassthroughAuth.cjs"),l=require("./Actions/Action.cjs"),A=require("./Actions/EventAction.cjs"),p=require("./AllowLists/AllowList.cjs"),d=require("./AllowLists/SimpleAllowList.cjs"),E=require("./AllowLists/SimpleDenyList.cjs"),s=require("./Budgets/Budget.cjs"),o=require("./Budgets/ManagedBudget.cjs"),g=require("./Deployable/Deployable.cjs"),C=require("./Deployable/Contract.cjs"),P=require("./Deployable/DeployableTarget.cjs"),v=require("./Incentives/AllowListIncentive.cjs"),I=require("./Incentives/CGDAIncentive.cjs"),m=require("./Incentives/ERC20Incentive.cjs"),t=require("./Incentives/Incentive.cjs"),S=require("./Incentives/PointsIncentive.cjs"),R=require("./Validators/SignerValidator.cjs"),c=require("./Validators/Validator.cjs"),a=require("./generated-BzszviNp.cjs");exports.BOOST_REGISTRY_ADDRESS=n.BOOST_REGISTRY_ADDRESS;exports.BoostRegistry=n.BoostRegistry;exports.BOOST_CORE_ADDRESS=i.BOOST_CORE_ADDRESS;exports.BoostCore=i.BoostCore;exports.Boost=y.Boost;exports.BoostCoreNoIdentifierEmitted=r.BoostCoreNoIdentifierEmitted;exports.BudgetMustAuthorizeBoostCore=r.BudgetMustAuthorizeBoostCore;exports.ContractAddressRequiredError=r.ContractAddressRequiredError;exports.DeployableAlreadyDeployedError=r.DeployableAlreadyDeployedError;exports.DeployableBuildParametersUnspecifiedError=r.DeployableBuildParametersUnspecifiedError;exports.DeployableMissingPayloadError=r.DeployableMissingPayloadError;exports.DeployableUnknownOwnerProvidedError=r.DeployableUnknownOwnerProvidedError;exports.DeployableWagmiConfigurationRequiredError=r.DeployableWagmiConfigurationRequiredError;exports.EventActionValidationError=r.EventActionValidationError;exports.FieldValueNotComparableError=r.FieldValueNotComparableError;exports.FieldValueUndefinedError=r.FieldValueUndefinedError;exports.IncentiveNotCloneableError=r.IncentiveNotCloneableError;exports.InvalidComponentInterfaceError=r.InvalidComponentInterfaceError;exports.InvalidNumericalCriteriaError=r.InvalidNumericalCriteriaError;exports.MustInitializeBudgetError=r.MustInitializeBudgetError;exports.NoContractAddressUponReceiptError=r.NoContractAddressUponReceiptError;exports.NoEventActionStepsProvidedError=r.NoEventActionStepsProvidedError;exports.TooManyEventActionStepsProvidedError=r.TooManyEventActionStepsProvidedError;exports.UnknownTransferPayloadSupplied=r.UnknownTransferPayloadSupplied;exports.UnrecognizedFilterTypeError=r.UnrecognizedFilterTypeError;exports.AssetType=e.AssetType;exports.ERC1155StrategyType=e.ERC1155StrategyType;exports.FilterType=e.FilterType;exports.PrimitiveType=e.PrimitiveType;exports.RegistryType=e.RegistryType;exports.SignatureType=e.SignatureType;exports.StrategyType=e.StrategyType;exports.awaitResult=e.awaitResult;exports.bytes4=e.bytes4;exports.dedupeActionSteps=e.dedupeActionSteps;exports.getDeployedContractAddress=e.getDeployedContractAddress;exports.isEventActionPayloadSimple=e.isEventActionPayloadSimple;exports.prepareAllowListIncentivePayload=e.prepareAllowListIncentivePayload;exports.prepareBoostClaimData=e.prepareBoostClaimData;exports.prepareBoostPayload=e.prepareBoostPayload;exports.prepareCGDAIncentivePayload=e.prepareCGDAIncentivePayload;exports.prepareClaimPayload=e.prepareClaimPayload;exports.prepareContractActionPayload=e.prepareContractActionPayload;exports.prepareERC1155IncentivePayload=e.prepareERC1155IncentivePayload;exports.prepareERC1155Payload=e.prepareERC1155Payload;exports.prepareERC1155Transfer=e.prepareERC1155Transfer;exports.prepareERC20IncentivePayload=e.prepareERC20IncentivePayload;exports.prepareERC20VariableIncentivePayload=e.prepareERC20VariableIncentivePayload;exports.prepareERC721MintActionPayload=e.prepareERC721MintActionPayload;exports.prepareERC721MintActionValidate=e.prepareERC721MintActionValidate;exports.prepareEventActionPayload=e.prepareEventActionPayload;exports.prepareFungiblePayload=e.prepareFungiblePayload;exports.prepareFungibleTransfer=e.prepareFungibleTransfer;exports.prepareManagedBudgetPayload=e.prepareManagedBudgetPayload;exports.preparePointsIncentivePayload=e.preparePointsIncentivePayload;exports.prepareSignerValidatorClaimDataPayload=e.prepareSignerValidatorClaimDataPayload;exports.prepareSignerValidatorInputParams=e.prepareSignerValidatorInputParams;exports.prepareSignerValidatorPayload=e.prepareSignerValidatorPayload;exports.prepareSimpleAllowListPayload=e.prepareSimpleAllowListPayload;exports.prepareSimpleBudgetPayload=e.prepareSimpleBudgetPayload;exports.prepareSimpleDenyListPayload=e.prepareSimpleDenyListPayload;exports.prepareTransferPayload=e.prepareTransferPayload;exports.prepareVestingBudgetPayload=e.prepareVestingBudgetPayload;exports.PassthroughAuth=u.PassthroughAuth;exports.ActionByComponentInterface=l.ActionByComponentInterface;exports.actionFromAddress=l.actionFromAddress;exports.EventAction=A.EventAction;exports.AllowListByComponentInterface=p.AllowListByComponentInterface;exports.allowListFromAddress=p.allowListFromAddress;exports.LIST_MANAGER_ROLE=d.LIST_MANAGER_ROLE;exports.SimpleAllowList=d.SimpleAllowList;exports.SimpleDenyList=E.SimpleDenyList;exports.BudgetByComponentInterface=s.BudgetByComponentInterface;exports.budgetFromAddress=s.budgetFromAddress;exports.ManagedBudget=o.ManagedBudget;exports.ManagedBudgetRoles=o.ManagedBudgetRoles;exports.isERC1155TransferPayload=o.isERC1155TransferPayload;exports.isFungibleTransfer=o.isFungibleTransfer;exports.prepareTransfer=o.prepareTransfer;exports.Deployable=g.Deployable;exports.Contract=C.Contract;exports.DeployableTarget=P.DeployableTarget;exports.AllowListIncentive=v.AllowListIncentive;exports.CGDAIncentive=I.CGDAIncentive;exports.ERC20Incentive=m.ERC20Incentive;exports.ERC20VariableIncentive=t.ERC20VariableIncentive;exports.IncentiveByComponentInterface=t.IncentiveByComponentInterface;exports.incentiveFromAddress=t.incentiveFromAddress;exports.PointsIncentive=S.PointsIncentive;exports.SignerValidator=R.SignerValidator;exports.ValidatorByComponentInterface=c.ValidatorByComponentInterface;exports.validatorFromAddress=c.validatorFromAddress;exports.allowListIncentiveAbi=a.A;exports.boostCoreAbi=a.c;exports.boostRegistryAbi=a.ee;exports.cgdaIncentiveAbi=a.v;exports.erc20IncentiveAbi=a.f;exports.managedBudgetAbi=a.p;exports.passthroughAuthAbi=a.ze;exports.pointsIncentiveAbi=a.l;exports.signerValidatorAbi=a.M;exports.simpleAllowListAbi=a.T;exports.simpleDenyListAbi=a.S;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,129 +1,130 @@
|
|
|
1
1
|
import { BOOST_REGISTRY_ADDRESS as o, BoostRegistry as a } from "./BoostRegistry.js";
|
|
2
2
|
import { BOOST_CORE_ADDRESS as i, BoostCore as n } from "./BoostCore.js";
|
|
3
3
|
import { Boost as l } from "./Boost.js";
|
|
4
|
-
import { BoostCoreNoIdentifierEmitted as s, BudgetMustAuthorizeBoostCore as y, ContractAddressRequiredError as m, DeployableAlreadyDeployedError as c, DeployableBuildParametersUnspecifiedError as A, DeployableMissingPayloadError as f, DeployableUnknownOwnerProvidedError as E, DeployableWagmiConfigurationRequiredError as g, EventActionValidationError as C, FieldValueNotComparableError as P, FieldValueUndefinedError as
|
|
5
|
-
import { AssetType as
|
|
6
|
-
import { PassthroughAuth as
|
|
7
|
-
import { ActionByComponentInterface as
|
|
4
|
+
import { BoostCoreNoIdentifierEmitted as s, BudgetMustAuthorizeBoostCore as y, ContractAddressRequiredError as m, DeployableAlreadyDeployedError as c, DeployableBuildParametersUnspecifiedError as A, DeployableMissingPayloadError as f, DeployableUnknownOwnerProvidedError as E, DeployableWagmiConfigurationRequiredError as g, EventActionValidationError as C, FieldValueNotComparableError as P, FieldValueUndefinedError as u, IncentiveNotCloneableError as v, InvalidComponentInterfaceError as I, InvalidNumericalCriteriaError as b, MustInitializeBudgetError as R, NoContractAddressUponReceiptError as S, NoEventActionStepsProvidedError as x, TooManyEventActionStepsProvidedError as B, UnknownTransferPayloadSupplied as T, UnrecognizedFilterTypeError as D } from "./errors.js";
|
|
5
|
+
import { AssetType as V, ERC1155StrategyType as w, FilterType as F, PrimitiveType as M, RegistryType as h, SignatureType as N, StrategyType as O, awaitResult as U, bytes4 as _, dedupeActionSteps as z, getDeployedContractAddress as G, isEventActionPayloadSimple as k, prepareAllowListIncentivePayload as q, prepareBoostClaimData as W, prepareBoostPayload as Y, prepareCGDAIncentivePayload as j, prepareClaimPayload as H, prepareContractActionPayload as J, prepareERC1155IncentivePayload as K, prepareERC1155Payload as Q, prepareERC1155Transfer as X, prepareERC20IncentivePayload as Z, prepareERC20VariableIncentivePayload as $, prepareERC721MintActionPayload as ee, prepareERC721MintActionValidate as re, prepareEventActionPayload as oe, prepareFungiblePayload as ae, prepareFungibleTransfer as te, prepareManagedBudgetPayload as ie, preparePointsIncentivePayload as ne, prepareSignerValidatorClaimDataPayload as pe, prepareSignerValidatorInputParams as le, prepareSignerValidatorPayload as de, prepareSimpleAllowListPayload as se, prepareSimpleBudgetPayload as ye, prepareSimpleDenyListPayload as me, prepareTransferPayload as ce, prepareVestingBudgetPayload as Ae } from "./utils.js";
|
|
6
|
+
import { PassthroughAuth as Ee } from "./Auth/PassthroughAuth.js";
|
|
7
|
+
import { ActionByComponentInterface as Ce, actionFromAddress as Pe } from "./Actions/Action.js";
|
|
8
8
|
import { EventAction as ve } from "./Actions/EventAction.js";
|
|
9
|
-
import { AllowListByComponentInterface as be, allowListFromAddress as
|
|
10
|
-
import { LIST_MANAGER_ROLE as
|
|
11
|
-
import { SimpleDenyList as
|
|
12
|
-
import { BudgetByComponentInterface as
|
|
13
|
-
import { ManagedBudget as
|
|
14
|
-
import { Deployable as
|
|
15
|
-
import { Contract as
|
|
16
|
-
import { DeployableTarget as
|
|
17
|
-
import { AllowListIncentive as
|
|
18
|
-
import { CGDAIncentive as
|
|
19
|
-
import { ERC20Incentive as
|
|
20
|
-
import { ERC20VariableIncentive as
|
|
21
|
-
import { PointsIncentive as
|
|
22
|
-
import { SignerValidator as
|
|
23
|
-
import { ValidatorByComponentInterface as
|
|
24
|
-
import { A as
|
|
9
|
+
import { AllowListByComponentInterface as be, allowListFromAddress as Re } from "./AllowLists/AllowList.js";
|
|
10
|
+
import { LIST_MANAGER_ROLE as xe, SimpleAllowList as Be } from "./AllowLists/SimpleAllowList.js";
|
|
11
|
+
import { SimpleDenyList as De } from "./AllowLists/SimpleDenyList.js";
|
|
12
|
+
import { BudgetByComponentInterface as Ve, budgetFromAddress as we } from "./Budgets/Budget.js";
|
|
13
|
+
import { ManagedBudget as Me, ManagedBudgetRoles as he, isERC1155TransferPayload as Ne, isFungibleTransfer as Oe, prepareTransfer as Ue } from "./Budgets/ManagedBudget.js";
|
|
14
|
+
import { Deployable as ze } from "./Deployable/Deployable.js";
|
|
15
|
+
import { Contract as ke } from "./Deployable/Contract.js";
|
|
16
|
+
import { DeployableTarget as We } from "./Deployable/DeployableTarget.js";
|
|
17
|
+
import { AllowListIncentive as je } from "./Incentives/AllowListIncentive.js";
|
|
18
|
+
import { CGDAIncentive as Je } from "./Incentives/CGDAIncentive.js";
|
|
19
|
+
import { ERC20Incentive as Qe } from "./Incentives/ERC20Incentive.js";
|
|
20
|
+
import { ERC20VariableIncentive as Ze, IncentiveByComponentInterface as $e, incentiveFromAddress as er } from "./Incentives/Incentive.js";
|
|
21
|
+
import { PointsIncentive as or } from "./Incentives/PointsIncentive.js";
|
|
22
|
+
import { SignerValidator as tr } from "./Validators/SignerValidator.js";
|
|
23
|
+
import { ValidatorByComponentInterface as nr, validatorFromAddress as pr } from "./Validators/Validator.js";
|
|
24
|
+
import { A as dr, c as sr, e as yr, v as mr, f as cr, p as Ar, z as fr, l as Er, M as gr, T as Cr, S as Pr } from "./generated-Cbv8zFkf.js";
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
Ce as ActionByComponentInterface,
|
|
27
27
|
be as AllowListByComponentInterface,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
je as AllowListIncentive,
|
|
29
|
+
V as AssetType,
|
|
30
30
|
i as BOOST_CORE_ADDRESS,
|
|
31
31
|
o as BOOST_REGISTRY_ADDRESS,
|
|
32
32
|
l as Boost,
|
|
33
33
|
n as BoostCore,
|
|
34
34
|
s as BoostCoreNoIdentifierEmitted,
|
|
35
35
|
a as BoostRegistry,
|
|
36
|
-
|
|
36
|
+
Ve as BudgetByComponentInterface,
|
|
37
37
|
y as BudgetMustAuthorizeBoostCore,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
Je as CGDAIncentive,
|
|
39
|
+
ke as Contract,
|
|
40
40
|
m as ContractAddressRequiredError,
|
|
41
|
-
|
|
41
|
+
ze as Deployable,
|
|
42
42
|
c as DeployableAlreadyDeployedError,
|
|
43
43
|
A as DeployableBuildParametersUnspecifiedError,
|
|
44
44
|
f as DeployableMissingPayloadError,
|
|
45
|
-
|
|
45
|
+
We as DeployableTarget,
|
|
46
46
|
E as DeployableUnknownOwnerProvidedError,
|
|
47
47
|
g as DeployableWagmiConfigurationRequiredError,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
w as ERC1155StrategyType,
|
|
49
|
+
Qe as ERC20Incentive,
|
|
50
|
+
Ze as ERC20VariableIncentive,
|
|
51
51
|
ve as EventAction,
|
|
52
52
|
C as EventActionValidationError,
|
|
53
53
|
P as FieldValueNotComparableError,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
R as
|
|
64
|
-
S as
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
M as
|
|
69
|
-
h as
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
B as
|
|
76
|
-
T as
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
sr as
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
54
|
+
u as FieldValueUndefinedError,
|
|
55
|
+
F as FilterType,
|
|
56
|
+
$e as IncentiveByComponentInterface,
|
|
57
|
+
v as IncentiveNotCloneableError,
|
|
58
|
+
I as InvalidComponentInterfaceError,
|
|
59
|
+
b as InvalidNumericalCriteriaError,
|
|
60
|
+
xe as LIST_MANAGER_ROLE,
|
|
61
|
+
Me as ManagedBudget,
|
|
62
|
+
he as ManagedBudgetRoles,
|
|
63
|
+
R as MustInitializeBudgetError,
|
|
64
|
+
S as NoContractAddressUponReceiptError,
|
|
65
|
+
x as NoEventActionStepsProvidedError,
|
|
66
|
+
Ee as PassthroughAuth,
|
|
67
|
+
or as PointsIncentive,
|
|
68
|
+
M as PrimitiveType,
|
|
69
|
+
h as RegistryType,
|
|
70
|
+
N as SignatureType,
|
|
71
|
+
tr as SignerValidator,
|
|
72
|
+
Be as SimpleAllowList,
|
|
73
|
+
De as SimpleDenyList,
|
|
74
|
+
O as StrategyType,
|
|
75
|
+
B as TooManyEventActionStepsProvidedError,
|
|
76
|
+
T as UnknownTransferPayloadSupplied,
|
|
77
|
+
D as UnrecognizedFilterTypeError,
|
|
78
|
+
nr as ValidatorByComponentInterface,
|
|
79
|
+
Pe as actionFromAddress,
|
|
80
|
+
Re as allowListFromAddress,
|
|
81
|
+
dr as allowListIncentiveAbi,
|
|
82
|
+
U as awaitResult,
|
|
83
|
+
sr as boostCoreAbi,
|
|
84
|
+
yr as boostRegistryAbi,
|
|
85
|
+
we as budgetFromAddress,
|
|
86
|
+
_ as bytes4,
|
|
87
|
+
mr as cgdaIncentiveAbi,
|
|
88
|
+
z as dedupeActionSteps,
|
|
89
|
+
cr as erc20IncentiveAbi,
|
|
89
90
|
G as getDeployedContractAddress,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
91
|
+
er as incentiveFromAddress,
|
|
92
|
+
Ne as isERC1155TransferPayload,
|
|
93
|
+
k as isEventActionPayloadSimple,
|
|
94
|
+
Oe as isFungibleTransfer,
|
|
95
|
+
Ar as managedBudgetAbi,
|
|
96
|
+
fr as passthroughAuthAbi,
|
|
97
|
+
Er as pointsIncentiveAbi,
|
|
98
|
+
q as prepareAllowListIncentivePayload,
|
|
99
|
+
W as prepareBoostClaimData,
|
|
100
|
+
Y as prepareBoostPayload,
|
|
101
|
+
j as prepareCGDAIncentivePayload,
|
|
102
|
+
H as prepareClaimPayload,
|
|
103
|
+
J as prepareContractActionPayload,
|
|
104
|
+
K as prepareERC1155IncentivePayload,
|
|
105
|
+
Q as prepareERC1155Payload,
|
|
106
|
+
X as prepareERC1155Transfer,
|
|
107
|
+
Z as prepareERC20IncentivePayload,
|
|
108
|
+
$ as prepareERC20VariableIncentivePayload,
|
|
109
|
+
ee as prepareERC721MintActionPayload,
|
|
110
|
+
re as prepareERC721MintActionValidate,
|
|
111
|
+
oe as prepareEventActionPayload,
|
|
112
|
+
ae as prepareFungiblePayload,
|
|
113
|
+
te as prepareFungibleTransfer,
|
|
114
|
+
ie as prepareManagedBudgetPayload,
|
|
115
|
+
ne as preparePointsIncentivePayload,
|
|
116
|
+
pe as prepareSignerValidatorClaimDataPayload,
|
|
117
|
+
le as prepareSignerValidatorInputParams,
|
|
118
|
+
de as prepareSignerValidatorPayload,
|
|
119
|
+
se as prepareSimpleAllowListPayload,
|
|
120
|
+
ye as prepareSimpleBudgetPayload,
|
|
121
|
+
me as prepareSimpleDenyListPayload,
|
|
122
|
+
Ue as prepareTransfer,
|
|
123
|
+
ce as prepareTransferPayload,
|
|
124
|
+
Ae as prepareVestingBudgetPayload,
|
|
125
|
+
gr as signerValidatorAbi,
|
|
126
|
+
Cr as simpleAllowListAbi,
|
|
127
|
+
Pr as simpleDenyListAbi,
|
|
128
|
+
pr as validatorFromAddress
|
|
128
129
|
};
|
|
129
130
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -46,8 +46,16 @@ import {
|
|
|
46
46
|
isEventActionPayloadSimple,
|
|
47
47
|
prepareEventActionPayload,
|
|
48
48
|
} from '../utils';
|
|
49
|
+
import type { SignatureType } from './../utils';
|
|
49
50
|
|
|
50
|
-
export type {
|
|
51
|
+
export type {
|
|
52
|
+
EventActionPayload,
|
|
53
|
+
ActionStep,
|
|
54
|
+
ActionClaimant,
|
|
55
|
+
SignatureType,
|
|
56
|
+
FilterType,
|
|
57
|
+
PrimitiveType,
|
|
58
|
+
};
|
|
51
59
|
|
|
52
60
|
/**
|
|
53
61
|
* A generic event action
|
|
@@ -270,7 +278,7 @@ export class EventAction extends DeployableTarget<
|
|
|
270
278
|
}));
|
|
271
279
|
if (!logs.length) return false;
|
|
272
280
|
for (let log of logs) {
|
|
273
|
-
if (!this.validateLogAgainstCriteria(criteria, log)) {
|
|
281
|
+
if (!(await this.validateLogAgainstCriteria(criteria, log))) {
|
|
274
282
|
return false;
|
|
275
283
|
}
|
|
276
284
|
}
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
type ReadParams,
|
|
27
27
|
RegistryType,
|
|
28
28
|
type SimpleAllowListPayload,
|
|
29
|
+
type WriteParams,
|
|
29
30
|
prepareSimpleAllowListPayload,
|
|
30
31
|
} from '../utils';
|
|
31
32
|
|
|
@@ -120,7 +121,7 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
120
121
|
public async setAllowed(
|
|
121
122
|
addresses: Address[],
|
|
122
123
|
allowed: boolean[],
|
|
123
|
-
params?:
|
|
124
|
+
params?: WriteParams<typeof simpleAllowListAbi, 'setAllowed'>,
|
|
124
125
|
) {
|
|
125
126
|
return this.awaitResult(this.setAllowedRaw(addresses, allowed, params));
|
|
126
127
|
}
|
|
@@ -168,7 +169,7 @@ export class SimpleAllowList extends DeployableTarget<
|
|
|
168
169
|
public async grantRoles(
|
|
169
170
|
address: Address,
|
|
170
171
|
role: bigint,
|
|
171
|
-
params?:
|
|
172
|
+
params?: WriteParams<typeof simpleAllowListAbi, 'grantRoles'>,
|
|
172
173
|
) {
|
|
173
174
|
return this.awaitResult(this.grantRolesRaw(address, role, params));
|
|
174
175
|
}
|
package/src/BoostCore.ts
CHANGED
|
@@ -9,10 +9,12 @@ import {
|
|
|
9
9
|
readBoostCoreProtocolFeeReceiver,
|
|
10
10
|
readIAuthIsAuthorized,
|
|
11
11
|
simulateBoostCoreClaimIncentive,
|
|
12
|
+
simulateBoostCoreClaimIncentiveFor,
|
|
12
13
|
simulateBoostCoreSetClaimFee,
|
|
13
14
|
simulateBoostCoreSetCreateBoostAuth,
|
|
14
15
|
simulateBoostCoreSetProtocolFeeReceiver,
|
|
15
16
|
writeBoostCoreClaimIncentive,
|
|
17
|
+
writeBoostCoreClaimIncentiveFor,
|
|
16
18
|
writeBoostCoreSetClaimFee,
|
|
17
19
|
writeBoostCoreSetCreateBoostAuth,
|
|
18
20
|
writeBoostCoreSetProtocolFeeReceiver,
|
|
@@ -82,6 +84,8 @@ import {
|
|
|
82
84
|
BoostCoreNoIdentifierEmitted,
|
|
83
85
|
BudgetMustAuthorizeBoostCore,
|
|
84
86
|
DeployableUnknownOwnerProvidedError,
|
|
87
|
+
IncentiveNotCloneableError,
|
|
88
|
+
MustInitializeBudgetError,
|
|
85
89
|
NoContractAddressUponReceiptError,
|
|
86
90
|
} from './errors';
|
|
87
91
|
import {
|
|
@@ -245,7 +249,8 @@ export class BoostCore extends Deployable<
|
|
|
245
249
|
}
|
|
246
250
|
//@ts-expect-error I can't set this property on the class because for some reason it takes super out of constructor scope?
|
|
247
251
|
this.abi = boostCoreAbi;
|
|
248
|
-
}
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
249
254
|
* Create a new Boost.
|
|
250
255
|
*
|
|
251
256
|
* @public
|
|
@@ -300,18 +305,7 @@ export class BoostCore extends Deployable<
|
|
|
300
305
|
throw new BudgetMustAuthorizeBoostCore(coreAddress);
|
|
301
306
|
}
|
|
302
307
|
} else {
|
|
303
|
-
|
|
304
|
-
const authorized = budget.payload?.authorized || [];
|
|
305
|
-
if (!authorized.includes(coreAddress)) {
|
|
306
|
-
throw new BudgetMustAuthorizeBoostCore(coreAddress);
|
|
307
|
-
}
|
|
308
|
-
const budgetHash = await budget.deployRaw(undefined, options);
|
|
309
|
-
const receipt = await waitForTransactionReceipt(options.config, {
|
|
310
|
-
hash: budgetHash,
|
|
311
|
-
});
|
|
312
|
-
if (!receipt.contractAddress)
|
|
313
|
-
throw new NoContractAddressUponReceiptError(receipt);
|
|
314
|
-
budgetPayload = receipt.contractAddress;
|
|
308
|
+
throw new MustInitializeBudgetError();
|
|
315
309
|
}
|
|
316
310
|
|
|
317
311
|
// if we're supplying an address, it could be a pre-initialized target
|
|
@@ -402,6 +396,7 @@ export class BoostCore extends Deployable<
|
|
|
402
396
|
const incentive = incentives.at(i)!;
|
|
403
397
|
if (incentive.address) {
|
|
404
398
|
const isBase = incentive.address === incentive.base || incentive.isBase;
|
|
399
|
+
if (!isBase) throw new IncentiveNotCloneableError(incentive);
|
|
405
400
|
incentivesPayloads[i] = {
|
|
406
401
|
isBase: isBase,
|
|
407
402
|
instance: incentive.address,
|
|
@@ -518,6 +513,74 @@ export class BoostCore extends Deployable<
|
|
|
518
513
|
return { hash, result };
|
|
519
514
|
}
|
|
520
515
|
|
|
516
|
+
/**
|
|
517
|
+
* Claims one incentive for a given `Boost` on behalf of another user by `boostId` and `incentiveId`
|
|
518
|
+
*
|
|
519
|
+
* @public
|
|
520
|
+
* @async
|
|
521
|
+
* @param {bigint} boostId
|
|
522
|
+
* @param {bigint} incentiveId
|
|
523
|
+
* @param {Address} referrer
|
|
524
|
+
* @param {Hex} data
|
|
525
|
+
* @param {Address} claimant
|
|
526
|
+
* @param {?WriteParams<typeof boostCoreAbi, 'claimIncentiveFor'>} [params]
|
|
527
|
+
* @returns {unknown}
|
|
528
|
+
*/
|
|
529
|
+
public async claimIncentiveFor(
|
|
530
|
+
boostId: bigint,
|
|
531
|
+
incentiveId: bigint,
|
|
532
|
+
referrer: Address,
|
|
533
|
+
data: Hex,
|
|
534
|
+
claimant: Address,
|
|
535
|
+
params?: WriteParams<typeof boostCoreAbi, 'claimIncentiveFor'>,
|
|
536
|
+
) {
|
|
537
|
+
return this.awaitResult(
|
|
538
|
+
this.claimIncentiveForRaw(
|
|
539
|
+
boostId,
|
|
540
|
+
incentiveId,
|
|
541
|
+
referrer,
|
|
542
|
+
data,
|
|
543
|
+
claimant,
|
|
544
|
+
params,
|
|
545
|
+
),
|
|
546
|
+
);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Claim an incentive for a Boost on behalf of another user
|
|
551
|
+
*
|
|
552
|
+
* @public
|
|
553
|
+
* @async
|
|
554
|
+
* @param {bigint} boostId - The ID of the Boost
|
|
555
|
+
* @param {bigint} incentiveId - The ID of the Incentive
|
|
556
|
+
* @param {Address} referrer - The address of the referrer (if any)
|
|
557
|
+
* @param {Hex} data - The data for the claim
|
|
558
|
+
* @param {Address} claimant - The address of the user eligible for the incentive payout
|
|
559
|
+
* @param {?WriteParams<typeof boostCoreAbi, 'claimIncentiveFor'>} [params]
|
|
560
|
+
* @returns {unknown}
|
|
561
|
+
*/
|
|
562
|
+
public async claimIncentiveForRaw(
|
|
563
|
+
boostId: bigint,
|
|
564
|
+
incentiveId: bigint,
|
|
565
|
+
referrer: Address,
|
|
566
|
+
data: Hex,
|
|
567
|
+
claimant: Address,
|
|
568
|
+
params?: WriteParams<typeof boostCoreAbi, 'claimIncentiveFor'>,
|
|
569
|
+
) {
|
|
570
|
+
const { request, result } = await simulateBoostCoreClaimIncentiveFor(
|
|
571
|
+
this._config,
|
|
572
|
+
{
|
|
573
|
+
address: this.assertValidAddress(),
|
|
574
|
+
args: [boostId, incentiveId, referrer, data, claimant],
|
|
575
|
+
...this.optionallyAttachAccount(),
|
|
576
|
+
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
577
|
+
...(params as any),
|
|
578
|
+
},
|
|
579
|
+
);
|
|
580
|
+
const hash = await writeBoostCoreClaimIncentiveFor(this._config, request);
|
|
581
|
+
return { hash, result };
|
|
582
|
+
}
|
|
583
|
+
|
|
521
584
|
/**
|
|
522
585
|
* Get a Boost by index, will return the raw on chain representation of a Boost.
|
|
523
586
|
*
|
package/src/BoostRegistry.ts
CHANGED
|
@@ -227,6 +227,27 @@ export class BoostRegistry extends Deployable<
|
|
|
227
227
|
return { hash, result };
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
+
/**
|
|
231
|
+
* Initialize a new instance of a registered base implementation, returning the provided target with a new address set on it.
|
|
232
|
+
* This method is the same as `clone`, but serves to make its function more obvious as to why you'd need to use it.
|
|
233
|
+
*
|
|
234
|
+
* @public
|
|
235
|
+
* @async
|
|
236
|
+
* @template {DeployableTarget} Target
|
|
237
|
+
* @param {string} displayName - The display name for the clone
|
|
238
|
+
* @param {Target} target - An instance of a target contract to clone and initialize
|
|
239
|
+
* @param {?WriteParams<typeof boostRegistryAbi, 'deployClone'>} [params]
|
|
240
|
+
* @returns {Target} - The provided instance, but with a new address attached.
|
|
241
|
+
* biome-ignore lint/suspicious/noExplicitAny: any deployable target will suffice
|
|
242
|
+
*/
|
|
243
|
+
public async initialize<Target extends DeployableTarget<any, any>>(
|
|
244
|
+
displayName: string,
|
|
245
|
+
target: Target,
|
|
246
|
+
params?: WriteParams<typeof boostRegistryAbi, 'deployClone'>,
|
|
247
|
+
): Promise<Target> {
|
|
248
|
+
return this.clone(displayName, target, params);
|
|
249
|
+
}
|
|
250
|
+
|
|
230
251
|
/**
|
|
231
252
|
* Deploy a new instance of a registered base implementation, returning the provided target with a new address set on it.
|
|
232
253
|
*
|
|
@@ -140,6 +140,9 @@ export class Deployable<
|
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
142
|
* High level deployment function to deploy and await the contract address.
|
|
143
|
+
* This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,
|
|
144
|
+
* which makes it useless for Boost components.
|
|
145
|
+
* Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
|
|
143
146
|
*
|
|
144
147
|
* @public
|
|
145
148
|
* @async
|
|
@@ -148,7 +151,7 @@ export class Deployable<
|
|
|
148
151
|
* @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - See [viem.WaitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)
|
|
149
152
|
* @returns {unknown}
|
|
150
153
|
*/
|
|
151
|
-
|
|
154
|
+
protected async deploy(
|
|
152
155
|
_payload?: Payload,
|
|
153
156
|
_options?: DeployableOptions,
|
|
154
157
|
waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,
|
|
@@ -165,6 +168,9 @@ export class Deployable<
|
|
|
165
168
|
|
|
166
169
|
/**
|
|
167
170
|
* The lower level contract deployment function that does not await for the transaction receipt.
|
|
171
|
+
* This is mainly a convenience method to easily deploy a contract, but will not initialize a `Cloneable`,
|
|
172
|
+
* which makes it useless for Boost components.
|
|
173
|
+
* Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
|
|
168
174
|
*
|
|
169
175
|
* @public
|
|
170
176
|
* @async
|
|
@@ -175,7 +181,7 @@ export class Deployable<
|
|
|
175
181
|
* @throws {@link DeployableWagmiConfigurationRequiredError}
|
|
176
182
|
* @throws {@link DeployableMissingPayloadError}
|
|
177
183
|
*/
|
|
178
|
-
|
|
184
|
+
protected async deployRaw(
|
|
179
185
|
_payload?: Payload,
|
|
180
186
|
_options?: DeployableOptions,
|
|
181
187
|
): Promise<Hash> {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type Hash,
|
|
11
11
|
type Hex,
|
|
12
12
|
type WaitForTransactionReceiptParameters,
|
|
13
|
+
isAddress,
|
|
13
14
|
zeroAddress,
|
|
14
15
|
} from 'viem';
|
|
15
16
|
import {
|
|
@@ -58,7 +59,11 @@ export class DeployableTarget<
|
|
|
58
59
|
* @readonly
|
|
59
60
|
* @type {boolean}
|
|
60
61
|
*/
|
|
61
|
-
|
|
62
|
+
protected _isBase = true;
|
|
63
|
+
get isBase() {
|
|
64
|
+
if (!!this.address && this.address !== this.base) return false;
|
|
65
|
+
return this._isBase;
|
|
66
|
+
}
|
|
62
67
|
|
|
63
68
|
/**
|
|
64
69
|
* Creates an instance of DeployableTarget.
|
|
@@ -74,7 +79,15 @@ export class DeployableTarget<
|
|
|
74
79
|
isBase?: boolean,
|
|
75
80
|
) {
|
|
76
81
|
super(options, payload);
|
|
77
|
-
if
|
|
82
|
+
// if supplying a custom address, safe enough to assume it is not a base address which makes reusing contracts like budgets easier
|
|
83
|
+
if (
|
|
84
|
+
typeof payload === 'string' &&
|
|
85
|
+
isAddress(payload) &&
|
|
86
|
+
payload !== this.base &&
|
|
87
|
+
payload !== zeroAddress
|
|
88
|
+
)
|
|
89
|
+
isBase = false;
|
|
90
|
+
if (isBase !== undefined) this._isBase = isBase;
|
|
78
91
|
}
|
|
79
92
|
|
|
80
93
|
/**
|
|
@@ -109,7 +122,7 @@ export class DeployableTarget<
|
|
|
109
122
|
* @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]
|
|
110
123
|
* @returns {unknown}
|
|
111
124
|
*/
|
|
112
|
-
|
|
125
|
+
protected override async deploy(
|
|
113
126
|
payload?: Payload,
|
|
114
127
|
options?: DeployableOptions,
|
|
115
128
|
waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,
|
|
@@ -128,7 +141,7 @@ export class DeployableTarget<
|
|
|
128
141
|
* @param {?DeployableOptions} [_options]
|
|
129
142
|
* @returns {Promise<Hash>}
|
|
130
143
|
*/
|
|
131
|
-
|
|
144
|
+
protected override async deployRaw(
|
|
132
145
|
_payload?: Payload,
|
|
133
146
|
_options?: DeployableOptions,
|
|
134
147
|
): Promise<Hash> {
|
package/src/errors.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
type WaitForTransactionReceiptReturnType,
|
|
5
5
|
zeroHash,
|
|
6
6
|
} from 'viem';
|
|
7
|
+
import type { BoostRegistry } from './BoostRegistry';
|
|
7
8
|
import type { Incentive } from './Incentives/Incentive';
|
|
8
9
|
import type { Criteria } from './utils';
|
|
9
10
|
|
|
@@ -301,6 +302,23 @@ export class BudgetMustAuthorizeBoostCore extends Error {
|
|
|
301
302
|
}
|
|
302
303
|
}
|
|
303
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Because this contract is a base implementation, it should not be initialized through the constructor. Instead, it should be cloned and initialized using the {@link BoostRegistry}
|
|
307
|
+
*
|
|
308
|
+
* @export
|
|
309
|
+
* @class MustInitializeBudgetError
|
|
310
|
+
* @typedef {MustInitializeBudgetError}
|
|
311
|
+
* @extends {Error}
|
|
312
|
+
*/
|
|
313
|
+
export class MustInitializeBudgetError extends Error {
|
|
314
|
+
/**
|
|
315
|
+
* Creates an instance of MustInitializeBudgetError.
|
|
316
|
+
*/
|
|
317
|
+
constructor() {
|
|
318
|
+
super(`Budgets must be preinitialized before being used with a new Boost`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
304
322
|
/**
|
|
305
323
|
* The error is thrown when trying to reuse an existing deployed Incentive that isn't a base implementation.
|
|
306
324
|
* The protocol doesn't allow this.
|