@boostxyz/sdk 0.0.0-alpha.15 → 0.0.0-alpha.17
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 +8 -8
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +416 -135
- package/dist/Actions/EventAction.js.map +1 -1
- package/dist/AllowLists/AllowList.cjs +1 -1
- package/dist/AllowLists/AllowList.cjs.map +1 -1
- package/dist/AllowLists/AllowList.js +3 -3
- package/dist/AllowLists/OpenAllowList.d.ts +183 -0
- package/dist/AllowLists/OpenAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +86 -31
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +54 -73
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.d.ts +195 -3
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +4 -4
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs +2 -2
- package/dist/BoostCore.js +22 -22
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +10 -10
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.cjs.map +1 -1
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/Budget.js.map +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +6 -156
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +60 -282
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +158 -54
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
- package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts +179 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js +222 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
- package/dist/{Incentive-CSnbCt3P.js → Incentive-DJf-vdyL.js} +23 -23
- package/dist/{Incentive-CSnbCt3P.js.map → Incentive-DJf-vdyL.js.map} +1 -1
- package/dist/{Incentive-BroOQqVi.cjs → Incentive-DNwROd1r.cjs} +2 -2
- package/dist/{Incentive-BroOQqVi.cjs.map → Incentive-DNwROd1r.cjs.map} +1 -1
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.js +10 -10
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.js +9 -9
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.js +23 -23
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.js +3 -3
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.js +6 -6
- package/dist/SimpleDenyList-DMlUkmAn.cjs +2 -0
- package/dist/SimpleDenyList-DMlUkmAn.cjs.map +1 -0
- package/dist/SimpleDenyList-DvUvmOeE.js +132 -0
- package/dist/SimpleDenyList-DvUvmOeE.js.map +1 -0
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +7 -7
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/componentInterfaces-BPVR_Ykd.js +13 -0
- package/dist/componentInterfaces-BPVR_Ykd.js.map +1 -0
- package/dist/{componentInterfaces-CKCBwG16.cjs → componentInterfaces-BfppSIl4.cjs} +2 -2
- package/dist/componentInterfaces-BfppSIl4.cjs.map +1 -0
- package/dist/generated-CMQ6ZC2_.cjs +3 -0
- package/dist/generated-CMQ6ZC2_.cjs.map +1 -0
- package/dist/{generated-CdXG-MpB.js → generated-C_7Jx3YG.js} +1666 -890
- package/dist/generated-C_7Jx3YG.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 +100 -96
- package/dist/index.js.map +1 -1
- package/package.json +11 -4
- package/src/Actions/EventAction.test.ts +138 -0
- package/src/Actions/EventAction.ts +28 -7
- package/src/AllowLists/SimpleAllowList.ts +29 -54
- package/src/AllowLists/SimpleDenyList.ts +27 -3
- package/src/Budgets/Budget.ts +1 -2
- package/src/Budgets/ManagedBudget.ts +3 -277
- package/src/Budgets/VestingBudget.ts +3 -74
- package/src/Deployable/DeployableTargetWithRBAC.ts +323 -0
- package/src/index.test.ts +3 -4
- package/src/index.ts +1 -0
- package/dist/Budgets/SimpleBudget.d.ts +0 -824
- package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
- package/dist/SimpleDenyList-CzNNbmmV.cjs +0 -2
- package/dist/SimpleDenyList-CzNNbmmV.cjs.map +0 -1
- package/dist/SimpleDenyList-sfskWLfa.js +0 -115
- package/dist/SimpleDenyList-sfskWLfa.js.map +0 -1
- package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
- package/dist/componentInterfaces-Cmg8tUxq.js +0 -13
- package/dist/componentInterfaces-Cmg8tUxq.js.map +0 -1
- package/dist/generated-BulULVyy.cjs +0 -3
- package/dist/generated-BulULVyy.cjs.map +0 -1
- package/dist/generated-CdXG-MpB.js.map +0 -1
- package/src/Budgets/SimpleBudget.test.ts +0 -152
- package/src/Budgets/SimpleBudget.ts +0 -563
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./BoostRegistry.cjs"),i=require("./BoostCore.cjs"),y=require("./Boost.cjs"),E=require("./Actions/Action.cjs"),o=require("./Actions/EventAction.cjs"),p=require("./AllowLists/AllowList.cjs"),c=require("./AllowLists/SimpleAllowList.cjs"),A=require("./SimpleDenyList-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./BoostRegistry.cjs"),i=require("./BoostCore.cjs"),y=require("./Boost.cjs"),E=require("./Actions/Action.cjs"),o=require("./Actions/EventAction.cjs"),p=require("./AllowLists/AllowList.cjs"),c=require("./AllowLists/SimpleAllowList.cjs"),A=require("./SimpleDenyList-DMlUkmAn.cjs"),u=require("./Budgets/Budget.cjs"),a=require("./Budgets/ManagedBudget.cjs"),R=require("./Deployable/Deployable.cjs"),b=require("./Deployable/Contract.cjs"),D=require("./Deployable/DeployableTarget.cjs"),C=require("./Deployable/DeployableTargetWithRBAC.cjs"),g=require("./Incentives/AllowListIncentive.cjs"),I=require("./Incentives/CGDAIncentive.cjs"),S=require("./Incentives/ERC20Incentive.cjs"),l=require("./Incentive-DNwROd1r.cjs"),P=require("./Incentives/PointsIncentive.cjs"),d=require("./Validators/SignerValidator.cjs"),v=require("./Validators/Validator.cjs"),e=require("./errors.cjs"),n=require("./utils.cjs"),m=require("./claiming.cjs"),t=require("./transfers.cjs"),B=require("./Auth/PassthroughAuth.cjs"),r=require("./generated-CMQ6ZC2_.cjs");exports.BOOST_REGISTRY_ADDRESS=s.BOOST_REGISTRY_ADDRESS;exports.BOOST_REGISTRY_ADDRESSES=s.BOOST_REGISTRY_ADDRESSES;exports.BoostRegistry=s.BoostRegistry;exports.BOOST_CORE_ADDRESS=i.BOOST_CORE_ADDRESS;exports.BOOST_CORE_ADDRESSES=i.BOOST_CORE_ADDRESSES;exports.BOOST_CORE_CLAIM_FEE=i.BOOST_CORE_CLAIM_FEE;exports.BoostCore=i.BoostCore;exports.Boost=y.Boost;exports.prepareBoostPayload=y.prepareBoostPayload;exports.ActionByComponentInterface=E.ActionByComponentInterface;exports.actionFromAddress=E.actionFromAddress;exports.EventAction=o.EventAction;exports.FilterType=o.FilterType;exports.PrimitiveType=o.PrimitiveType;exports.SignatureType=o.SignatureType;exports.isEventActionPayloadSimple=o.isEventActionPayloadSimple;exports.prepareEventActionPayload=o.prepareEventActionPayload;exports.AllowListByComponentInterface=p.AllowListByComponentInterface;exports.OpenAllowList=p.OpenAllowList;exports.allowListFromAddress=p.allowListFromAddress;exports.LIST_MANAGER_ROLE=c.LIST_MANAGER_ROLE;exports.SimpleAllowList=c.SimpleAllowList;exports.prepareSimpleAllowListPayload=c.prepareSimpleAllowListPayload;exports.SimpleDenyList=A.SimpleDenyList;exports.prepareSimpleDenyListPayload=A.prepareSimpleDenyListPayload;exports.BudgetByComponentInterface=u.BudgetByComponentInterface;exports.budgetFromAddress=u.budgetFromAddress;exports.ManagedBudget=a.ManagedBudget;exports.ManagedBudgetRoles=a.ManagedBudgetRoles;exports.isERC1155TransferPayload=a.isERC1155TransferPayload;exports.isFungibleTransfer=a.isFungibleTransfer;exports.prepareManagedBudgetPayload=a.prepareManagedBudgetPayload;exports.prepareTransfer=a.prepareTransfer;exports.Deployable=R.Deployable;exports.Contract=b.Contract;exports.DeployableTarget=D.DeployableTarget;exports.DeployableTargetWithRBAC=C.DeployableTargetWithRBAC;exports.Roles=C.Roles;exports.AllowListIncentive=g.AllowListIncentive;exports.prepareAllowListIncentivePayload=g.prepareAllowListIncentivePayload;exports.CGDAIncentive=I.CGDAIncentive;exports.prepareCGDAIncentivePayload=I.prepareCGDAIncentivePayload;exports.ERC20Incentive=S.ERC20Incentive;exports.prepareERC20IncentivePayload=S.prepareERC20IncentivePayload;exports.ERC20VariableIncentive=l.ERC20VariableIncentive;exports.IncentiveByComponentInterface=l.IncentiveByComponentInterface;exports.incentiveFromAddress=l.incentiveFromAddress;exports.prepareERC20VariableIncentivePayload=l.prepareERC20VariableIncentivePayload;exports.PointsIncentive=P.PointsIncentive;exports.preparePointsIncentivePayload=P.preparePointsIncentivePayload;exports.SignerValidator=d.SignerValidator;exports.prepareSignerValidatorClaimDataPayload=d.prepareSignerValidatorClaimDataPayload;exports.prepareSignerValidatorInputParams=d.prepareSignerValidatorInputParams;exports.prepareSignerValidatorPayload=d.prepareSignerValidatorPayload;exports.ValidatorByComponentInterface=v.ValidatorByComponentInterface;exports.validatorFromAddress=v.validatorFromAddress;exports.BoostCoreNoIdentifierEmitted=e.BoostCoreNoIdentifierEmitted;exports.BudgetMustAuthorizeBoostCore=e.BudgetMustAuthorizeBoostCore;exports.ContractAddressRequiredError=e.ContractAddressRequiredError;exports.DecodedArgsMalformedError=e.DecodedArgsMalformedError;exports.DeployableAlreadyDeployedError=e.DeployableAlreadyDeployedError;exports.DeployableBuildParametersUnspecifiedError=e.DeployableBuildParametersUnspecifiedError;exports.DeployableMissingPayloadError=e.DeployableMissingPayloadError;exports.DeployableUnknownOwnerProvidedError=e.DeployableUnknownOwnerProvidedError;exports.DeployableWagmiConfigurationRequiredError=e.DeployableWagmiConfigurationRequiredError;exports.FieldActionValidationError=e.FieldActionValidationError;exports.FieldValueNotComparableError=e.FieldValueNotComparableError;exports.FieldValueUndefinedError=e.FieldValueUndefinedError;exports.FunctionDataDecodeError=e.FunctionDataDecodeError;exports.IncentiveNotCloneableError=e.IncentiveNotCloneableError;exports.InvalidComponentInterfaceError=e.InvalidComponentInterfaceError;exports.InvalidNumericalCriteriaError=e.InvalidNumericalCriteriaError;exports.InvalidProtocolChainIdError=e.InvalidProtocolChainIdError;exports.MustInitializeBudgetError=e.MustInitializeBudgetError;exports.NoConnectedChainIdError=e.NoConnectedChainIdError;exports.NoContractAddressUponReceiptError=e.NoContractAddressUponReceiptError;exports.NoEventActionStepsProvidedError=e.NoEventActionStepsProvidedError;exports.TooManyEventActionStepsProvidedError=e.TooManyEventActionStepsProvidedError;exports.UnknownTransferPayloadSupplied=e.UnknownTransferPayloadSupplied;exports.UnparseableAbiParamError=e.UnparseableAbiParamError;exports.UnrecognizedFilterTypeError=e.UnrecognizedFilterTypeError;exports.RegistryType=n.RegistryType;exports.assertValidAddressByChainId=n.assertValidAddressByChainId;exports.awaitResult=n.awaitResult;exports.bytes4=n.bytes4;exports.getDeployedContractAddress=n.getDeployedContractAddress;exports.StrategyType=m.StrategyType;exports.prepareClaimPayload=m.prepareClaimPayload;exports.AssetType=t.AssetType;exports.prepareERC1155Payload=t.prepareERC1155Payload;exports.prepareERC1155Transfer=t.prepareERC1155Transfer;exports.prepareFungiblePayload=t.prepareFungiblePayload;exports.prepareFungibleTransfer=t.prepareFungibleTransfer;exports.prepareTransferPayload=t.prepareTransferPayload;exports.PassthroughAuth=B.PassthroughAuth;exports.allowListIncentiveAbi=r.O;exports.boostCoreAbi=r.b;exports.cgdaIncentiveAbi=r.N;exports.erc20IncentiveAbi=r.T;exports.erc20VariableIncentiveAbi=r.g;exports.managedBudgetAbi=r.l;exports.passthroughAuthAbi=r.Ce;exports.pointsIncentiveAbi=r.c;exports.rbacAbi=r.C;exports.signerValidatorAbi=r.H;exports.simpleAllowListAbi=r.A;exports.simpleDenyListAbi=r.h;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './Budgets/ManagedBudget';
|
|
|
11
11
|
export * from './Deployable/Deployable';
|
|
12
12
|
export * from './Deployable/Contract';
|
|
13
13
|
export * from './Deployable/DeployableTarget';
|
|
14
|
+
export * from './Deployable/DeployableTargetWithRBAC';
|
|
14
15
|
export * from './Incentives/AllowListIncentive';
|
|
15
16
|
export * from './Incentives/CGDAIncentive';
|
|
16
17
|
export * from './Incentives/ERC20Incentive';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAIxB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,uBAAuB,CAAC;AAItC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAI5C,cAAc,kBAAkB,CAAC;AAGjC,cAAc,yBAAyB,CAAC;AAIxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAIxB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,uBAAuB,CAAC;AAItC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAI5C,cAAc,kBAAkB,CAAC;AAGjC,cAAc,yBAAyB,CAAC;AAIxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AAItD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AAEpD,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAI7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AAIvC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAI5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,133 +1,137 @@
|
|
|
1
1
|
import { BOOST_REGISTRY_ADDRESS as o, BOOST_REGISTRY_ADDRESSES as a, BoostRegistry as t } from "./BoostRegistry.js";
|
|
2
|
-
import { BOOST_CORE_ADDRESS as n, BOOST_CORE_ADDRESSES as p, BOOST_CORE_CLAIM_FEE as l, BoostCore as
|
|
3
|
-
import { Boost as m, prepareBoostPayload as
|
|
2
|
+
import { BOOST_CORE_ADDRESS as n, BOOST_CORE_ADDRESSES as p, BOOST_CORE_CLAIM_FEE as l, BoostCore as s } from "./BoostCore.js";
|
|
3
|
+
import { Boost as m, prepareBoostPayload as A } from "./Boost.js";
|
|
4
4
|
import { ActionByComponentInterface as E, actionFromAddress as c } from "./Actions/Action.js";
|
|
5
|
-
import { EventAction as C, FilterType as I, PrimitiveType as g, SignatureType as
|
|
5
|
+
import { EventAction as C, FilterType as I, PrimitiveType as g, SignatureType as b, isEventActionPayloadSimple as S, prepareEventActionPayload as v } from "./Actions/EventAction.js";
|
|
6
6
|
import { AllowListByComponentInterface as u, OpenAllowList as R, allowListFromAddress as x } from "./AllowLists/AllowList.js";
|
|
7
7
|
import { LIST_MANAGER_ROLE as B, SimpleAllowList as T, prepareSimpleAllowListPayload as O } from "./AllowLists/SimpleAllowList.js";
|
|
8
|
-
import { S as L, p as w } from "./SimpleDenyList-
|
|
9
|
-
import { BudgetByComponentInterface as _, budgetFromAddress as
|
|
8
|
+
import { S as L, p as w } from "./SimpleDenyList-DvUvmOeE.js";
|
|
9
|
+
import { BudgetByComponentInterface as _, budgetFromAddress as h } from "./Budgets/Budget.js";
|
|
10
10
|
import { ManagedBudget as N, ManagedBudgetRoles as U, isERC1155TransferPayload as G, isFungibleTransfer as z, prepareManagedBudgetPayload as k, prepareTransfer as q } from "./Budgets/ManagedBudget.js";
|
|
11
|
-
import { Deployable as
|
|
12
|
-
import { Contract as
|
|
11
|
+
import { Deployable as Y } from "./Deployable/Deployable.js";
|
|
12
|
+
import { Contract as j } from "./Deployable/Contract.js";
|
|
13
13
|
import { DeployableTarget as K } from "./Deployable/DeployableTarget.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
14
|
+
import { DeployableTargetWithRBAC as X, Roles as Z } from "./Deployable/DeployableTargetWithRBAC.js";
|
|
15
|
+
import { AllowListIncentive as ee, prepareAllowListIncentivePayload as re } from "./Incentives/AllowListIncentive.js";
|
|
16
|
+
import { CGDAIncentive as ae, prepareCGDAIncentivePayload as te } from "./Incentives/CGDAIncentive.js";
|
|
17
|
+
import { ERC20Incentive as ne, prepareERC20IncentivePayload as pe } from "./Incentives/ERC20Incentive.js";
|
|
18
|
+
import { E as se, I as de, i as me, p as Ae } from "./Incentive-DJf-vdyL.js";
|
|
19
|
+
import { PointsIncentive as Ee, preparePointsIncentivePayload as ce } from "./Incentives/PointsIncentive.js";
|
|
20
|
+
import { SignerValidator as Ce, prepareSignerValidatorClaimDataPayload as Ie, prepareSignerValidatorInputParams as ge, prepareSignerValidatorPayload as be } from "./Validators/SignerValidator.js";
|
|
21
|
+
import { ValidatorByComponentInterface as ve, validatorFromAddress as Pe } from "./Validators/Validator.js";
|
|
22
|
+
import { BoostCoreNoIdentifierEmitted as Re, BudgetMustAuthorizeBoostCore as xe, ContractAddressRequiredError as De, DecodedArgsMalformedError as Be, DeployableAlreadyDeployedError as Te, DeployableBuildParametersUnspecifiedError as Oe, DeployableMissingPayloadError as Fe, DeployableUnknownOwnerProvidedError as Le, DeployableWagmiConfigurationRequiredError as we, FieldActionValidationError as Ve, FieldValueNotComparableError as _e, FieldValueUndefinedError as he, FunctionDataDecodeError as Me, IncentiveNotCloneableError as Ne, InvalidComponentInterfaceError as Ue, InvalidNumericalCriteriaError as Ge, InvalidProtocolChainIdError as ze, MustInitializeBudgetError as ke, NoConnectedChainIdError as qe, NoContractAddressUponReceiptError as We, NoEventActionStepsProvidedError as Ye, TooManyEventActionStepsProvidedError as He, UnknownTransferPayloadSupplied as je, UnparseableAbiParamError as Je, UnrecognizedFilterTypeError as Ke } from "./errors.js";
|
|
23
|
+
import { RegistryType as Xe, assertValidAddressByChainId as Ze, awaitResult as $e, bytes4 as er, getDeployedContractAddress as rr } from "./utils.js";
|
|
24
|
+
import { StrategyType as ar, prepareClaimPayload as tr } from "./claiming.js";
|
|
25
|
+
import { AssetType as nr, prepareERC1155Payload as pr, prepareERC1155Transfer as lr, prepareFungiblePayload as sr, prepareFungibleTransfer as dr, prepareTransferPayload as mr } from "./transfers.js";
|
|
26
|
+
import { PassthroughAuth as yr } from "./Auth/PassthroughAuth.js";
|
|
27
|
+
import { O as cr, b as fr, N as Cr, T as Ir, g as gr, l as br, a as Sr, c as vr, C as Pr, H as ur, A as Rr, h as xr } from "./generated-C_7Jx3YG.js";
|
|
27
28
|
export {
|
|
28
29
|
E as ActionByComponentInterface,
|
|
29
30
|
u as AllowListByComponentInterface,
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
ee as AllowListIncentive,
|
|
32
|
+
nr as AssetType,
|
|
32
33
|
n as BOOST_CORE_ADDRESS,
|
|
33
34
|
p as BOOST_CORE_ADDRESSES,
|
|
34
35
|
l as BOOST_CORE_CLAIM_FEE,
|
|
35
36
|
o as BOOST_REGISTRY_ADDRESS,
|
|
36
37
|
a as BOOST_REGISTRY_ADDRESSES,
|
|
37
38
|
m as Boost,
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
s as BoostCore,
|
|
40
|
+
Re as BoostCoreNoIdentifierEmitted,
|
|
40
41
|
t as BoostRegistry,
|
|
41
42
|
_ as BudgetByComponentInterface,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
xe as BudgetMustAuthorizeBoostCore,
|
|
44
|
+
ae as CGDAIncentive,
|
|
45
|
+
j as Contract,
|
|
46
|
+
De as ContractAddressRequiredError,
|
|
47
|
+
Be as DecodedArgsMalformedError,
|
|
48
|
+
Y as Deployable,
|
|
49
|
+
Te as DeployableAlreadyDeployedError,
|
|
50
|
+
Oe as DeployableBuildParametersUnspecifiedError,
|
|
51
|
+
Fe as DeployableMissingPayloadError,
|
|
51
52
|
K as DeployableTarget,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
ne as
|
|
53
|
+
X as DeployableTargetWithRBAC,
|
|
54
|
+
Le as DeployableUnknownOwnerProvidedError,
|
|
55
|
+
we as DeployableWagmiConfigurationRequiredError,
|
|
56
|
+
ne as ERC20Incentive,
|
|
57
|
+
se as ERC20VariableIncentive,
|
|
56
58
|
C as EventAction,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
Ve as FieldActionValidationError,
|
|
60
|
+
_e as FieldValueNotComparableError,
|
|
61
|
+
he as FieldValueUndefinedError,
|
|
60
62
|
I as FilterType,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
Me as FunctionDataDecodeError,
|
|
64
|
+
de as IncentiveByComponentInterface,
|
|
65
|
+
Ne as IncentiveNotCloneableError,
|
|
66
|
+
Ue as InvalidComponentInterfaceError,
|
|
67
|
+
Ge as InvalidNumericalCriteriaError,
|
|
68
|
+
ze as InvalidProtocolChainIdError,
|
|
67
69
|
B as LIST_MANAGER_ROLE,
|
|
68
70
|
N as ManagedBudget,
|
|
69
71
|
U as ManagedBudgetRoles,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
ke as MustInitializeBudgetError,
|
|
73
|
+
qe as NoConnectedChainIdError,
|
|
74
|
+
We as NoContractAddressUponReceiptError,
|
|
75
|
+
Ye as NoEventActionStepsProvidedError,
|
|
74
76
|
R as OpenAllowList,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
yr as PassthroughAuth,
|
|
78
|
+
Ee as PointsIncentive,
|
|
77
79
|
g as PrimitiveType,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
Xe as RegistryType,
|
|
81
|
+
Z as Roles,
|
|
82
|
+
b as SignatureType,
|
|
83
|
+
Ce as SignerValidator,
|
|
81
84
|
T as SimpleAllowList,
|
|
82
85
|
L as SimpleDenyList,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
ar as StrategyType,
|
|
87
|
+
He as TooManyEventActionStepsProvidedError,
|
|
88
|
+
je as UnknownTransferPayloadSupplied,
|
|
89
|
+
Je as UnparseableAbiParamError,
|
|
90
|
+
Ke as UnrecognizedFilterTypeError,
|
|
91
|
+
ve as ValidatorByComponentInterface,
|
|
89
92
|
c as actionFromAddress,
|
|
90
93
|
x as allowListFromAddress,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
cr as allowListIncentiveAbi,
|
|
95
|
+
Ze as assertValidAddressByChainId,
|
|
96
|
+
$e as awaitResult,
|
|
97
|
+
fr as boostCoreAbi,
|
|
98
|
+
h as budgetFromAddress,
|
|
99
|
+
er as bytes4,
|
|
100
|
+
Cr as cgdaIncentiveAbi,
|
|
101
|
+
Ir as erc20IncentiveAbi,
|
|
102
|
+
gr as erc20VariableIncentiveAbi,
|
|
103
|
+
rr as getDeployedContractAddress,
|
|
104
|
+
me as incentiveFromAddress,
|
|
102
105
|
G as isERC1155TransferPayload,
|
|
103
|
-
|
|
106
|
+
S as isEventActionPayloadSimple,
|
|
104
107
|
z as isFungibleTransfer,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
br as managedBudgetAbi,
|
|
109
|
+
Sr as passthroughAuthAbi,
|
|
110
|
+
vr as pointsIncentiveAbi,
|
|
111
|
+
re as prepareAllowListIncentivePayload,
|
|
112
|
+
A as prepareBoostPayload,
|
|
113
|
+
te as prepareCGDAIncentivePayload,
|
|
114
|
+
tr as prepareClaimPayload,
|
|
115
|
+
pr as prepareERC1155Payload,
|
|
116
|
+
lr as prepareERC1155Transfer,
|
|
117
|
+
pe as prepareERC20IncentivePayload,
|
|
118
|
+
Ae as prepareERC20VariableIncentivePayload,
|
|
119
|
+
v as prepareEventActionPayload,
|
|
120
|
+
sr as prepareFungiblePayload,
|
|
121
|
+
dr as prepareFungibleTransfer,
|
|
119
122
|
k as prepareManagedBudgetPayload,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
ce as preparePointsIncentivePayload,
|
|
124
|
+
Ie as prepareSignerValidatorClaimDataPayload,
|
|
125
|
+
ge as prepareSignerValidatorInputParams,
|
|
126
|
+
be as prepareSignerValidatorPayload,
|
|
124
127
|
O as prepareSimpleAllowListPayload,
|
|
125
128
|
w as prepareSimpleDenyListPayload,
|
|
126
129
|
q as prepareTransfer,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
mr as prepareTransferPayload,
|
|
131
|
+
Pr as rbacAbi,
|
|
132
|
+
ur as signerValidatorAbi,
|
|
133
|
+
Rr as simpleAllowListAbi,
|
|
134
|
+
xr as simpleDenyListAbi,
|
|
135
|
+
Pe as validatorFromAddress
|
|
132
136
|
};
|
|
133
137
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boostxyz/sdk",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.17",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -97,6 +97,12 @@
|
|
|
97
97
|
"node": "./dist/Deployable/DeployableTarget.js",
|
|
98
98
|
"types": "./dist/Deployable/DeployableTarget.d.ts"
|
|
99
99
|
},
|
|
100
|
+
"./Deployable/DeployableTargetWithRBAC": {
|
|
101
|
+
"require": "./dist/Deployable/DeployableTargetWithRBAC.cjs",
|
|
102
|
+
"import": "./dist/Deployable/DeployableTargetWithRBAC.js",
|
|
103
|
+
"node": "./dist/Deployable/DeployableTargetWithRBAC.js",
|
|
104
|
+
"types": "./dist/Deployable/DeployableTargetWithRBAC.d.ts"
|
|
105
|
+
},
|
|
100
106
|
"./Deployable/Contract": {
|
|
101
107
|
"require": "./dist/Deployable/Contract.cjs",
|
|
102
108
|
"import": "./dist/Deployable/Contract.js",
|
|
@@ -189,11 +195,12 @@
|
|
|
189
195
|
}
|
|
190
196
|
},
|
|
191
197
|
"dependencies": {
|
|
192
|
-
"
|
|
198
|
+
"ts-pattern": "5.4.0",
|
|
199
|
+
"@boostxyz/signatures": "0.0.0-alpha.5"
|
|
193
200
|
},
|
|
194
201
|
"optionalDependencies": {
|
|
195
|
-
"@boostxyz/signatures": "0.0.0-alpha.
|
|
196
|
-
"@boostxyz/evm": "0.0.0-alpha.
|
|
202
|
+
"@boostxyz/signatures": "0.0.0-alpha.5",
|
|
203
|
+
"@boostxyz/evm": "0.0.0-alpha.5"
|
|
197
204
|
},
|
|
198
205
|
"peerDependencies": {
|
|
199
206
|
"@wagmi/core": "2.x",
|
|
@@ -11,11 +11,13 @@ import {
|
|
|
11
11
|
pad,
|
|
12
12
|
parseEther,
|
|
13
13
|
toHex,
|
|
14
|
+
zeroAddress,
|
|
14
15
|
} from 'viem';
|
|
15
16
|
import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
|
|
16
17
|
import type { MockERC20 } from '@boostxyz/test/MockERC20';
|
|
17
18
|
import type { MockERC721 } from '@boostxyz/test/MockERC721';
|
|
18
19
|
import { accounts } from '@boostxyz/test/accounts';
|
|
20
|
+
import { InvalidNumericalCriteriaError, FieldValueNotComparableError, UnrecognizedFilterTypeError } from '../errors';
|
|
19
21
|
import {
|
|
20
22
|
type Fixtures,
|
|
21
23
|
type StringEmitterFixtures,
|
|
@@ -32,6 +34,7 @@ import {
|
|
|
32
34
|
FilterType,
|
|
33
35
|
PrimitiveType,
|
|
34
36
|
SignatureType,
|
|
37
|
+
Criteria,
|
|
35
38
|
} from "./EventAction";
|
|
36
39
|
|
|
37
40
|
let fixtures: Fixtures,
|
|
@@ -248,6 +251,20 @@ function cloneStringEventAction(
|
|
|
248
251
|
};
|
|
249
252
|
}
|
|
250
253
|
|
|
254
|
+
function createMockCriteria(
|
|
255
|
+
filterType: FilterType,
|
|
256
|
+
fieldType: PrimitiveType,
|
|
257
|
+
filterData: Hex,
|
|
258
|
+
fieldIndex: number = 0
|
|
259
|
+
): Criteria {
|
|
260
|
+
return {
|
|
261
|
+
filterType,
|
|
262
|
+
fieldType,
|
|
263
|
+
filterData,
|
|
264
|
+
fieldIndex,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
251
268
|
describe("EventAction Event Selector", () => {
|
|
252
269
|
beforeEach(async () => {
|
|
253
270
|
erc721 = await loadFixture(fundErc721(defaultOptions));
|
|
@@ -472,6 +489,127 @@ describe("EventAction Event Selector", () => {
|
|
|
472
489
|
});
|
|
473
490
|
});
|
|
474
491
|
|
|
492
|
+
describe("validateFieldAgainstCriteria unit tests", () => {
|
|
493
|
+
let action: EventAction
|
|
494
|
+
beforeAll(async () => {
|
|
495
|
+
action = await loadFixture(cloneEventAction(fixtures, erc721));
|
|
496
|
+
});
|
|
497
|
+
const mockAddress = '0x1234567890abcdef1234567890abcdef12345678';
|
|
498
|
+
const mockInput = { decodedArgs: ['not used'] };
|
|
499
|
+
|
|
500
|
+
test('should return true for EQUAL filter type with ADDRESS field type', () => {
|
|
501
|
+
const mockCriteria = createMockCriteria(FilterType.EQUAL, PrimitiveType.ADDRESS, mockAddress);
|
|
502
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, mockAddress, mockInput);
|
|
503
|
+
expect(result).toBe(true);
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
test('should return true for EQUAL filter type with UINT field type', () => {
|
|
507
|
+
const mockCriteria = createMockCriteria(FilterType.EQUAL, PrimitiveType.UINT, '0xc8');
|
|
508
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, 200n, mockInput);
|
|
509
|
+
expect(result).toBe(true);
|
|
510
|
+
});
|
|
511
|
+
test('should return true for EQUAL filter type with STRING field type when values match', () => {
|
|
512
|
+
// Decoded value: 'hello'
|
|
513
|
+
const mockCriteria = createMockCriteria(FilterType.EQUAL, PrimitiveType.STRING, '0x68656c6c6f');
|
|
514
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, 'hello', mockInput);
|
|
515
|
+
expect(result).toBe(true);
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
test('should return false for EQUAL filter type with STRING field type when values do not match', () => {
|
|
519
|
+
// Decoded value: 'hello'
|
|
520
|
+
const mockCriteria = createMockCriteria(FilterType.EQUAL, PrimitiveType.STRING, '0x68656c6c6f');
|
|
521
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, 'world', mockInput);
|
|
522
|
+
expect(result).toBe(false);
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
test('should return true for EQUAL filter type with BYTES field type when values match', () => {
|
|
526
|
+
// Decoded value: '0x68656c6c6f' (hex for 'hello')
|
|
527
|
+
const mockCriteria = createMockCriteria(FilterType.EQUAL, PrimitiveType.BYTES, '0x68656c6c6f');
|
|
528
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, '0x68656c6c6f', mockInput);
|
|
529
|
+
expect(result).toBe(true);
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
test('should return false for EQUAL filter type with BYTES field type when values do not match', () => {
|
|
533
|
+
// Decoded value: '0x68656c6c6f' (hex for 'hello')
|
|
534
|
+
const mockCriteria = createMockCriteria(FilterType.EQUAL, PrimitiveType.BYTES, '0x68656c6c6f');
|
|
535
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, '0x776f726c64', mockInput); // hex for 'world'
|
|
536
|
+
expect(result).toBe(false);
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
test('should return false for NOT_EQUAL filter type with ADDRESS field type', () => {
|
|
540
|
+
const mockCriteria = createMockCriteria(FilterType.NOT_EQUAL, PrimitiveType.ADDRESS, mockAddress);
|
|
541
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, zeroAddress, mockInput);
|
|
542
|
+
expect(result).toBe(true);
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
test('should return true for NOT_EQUAL filter type with UINT field type', () => {
|
|
546
|
+
const mockCriteria = createMockCriteria(FilterType.NOT_EQUAL, PrimitiveType.UINT, '0xc9');
|
|
547
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, 200n, mockInput);
|
|
548
|
+
expect(result).toBe(true);
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
test('should throw InvalidNumericalCriteriaError for GREATER_THAN filter type with non-uint field type', () => {
|
|
552
|
+
const mockCriteria = createMockCriteria(FilterType.GREATER_THAN, PrimitiveType.STRING, '0x100');
|
|
553
|
+
expect(() => action.validateFieldAgainstCriteria(mockCriteria, '200', mockInput)).toThrow('non-numerical criteria');
|
|
554
|
+
});
|
|
555
|
+
|
|
556
|
+
test('should return true for GREATER_THAN filter type with UINT field type', () => {
|
|
557
|
+
const mockCriteria = createMockCriteria(FilterType.GREATER_THAN, PrimitiveType.UINT, '0x64');
|
|
558
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, 200n, mockInput);
|
|
559
|
+
expect(result).toBe(true);
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
test('should return true for CONTAINS filter type with STRING field type', () => {
|
|
563
|
+
// Decoded value: 'hello'
|
|
564
|
+
const mockCriteria = createMockCriteria(FilterType.CONTAINS, PrimitiveType.STRING, '0x68656c6c6f');
|
|
565
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, 'hello world', mockInput);
|
|
566
|
+
expect(result).toBe(true);
|
|
567
|
+
});
|
|
568
|
+
|
|
569
|
+
test('should return true for CONTAINS filter type with BYTES field type', () => {
|
|
570
|
+
const mockCriteria = createMockCriteria(FilterType.CONTAINS, PrimitiveType.BYTES, '0xbeef');
|
|
571
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, '0xdeadbeef', mockInput);
|
|
572
|
+
expect(result).toBe(true);
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
test('should throw FieldValueNotComparableError for CONTAINS filter type with non-string/bytes field type', () => {
|
|
576
|
+
// Decoded value: 123
|
|
577
|
+
const mockCriteria = createMockCriteria(FilterType.CONTAINS, PrimitiveType.UINT, '0x7b');
|
|
578
|
+
expect(() => action.validateFieldAgainstCriteria(mockCriteria, 123n, mockInput)).toThrow(/only .* bytes or string/);
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
test('should throw UnrecognizedFilterTypeError for unrecognized filter type', () => {
|
|
582
|
+
const mockCriteria = createMockCriteria(6 as FilterType, PrimitiveType.STRING, '0x74657374'); // Decoded value: 'test'
|
|
583
|
+
expect(() => action.validateFieldAgainstCriteria(mockCriteria, 'test', mockInput)).toThrow('Invalid FilterType');
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
test('should return true for LESS_THAN filter type with UINT field type', () => {
|
|
587
|
+
// Decoded value: 200
|
|
588
|
+
const mockCriteria = createMockCriteria(FilterType.LESS_THAN, PrimitiveType.UINT, '0xc8');
|
|
589
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, 100n, mockInput);
|
|
590
|
+
expect(result).toBe(true);
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
test('should return false for LESS_THAN filter type with UINT field type when value is greater', () => {
|
|
594
|
+
// Decoded value: 100
|
|
595
|
+
const mockCriteria = createMockCriteria(FilterType.LESS_THAN, PrimitiveType.UINT, '0x64');
|
|
596
|
+
const result = action.validateFieldAgainstCriteria(mockCriteria, 200n, mockInput);
|
|
597
|
+
expect(result).toBe(false);
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
test('should throw InvalidNumericalCriteriaError for LESS_THAN filter type with non-uint field type', () => {
|
|
601
|
+
// Decoded value: 100
|
|
602
|
+
const mockCriteria = createMockCriteria(FilterType.LESS_THAN, PrimitiveType.STRING, '0x64');
|
|
603
|
+
expect(() => action.validateFieldAgainstCriteria(mockCriteria, '50', mockInput)).toThrow('non-numerical');
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
test('should throw InvalidNumericalCriteriaError for LESS_THAN filter type with ADDRESS field type', () => {
|
|
607
|
+
const mockCriteria = createMockCriteria(FilterType.LESS_THAN, PrimitiveType.ADDRESS, '0x1234567890abcdef1234567890abcdef12345678');
|
|
608
|
+
expect(() => action.validateFieldAgainstCriteria(mockCriteria, '0x1234567890abcdef1234567890abcdef12345678', mockInput)).toThrow('non-numerical');
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
})
|
|
612
|
+
|
|
475
613
|
describe("EventAction Func Selector", () => {
|
|
476
614
|
beforeEach(async () => {
|
|
477
615
|
erc721 = await loadFixture(fundErc721(defaultOptions));
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import { bytecode } from '@boostxyz/evm/artifacts/contracts/actions/EventAction.sol/EventAction.json';
|
|
9
9
|
import events from '@boostxyz/signatures/events';
|
|
10
10
|
import functions from '@boostxyz/signatures/functions';
|
|
11
|
+
import { match } from 'ts-pattern';
|
|
11
12
|
import {
|
|
12
13
|
type Abi,
|
|
13
14
|
type AbiEvent,
|
|
@@ -24,8 +25,6 @@ import {
|
|
|
24
25
|
encodeAbiParameters,
|
|
25
26
|
fromHex,
|
|
26
27
|
isAddressEqual,
|
|
27
|
-
pad,
|
|
28
|
-
trim,
|
|
29
28
|
} from 'viem';
|
|
30
29
|
import { getLogs } from 'viem/actions';
|
|
31
30
|
import { EventAction as EventActionBases } from '../../dist/deployments.json';
|
|
@@ -678,13 +677,35 @@ export class EventAction extends DeployableTarget<
|
|
|
678
677
|
// Type narrow based on criteria.filterType
|
|
679
678
|
switch (criteria.filterType) {
|
|
680
679
|
case FilterType.EQUAL:
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
680
|
+
return match(criteria.fieldType)
|
|
681
|
+
.with(PrimitiveType.ADDRESS, () =>
|
|
682
|
+
isAddressEqual(criteria.filterData, fieldValue as Address),
|
|
683
|
+
)
|
|
684
|
+
.with(
|
|
685
|
+
PrimitiveType.UINT,
|
|
686
|
+
() => BigInt(fieldValue) === BigInt(criteria.filterData),
|
|
687
|
+
)
|
|
688
|
+
.with(
|
|
689
|
+
PrimitiveType.STRING,
|
|
690
|
+
() => fieldValue === fromHex(criteria.filterData, 'string'),
|
|
691
|
+
)
|
|
692
|
+
.otherwise(() => fieldValue === criteria.filterData);
|
|
685
693
|
|
|
686
694
|
case FilterType.NOT_EQUAL:
|
|
687
|
-
return
|
|
695
|
+
return match(criteria.fieldType)
|
|
696
|
+
.with(
|
|
697
|
+
PrimitiveType.ADDRESS,
|
|
698
|
+
() => !isAddressEqual(criteria.filterData, fieldValue as Address),
|
|
699
|
+
)
|
|
700
|
+
.with(
|
|
701
|
+
PrimitiveType.UINT,
|
|
702
|
+
() => BigInt(fieldValue) !== BigInt(criteria.filterData),
|
|
703
|
+
)
|
|
704
|
+
.with(
|
|
705
|
+
PrimitiveType.STRING,
|
|
706
|
+
() => fieldValue !== fromHex(criteria.filterData, 'string'),
|
|
707
|
+
)
|
|
708
|
+
.otherwise(() => fieldValue !== criteria.filterData);
|
|
688
709
|
|
|
689
710
|
case FilterType.GREATER_THAN:
|
|
690
711
|
if (criteria.fieldType === PrimitiveType.UINT) {
|