@boostxyz/sdk 5.0.0 → 5.1.1
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 +5 -5
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +18 -0
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +201 -132
- 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.js +8 -8
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.js +3 -3
- 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 +14 -0
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +130 -111
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.js +6 -6
- package/dist/{Budget-fHCvlPfB.js → Budget-C0SMvfEl.js} +53 -53
- package/dist/{Budget-fHCvlPfB.js.map → Budget-C0SMvfEl.js.map} +1 -1
- package/dist/{Budget-Cnyh81n5.cjs → Budget-N0YEfSt2.cjs} +2 -2
- package/dist/{Budget-Cnyh81n5.cjs.map → Budget-N0YEfSt2.cjs.map} +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.js +3 -3
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.js +29 -29
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.js +15 -15
- package/dist/Incentive-DSsxOFKY.js +901 -0
- package/dist/Incentive-DSsxOFKY.js.map +1 -0
- package/dist/Incentive-lNp-ZudZ.cjs +2 -0
- package/dist/Incentive-lNp-ZudZ.cjs.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.js +11 -11
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +24 -22
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +19 -19
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts +1035 -0
- package/dist/Incentives/ERC20PeggedVariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js +19 -19
- package/dist/Incentives/ERC20VariableCriteriaIncentive.js.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs +1 -1
- package/dist/Incentives/ERC20VariableIncentive.cjs.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20VariableIncentive.js +25 -23
- package/dist/Incentives/ERC20VariableIncentive.js.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.d.ts +6 -5
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +17 -16
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.js +8 -8
- package/dist/{SimpleDenyList-GZlSeh2G.js → SimpleDenyList-B8QeJthf.js} +12 -12
- package/dist/{SimpleDenyList-GZlSeh2G.js.map → SimpleDenyList-B8QeJthf.js.map} +1 -1
- package/dist/{SimpleDenyList-CgQvS1ek.cjs → SimpleDenyList-DIb4xX3j.cjs} +2 -2
- package/dist/{SimpleDenyList-CgQvS1ek.cjs.map → SimpleDenyList-DIb4xX3j.cjs.map} +1 -1
- package/dist/Validators/LimitedSignerValidator.cjs +1 -1
- package/dist/Validators/LimitedSignerValidator.js +18 -18
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.js +16 -16
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.js +4 -4
- package/dist/componentInterfaces-D7r9xJmt.cjs +2 -0
- package/dist/componentInterfaces-D7r9xJmt.cjs.map +1 -0
- package/dist/componentInterfaces-PR3ijhgZ.js +18 -0
- package/dist/componentInterfaces-PR3ijhgZ.js.map +1 -0
- package/dist/{deployments-CMdsItcq.cjs → deployments-BGpr4ppG.cjs} +2 -2
- package/dist/deployments-BGpr4ppG.cjs.map +1 -0
- package/dist/{deployments-DzhmI-zL.js → deployments-COxshLqt.js} +42 -32
- package/dist/deployments-COxshLqt.js.map +1 -0
- package/dist/deployments.json +20 -15
- package/dist/generated-CRD9XfOT.cjs +3 -0
- package/dist/generated-CRD9XfOT.cjs.map +1 -0
- package/dist/{generated-Hbd0NIf9.js → generated-ClbO_ULI.js} +1274 -709
- package/dist/generated-ClbO_ULI.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 -129
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +7 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1121 -41
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/Actions/EventAction.ts +85 -1
- package/src/BoostCore.ts +27 -0
- package/src/Incentives/CGDAIncentive.ts +3 -1
- package/src/Incentives/ERC20PeggedIncentive.ts +2 -2
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.test.ts +315 -0
- package/src/Incentives/ERC20PeggedVariableCriteriaIncentive.ts +728 -0
- package/src/Incentives/ERC20VariableIncentive.ts +3 -1
- package/src/Incentives/Incentive.ts +8 -2
- package/src/index.ts +1 -0
- package/src/utils.ts +10 -0
- package/dist/Incentive-M45PaQsT.js +0 -397
- package/dist/Incentive-M45PaQsT.js.map +0 -1
- package/dist/Incentive-axLU7ndr.cjs +0 -2
- package/dist/Incentive-axLU7ndr.cjs.map +0 -1
- package/dist/componentInterfaces-Bt-4sNB5.cjs +0 -2
- package/dist/componentInterfaces-Bt-4sNB5.cjs.map +0 -1
- package/dist/componentInterfaces-C4uAYjSo.js +0 -16
- package/dist/componentInterfaces-C4uAYjSo.js.map +0 -1
- package/dist/deployments-CMdsItcq.cjs.map +0 -1
- package/dist/deployments-DzhmI-zL.js.map +0 -1
- package/dist/generated-CNkDfjzI.cjs +0 -3
- package/dist/generated-CNkDfjzI.cjs.map +0 -1
- package/dist/generated-Hbd0NIf9.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./BoostRegistry.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./BoostRegistry.cjs"),l=require("./BoostCore.cjs"),A=require("./Boost.cjs"),u=require("./Actions/Action.cjs"),a=require("./Actions/EventAction.cjs"),g=require("./AllowLists/AllowList.cjs"),y=require("./AllowLists/SimpleAllowList.cjs"),I=require("./SimpleDenyList-DIb4xX3j.cjs"),d=require("./Budget-N0YEfSt2.cjs"),t=require("./Budgets/ManagedBudget.cjs"),D=require("./Deployable/Deployable.cjs"),T=require("./Deployable/Contract.cjs"),V=require("./Deployable/DeployableTarget.cjs"),P=require("./Deployable/DeployableTargetWithRBAC.cjs"),v=require("./Incentives/AllowListIncentive.cjs"),R=require("./Incentives/CGDAIncentive.cjs"),S=require("./Incentives/ERC20Incentive.cjs"),o=require("./Incentive-lNp-ZudZ.cjs"),m=require("./Incentives/ERC20VariableIncentive.cjs"),C=require("./Incentives/ERC20VariableCriteriaIncentive.cjs"),b=require("./Incentives/PointsIncentive.cjs"),s=require("./Validators/SignerValidator.cjs"),p=require("./Validators/LimitedSignerValidator.cjs"),c=require("./Validators/Validator.cjs"),e=require("./errors.cjs"),i=require("./utils.cjs"),B=require("./claiming.cjs"),n=require("./transfers.cjs"),F=require("./Auth/PassthroughAuth.cjs"),r=require("./generated-CRD9XfOT.cjs");exports.BOOST_REGISTRY_ADDRESS=E.BOOST_REGISTRY_ADDRESS;exports.BOOST_REGISTRY_ADDRESSES=E.BOOST_REGISTRY_ADDRESSES;exports.BoostRegistry=E.BoostRegistry;exports.BOOST_CORE_ADDRESS=l.BOOST_CORE_ADDRESS;exports.BOOST_CORE_ADDRESSES=l.BOOST_CORE_ADDRESSES;exports.BoostCore=l.BoostCore;exports.FEE_DENOMINATOR=l.FEE_DENOMINATOR;exports.Boost=A.Boost;exports.prepareBoostPayload=A.prepareBoostPayload;exports.ActionByComponentInterface=u.ActionByComponentInterface;exports.actionFromAddress=u.actionFromAddress;exports.EventAction=a.EventAction;exports.FilterType=a.FilterType;exports.PrimitiveType=a.PrimitiveType;exports.SignatureType=a.SignatureType;exports.anyActionParameter=a.anyActionParameter;exports.isEventActionPayloadSimple=a.isEventActionPayloadSimple;exports.prepareEventActionPayload=a.prepareEventActionPayload;exports.transactionSenderClaimant=a.transactionSenderClaimant;exports.AllowListByComponentInterface=g.AllowListByComponentInterface;exports.OpenAllowList=g.OpenAllowList;exports.allowListFromAddress=g.allowListFromAddress;exports.LIST_MANAGER_ROLE=y.LIST_MANAGER_ROLE;exports.SimpleAllowList=y.SimpleAllowList;exports.prepareSimpleAllowListPayload=y.prepareSimpleAllowListPayload;exports.SimpleDenyList=I.SimpleDenyList;exports.prepareSimpleDenyListPayload=I.prepareSimpleDenyListPayload;exports.BudgetByComponentInterface=d.BudgetByComponentInterface;exports.ManagedBudgetWithFees=d.ManagedBudgetWithFees;exports.budgetFromAddress=d.budgetFromAddress;exports.prepareManagedBudgetWithFeesPayload=d.prepareManagedBudgetWithFeesPayload;exports.ManagedBudget=t.ManagedBudget;exports.ManagedBudgetRoles=t.ManagedBudgetRoles;exports.isERC1155TransferPayload=t.isERC1155TransferPayload;exports.isFungibleTransfer=t.isFungibleTransfer;exports.prepareManagedBudgetPayload=t.prepareManagedBudgetPayload;exports.prepareTransfer=t.prepareTransfer;exports.Deployable=D.Deployable;exports.Contract=T.Contract;exports.DeployableTarget=V.DeployableTarget;exports.DeployableTargetWithRBAC=P.DeployableTargetWithRBAC;exports.Roles=P.Roles;exports.AllowListIncentive=v.AllowListIncentive;exports.prepareAllowListIncentivePayload=v.prepareAllowListIncentivePayload;exports.CGDAIncentive=R.CGDAIncentive;exports.prepareCGDAIncentivePayload=R.prepareCGDAIncentivePayload;exports.ERC20Incentive=S.ERC20Incentive;exports.prepareERC20IncentivePayload=S.prepareERC20IncentivePayload;exports.ERC20PeggedIncentive=o.ERC20PeggedIncentive;exports.ERC20PeggedVariableCriteriaIncentive=o.ERC20PeggedVariableCriteriaIncentive;exports.IncentiveByComponentInterface=o.IncentiveByComponentInterface;exports.incentiveFromAddress=o.incentiveFromAddress;exports.prepareERC20PeggedIncentivePayload=o.prepareERC20PeggedIncentivePayload;exports.prepareERC20PeggedVariableCriteriaIncentivePayload=o.prepareERC20PeggedVariableCriteriaIncentivePayload;exports.ERC20VariableIncentive=m.ERC20VariableIncentive;exports.prepareERC20VariableIncentivePayload=m.prepareERC20VariableIncentivePayload;exports.ERC20VariableCriteriaIncentive=C.ERC20VariableCriteriaIncentive;exports.gasRebateIncentiveCriteria=C.gasRebateIncentiveCriteria;exports.prepareERC20VariableCriteriaIncentivePayload=C.prepareERC20VariableCriteriaIncentivePayload;exports.PointsIncentive=b.PointsIncentive;exports.preparePointsIncentivePayload=b.preparePointsIncentivePayload;exports.SignerValidator=s.SignerValidator;exports.prepareSignerValidatorClaimDataPayload=s.prepareSignerValidatorClaimDataPayload;exports.prepareSignerValidatorInputParams=s.prepareSignerValidatorInputParams;exports.prepareSignerValidatorPayload=s.prepareSignerValidatorPayload;exports.LimitedSignerValidator=p.LimitedSignerValidator;exports.prepareLimitedSignerValidatorClaimDataPayload=p.prepareLimitedSignerValidatorClaimDataPayload;exports.prepareLimitedSignerValidatorInputParams=p.prepareLimitedSignerValidatorInputParams;exports.prepareLimitedSignerValidatorPayload=p.prepareLimitedSignerValidatorPayload;exports.BoostValidatorEOA=c.BoostValidatorEOA;exports.ValidatorByComponentInterface=c.ValidatorByComponentInterface;exports.decodeClaimData=c.decodeClaimData;exports.validatorFromAddress=c.validatorFromAddress;exports.BoostCoreNoIdentifierEmitted=e.BoostCoreNoIdentifierEmitted;exports.BoostNotFoundError=e.BoostNotFoundError;exports.BudgetMustAuthorizeBoostCore=e.BudgetMustAuthorizeBoostCore;exports.ContractAddressRequiredError=e.ContractAddressRequiredError;exports.DecodedArgsError=e.DecodedArgsError;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.IncentiveCriteriaNotFoundError=e.IncentiveCriteriaNotFoundError;exports.IncentiveNotCloneableError=e.IncentiveNotCloneableError;exports.InvalidComponentInterfaceError=e.InvalidComponentInterfaceError;exports.InvalidCriteriaTypeError=e.InvalidCriteriaTypeError;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.NoMatchingLogsError=e.NoMatchingLogsError;exports.TooManyEventActionStepsProvidedError=e.TooManyEventActionStepsProvidedError;exports.UnknownTransferPayloadSupplied=e.UnknownTransferPayloadSupplied;exports.UnparseableAbiParamError=e.UnparseableAbiParamError;exports.UnrecognizedFilterTypeError=e.UnrecognizedFilterTypeError;exports.ValidationAbiMissingError=e.ValidationAbiMissingError;exports.CheatCodes=i.CheatCodes;exports.RegistryType=i.RegistryType;exports.TRANSFER_SIGNATURE=i.TRANSFER_SIGNATURE;exports.assertValidAddressByChainId=i.assertValidAddressByChainId;exports.awaitResult=i.awaitResult;exports.bytes4=i.bytes4;exports.getDeployedContractAddress=i.getDeployedContractAddress;exports.getErc20Balance=i.getErc20Balance;exports.StrategyType=B.StrategyType;exports.prepareClaimPayload=B.prepareClaimPayload;exports.AssetType=n.AssetType;exports.prepareERC1155Payload=n.prepareERC1155Payload;exports.prepareERC1155Transfer=n.prepareERC1155Transfer;exports.prepareFungiblePayload=n.prepareFungiblePayload;exports.prepareFungibleTransfer=n.prepareFungibleTransfer;exports.prepareTransferPayload=n.prepareTransferPayload;exports.PassthroughAuth=F.PassthroughAuth;exports.allowListIncentiveAbi=r.B;exports.boostCoreAbi=r.I;exports.boostRegistryAbi=r.ce;exports.cgdaIncentiveAbi=r.A;exports.erc20IncentiveAbi=r.f;exports.erc20PeggedIncentiveAbi=r.v;exports.erc20PeggedVariableCriteriaIncentiveAbi=r.l;exports.erc20VariableCriteriaIncentiveAbi=r.d;exports.erc20VariableIncentiveAbi=r.g;exports.limitedSignerValidatorAbi=r.V;exports.managedBudgetAbi=r.w;exports.managedBudgetWithFeesAbi=r.o;exports.passthroughAuthAbi=r.We;exports.pointsIncentiveAbi=r.N;exports.rbacAbi=r.H;exports.signerValidatorAbi=r.k;exports.simpleAllowListAbi=r.C;exports.simpleDenyListAbi=r.E;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './Incentives/ERC20Incentive';
|
|
|
19
19
|
export * from './Incentives/ERC20PeggedIncentive';
|
|
20
20
|
export * from './Incentives/ERC20VariableIncentive';
|
|
21
21
|
export * from './Incentives/ERC20VariableCriteriaIncentive';
|
|
22
|
+
export * from './Incentives/ERC20PeggedVariableCriteriaIncentive';
|
|
22
23
|
export * from './Incentives/Incentive';
|
|
23
24
|
export * from './Incentives/PointsIncentive';
|
|
24
25
|
export * from './Validators/SignerValidator';
|
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;AACxC,cAAc,iCAAiC,CAAC;AAIhD,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,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6CAA6C,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;AACxC,cAAc,iCAAiC,CAAC;AAIhD,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,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;AAElE,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAI7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,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,168 +1,172 @@
|
|
|
1
1
|
import { BOOST_REGISTRY_ADDRESS as a, BOOST_REGISTRY_ADDRESSES as o, BoostRegistry as t } from "./BoostRegistry.js";
|
|
2
|
-
import { BOOST_CORE_ADDRESS as n, BOOST_CORE_ADDRESSES as
|
|
3
|
-
import { Boost as
|
|
4
|
-
import { ActionByComponentInterface as
|
|
5
|
-
import { EventAction as C, FilterType as
|
|
6
|
-
import { AllowListByComponentInterface as B, OpenAllowList as
|
|
2
|
+
import { BOOST_CORE_ADDRESS as n, BOOST_CORE_ADDRESSES as d, BoostCore as p, FEE_DENOMINATOR as l } from "./BoostCore.js";
|
|
3
|
+
import { Boost as c, prepareBoostPayload as m } from "./Boost.js";
|
|
4
|
+
import { ActionByComponentInterface as g, actionFromAddress as A } from "./Actions/Action.js";
|
|
5
|
+
import { EventAction as C, FilterType as I, PrimitiveType as b, SignatureType as f, anyActionParameter as P, isEventActionPayloadSimple as v, prepareEventActionPayload as R, transactionSenderClaimant as S } from "./Actions/EventAction.js";
|
|
6
|
+
import { AllowListByComponentInterface as B, OpenAllowList as D, allowListFromAddress as x } from "./AllowLists/AllowList.js";
|
|
7
7
|
import { LIST_MANAGER_ROLE as V, SimpleAllowList as F, prepareSimpleAllowListPayload as L } from "./AllowLists/SimpleAllowList.js";
|
|
8
|
-
import { S as
|
|
9
|
-
import { B as
|
|
10
|
-
import { ManagedBudget as
|
|
8
|
+
import { S as N, p as O } from "./SimpleDenyList-B8QeJthf.js";
|
|
9
|
+
import { B as w, M as _, b as U, p as G } from "./Budget-C0SMvfEl.js";
|
|
10
|
+
import { ManagedBudget as k, ManagedBudgetRoles as z, isERC1155TransferPayload as q, isFungibleTransfer as Y, prepareManagedBudgetPayload as H, prepareTransfer as j } from "./Budgets/ManagedBudget.js";
|
|
11
11
|
import { Deployable as K } from "./Deployable/Deployable.js";
|
|
12
12
|
import { Contract as X } from "./Deployable/Contract.js";
|
|
13
13
|
import { DeployableTarget as $ } from "./Deployable/DeployableTarget.js";
|
|
14
14
|
import { DeployableTargetWithRBAC as re, Roles as ae } from "./Deployable/DeployableTargetWithRBAC.js";
|
|
15
15
|
import { AllowListIncentive as te, prepareAllowListIncentivePayload as ie } from "./Incentives/AllowListIncentive.js";
|
|
16
|
-
import { CGDAIncentive as
|
|
17
|
-
import { ERC20Incentive as se, prepareERC20IncentivePayload as
|
|
18
|
-
import { E as Ee, I as Ae, i as ye, p as
|
|
19
|
-
import { ERC20VariableIncentive as fe, prepareERC20VariableIncentivePayload as
|
|
20
|
-
import { ERC20VariableCriteriaIncentive as
|
|
21
|
-
import { PointsIncentive as
|
|
22
|
-
import { SignerValidator as
|
|
23
|
-
import { LimitedSignerValidator as
|
|
24
|
-
import { BoostValidatorEOA as
|
|
25
|
-
import { BoostCoreNoIdentifierEmitted as
|
|
26
|
-
import { CheatCodes as
|
|
27
|
-
import { StrategyType as
|
|
28
|
-
import { AssetType as
|
|
29
|
-
import { PassthroughAuth as
|
|
30
|
-
import { B as
|
|
16
|
+
import { CGDAIncentive as de, prepareCGDAIncentivePayload as pe } from "./Incentives/CGDAIncentive.js";
|
|
17
|
+
import { ERC20Incentive as se, prepareERC20IncentivePayload as ce } from "./Incentives/ERC20Incentive.js";
|
|
18
|
+
import { E as Ee, a as ge, I as Ae, i as ye, p as Ce, b as Ie } from "./Incentive-DSsxOFKY.js";
|
|
19
|
+
import { ERC20VariableIncentive as fe, prepareERC20VariableIncentivePayload as Pe } from "./Incentives/ERC20VariableIncentive.js";
|
|
20
|
+
import { ERC20VariableCriteriaIncentive as Re, gasRebateIncentiveCriteria as Se, prepareERC20VariableCriteriaIncentivePayload as ue } from "./Incentives/ERC20VariableCriteriaIncentive.js";
|
|
21
|
+
import { PointsIncentive as De, preparePointsIncentivePayload as xe } from "./Incentives/PointsIncentive.js";
|
|
22
|
+
import { SignerValidator as Ve, prepareSignerValidatorClaimDataPayload as Fe, prepareSignerValidatorInputParams as Le, prepareSignerValidatorPayload as he } from "./Validators/SignerValidator.js";
|
|
23
|
+
import { LimitedSignerValidator as Oe, prepareLimitedSignerValidatorClaimDataPayload as Me, prepareLimitedSignerValidatorInputParams as we, prepareLimitedSignerValidatorPayload as _e } from "./Validators/LimitedSignerValidator.js";
|
|
24
|
+
import { BoostValidatorEOA as Ge, ValidatorByComponentInterface as We, decodeClaimData as ke, validatorFromAddress as ze } from "./Validators/Validator.js";
|
|
25
|
+
import { BoostCoreNoIdentifierEmitted as Ye, BoostNotFoundError as He, BudgetMustAuthorizeBoostCore as je, ContractAddressRequiredError as Je, DecodedArgsError as Ke, DecodedArgsMalformedError as Qe, DeployableAlreadyDeployedError as Xe, DeployableBuildParametersUnspecifiedError as Ze, DeployableMissingPayloadError as $e, DeployableUnknownOwnerProvidedError as er, DeployableWagmiConfigurationRequiredError as rr, FieldActionValidationError as ar, FieldValueNotComparableError as or, FieldValueUndefinedError as tr, FunctionDataDecodeError as ir, IncentiveCriteriaNotFoundError as nr, IncentiveNotCloneableError as dr, InvalidComponentInterfaceError as pr, InvalidCriteriaTypeError as lr, InvalidNumericalCriteriaError as sr, InvalidProtocolChainIdError as cr, MustInitializeBudgetError as mr, NoConnectedChainIdError as Er, NoContractAddressUponReceiptError as gr, NoEventActionStepsProvidedError as Ar, NoMatchingLogsError as yr, TooManyEventActionStepsProvidedError as Cr, UnknownTransferPayloadSupplied as Ir, UnparseableAbiParamError as br, UnrecognizedFilterTypeError as fr, ValidationAbiMissingError as Pr } from "./errors.js";
|
|
26
|
+
import { CheatCodes as Rr, RegistryType as Sr, TRANSFER_SIGNATURE as ur, assertValidAddressByChainId as Br, awaitResult as Dr, bytes4 as xr, getDeployedContractAddress as Tr, getErc20Balance as Vr } from "./utils.js";
|
|
27
|
+
import { StrategyType as Lr, prepareClaimPayload as hr } from "./claiming.js";
|
|
28
|
+
import { AssetType as Or, prepareERC1155Payload as Mr, prepareERC1155Transfer as wr, prepareFungiblePayload as _r, prepareFungibleTransfer as Ur, prepareTransferPayload as Gr } from "./transfers.js";
|
|
29
|
+
import { PassthroughAuth as kr } from "./Auth/PassthroughAuth.js";
|
|
30
|
+
import { B as qr, I as Yr, c as Hr, A as jr, f as Jr, v as Kr, l as Qr, d as Xr, g as Zr, V as $r, w as ea, o as ra, W as aa, N as oa, H as ta, k as ia, C as na, E as da } from "./generated-ClbO_ULI.js";
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
g as ActionByComponentInterface,
|
|
33
33
|
B as AllowListByComponentInterface,
|
|
34
34
|
te as AllowListIncentive,
|
|
35
|
-
|
|
35
|
+
Or as AssetType,
|
|
36
36
|
n as BOOST_CORE_ADDRESS,
|
|
37
|
-
|
|
37
|
+
d as BOOST_CORE_ADDRESSES,
|
|
38
38
|
a as BOOST_REGISTRY_ADDRESS,
|
|
39
39
|
o as BOOST_REGISTRY_ADDRESSES,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
c as Boost,
|
|
41
|
+
p as BoostCore,
|
|
42
|
+
Ye as BoostCoreNoIdentifierEmitted,
|
|
43
|
+
He as BoostNotFoundError,
|
|
44
44
|
t as BoostRegistry,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
Ge as BoostValidatorEOA,
|
|
46
|
+
w as BudgetByComponentInterface,
|
|
47
|
+
je as BudgetMustAuthorizeBoostCore,
|
|
48
|
+
de as CGDAIncentive,
|
|
49
|
+
Rr as CheatCodes,
|
|
50
50
|
X as Contract,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
Je as ContractAddressRequiredError,
|
|
52
|
+
Ke as DecodedArgsError,
|
|
53
|
+
Qe as DecodedArgsMalformedError,
|
|
54
54
|
K as Deployable,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
Xe as DeployableAlreadyDeployedError,
|
|
56
|
+
Ze as DeployableBuildParametersUnspecifiedError,
|
|
57
|
+
$e as DeployableMissingPayloadError,
|
|
58
58
|
$ as DeployableTarget,
|
|
59
59
|
re as DeployableTargetWithRBAC,
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
er as DeployableUnknownOwnerProvidedError,
|
|
61
|
+
rr as DeployableWagmiConfigurationRequiredError,
|
|
62
62
|
se as ERC20Incentive,
|
|
63
63
|
Ee as ERC20PeggedIncentive,
|
|
64
|
-
|
|
64
|
+
ge as ERC20PeggedVariableCriteriaIncentive,
|
|
65
|
+
Re as ERC20VariableCriteriaIncentive,
|
|
65
66
|
fe as ERC20VariableIncentive,
|
|
66
67
|
C as EventAction,
|
|
67
68
|
l as FEE_DENOMINATOR,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
ar as FieldActionValidationError,
|
|
70
|
+
or as FieldValueNotComparableError,
|
|
71
|
+
tr as FieldValueUndefinedError,
|
|
72
|
+
I as FilterType,
|
|
73
|
+
ir as FunctionDataDecodeError,
|
|
73
74
|
Ae as IncentiveByComponentInterface,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
nr as IncentiveCriteriaNotFoundError,
|
|
76
|
+
dr as IncentiveNotCloneableError,
|
|
77
|
+
pr as InvalidComponentInterfaceError,
|
|
78
|
+
lr as InvalidCriteriaTypeError,
|
|
79
|
+
sr as InvalidNumericalCriteriaError,
|
|
80
|
+
cr as InvalidProtocolChainIdError,
|
|
80
81
|
V as LIST_MANAGER_ROLE,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
Oe as LimitedSignerValidator,
|
|
83
|
+
k as ManagedBudget,
|
|
84
|
+
z as ManagedBudgetRoles,
|
|
84
85
|
_ as ManagedBudgetWithFees,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
mr as MustInitializeBudgetError,
|
|
87
|
+
Er as NoConnectedChainIdError,
|
|
88
|
+
gr as NoContractAddressUponReceiptError,
|
|
89
|
+
Ar as NoEventActionStepsProvidedError,
|
|
90
|
+
yr as NoMatchingLogsError,
|
|
91
|
+
D as OpenAllowList,
|
|
92
|
+
kr as PassthroughAuth,
|
|
93
|
+
De as PointsIncentive,
|
|
93
94
|
b as PrimitiveType,
|
|
94
|
-
|
|
95
|
+
Sr as RegistryType,
|
|
95
96
|
ae as Roles,
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
f as SignatureType,
|
|
98
|
+
Ve as SignerValidator,
|
|
98
99
|
F as SimpleAllowList,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
N as SimpleDenyList,
|
|
101
|
+
Lr as StrategyType,
|
|
102
|
+
ur as TRANSFER_SIGNATURE,
|
|
103
|
+
Cr as TooManyEventActionStepsProvidedError,
|
|
104
|
+
Ir as UnknownTransferPayloadSupplied,
|
|
105
|
+
br as UnparseableAbiParamError,
|
|
104
106
|
fr as UnrecognizedFilterTypeError,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
Pr as ValidationAbiMissingError,
|
|
108
|
+
We as ValidatorByComponentInterface,
|
|
109
|
+
A as actionFromAddress,
|
|
110
|
+
x as allowListFromAddress,
|
|
111
|
+
qr as allowListIncentiveAbi,
|
|
112
|
+
P as anyActionParameter,
|
|
113
|
+
Br as assertValidAddressByChainId,
|
|
114
|
+
Dr as awaitResult,
|
|
115
|
+
Yr as boostCoreAbi,
|
|
116
|
+
Hr as boostRegistryAbi,
|
|
115
117
|
U as budgetFromAddress,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
118
|
+
xr as bytes4,
|
|
119
|
+
jr as cgdaIncentiveAbi,
|
|
120
|
+
ke as decodeClaimData,
|
|
121
|
+
Jr as erc20IncentiveAbi,
|
|
122
|
+
Kr as erc20PeggedIncentiveAbi,
|
|
123
|
+
Qr as erc20PeggedVariableCriteriaIncentiveAbi,
|
|
124
|
+
Xr as erc20VariableCriteriaIncentiveAbi,
|
|
125
|
+
Zr as erc20VariableIncentiveAbi,
|
|
126
|
+
Se as gasRebateIncentiveCriteria,
|
|
127
|
+
Tr as getDeployedContractAddress,
|
|
128
|
+
Vr as getErc20Balance,
|
|
126
129
|
ye as incentiveFromAddress,
|
|
127
130
|
q as isERC1155TransferPayload,
|
|
128
|
-
|
|
131
|
+
v as isEventActionPayloadSimple,
|
|
129
132
|
Y as isFungibleTransfer,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
$r as limitedSignerValidatorAbi,
|
|
134
|
+
ea as managedBudgetAbi,
|
|
135
|
+
ra as managedBudgetWithFeesAbi,
|
|
136
|
+
aa as passthroughAuthAbi,
|
|
137
|
+
oa as pointsIncentiveAbi,
|
|
135
138
|
ie as prepareAllowListIncentivePayload,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
Me as
|
|
150
|
-
we as
|
|
151
|
-
|
|
139
|
+
m as prepareBoostPayload,
|
|
140
|
+
pe as prepareCGDAIncentivePayload,
|
|
141
|
+
hr as prepareClaimPayload,
|
|
142
|
+
Mr as prepareERC1155Payload,
|
|
143
|
+
wr as prepareERC1155Transfer,
|
|
144
|
+
ce as prepareERC20IncentivePayload,
|
|
145
|
+
Ce as prepareERC20PeggedIncentivePayload,
|
|
146
|
+
Ie as prepareERC20PeggedVariableCriteriaIncentivePayload,
|
|
147
|
+
ue as prepareERC20VariableCriteriaIncentivePayload,
|
|
148
|
+
Pe as prepareERC20VariableIncentivePayload,
|
|
149
|
+
R as prepareEventActionPayload,
|
|
150
|
+
_r as prepareFungiblePayload,
|
|
151
|
+
Ur as prepareFungibleTransfer,
|
|
152
|
+
Me as prepareLimitedSignerValidatorClaimDataPayload,
|
|
153
|
+
we as prepareLimitedSignerValidatorInputParams,
|
|
154
|
+
_e as prepareLimitedSignerValidatorPayload,
|
|
155
|
+
H as prepareManagedBudgetPayload,
|
|
152
156
|
G as prepareManagedBudgetWithFeesPayload,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
+
xe as preparePointsIncentivePayload,
|
|
158
|
+
Fe as prepareSignerValidatorClaimDataPayload,
|
|
159
|
+
Le as prepareSignerValidatorInputParams,
|
|
160
|
+
he as prepareSignerValidatorPayload,
|
|
157
161
|
L as prepareSimpleAllowListPayload,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
162
|
+
O as prepareSimpleDenyListPayload,
|
|
163
|
+
j as prepareTransfer,
|
|
164
|
+
Gr as prepareTransferPayload,
|
|
165
|
+
ta as rbacAbi,
|
|
166
|
+
ia as signerValidatorAbi,
|
|
167
|
+
na as simpleAllowListAbi,
|
|
168
|
+
da as simpleDenyListAbi,
|
|
169
|
+
S as transactionSenderClaimant,
|
|
170
|
+
ze as validatorFromAddress
|
|
167
171
|
};
|
|
168
172
|
//# sourceMappingURL=index.js.map
|
package/dist/utils.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@wagmi/core"),r=require("viem"),A=require("./errors.cjs");var u=(t=>(t[t.ACTION=0]="ACTION",t[t.ALLOW_LIST=1]="ALLOW_LIST",t[t.BUDGET=2]="BUDGET",t[t.INCENTIVE=3]="INCENTIVE",t[t.VALIDATOR=4]="VALIDATOR",t))(u||{}),s=(t=>(t[t.ANY_ACTION_PARAM=255]="ANY_ACTION_PARAM",t[t.TX_SENDER_CLAIMANT=255]="TX_SENDER_CLAIMANT",t[t.GAS_REBATE_INCENTIVE=255]="GAS_REBATE_INCENTIVE",t))(s||{});function E(t){return r.slice(r.isHex(t)?r.keccak256(t):r.keccak256(r.toHex(t)),0,4)}async function N(t,a,c){const n=await o.waitForTransactionReceipt(t,{...c,hash:await a});if(!n.contractAddress)throw new A.NoContractAddressUponReceiptError(n);return n.contractAddress}async function l(t,a,c){const{hash:n,result:e}=await a;return await o.waitForTransactionReceipt(t,{...c,hash:n}),e}function f(t,a,c){let n;const e=o.getChainId(t);if(e&&a[e]&&(n=e),c!==void 0?a[c]&&(n=c):e!==void 0&&a[e]&&(n=e),n===void 0){const i=o.getAccount(t);i.chainId!==void 0&&a[i.chainId]&&(n=i.chainId)}if(n===void 0&&(n=11155111),!a[n])throw new A.InvalidProtocolChainIdError(n,Object.keys(a).map(Number));return{chainId:n,address:a[n]}}async function I(t,a,c,n){return await o.readContract(t,{...n,functionName:"balanceOf",address:a,args:[c],abi:[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"}]})}exports.CheatCodes=s;exports.RegistryType=u;exports.assertValidAddressByChainId=f;exports.awaitResult=l;exports.bytes4=E;exports.getDeployedContractAddress=N;exports.getErc20Balance=I;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@wagmi/core"),s=require("viem"),r=require("./errors.cjs"),c={abi:{"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{name:"Transfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0}]},"Transfer(address indexed,address indexed,uint256 indexed)":{name:"Transfer",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0}]},"0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e":{name:"Purchased",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"uint256"},{type:"uint256"}]},"Purchased(address indexed,address indexed,uint256 indexed,uint256,uint256)":{name:"Purchased",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"uint256"},{type:"uint256"}]},"0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"NameRegistered(string,bytes32 indexed,address indexed,uint256,uint256,uint256)":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x0667086d08417333ce63f40d5bc2ef6fd330e25aaaf317b7c489541f8fe600fa":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"}]},"NameRegistered(string,bytes32 indexed,address indexed,uint256)":{name:"NameRegistered",type:"event",inputs:[{type:"string"},{type:"bytes32",indexed:!0},{type:"address",indexed:!0},{type:"uint256"}]},"0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f":{name:"DelegateChanged",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0}]},"DelegateChanged(address indexed,address indexed,address indexed)":{name:"DelegateChanged",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0}]},"0xe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb0":{name:"SwappedV3",type:"event",inputs:[{type:"bytes16"},{type:"address"},{type:"uint256"},{type:"address"},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"SwappedV3(bytes16,address,uint256,address,address indexed,address indexed,address indexed,uint256,uint256,uint256)":{name:"SwappedV3",type:"event",inputs:[{type:"bytes16"},{type:"address"},{type:"uint256"},{type:"address"},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4":{name:"VoteCast",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256"},{type:"uint8"},{type:"uint256"},{type:"string"}]},"VoteCast(address indexed,uint256,uint8,uint256,string)":{name:"VoteCast",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256"},{type:"uint8"},{type:"uint256"},{type:"string"}]},"0x7ac572687bf4e66a8514fc2ec464fc2644c78bcb1d80a225fc51a33e0ee38bfa":{name:"Minted",type:"event",inputs:[{type:"uint8"},{type:"address"},{type:"uint256"},{type:"uint256"}]},"Minted(uint8,address,uint256,uint256)":{name:"Minted",type:"event",inputs:[{type:"uint8"},{type:"address"},{type:"uint256"},{type:"uint256"}]},"0x2a29f7402bd32f0e4bbe17d44be064f7f64d96ee174ed7cb27936d869bf9a888":{name:"Minted",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint8"},{type:"uint8"},{type:"address",indexed:!0},{type:"tuple",components:[{type:"uint32"},{type:"uint256"},{type:"address"},{type:"uint32"},{type:"uint32"},{type:"uint32"},{type:"address"},{type:"bool"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},{type:"uint256",indexed:!0}]},"Minted(address indexed,uint8,uint8,address indexed,(uint32,uint256,address,uint32,uint32,uint32,address,bool,uint256,uint256,uint256,uint256,uint256),uint256 indexed)":{name:"Minted",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint8"},{type:"uint8"},{type:"address",indexed:!0},{type:"tuple",components:[{type:"uint32"},{type:"uint256"},{type:"address"},{type:"uint32"},{type:"uint32"},{type:"uint32"},{type:"address"},{type:"bool"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},{type:"uint256",indexed:!0}]},"0xc773e203af3f3079b18c21f98bb8d8ccd2fea097d631d448df89de4edbe7a2a8":{name:"ZoraTimedSaleStrategyRewards",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"}]},"ZoraTimedSaleStrategyRewards(address indexed,uint256 indexed,address,uint256,address,uint256,address,uint256,address,uint256,address,uint256)":{name:"ZoraTimedSaleStrategyRewards",type:"event",inputs:[{type:"address",indexed:!0},{type:"uint256",indexed:!0},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"},{type:"address"},{type:"uint256"}]},"0x0f29bbf4ce25d2346bbeb8a898e24e5d6d7d1d19bb895e71faecac833b259547":{name:"BoostClaimed",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"bytes"}]},"BoostClaimed(uint256 indexed,uint256 indexed,address indexed,address,bytes)":{name:"BoostClaimed",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"bytes"}]},"0x116812d3ad4507d72f2c428b63246d594ca055a1dc119394285504c23d1f34cd":{name:"BoostCreated",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"address"},{type:"address"},{type:"address"}]},"BoostCreated(uint256 indexed,address indexed,address indexed,uint256,address,address,address)":{name:"BoostCreated",type:"event",inputs:[{type:"uint256",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"address"},{type:"address"},{type:"address"}]},"0x72d6b4b5ad0fb12b8a7bb3bcb60edd774c096403d611437859c156ecb3c03a36":{name:"SecondaryBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"}]},"SecondaryBuy(address indexed,address indexed,address indexed,uint256,uint256)":{name:"SecondaryBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"}]},"0x6779abc30cb1bfb05c1170de8e2ef5828c19a2590043d2fd9579d945929fd8a4":{name:"CoopTokenBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"CoopTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":{name:"CoopTokenBuy",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"0xeb3adfe7d8294092cd6b0e7ce95ed01c11d3c5d5d3dc1fecdeb87de43c5e40b2":{name:"CoopTokenSell",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"CoopTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":{name:"CoopTokenSell",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"string"},{type:"uint256"},{type:"uint8"}]},"0xd5468362e31bdcdc9884e72dcf3b00f9d46086067621224b7cb759308d597c6c":{name:"CoopTokenFees",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"CoopTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)":{name:"CoopTokenFees",type:"event",inputs:[{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address",indexed:!0},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},"0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b":{name:"InfoIndexed",type:"event",inputs:[{type:"address",indexed:!0},{type:"string",indexed:!0}]},"InfoIndexed(address indexed,string indexed)":{name:"InfoIndexed",type:"event",inputs:[{type:"address",indexed:!0},{type:"string",indexed:!0}]},"0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c":{name:"Info",type:"event",inputs:[{type:"address"},{type:"string"}]},"Info(address,string)":{name:"Info",type:"event",inputs:[{type:"address"},{type:"string"}]}},selectors:{"Transfer(address indexed,address indexed,uint256 indexed)":"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":"Transfer(address indexed,address indexed,uint256 indexed)","Purchased(address indexed,address indexed,uint256 indexed,uint256,uint256)":"0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e","0xb362243af1e2070d7d5bf8d713f2e0fab64203f1b71462afbe20572909788c5e":"Purchased(address indexed,address indexed,uint256 indexed,uint256,uint256)","NameRegistered(string,bytes32 indexed,address indexed,uint256,uint256,uint256)":"0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27","0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27":"NameRegistered(string,bytes32 indexed,address indexed,uint256,uint256,uint256)","NameRegistered(string,bytes32 indexed,address indexed,uint256)":"0x0667086d08417333ce63f40d5bc2ef6fd330e25aaaf317b7c489541f8fe600fa","0x0667086d08417333ce63f40d5bc2ef6fd330e25aaaf317b7c489541f8fe600fa":"NameRegistered(string,bytes32 indexed,address indexed,uint256)","DelegateChanged(address indexed,address indexed,address indexed)":"0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f","0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f":"DelegateChanged(address indexed,address indexed,address indexed)","SwappedV3(bytes16,address,uint256,address,address indexed,address indexed,address indexed,uint256,uint256,uint256)":"0xe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb0","0xe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb0":"SwappedV3(bytes16,address,uint256,address,address indexed,address indexed,address indexed,uint256,uint256,uint256)","VoteCast(address indexed,uint256,uint8,uint256,string)":"0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4","0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4":"VoteCast(address indexed,uint256,uint8,uint256,string)","Minted(uint8,address,uint256,uint256)":"0x7ac572687bf4e66a8514fc2ec464fc2644c78bcb1d80a225fc51a33e0ee38bfa","0x7ac572687bf4e66a8514fc2ec464fc2644c78bcb1d80a225fc51a33e0ee38bfa":"Minted(uint8,address,uint256,uint256)","Minted(address indexed,uint8,uint8,address indexed,(uint32,uint256,address,uint32,uint32,uint32,address,bool,uint256,uint256,uint256,uint256,uint256),uint256 indexed)":"0x2a29f7402bd32f0e4bbe17d44be064f7f64d96ee174ed7cb27936d869bf9a888","0x2a29f7402bd32f0e4bbe17d44be064f7f64d96ee174ed7cb27936d869bf9a888":"Minted(address indexed,uint8,uint8,address indexed,(uint32,uint256,address,uint32,uint32,uint32,address,bool,uint256,uint256,uint256,uint256,uint256),uint256 indexed)","ZoraTimedSaleStrategyRewards(address indexed,uint256 indexed,address,uint256,address,uint256,address,uint256,address,uint256,address,uint256)":"0xc773e203af3f3079b18c21f98bb8d8ccd2fea097d631d448df89de4edbe7a2a8","0xc773e203af3f3079b18c21f98bb8d8ccd2fea097d631d448df89de4edbe7a2a8":"ZoraTimedSaleStrategyRewards(address indexed,uint256 indexed,address,uint256,address,uint256,address,uint256,address,uint256,address,uint256)","BoostClaimed(uint256 indexed,uint256 indexed,address indexed,address,bytes)":"0x0f29bbf4ce25d2346bbeb8a898e24e5d6d7d1d19bb895e71faecac833b259547","0x0f29bbf4ce25d2346bbeb8a898e24e5d6d7d1d19bb895e71faecac833b259547":"BoostClaimed(uint256 indexed,uint256 indexed,address indexed,address,bytes)","BoostCreated(uint256 indexed,address indexed,address indexed,uint256,address,address,address)":"0x116812d3ad4507d72f2c428b63246d594ca055a1dc119394285504c23d1f34cd","0x116812d3ad4507d72f2c428b63246d594ca055a1dc119394285504c23d1f34cd":"BoostCreated(uint256 indexed,address indexed,address indexed,uint256,address,address,address)","SecondaryBuy(address indexed,address indexed,address indexed,uint256,uint256)":"0x72d6b4b5ad0fb12b8a7bb3bcb60edd774c096403d611437859c156ecb3c03a36","0x72d6b4b5ad0fb12b8a7bb3bcb60edd774c096403d611437859c156ecb3c03a36":"SecondaryBuy(address indexed,address indexed,address indexed,uint256,uint256)","CoopTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":"0x6779abc30cb1bfb05c1170de8e2ef5828c19a2590043d2fd9579d945929fd8a4","0x6779abc30cb1bfb05c1170de8e2ef5828c19a2590043d2fd9579d945929fd8a4":"CoopTokenBuy(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)","CoopTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)":"0xeb3adfe7d8294092cd6b0e7ce95ed01c11d3c5d5d3dc1fecdeb87de43c5e40b2","0xeb3adfe7d8294092cd6b0e7ce95ed01c11d3c5d5d3dc1fecdeb87de43c5e40b2":"CoopTokenSell(address indexed,address indexed,address indexed,uint256,uint256,uint256,uint256,uint256,string,uint256,uint8)","CoopTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)":"0xd5468362e31bdcdc9884e72dcf3b00f9d46086067621224b7cb759308d597c6c","0xd5468362e31bdcdc9884e72dcf3b00f9d46086067621224b7cb759308d597c6c":"CoopTokenFees(address indexed,address indexed,address indexed,address,uint256,uint256,uint256,uint256)","InfoIndexed(address indexed,string indexed)":"0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b","0x883a883a9ea847654d33471b1e5fb2dea76a2cfc86a6cc7da6c14102800e4d0b":"InfoIndexed(address indexed,string indexed)","Info(address,string)":"0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c","0xe46343e36b0721f173bdc76b8f25c08b04f417df09c27e1e83ba1980007fef8c":"Info(address,string)"}};var p=(e=>(e[e.ACTION=0]="ACTION",e[e.ALLOW_LIST=1]="ALLOW_LIST",e[e.BUDGET=2]="BUDGET",e[e.INCENTIVE=3]="INCENTIVE",e[e.VALIDATOR=4]="VALIDATOR",e))(p||{}),y=(e=>(e[e.ANY_ACTION_PARAM=255]="ANY_ACTION_PARAM",e[e.TX_SENDER_CLAIMANT=255]="TX_SENDER_CLAIMANT",e[e.GAS_REBATE_INCENTIVE=255]="GAS_REBATE_INCENTIVE",e))(y||{});const x=c.selectors["Transfer(address indexed,address indexed,uint256 indexed)"];function b(e){return s.slice(s.isHex(e)?s.keccak256(e):s.keccak256(s.toHex(e)),0,4)}async function f(e,t,n){const d=await a.waitForTransactionReceipt(e,{...n,hash:await t});if(!d.contractAddress)throw new r.NoContractAddressUponReceiptError(d);return d.contractAddress}async function o(e,t,n){const{hash:d,result:i}=await t;return await a.waitForTransactionReceipt(e,{...n,hash:d}),i}function m(e,t,n){let d;const i=a.getChainId(e);if(i&&t[i]&&(d=i),n!==void 0?t[n]&&(d=n):i!==void 0&&t[i]&&(d=i),d===void 0){const u=a.getAccount(e);u.chainId!==void 0&&t[u.chainId]&&(d=u.chainId)}if(d===void 0&&(d=11155111),!t[d])throw new r.InvalidProtocolChainIdError(d,Object.keys(t).map(Number));return{chainId:d,address:t[d]}}async function g(e,t,n,d){return await a.readContract(e,{...d,functionName:"balanceOf",address:t,args:[n],abi:[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"}]})}exports.CheatCodes=y;exports.RegistryType=p;exports.TRANSFER_SIGNATURE=x;exports.assertValidAddressByChainId=m;exports.awaitResult=o;exports.bytes4=b;exports.getDeployedContractAddress=f;exports.getErc20Balance=g;
|
|
2
2
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../src/utils.ts"],"sourcesContent":["import {\n type Config,\n type ReadContractParameters,\n type SimulateContractParameters,\n type WatchContractEventParameters,\n getAccount,\n getChainId,\n readContract,\n waitForTransactionReceipt,\n} from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport type {\n Abi,\n AbiEvent,\n Address,\n ContractEventName,\n ContractFunctionName,\n GetLogsParameters,\n Hash,\n Hex,\n Log,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport { isHex, keccak256, slice, toHex } from 'viem';\nimport {\n InvalidProtocolChainIdError,\n NoContractAddressUponReceiptError,\n} from './errors';\n\nexport type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;\n\n/**\n * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.\n *\n * @export\n * @enum {number}\n */\nexport enum RegistryType {\n ACTION = 0,\n ALLOW_LIST = 1,\n BUDGET = 2,\n INCENTIVE = 3,\n VALIDATOR = 4,\n}\n\n/**\n * Enum encapsulating all the different cheat codes for criteria modules.\n * An Event Action action step criteria with a `fieldIndex` set to `CheatCodes.ANY_ACTION_PARAM`, fieldType set to `PrimitiveType.BYTES`, and `filterType` set to `FilterType.EQUAL` will always return true when validating the field, regardless of inputs\n * An Event Action `ActionClaimant` with a `fieldIndex` set to `CheatCodes.TX_SENDER_CLAIMANT`, will always validate with the sender of a given transaction.\n *\n *\n * @export\n * @enum {number}\n */\nexport enum CheatCodes {\n /* An Event Action action step criteria with a `fieldIndex` set to `CheatCodes.ANY_ACTION_PARAM`, fieldType set to `PrimitiveType.BYTES`, and `filterType` set to `FilterType.EQUAL` will always return true when validating the field, regardless of inputs */\n ANY_ACTION_PARAM = 255,\n /* An Event Action `ActionClaimant` with a `fieldIndex` set to `CheatCodes.TX_SENDER_CLAIMANT`, will always validate with the sender of a given transaction. */\n TX_SENDER_CLAIMANT = 255,\n /* For use with `ERC20VariableCriteriaIncentive`, if the criteria's `fieldIndex` is set to `CheatCodes.GAS_REBATE_INCENTIVE`, will claim an incentive amount equal to the transaction's gas used. */\n GAS_REBATE_INCENTIVE = 255,\n}\n\n/**\n * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (writeContract)[https://viem.sh/docs/contract/writeContract]\n *\n * @export\n * @typedef {WriteParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type WriteParams = Partial<\n Omit<SimulateContractParameters, 'address' | 'args' | 'functionName' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (readContract)[https://viem.sh/docs/contract/readContract]\n *\n * @export\n * @typedef {ReadParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type ReadParams = Partial<\n Omit<ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `watchContractEvent` parameters without fields like `address`, and `abi` that are expected to be provided the SDK.\n * See (watchContractEvent)[https://wagmi.sh/core/api/actions/watchContractEvent]\n *\n * @export\n * @typedef {WatchParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi> | undefined} [eventName=undefined]\n */\nexport type WatchParams<\n abi extends Abi,\n eventName extends ContractEventName<abi> | undefined = undefined,\n> = Partial<\n Omit<WatchContractEventParameters<abi, eventName>, 'address' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `getLogs` parameters without fields like `address` that are expected to be provided the SDK.\n * See (getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]\n *\n * @export\n * @typedef {GetLogsParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} event\n * @template {ExtractAbiEvent<abi, event>} [abiEvent=ExtractAbiEvent<abi, event>]\n * @template {| readonly AbiEvent[]\n * | readonly unknown[]\n * | undefined} [abiEvents=abiEvent extends AbiEvent ? [abiEvent] : undefined]\n */\nexport type GetLogsParams<\n abi extends Abi,\n event extends ContractEventName<abi>,\n abiEvent extends ExtractAbiEvent<abi, event> = ExtractAbiEvent<abi, event>,\n abiEvents extends\n | readonly AbiEvent[]\n | readonly unknown[]\n | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined,\n> = Partial<Omit<GetLogsParameters<abiEvent, abiEvents>, 'address'>> & {\n chainId?: number | undefined;\n};\n\n/**\n * A generic `viem.Log` event with typed `args` support via a given `Abi` and `ContractEventName`\n *\n * @export\n * @typedef {GenericLog}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} [event=ContractEventName<abi>]\n */\nexport type GenericLog<\n abi extends Abi,\n event extends ContractEventName<abi> = ContractEventName<abi>,\n> = Log<bigint, number, false, ExtractAbiEvent<abi, event>, false>;\n\n/**\n * Helper utility to convert a string to a `bytes4` type\n *\n * @export\n * @param {string} input\n * @returns {Hex}\n */\nexport function bytes4(input: string) {\n return slice(isHex(input) ? keccak256(input) : keccak256(toHex(input)), 0, 4);\n}\n\n/**\n * Utility function to wait for a transaction receipt, and extract the contractAddress\n *\n * @export\n * @async\n * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {Promise<Hash>} hash - A transaction hash promise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}\n * @returns {Promise<Address>}\n * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received\n */\nexport async function getDeployedContractAddress(\n config: Config,\n hash: Promise<Hash>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n) {\n const receipt = await waitForTransactionReceipt(config, {\n ...waitParams,\n hash: await hash,\n });\n if (!receipt.contractAddress)\n throw new NoContractAddressUponReceiptError(receipt);\n return receipt.contractAddress;\n}\n\n/**\n * Utility type to encapsulate a transaction hash, and the simulated result prior to submitting the transaction.\n *\n * @export\n * @typedef {HashAndSimulatedResult}\n * @template [T=unknown]\n */\nexport type HashAndSimulatedResult<T = unknown> = { hash: Hash; result: T };\n\n/**\n * Helper function to wait for a transaction receipt given a hash promise.\n *\n * @export\n * @async\n * @template [Result=unknown]\n * @param {WagmiConfig} config\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\nexport async function awaitResult<Result = unknown>(\n config: Config,\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n): Promise<Result> {\n const { hash, result } = await hashPromise;\n await waitForTransactionReceipt(config, {\n ...waitParams,\n hash,\n });\n return result;\n}\n\n/**\n * Given a wagmi config and a map of chain id's to addresses, determine an address/chainId combo that maps to the currently connected chain id, or throw a typed error.\n *\n * @export\n * @param {Config} config\n * @param {Record<string, Address>} addressByChainId\n * @param {number} desiredChainId\n * @returns {{ chainId: number, address: Address }}\n * @throws {@link InvalidProtocolChainIdError}\n */\nexport function assertValidAddressByChainId(\n config: Config,\n addressByChainId: Record<number, Address>,\n desiredChainId?: number,\n): { chainId: number; address: Address } {\n let chainId: number | undefined = undefined;\n\n const wagmiChainId = getChainId(config);\n if (wagmiChainId && addressByChainId[wagmiChainId]) chainId = wagmiChainId;\n // if manually providing a chain id for some contract operation, try to use it\n if (desiredChainId !== undefined) {\n if (addressByChainId[desiredChainId]) chainId = desiredChainId;\n } else if (wagmiChainId !== undefined) {\n // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it\n if (addressByChainId[wagmiChainId]) chainId = wagmiChainId;\n }\n // chainId is still undefined, try to get chain id off viem client\n if (chainId === undefined) {\n const wagmiAccount = getAccount(config);\n if (wagmiAccount.chainId !== undefined) {\n // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it\n if (addressByChainId[wagmiAccount.chainId])\n chainId = wagmiAccount.chainId;\n }\n }\n // if chainId is STILL undefined, use our default addresses\n // TODO: update this when on prod network\n if (chainId === undefined) chainId = Number(__DEFAULT_CHAIN_ID__);\n if (!addressByChainId[chainId])\n throw new InvalidProtocolChainIdError(\n chainId,\n Object.keys(addressByChainId).map(Number),\n );\n // biome-ignore lint/style/noNonNullAssertion: this type should be narrowed by the above statement but isn't?\n return { chainId, address: addressByChainId[chainId]! };\n}\n\n/**\n * Check an ERC20's balance for a given asset and\n *\n * @public\n * @async\n * @param {Config} [config]\n * @param {Address} [asset]\n * @param {Address} [owner]\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The erc20 balance\n */\nexport async function getErc20Balance(\n config: Config,\n asset: Address,\n owner: Address,\n params?: ReadParams,\n) {\n return await readContract(config, {\n ...params,\n functionName: 'balanceOf',\n address: asset,\n args: [owner],\n abi: [\n {\n constant: true,\n inputs: [\n {\n name: '_owner',\n type: 'address',\n },\n ],\n name: 'balanceOf',\n outputs: [\n {\n name: 'balance',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n });\n}\n"],"names":["RegistryType","CheatCodes","bytes4","input","slice","isHex","keccak256","toHex","getDeployedContractAddress","config","hash","waitParams","receipt","waitForTransactionReceipt","NoContractAddressUponReceiptError","awaitResult","hashPromise","result","assertValidAddressByChainId","addressByChainId","desiredChainId","chainId","wagmiChainId","getChainId","wagmiAccount","getAccount","InvalidProtocolChainIdError","getErc20Balance","asset","owner","params","readContract"],"mappings":"2JAqCY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,OAAS,CAAT,EAAA,SACAA,EAAAA,EAAA,WAAa,CAAb,EAAA,aACAA,EAAAA,EAAA,OAAS,CAAT,EAAA,SACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YALUA,IAAAA,GAAA,CAAA,CAAA,EAiBAC,GAAAA,IAEVA,EAAAA,EAAA,iBAAmB,GAAnB,EAAA,mBAEAA,EAAAA,EAAA,mBAAqB,GAArB,EAAA,qBAEAA,EAAAA,EAAA,qBAAuB,GAAvB,EAAA,uBANUA,IAAAA,GAAA,CAAA,CAAA,EAgGL,SAASC,EAAOC,EAAe,CACpC,OAAOC,EAAM,MAAAC,EAAA,MAAMF,CAAK,EAAIG,EAAU,UAAAH,CAAK,EAAIG,EAAA,UAAUC,EAAM,MAAAJ,CAAK,CAAC,EAAG,EAAG,CAAC,CAC9E,CAasB,eAAAK,EACpBC,EACAC,EACAC,EACA,CACM,MAAAC,EAAU,MAAMC,EAAA,0BAA0BJ,EAAQ,CACtD,GAAGE,EACH,KAAM,MAAMD,CAAA,CACb,EACD,GAAI,CAACE,EAAQ,gBACL,MAAA,IAAIE,EAAAA,kCAAkCF,CAAO,EACrD,OAAOA,EAAQ,eACjB,CAsBsB,eAAAG,EACpBN,EACAO,EACAL,EACiB,CACjB,KAAM,CAAE,KAAAD,EAAM,OAAAO,CAAO,EAAI,MAAMD,EAC/B,aAAMH,EAAAA,0BAA0BJ,EAAQ,CACtC,GAAGE,EACH,KAAAD,CAAA,CACD,EACMO,CACT,CAYgB,SAAAC,EACdT,EACAU,EACAC,EACuC,CACvC,IAAIC,EAEE,MAAAC,EAAeC,aAAWd,CAAM,EAUtC,GATIa,GAAgBH,EAAiBG,CAAY,IAAaD,EAAAC,GAE1DF,IAAmB,OACjBD,EAAiBC,CAAc,IAAaC,EAAAD,GACvCE,IAAiB,QAEtBH,EAAiBG,CAAY,IAAaD,EAAAC,GAG5CD,IAAY,OAAW,CACnB,MAAAG,EAAeC,aAAWhB,CAAM,EAClCe,EAAa,UAAY,QAEvBL,EAAiBK,EAAa,OAAO,IACvCH,EAAUG,EAAa,QAE7B,CAII,GADAH,IAAY,SAAqBA,EAAO,UACxC,CAACF,EAAiBE,CAAO,EAC3B,MAAM,IAAIK,EAAA,4BACRL,EACA,OAAO,KAAKF,CAAgB,EAAE,IAAI,MAAM,CAAA,EAG5C,MAAO,CAAE,QAAAE,EAAS,QAASF,EAAiBE,CAAO,CAAG,CACxD,CAaA,eAAsBM,EACpBlB,EACAmB,EACAC,EACAC,EACA,CACO,OAAA,MAAMC,eAAatB,EAAQ,CAChC,GAAGqB,EACH,aAAc,YACd,QAASF,EACT,KAAM,CAACC,CAAK,EACZ,IAAK,CACH,CACE,SAAU,GACV,OAAQ,CACN,CACE,KAAM,SACN,KAAM,SACR,CACF,EACA,KAAM,YACN,QAAS,CACP,CACE,KAAM,UACN,KAAM,SACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,CACF,CAAA,CACD,CACH"}
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../src/utils.ts"],"sourcesContent":["import { events } from '@boostxyz/signatures';\nimport {\n type Config,\n type ReadContractParameters,\n type SimulateContractParameters,\n type WatchContractEventParameters,\n getAccount,\n getChainId,\n readContract,\n waitForTransactionReceipt,\n} from '@wagmi/core';\nimport type { ExtractAbiEvent } from 'abitype';\nimport type {\n Abi,\n AbiEvent,\n Address,\n ContractEventName,\n ContractFunctionName,\n GetLogsParameters,\n Hash,\n Hex,\n Log,\n WaitForTransactionReceiptParameters,\n} from 'viem';\nimport { isHex, keccak256, slice, toHex } from 'viem';\nimport {\n InvalidProtocolChainIdError,\n NoContractAddressUponReceiptError,\n} from './errors';\n\nexport type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;\n\n/**\n * Enum encapsulating all the different types of targets used in the Boost V2 Protocol.\n *\n * @export\n * @enum {number}\n */\nexport enum RegistryType {\n ACTION = 0,\n ALLOW_LIST = 1,\n BUDGET = 2,\n INCENTIVE = 3,\n VALIDATOR = 4,\n}\n\n/**\n * Enum encapsulating all the different cheat codes for criteria modules.\n * An Event Action action step criteria with a `fieldIndex` set to `CheatCodes.ANY_ACTION_PARAM`, fieldType set to `PrimitiveType.BYTES`, and `filterType` set to `FilterType.EQUAL` will always return true when validating the field, regardless of inputs\n * An Event Action `ActionClaimant` with a `fieldIndex` set to `CheatCodes.TX_SENDER_CLAIMANT`, will always validate with the sender of a given transaction.\n *\n *\n * @export\n * @enum {number}\n */\nexport enum CheatCodes {\n /* An Event Action action step criteria with a `fieldIndex` set to `CheatCodes.ANY_ACTION_PARAM`, fieldType set to `PrimitiveType.BYTES`, and `filterType` set to `FilterType.EQUAL` will always return true when validating the field, regardless of inputs */\n ANY_ACTION_PARAM = 255,\n /* An Event Action `ActionClaimant` with a `fieldIndex` set to `CheatCodes.TX_SENDER_CLAIMANT`, will always validate with the sender of a given transaction. */\n TX_SENDER_CLAIMANT = 255,\n /* For use with `ERC20VariableCriteriaIncentive`, if the criteria's `fieldIndex` is set to `CheatCodes.GAS_REBATE_INCENTIVE`, will claim an incentive amount equal to the transaction's gas used. */\n GAS_REBATE_INCENTIVE = 255,\n}\n\n/**\n * The signature for the Transfer event for both ERC20 and ERC721.\n *\n * @type {Hex}\n */\nexport const TRANSFER_SIGNATURE = events.selectors[\n 'Transfer(address indexed,address indexed,uint256 indexed)'\n] as Hex;\n\n/**\n * Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (writeContract)[https://viem.sh/docs/contract/writeContract]\n *\n * @export\n * @typedef {WriteParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type WriteParams = Partial<\n Omit<SimulateContractParameters, 'address' | 'args' | 'functionName' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common readContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.\n * See (readContract)[https://viem.sh/docs/contract/readContract]\n *\n * @export\n * @typedef {ReadParams}\n * @template {Abi} abi\n * @template {ContractFunctionName<abi>} functionName\n */\nexport type ReadParams = Partial<\n Omit<ReadContractParameters, 'address' | 'args' | 'functionName' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `watchContractEvent` parameters without fields like `address`, and `abi` that are expected to be provided the SDK.\n * See (watchContractEvent)[https://wagmi.sh/core/api/actions/watchContractEvent]\n *\n * @export\n * @typedef {WatchParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi> | undefined} [eventName=undefined]\n */\nexport type WatchParams<\n abi extends Abi,\n eventName extends ContractEventName<abi> | undefined = undefined,\n> = Partial<\n Omit<WatchContractEventParameters<abi, eventName>, 'address' | 'abi'>\n>;\n\n/**\n * Helper type that encapsulates common `getLogs` parameters without fields like `address` that are expected to be provided the SDK.\n * See (getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]\n *\n * @export\n * @typedef {GetLogsParams}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} event\n * @template {ExtractAbiEvent<abi, event>} [abiEvent=ExtractAbiEvent<abi, event>]\n * @template {| readonly AbiEvent[]\n * | readonly unknown[]\n * | undefined} [abiEvents=abiEvent extends AbiEvent ? [abiEvent] : undefined]\n */\nexport type GetLogsParams<\n abi extends Abi,\n event extends ContractEventName<abi>,\n abiEvent extends ExtractAbiEvent<abi, event> = ExtractAbiEvent<abi, event>,\n abiEvents extends\n | readonly AbiEvent[]\n | readonly unknown[]\n | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined,\n> = Partial<Omit<GetLogsParameters<abiEvent, abiEvents>, 'address'>> & {\n chainId?: number | undefined;\n};\n\n/**\n * A generic `viem.Log` event with typed `args` support via a given `Abi` and `ContractEventName`\n *\n * @export\n * @typedef {GenericLog}\n * @template {Abi} abi\n * @template {ContractEventName<abi>} [event=ContractEventName<abi>]\n */\nexport type GenericLog<\n abi extends Abi,\n event extends ContractEventName<abi> = ContractEventName<abi>,\n> = Log<bigint, number, false, ExtractAbiEvent<abi, event>, false>;\n\n/**\n * Helper utility to convert a string to a `bytes4` type\n *\n * @export\n * @param {string} input\n * @returns {Hex}\n */\nexport function bytes4(input: string) {\n return slice(isHex(input) ? keccak256(input) : keccak256(toHex(input)), 0, 4);\n}\n\n/**\n * Utility function to wait for a transaction receipt, and extract the contractAddress\n *\n * @export\n * @async\n * @param {WagmiConfig} config - [Wagmi Configuration](https://wagmi.sh/core/api/createConfig)\n * @param {Promise<Hash>} hash - A transaction hash promise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams] - @see {@link WaitForTransactionReceiptParameters}\n * @returns {Promise<Address>}\n * @throws {@link NoContractAddressUponReceiptError} if no `contractAddress` exists after the transaction has been received\n */\nexport async function getDeployedContractAddress(\n config: Config,\n hash: Promise<Hash>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n) {\n const receipt = await waitForTransactionReceipt(config, {\n ...waitParams,\n hash: await hash,\n });\n if (!receipt.contractAddress)\n throw new NoContractAddressUponReceiptError(receipt);\n return receipt.contractAddress;\n}\n\n/**\n * Utility type to encapsulate a transaction hash, and the simulated result prior to submitting the transaction.\n *\n * @export\n * @typedef {HashAndSimulatedResult}\n * @template [T=unknown]\n */\nexport type HashAndSimulatedResult<T = unknown> = { hash: Hash; result: T };\n\n/**\n * Helper function to wait for a transaction receipt given a hash promise.\n *\n * @export\n * @async\n * @template [Result=unknown]\n * @param {WagmiConfig} config\n * @param {Promise<HashAndSimulatedResult<Result>>} hashPromise\n * @param {?Omit<WaitForTransactionReceiptParameters, 'hash'>} [waitParams]\n * @returns {Promise<Result>}\n */\nexport async function awaitResult<Result = unknown>(\n config: Config,\n hashPromise: Promise<HashAndSimulatedResult<Result>>,\n waitParams?: Omit<WaitForTransactionReceiptParameters, 'hash'>,\n): Promise<Result> {\n const { hash, result } = await hashPromise;\n await waitForTransactionReceipt(config, {\n ...waitParams,\n hash,\n });\n return result;\n}\n\n/**\n * Given a wagmi config and a map of chain id's to addresses, determine an address/chainId combo that maps to the currently connected chain id, or throw a typed error.\n *\n * @export\n * @param {Config} config\n * @param {Record<string, Address>} addressByChainId\n * @param {number} desiredChainId\n * @returns {{ chainId: number, address: Address }}\n * @throws {@link InvalidProtocolChainIdError}\n */\nexport function assertValidAddressByChainId(\n config: Config,\n addressByChainId: Record<number, Address>,\n desiredChainId?: number,\n): { chainId: number; address: Address } {\n let chainId: number | undefined = undefined;\n\n const wagmiChainId = getChainId(config);\n if (wagmiChainId && addressByChainId[wagmiChainId]) chainId = wagmiChainId;\n // if manually providing a chain id for some contract operation, try to use it\n if (desiredChainId !== undefined) {\n if (addressByChainId[desiredChainId]) chainId = desiredChainId;\n } else if (wagmiChainId !== undefined) {\n // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it\n if (addressByChainId[wagmiChainId]) chainId = wagmiChainId;\n }\n // chainId is still undefined, try to get chain id off viem client\n if (chainId === undefined) {\n const wagmiAccount = getAccount(config);\n if (wagmiAccount.chainId !== undefined) {\n // otherwise if we can get the current chain id off the connected account and it matches one of ours, use it\n if (addressByChainId[wagmiAccount.chainId])\n chainId = wagmiAccount.chainId;\n }\n }\n // if chainId is STILL undefined, use our default addresses\n // TODO: update this when on prod network\n if (chainId === undefined) chainId = Number(__DEFAULT_CHAIN_ID__);\n if (!addressByChainId[chainId])\n throw new InvalidProtocolChainIdError(\n chainId,\n Object.keys(addressByChainId).map(Number),\n );\n // biome-ignore lint/style/noNonNullAssertion: this type should be narrowed by the above statement but isn't?\n return { chainId, address: addressByChainId[chainId]! };\n}\n\n/**\n * Check an ERC20's balance for a given asset and\n *\n * @public\n * @async\n * @param {Config} [config]\n * @param {Address} [asset]\n * @param {Address} [owner]\n * @param {?ReadParams} [params]\n * @returns {Promise<bigint>} - The erc20 balance\n */\nexport async function getErc20Balance(\n config: Config,\n asset: Address,\n owner: Address,\n params?: ReadParams,\n) {\n return await readContract(config, {\n ...params,\n functionName: 'balanceOf',\n address: asset,\n args: [owner],\n abi: [\n {\n constant: true,\n inputs: [\n {\n name: '_owner',\n type: 'address',\n },\n ],\n name: 'balanceOf',\n outputs: [\n {\n name: 'balance',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n });\n}\n"],"names":["RegistryType","CheatCodes","TRANSFER_SIGNATURE","events","bytes4","input","slice","isHex","keccak256","toHex","getDeployedContractAddress","config","hash","waitParams","receipt","waitForTransactionReceipt","NoContractAddressUponReceiptError","awaitResult","hashPromise","result","assertValidAddressByChainId","addressByChainId","desiredChainId","chainId","wagmiChainId","getChainId","wagmiAccount","getAccount","InvalidProtocolChainIdError","getErc20Balance","asset","owner","params","readContract"],"mappings":"q0dAsCY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,OAAS,CAAT,EAAA,SACAA,EAAAA,EAAA,WAAa,CAAb,EAAA,aACAA,EAAAA,EAAA,OAAS,CAAT,EAAA,SACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YACAA,EAAAA,EAAA,UAAY,CAAZ,EAAA,YALUA,IAAAA,GAAA,CAAA,CAAA,EAiBAC,GAAAA,IAEVA,EAAAA,EAAA,iBAAmB,GAAnB,EAAA,mBAEAA,EAAAA,EAAA,mBAAqB,GAArB,EAAA,qBAEAA,EAAAA,EAAA,qBAAuB,GAAvB,EAAA,uBANUA,IAAAA,GAAA,CAAA,CAAA,EAcC,MAAAC,EAAqBC,EAAO,UACvC,2DACF,EAyFO,SAASC,EAAOC,EAAe,CACpC,OAAOC,EAAM,MAAAC,EAAA,MAAMF,CAAK,EAAIG,EAAU,UAAAH,CAAK,EAAIG,EAAA,UAAUC,EAAM,MAAAJ,CAAK,CAAC,EAAG,EAAG,CAAC,CAC9E,CAasB,eAAAK,EACpBC,EACAC,EACAC,EACA,CACM,MAAAC,EAAU,MAAMC,EAAA,0BAA0BJ,EAAQ,CACtD,GAAGE,EACH,KAAM,MAAMD,CAAA,CACb,EACD,GAAI,CAACE,EAAQ,gBACL,MAAA,IAAIE,EAAAA,kCAAkCF,CAAO,EACrD,OAAOA,EAAQ,eACjB,CAsBsB,eAAAG,EACpBN,EACAO,EACAL,EACiB,CACjB,KAAM,CAAE,KAAAD,EAAM,OAAAO,CAAO,EAAI,MAAMD,EAC/B,aAAMH,EAAAA,0BAA0BJ,EAAQ,CACtC,GAAGE,EACH,KAAAD,CAAA,CACD,EACMO,CACT,CAYgB,SAAAC,EACdT,EACAU,EACAC,EACuC,CACvC,IAAIC,EAEE,MAAAC,EAAeC,aAAWd,CAAM,EAUtC,GATIa,GAAgBH,EAAiBG,CAAY,IAAaD,EAAAC,GAE1DF,IAAmB,OACjBD,EAAiBC,CAAc,IAAaC,EAAAD,GACvCE,IAAiB,QAEtBH,EAAiBG,CAAY,IAAaD,EAAAC,GAG5CD,IAAY,OAAW,CACnB,MAAAG,EAAeC,aAAWhB,CAAM,EAClCe,EAAa,UAAY,QAEvBL,EAAiBK,EAAa,OAAO,IACvCH,EAAUG,EAAa,QAE7B,CAII,GADAH,IAAY,SAAqBA,EAAO,UACxC,CAACF,EAAiBE,CAAO,EAC3B,MAAM,IAAIK,EAAA,4BACRL,EACA,OAAO,KAAKF,CAAgB,EAAE,IAAI,MAAM,CAAA,EAG5C,MAAO,CAAE,QAAAE,EAAS,QAASF,EAAiBE,CAAO,CAAG,CACxD,CAaA,eAAsBM,EACpBlB,EACAmB,EACAC,EACAC,EACA,CACO,OAAA,MAAMC,eAAatB,EAAQ,CAChC,GAAGqB,EACH,aAAc,YACd,QAASF,EACT,KAAM,CAACC,CAAK,EACZ,IAAK,CACH,CACE,SAAU,GACV,OAAQ,CACN,CACE,KAAM,SACN,KAAM,SACR,CACF,EACA,KAAM,YACN,QAAS,CACP,CACE,KAAM,UACN,KAAM,SACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,CACF,CAAA,CACD,CACH"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Config, type ReadContractParameters, type SimulateContractParameters, type WatchContractEventParameters } from '@wagmi/core';
|
|
2
2
|
import type { ExtractAbiEvent } from 'abitype';
|
|
3
|
-
import type { Abi, AbiEvent, Address, ContractEventName, GetLogsParameters, Hash, Log, WaitForTransactionReceiptParameters } from 'viem';
|
|
3
|
+
import type { Abi, AbiEvent, Address, ContractEventName, GetLogsParameters, Hash, Hex, Log, WaitForTransactionReceiptParameters } from 'viem';
|
|
4
4
|
export type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
|
5
5
|
/**
|
|
6
6
|
* Enum encapsulating all the different types of targets used in the Boost V2 Protocol.
|
|
@@ -29,6 +29,12 @@ export declare enum CheatCodes {
|
|
|
29
29
|
TX_SENDER_CLAIMANT = 255,
|
|
30
30
|
GAS_REBATE_INCENTIVE = 255
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* The signature for the Transfer event for both ERC20 and ERC721.
|
|
34
|
+
*
|
|
35
|
+
* @type {Hex}
|
|
36
|
+
*/
|
|
37
|
+
export declare const TRANSFER_SIGNATURE: Hex;
|
|
32
38
|
/**
|
|
33
39
|
* Helper type that encapsulates common writeContract parameters without fields like `abi`, `args`, `functionName`, `address` that are expected to be provided the SDK.
|
|
34
40
|
* See (writeContract)[https://viem.sh/docs/contract/writeContract]
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EAKlC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EACV,GAAG,EACH,QAAQ,EACR,OAAO,EACP,iBAAiB,EAEjB,iBAAiB,EACjB,IAAI,EACJ,GAAG,EACH,GAAG,EACH,mCAAmC,EACpC,MAAM,MAAM,CAAC;AAOd,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAErE;;;;;GAKG;AACH,oBAAY,YAAY;IACtB,MAAM,IAAI;IACV,UAAU,IAAI;IACd,MAAM,IAAI;IACV,SAAS,IAAI;IACb,SAAS,IAAI;CACd;AAED;;;;;;;;GAQG;AACH,oBAAY,UAAU;IAEpB,gBAAgB,MAAM;IAEtB,kBAAkB,MAAM;IAExB,oBAAoB,MAAM;CAC3B;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAE1B,GAAG,CAAC;AAET;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAC/B,IAAI,CAAC,0BAA0B,EAAE,SAAS,GAAG,MAAM,GAAG,cAAc,GAAG,KAAK,CAAC,CAC9E,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAC9B,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,MAAM,GAAG,cAAc,GAAG,KAAK,CAAC,CAC1E,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,CACrB,GAAG,SAAS,GAAG,EACf,SAAS,SAAS,iBAAiB,CAAC,GAAG,CAAC,GAAG,SAAS,GAAG,SAAS,IAC9D,OAAO,CACT,IAAI,CAAC,4BAA4B,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,CACtE,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,CACvB,GAAG,SAAS,GAAG,EACf,KAAK,SAAS,iBAAiB,CAAC,GAAG,CAAC,EACpC,QAAQ,SAAS,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,EAC1E,SAAS,SACL,SAAS,QAAQ,EAAE,GACnB,SAAS,OAAO,EAAE,GAClB,SAAS,GAAG,QAAQ,SAAS,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG,SAAS,IAChE,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG;IACrE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,CACpB,GAAG,SAAS,GAAG,EACf,KAAK,SAAS,iBAAiB,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,GAAG,CAAC,IAC3D,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;AAEnE;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,iBAEnC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EACnB,UAAU,CAAC,EAAE,IAAI,CAAC,mCAAmC,EAAE,MAAM,CAAC,0BAS/D;AAED;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,GAAG,OAAO,IAAI;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC;AAE5E;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAAC,MAAM,GAAG,OAAO,EAChD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,OAAO,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,EACpD,UAAU,CAAC,EAAE,IAAI,CAAC,mCAAmC,EAAE,MAAM,CAAC,GAC7D,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzC,cAAc,CAAC,EAAE,MAAM,GACtB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CA+BvC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,UAAU,mBA4BpB"}
|