@boostxyz/sdk 0.0.0-alpha.10 → 0.0.0-alpha.12
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.js +2 -2
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +115 -31
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +306 -122
- 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.d.ts +6 -4
- package/dist/AllowLists/AllowList.d.ts.map +1 -1
- package/dist/AllowLists/AllowList.js +45 -23
- package/dist/AllowLists/AllowList.js.map +1 -1
- package/dist/AllowLists/OpenAllowList.d.ts +240 -0
- package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.js +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs.map +1 -1
- package/dist/AllowLists/SimpleDenyList.d.ts +2 -2
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +9 -111
- package/dist/AllowLists/SimpleDenyList.js.map +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 -1
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +169 -151
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.js +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +29 -27
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +78 -77
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/SimpleBudget.d.ts +6 -6
- package/dist/Budgets/SimpleBudget.d.ts.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +6 -6
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -1
- package/dist/Deployable/DeployableTarget.d.ts +1 -1
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +1 -1
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +2 -2
- package/dist/Incentives/CGDAIncentive.js +1 -1
- package/dist/Incentives/ERC20Incentive.js +1 -1
- package/dist/Incentives/ERC20VariableIncentive.d.ts +5 -5
- package/dist/Incentives/Incentive.cjs.map +1 -1
- package/dist/Incentives/Incentive.js +16 -16
- package/dist/Incentives/Incentive.js.map +1 -1
- package/dist/Incentives/PointsIncentive.js +1 -1
- package/dist/SimpleDenyList-CqT0BMP7.cjs +2 -0
- package/dist/SimpleDenyList-CqT0BMP7.cjs.map +1 -0
- package/dist/SimpleDenyList-IJ9Ipya7.js +112 -0
- package/dist/SimpleDenyList-IJ9Ipya7.js.map +1 -0
- package/dist/Validators/SignerValidator.js +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/{componentInterfaces-DYkaxBda.js → componentInterfaces-Cmg8tUxq.js} +5 -5
- package/dist/componentInterfaces-Cmg8tUxq.js.map +1 -0
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +116 -20
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +106 -52
- package/dist/errors.js.map +1 -1
- package/dist/{generated-BDeDiaCK.js → generated-HGddZXHJ.js} +21 -21
- package/dist/{generated-BDeDiaCK.js.map → generated-HGddZXHJ.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +95 -91
- package/package.json +11 -7
- package/src/Actions/Action.test.ts +9 -5
- package/src/Actions/ContractAction.test.ts +3 -3
- package/src/Actions/ERC721MintAction.test.ts +1 -1
- package/src/Actions/EventAction.test.ts +527 -99
- package/src/Actions/EventAction.ts +296 -58
- package/src/AllowLists/AllowList.test.ts +2 -2
- package/src/AllowLists/AllowList.ts +5 -3
- package/src/AllowLists/OpenAllowList.test.ts +40 -0
- package/src/AllowLists/OpenAllowList.ts +45 -0
- package/src/AllowLists/SimpleAllowList.test.ts +1 -1
- package/src/AllowLists/SimpleDenyList.test.ts +1 -1
- package/src/AllowLists/SimpleDenyList.ts +6 -9
- package/src/BoostCore.ts +19 -0
- package/src/Budgets/ManagedBudget.test.ts +70 -7
- package/src/Budgets/ManagedBudget.ts +42 -31
- package/src/Budgets/SimpleBudget.test.ts +3 -3
- package/src/Budgets/SimpleBudget.ts +6 -6
- package/src/Budgets/VestingBudget.test.ts +3 -3
- package/src/Budgets/VestingBudget.ts +6 -6
- package/src/Deployable/DeployableTarget.ts +1 -1
- package/src/Incentives/AllowListIncentive.test.ts +1 -1
- package/src/Incentives/ERC20VariableIncentive.ts +5 -5
- package/src/Validators/SignerValidator.test.ts +1 -1
- package/src/errors.ts +160 -20
- package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleDenyList-IJ9Ipya7.js","sources":["../src/AllowLists/SimpleDenyList.ts"],"sourcesContent":["import {\n readSimpleDenyListIsAllowed,\n simpleDenyListAbi,\n simulateSimpleDenyListSetDenied,\n writeSimpleDenyListSetDenied,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleDenyList.sol/SimpleDenyList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n encodeAbiParameters,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type WriteParams,\n} from '../utils';\n\nexport { simpleDenyListAbi };\n\n/**\n * Object representation of a {@link SimpleDenyList} initialization payload.\n *\n * @export\n * @interface SimpleDenyListPayload\n * @typedef {SimpleDenyListPayload}\n */\nexport interface SimpleDenyListPayload {\n /**\n * The allow list's owner\n *\n * @type {Address}\n */\n owner: Address;\n /**\n * List of denied addresses.\n *\n * @type {Address[]}\n */\n denied: Address[];\n}\n\n/**\n * A generic `viem.Log` event with support for `SimpleDenyList` event types.\n *\n * @export\n * @typedef {SimpleDenyListLog}\n * @template {ContractEventName<typeof simpleDenyListAbi>} [event=ContractEventName<\n * typeof simpleDenyListAbi\n * >]\n */\nexport type SimpleDenyListLog<\n event extends ContractEventName<typeof simpleDenyListAbi> = ContractEventName<\n typeof simpleDenyListAbi\n >,\n> = GenericLog<typeof simpleDenyListAbi, event>;\n\n/**\n * A simple implementation of an AllowList that implicitly allows all addresses except those explicitly added to the deny list\n *\n * @export\n * @class SimpleDenyList\n * @typedef {SimpleDenyList}\n * @extends {DeployableTarget<SimpleDenyListPayload>}\n */\nexport class SimpleDenyList<\n Payload = SimpleDenyListPayload,\n> extends DeployableTarget<Payload | undefined, typeof simpleDenyListAbi> {\n public override readonly abi = simpleDenyListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIMPLE_DENYLIST_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Check if a user is authorized (i.e. not denied)\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams<typeof simpleDenyListAbi, 'isAllowed'>} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams<typeof simpleDenyListAbi, 'isAllowed'>,\n ): Promise<boolean> {\n return await readSimpleDenyListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams<typeof simpleDenyListAbi, 'setDenied'>} [params]\n * @returns {unknown}\n */\n public async setDenied(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof simpleDenyListAbi, 'setDenied'>,\n ) {\n return await this.awaitResult(\n this.setDeniedRaw(addresses, allowed, params),\n );\n }\n\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams<typeof simpleDenyListAbi, 'setDenied'>} [params]\n * @returns {unknown}\n */\n public async setDeniedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof simpleDenyListAbi, 'setDenied'>,\n ) {\n const { request, result } = await simulateSimpleDenyListSetDenied(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleDenyListSetDenied(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleDenyListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: Payload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [p, options] = this.validateDeploymentConfig(_payload, _options);\n const payload = p as SimpleDenyListPayload;\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleDenyListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleDenyListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n\n/**\n * Given a {@link SimpleDenyListPayload}, properly encode the initialization payload.\n *\n * @param {SimpleDenyListPayload} param0\n * @param {Address} param0.owner - The allow list's owner\n * @param {Address[]} param0.denied - List of denied addresses.\n * @returns {Hex}\n */\nexport function prepareSimpleDenyListPayload({\n owner,\n denied,\n}: SimpleDenyListPayload) {\n return encodeAbiParameters(\n [\n { type: 'address', name: 'owner' },\n { type: 'address[]', name: 'denied' },\n ],\n [owner, denied],\n );\n}\n"],"names":["_SimpleDenyList","DeployableTarget","simpleDenyListAbi","address","params","readSimpleDenyListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleDenyListSetDenied","writeSimpleDenyListSetDenied","_payload","_options","p","options","payload","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleDenyListPayload","RegistryType","SimpleDenyList","denied","encodeAbiParameters"],"mappings":";;;;;;kuRA4EaA,IAAN,MAAMA,UAEHC,EAAgE;AAAA,EAFnE,cAAA;AAAA,UAAA,GAAA,SAAA,GAGL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4B/B,MAAa,UACXC,GACAC,GACkB;AACX,WAAA,MAAMC,EAA4B,KAAK,SAAS;AAAA,MACrD,SAAS,KAAK,mBAAmB;A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,MACA,MAAM,CAACC,EAA6BP,CAAO,CAAC;AAAA,MAC5C,GAAG,KAAK,wBAAwBD,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;AAnHyBhB,EAAA,OAAgB,8CASvCA,EAAuB,eAA6ByB,EAAa;AApB5D,IAAMC,IAAN1B;AAwIA,SAASwB,EAA6B;AAAA,EAC3C,OAAAL;AAAA,EACA,QAAAQ;AACF,GAA0B;AACjB,SAAAC;AAAA,IACL;AAAA,MACE,EAAE,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC,EAAE,MAAM,aAAa,MAAM,SAAS;AAAA,IACtC;AAAA,IACA,CAACT,GAAOQ,CAAM;AAAA,EAAA;AAElB;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as r, aN as u, aO as h, aP as y, aQ as m, aR as p, aS as g, aT as w, aU as A } from "../generated-
|
|
1
|
+
import { M as r, aN as u, aO as h, aP as y, aQ as m, aR as p, aS as g, aT as w, aU as A } from "../generated-HGddZXHJ.js";
|
|
2
2
|
import { encodeAbiParameters as s } from "viem";
|
|
3
3
|
import { signTypedData as D } from "viem/accounts";
|
|
4
4
|
import { DeployableTarget as v } from "../Deployable/DeployableTarget.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as a } from "../generated-
|
|
2
|
-
import {
|
|
1
|
+
import { r as a } from "../generated-HGddZXHJ.js";
|
|
2
|
+
import { b as i } from "../componentInterfaces-Cmg8tUxq.js";
|
|
3
3
|
import { readContract as m } from "@wagmi/core";
|
|
4
4
|
import { InvalidComponentInterfaceError as c } from "../errors.js";
|
|
5
5
|
import { SignerValidator as f } from "./SignerValidator.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const n = "0xa39e44d9", e = "0x8c901437", s = "0x6060409d", t = "0x7687b0ed", a = "0xa0109882", c = "0xc5b24b8e", o = "0xb8ce7b22", i = "0x8ba1fc24", A = "0x3d30a22c";
|
|
2
2
|
export {
|
|
3
3
|
t as A,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
a,
|
|
5
|
+
o as b,
|
|
6
|
+
i as c,
|
|
7
|
+
A as d,
|
|
8
8
|
c as e,
|
|
9
9
|
e as f,
|
|
10
10
|
n as g,
|
|
11
11
|
s as h
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=componentInterfaces-
|
|
13
|
+
//# sourceMappingURL=componentInterfaces-Cmg8tUxq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentInterfaces-Cmg8tUxq.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/errors.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("viem");class i extends Error{constructor(){super('No "BoostCreated" log was emitted from which to extract boostId')}}class d extends Error{constructor(){super("Attempted to call contract method without providing an address")}}class c extends Error{constructor(r){super("Attempted to deploy a contract that already has an address configured"),this.address=r}}class l extends Error{constructor(){super("Implementing class did not properly override the `buildParameters` method")}}class u extends Error{constructor(){super("Expected an an owner to be provided in configuration or an account to exist on Wagmi config.")}}class p extends Error{constructor(){super("Expected a valid Wagmi configuration to be available either on Deployable, or as argument to deploy.")}}class E extends Error{constructor(){super("Expected a valid payload to be available either on Deployable or as argument to deploy.")}}class m extends Error{constructor(r){super("Expected a contract address to exist on receipt.",{cause:r}),this.receipt=r}}class y extends Error{constructor(r,o){super("Address provided does not match any expected protocol interface",{cause:{expected:r,received:o}}),this.expected=[],this.received=n.zeroHash,this.expected=r,this.received=o}}class h extends Error{constructor(r,o){super(`Parameter is not transparently stored onchain. Parameter ${r} in event ${o.name} cannot be used in an action`,{cause:o}),this.event=o,this.input_param_idx=r}}class b extends Error{constructor(r){super("Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.",{cause:r}),this.received=r}}class g extends Error{constructor(r){super(`Budget needs to explicitly authorize ${r}. You can retrieve this value from BoostCore.address`)}}class v extends Error{constructor(){super("Budgets must be preinitialized before being used with a new Boost")}}class x extends Error{constructor(r){super(`Incentive not cloneable: ${r.constructor.name}`)}}class f extends Error{constructor(){super("Must supply at least one action step")}}class A extends Error{constructor(){super("Cannot supply more than 4 action steps with current protocol version")}}class t extends Error{constructor(r,{fieldValue:o,criteria:a,...s}){switch(super(r),this.fieldValue=o,this.criteria=a,!0){case"log"in s:this.log=s.log;break;case"decodedArgs"in s:this.decodedArgs=s.decodedArgs}}}class D extends t{constructor(r){super("Decoded Args are malformed; Check which params are indexed",r)}}class C extends t{constructor(r){super("Field value is undefined",r)}}class P extends t{constructor(r){super("Numerical comparisons cannot be used with non-numerical criteria",r)}}class w extends Error{constructor(r,o){super(`Failed to decode function data: ${o.message}`),this.name="FunctionDataDecodeError",this.abi=r,this.originalError=o}}class F extends t{constructor(r){super("Filter can only be used with bytes or string field type",r)}}class I extends t{constructor(r){super("Invalid FilterType provided",r)}}exports.BoostCoreNoIdentifierEmitted=i;exports.BudgetMustAuthorizeBoostCore=g;exports.ContractAddressRequiredError=d;exports.DecodedArgsMalformedError=D;exports.DeployableAlreadyDeployedError=c;exports.DeployableBuildParametersUnspecifiedError=l;exports.DeployableMissingPayloadError=E;exports.DeployableUnknownOwnerProvidedError=u;exports.DeployableWagmiConfigurationRequiredError=p;exports.FieldActionValidationError=t;exports.FieldValueNotComparableError=F;exports.FieldValueUndefinedError=C;exports.FunctionDataDecodeError=w;exports.IncentiveNotCloneableError=x;exports.InvalidComponentInterfaceError=y;exports.InvalidNumericalCriteriaError=P;exports.MustInitializeBudgetError=v;exports.NoContractAddressUponReceiptError=m;exports.NoEventActionStepsProvidedError=f;exports.TooManyEventActionStepsProvidedError=A;exports.UnknownTransferPayloadSupplied=b;exports.UnparseableAbiParamError=h;exports.UnrecognizedFilterTypeError=I;
|
|
2
2
|
//# sourceMappingURL=errors.cjs.map
|
package/dist/errors.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs","sources":["../src/errors.ts"],"sourcesContent":["import {\n type Hex,\n type Log,\n type WaitForTransactionReceiptReturnType,\n zeroHash,\n} from 'viem';\nimport type { Criteria } from './Actions/EventAction';\nimport type { BoostRegistry } from './BoostRegistry';\nimport type { Incentive } from './Incentives/Incentive';\n\n/**\n * This error is thrown during Boost creation if no `BoostCreated` event was emitted.\n *\n * @export\n * @class BoostCoreNoIdentifierEmitted\n * @typedef {BoostCoreNoIdentifierEmitted}\n * @extends {Error}\n * @example\n * ```ts\n * try {\n * await boostCore.createBoost(...)\n * } catch(e) {\n * if(e instanceof BoostCoreNoIdentifierEmitted) {}\n * }\n * ```\n */\nexport class BoostCoreNoIdentifierEmitted extends Error {\n /**\n * Creates an instance of BoostCoreNoIdentifierEmitted.\n *\n * @constructor\n */\n constructor() {\n super(`No \"BoostCreated\" log was emitted from which to extract boostId`);\n }\n}\n\n/**\n * This error is thrown when `assertValidAddress` is called, usually because a contract call expects the class to have a valid address attached.\n *\n * @export\n * @class ContractAddressRequiredError\n * @typedef {ContractAddressRequiredError}\n * @extends {Error}\n * @example\n * ```ts\n * try {\n * target.assertValidAddress()\n * } catch(e) {\n * if(e instanceof ContractAddressRequiredError) {}\n * }\n */\nexport class ContractAddressRequiredError extends Error {\n /**\n * Creates an instance of ContractAddressRequiredError.\n *\n * @constructor\n */\n constructor() {\n super('Attempted to call contract method without providing an address');\n }\n}\n\n/**\n * This error is thrown when attempting to deploy a contract that has already been deployed, or has an address attached.\n *\n * @export\n * @class DeployableAlreadyDeployedError\n * @typedef {DeployableAlreadyDeployedError}\n * @extends {Error}\n */\nexport class DeployableAlreadyDeployedError extends Error {\n /**\n * The address already attached to the target.\n *\n * @type {string}\n */\n address: string;\n /**\n * Creates an instance of DeployableAlreadyDeployedError.\n *\n * @constructor\n * @param {string} address\n */\n constructor(address: string) {\n super(\n `Attempted to deploy a contract that already has an address configured`,\n );\n this.address = address;\n }\n}\n\n/**\n * You should never see this error if we did our jobs and every target overrides the `buildParameters` method.\n *\n * @export\n * @class DeployableBuildParametersUnspecifiedError\n * @typedef {DeployableBuildParametersUnspecifiedError}\n * @extends {Error}\n */\nexport class DeployableBuildParametersUnspecifiedError extends Error {\n /**\n * Creates an instance of DeployableBuildParametersUnspecifiedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Implementing class did not properly override the `buildParameters` method',\n );\n }\n}\n\n/**\n * This error is thrown when attempting to deploy an `ownable` contract and the owner cannot be ascertained from the initialization payload or configured account.\n *\n * @export\n * @class DeployableUnknownOwnerProvidedError\n * @typedef {DeployableUnknownOwnerProvidedError}\n * @extends {Error}\n */\nexport class DeployableUnknownOwnerProvidedError extends Error {\n /**\n * Creates an instance of DeployableUnknownOwnerProvidedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected an an owner to be provided in configuration or an account to exist on Wagmi config.',\n );\n }\n}\n\n/**\n * This error is thrown when deploying a contract with no valid Wagmi configuration on the instance.\n *\n * @export\n * @class DeployableWagmiConfigurationRequiredError\n * @typedef {DeployableWagmiConfigurationRequiredError}\n * @extends {Error}\n */\nexport class DeployableWagmiConfigurationRequiredError extends Error {\n /**\n * Creates an instance of DeployableWagmiConfigurationRequiredError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected a valid Wagmi configuration to be available either on Deployable, or as argument to deploy.',\n );\n }\n}\n\n/**\n * This error is thrown when deploying a contract with no valid initialization payload.\n *\n * @export\n * @class DeployableMissingPayloadError\n * @typedef {DeployableMissingPayloadError}\n * @extends {Error}\n */\nexport class DeployableMissingPayloadError extends Error {\n /**\n * Creates an instance of DeployableMissingPayloadError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected a valid payload to be available either on Deployable or as argument to deploy.',\n );\n }\n}\n\n/**\n * This error is thrown when we receive a transaction receipt for a contract deployment without a contract address on it.\n *\n * @export\n * @class NoContractAddressUponReceiptError\n * @typedef {NoContractAddressUponReceiptError}\n * @extends {Error}\n */\nexport class NoContractAddressUponReceiptError extends Error {\n /**\n * The raw receipt we receive from [waitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n *\n * @public\n * @readonly\n * @type {WaitForTransactionReceiptReturnType}\n */\n public readonly receipt: WaitForTransactionReceiptReturnType;\n /**\n * Creates an instance of NoContractAddressUponReceiptError.\n *\n * @constructor\n * @param {WaitForTransactionReceiptReturnType} receipt\n */\n constructor(receipt: WaitForTransactionReceiptReturnType) {\n super(`Expected a contract address to exist on receipt.`, {\n cause: receipt,\n });\n this.receipt = receipt;\n }\n}\n\n/**\n * This error is thrown when a target address was provided that doesn't match any supported interface for the given registry type.\n * For example, if you try to do `incentiveFromAddress()` with the address of a deployed `SimpleBudget`\n *\n * @export\n * @class InvalidComponentInterfaceError\n * @typedef {InvalidComponentInterfaceError}\n * @extends {Error}\n */\nexport class InvalidComponentInterfaceError extends Error {\n /**\n * Expected interface hashes.\n *\n * @public\n * @readonly\n * @type {Hex[]}\n */\n public readonly expected: Hex[] = [];\n /**\n * The actual interface hash.\n *\n * @public\n * @readonly\n * @type {Hex}\n */\n public readonly received: Hex = zeroHash;\n\n /**\n * Creates an instance of InvalidComponentInterfaceError.\n *\n * @constructor\n * @param {Hex[]} expected\n * @param {Hex} received\n */\n constructor(expected: Hex[], received: Hex) {\n super(`Address provided does not match any expected protocol interface`, {\n cause: { expected, received },\n });\n this.expected = expected;\n this.received = received;\n }\n}\n\n/**\n * This error is thrown when attempting a Budget transfer and arguments aren't of the type `FungibleTransferPayload` or `ERC1155TransferPayload`\n *\n * @see {@link FungibleTransferPayload}\n * @see {@link ERC1155TransferPayload}\n * @export\n * @class UnknownTransferPayloadSupplied\n * @typedef {UnknownTransferPayloadSupplied}\n * @extends {Error}\n */\nexport class UnknownTransferPayloadSupplied extends Error {\n /**\n * The given payload that does not conform to the correct payload shape.\n *\n * @type {unknown}\n */\n received: unknown;\n /**\n * Creates an instance of UnknownTransferPayloadSupplied.\n *\n * @constructor\n * @param {unknown} received\n */\n constructor(received: unknown) {\n super(\n `Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.`,\n { cause: received },\n );\n this.received = received;\n }\n}\n\n/**\n * This error is thrown during Boost creation when the budget doesn't authorize the Boost Core address.\n *\n * @export\n * @class BudgetMustAuthorizeBoostCore\n * @typedef {BudgetMustAuthorizeBoostCore}\n * @extends {Error}\n */\nexport class BudgetMustAuthorizeBoostCore extends Error {\n /**\n * Creates an instance of BudgetMustAuthorizeBoostCore.\n *\n * @constructor\n * @param {string} boostCoreAddress\n */\n constructor(boostCoreAddress: string) {\n super(\n `Budget needs to explicitly authorize ${boostCoreAddress}. You can retrieve this value from BoostCore.address`,\n );\n }\n}\n\n/**\n * Because this contract is a base implementation, it should not be initialized through the constructor. Instead, it should be cloned and initialized using the {@link BoostRegistry}\n *\n * @export\n * @class MustInitializeBudgetError\n * @typedef {MustInitializeBudgetError}\n * @extends {Error}\n */\nexport class MustInitializeBudgetError extends Error {\n /**\n * Creates an instance of MustInitializeBudgetError.\n */\n constructor() {\n super(`Budgets must be preinitialized before being used with a new Boost`);\n }\n}\n\n/**\n * The error is thrown when trying to reuse an existing deployed Incentive that isn't a base implementation.\n * The protocol doesn't allow this.\n *\n * @export\n * @class IncentiveNotCloneableError\n * @typedef {IncentiveNotCloneableError}\n * @extends {Error}\n */\nexport class IncentiveNotCloneableError extends Error {\n /**\n * Creates an instance of IncentiveNotCloneableError.\n *\n * @constructor\n * @param {Incentive} incentive\n */\n constructor(incentive: Incentive) {\n super(`Incentive not cloneable: ${incentive.constructor.name}`);\n }\n}\n\n/**\n * Thrown when encoding an EventAction payload and no action steps are provided\n *\n * @export\n * @class NoEventActionStepsProvidedError\n * @typedef {NoEventActionStepsProvidedError}\n * @extends {Error}\n */\nexport class NoEventActionStepsProvidedError extends Error {\n /**\n * Creates an instance of NoEventActionStepsProvidedError.\n *\n * @constructor\n */\n constructor() {\n super('Must supply at least one action step');\n }\n}\n\n/**\n * Thrown when encoding an EventAction payload and > 4 steps are provided\n *\n * @export\n * @class TooManyEventActionStepsProvidedError\n * @typedef {TooManyEventActionStepsProvidedError}\n * @extends {Error}\n */\nexport class TooManyEventActionStepsProvidedError extends Error {\n /**\n * Creates an instance of TooManyEventActionStepsProvidedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Cannot supply more than 4 action steps with current protocol version',\n );\n }\n}\n\n/**\n * Event action validation context to help debug other validation errors\n *\n * @interface EventActionValidationMeta\n * @typedef {EventActionValidationMeta}\n */\ninterface EventActionValidationMeta {\n /**\n * The viem log being validated against\n *\n * @type {Log}\n */\n log: Log;\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n}\n\n/**\n * The base error thrown during event action validation extended by more specific validation errors.\n * Instantiated with relevent context data for more in depth debugging.\n *\n * @export\n * @class EventActionValidationError\n * @typedef {EventActionValidationError}\n * @extends {Error}\n */\nexport class EventActionValidationError extends Error {\n /**\n * The viem log being validated against\n *\n * @type {Log}\n */\n log: Log;\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n /**\n * Creates an instance of EventActionValidationError.\n *\n * @constructor\n * @param {string} message\n * @param {EventActionValidationMeta} param0\n * @param {*} param0.fieldValue\n * @param {Criteria} param0.criteria\n * @param {Log} param0.log\n */\n constructor(\n message: string,\n { fieldValue, criteria, log }: EventActionValidationMeta,\n ) {\n super(message);\n this.fieldValue = fieldValue;\n this.criteria = criteria;\n this.log = log;\n }\n}\n\n/**\n * Thrown when field value on log is undefined\n *\n * @export\n * @class FieldValueUndefinedError\n * @typedef {FieldValueUndefinedError}\n * @extends {EventActionValidationError}\n */\nexport class FieldValueUndefinedError extends EventActionValidationError {\n /**\n * Creates an instance of FieldValueUndefinedError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Field value is undefined', metadata);\n }\n}\n\n/**\n * Thrown when a filter type is using a numerical operator but field type is not numerical\n *\n * @export\n * @class InvalidNumericalCriteriaError\n * @typedef {InvalidNumericalCriteriaError}\n * @extends {EventActionValidationError}\n */\nexport class InvalidNumericalCriteriaError extends EventActionValidationError {\n /**\n * Creates an instance of InvalidNumericalCriteria.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super(\n 'Numerical comparisons cannot be used with non-numerical criteria',\n metadata,\n );\n }\n}\n\n/**\n * Thrown when an the log's field value is being compared a field type that isn't bytes or string during event action validation\n *\n * @export\n * @class FieldValueNotComparableError\n * @typedef {FieldValueNotComparableError}\n * @extends {EventActionValidationError}\n */\nexport class FieldValueNotComparableError extends EventActionValidationError {\n /**\n * Creates an instance of FieldValueNotComparableError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Filter can only be used with bytes or string field type', metadata);\n }\n}\n\n/**\n * Thrown when an invalid filter type enum was provided event action validation.\n *\n * @export\n * @class UnrecognizedFilterTypeError\n * @typedef {UnrecognizedFilterTypeError}\n * @extends {EventActionValidationError}\n */\nexport class UnrecognizedFilterTypeError extends EventActionValidationError {\n /**\n * Creates an instance of UnrecognizedFilterTypeError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(metadata: EventActionValidationMeta) {\n super('Invalid FilterType provided', metadata);\n }\n}\n"],"names":["BoostCoreNoIdentifierEmitted","ContractAddressRequiredError","DeployableAlreadyDeployedError","address","DeployableBuildParametersUnspecifiedError","DeployableUnknownOwnerProvidedError","DeployableWagmiConfigurationRequiredError","DeployableMissingPayloadError","NoContractAddressUponReceiptError","receipt","InvalidComponentInterfaceError","expected","received","zeroHash","UnknownTransferPayloadSupplied","BudgetMustAuthorizeBoostCore","boostCoreAddress","MustInitializeBudgetError","IncentiveNotCloneableError","incentive","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","EventActionValidationError","message","fieldValue","criteria","log","FieldValueUndefinedError","metadata","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError"],"mappings":"wGA0BO,MAAMA,UAAqC,KAAM,CAMtD,aAAc,CACZ,MAAM,iEAAiE,CACzE,CACF,CAiBO,MAAMC,UAAqC,KAAM,CAMtD,aAAc,CACZ,MAAM,gEAAgE,CACxE,CACF,CAUO,MAAMC,UAAuC,KAAM,CAaxD,YAAYC,EAAiB,CAC3B,MACE,uEAAA,EAEF,KAAK,QAAUA,CACjB,CACF,CAUO,MAAMC,UAAkD,KAAM,CAMnE,aAAc,CACZ,MACE,2EAAA,CAEJ,CACF,CAUO,MAAMC,UAA4C,KAAM,CAM7D,aAAc,CACZ,MACE,8FAAA,CAEJ,CACF,CAUO,MAAMC,UAAkD,KAAM,CAMnE,aAAc,CACZ,MACE,sGAAA,CAEJ,CACF,CAUO,MAAMC,UAAsC,KAAM,CAMvD,aAAc,CACZ,MACE,yFAAA,CAEJ,CACF,CAUO,MAAMC,UAA0C,KAAM,CAe3D,YAAYC,EAA8C,CACxD,MAAM,mDAAoD,CACxD,MAAOA,CAAA,CACR,EACD,KAAK,QAAUA,CACjB,CACF,CAWO,MAAMC,UAAuC,KAAM,CAyBxD,YAAYC,EAAiBC,EAAe,CAC1C,MAAM,kEAAmE,CACvE,MAAO,CAAE,SAAAD,EAAU,SAAAC,CAAS,CAAA,CAC7B,EApBH,KAAgB,SAAkB,GAQlC,KAAgB,SAAgBC,WAa9B,KAAK,SAAWF,EAChB,KAAK,SAAWC,CAClB,CACF,CAYO,MAAME,UAAuC,KAAM,CAaxD,YAAYF,EAAmB,CAC7B,MACE,+EACA,CAAE,MAAOA,CAAS,CAAA,EAEpB,KAAK,SAAWA,CAClB,CACF,CAUO,MAAMG,UAAqC,KAAM,CAOtD,YAAYC,EAA0B,CACpC,MACE,wCAAwCA,CAAgB,sDAAA,CAE5D,CACF,CAUO,MAAMC,UAAkC,KAAM,CAInD,aAAc,CACZ,MAAM,mEAAmE,CAC3E,CACF,CAWO,MAAMC,UAAmC,KAAM,CAOpD,YAAYC,EAAsB,CAChC,MAAM,4BAA4BA,EAAU,YAAY,IAAI,EAAE,CAChE,CACF,CAUO,MAAMC,UAAwC,KAAM,CAMzD,aAAc,CACZ,MAAM,sCAAsC,CAC9C,CACF,CAUO,MAAMC,UAA6C,KAAM,CAM9D,aAAc,CACZ,MACE,sEAAA,CAEJ,CACF,CAuCO,MAAMC,UAAmC,KAAM,CA8BpD,YACEC,EACA,CAAE,WAAAC,EAAY,SAAAC,EAAU,IAAAC,GACxB,CACA,MAAMH,CAAO,EACb,KAAK,WAAaC,EAClB,KAAK,SAAWC,EAChB,KAAK,IAAMC,CACb,CACF,CAUO,MAAMC,UAAiCL,CAA2B,CAOvE,YAAYM,EAAqC,CAC/C,MAAM,2BAA4BA,CAAQ,CAC5C,CACF,CAUO,MAAMC,UAAsCP,CAA2B,CAO5E,YAAYM,EAAqC,CAC/C,MACE,mEACAA,CAAA,CAEJ,CACF,CAUO,MAAME,UAAqCR,CAA2B,CAO3E,YAAYM,EAAqC,CAC/C,MAAM,0DAA2DA,CAAQ,CAC3E,CACF,CAUO,MAAMG,UAAoCT,CAA2B,CAO1E,YAAYM,EAAqC,CAC/C,MAAM,8BAA+BA,CAAQ,CAC/C,CACF"}
|
|
1
|
+
{"version":3,"file":"errors.cjs","sources":["../src/errors.ts"],"sourcesContent":["import {\n type AbiEvent,\n type AbiFunction,\n type Hex,\n type Log,\n type WaitForTransactionReceiptReturnType,\n zeroHash,\n} from 'viem';\nimport type { Criteria } from './Actions/EventAction';\nimport type { EventLogs } from './Actions/EventAction';\nimport type { BoostRegistry } from './BoostRegistry';\nimport type { Incentive } from './Incentives/Incentive';\n\n/**\n * This error is thrown during Boost creation if no `BoostCreated` event was emitted.\n *\n * @export\n * @class BoostCoreNoIdentifierEmitted\n * @typedef {BoostCoreNoIdentifierEmitted}\n * @extends {Error}\n * @example\n * ```ts\n * try {\n * await boostCore.createBoost(...)\n * } catch(e) {\n * if(e instanceof BoostCoreNoIdentifierEmitted) {}\n * }\n * ```\n */\nexport class BoostCoreNoIdentifierEmitted extends Error {\n /**\n * Creates an instance of BoostCoreNoIdentifierEmitted.\n *\n * @constructor\n */\n constructor() {\n super(`No \"BoostCreated\" log was emitted from which to extract boostId`);\n }\n}\n\n/**\n * This error is thrown when `assertValidAddress` is called, usually because a contract call expects the class to have a valid address attached.\n *\n * @export\n * @class ContractAddressRequiredError\n * @typedef {ContractAddressRequiredError}\n * @extends {Error}\n * @example\n * ```ts\n * try {\n * target.assertValidAddress()\n * } catch(e) {\n * if(e instanceof ContractAddressRequiredError) {}\n * }\n */\nexport class ContractAddressRequiredError extends Error {\n /**\n * Creates an instance of ContractAddressRequiredError.\n *\n * @constructor\n */\n constructor() {\n super('Attempted to call contract method without providing an address');\n }\n}\n\n/**\n * This error is thrown when attempting to deploy a contract that has already been deployed, or has an address attached.\n *\n * @export\n * @class DeployableAlreadyDeployedError\n * @typedef {DeployableAlreadyDeployedError}\n * @extends {Error}\n */\nexport class DeployableAlreadyDeployedError extends Error {\n /**\n * The address already attached to the target.\n *\n * @type {string}\n */\n address: string;\n /**\n * Creates an instance of DeployableAlreadyDeployedError.\n *\n * @constructor\n * @param {string} address\n */\n constructor(address: string) {\n super(\n `Attempted to deploy a contract that already has an address configured`,\n );\n this.address = address;\n }\n}\n\n/**\n * You should never see this error if we did our jobs and every target overrides the `buildParameters` method.\n *\n * @export\n * @class DeployableBuildParametersUnspecifiedError\n * @typedef {DeployableBuildParametersUnspecifiedError}\n * @extends {Error}\n */\nexport class DeployableBuildParametersUnspecifiedError extends Error {\n /**\n * Creates an instance of DeployableBuildParametersUnspecifiedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Implementing class did not properly override the `buildParameters` method',\n );\n }\n}\n\n/**\n * This error is thrown when attempting to deploy an `ownable` contract and the owner cannot be ascertained from the initialization payload or configured account.\n *\n * @export\n * @class DeployableUnknownOwnerProvidedError\n * @typedef {DeployableUnknownOwnerProvidedError}\n * @extends {Error}\n */\nexport class DeployableUnknownOwnerProvidedError extends Error {\n /**\n * Creates an instance of DeployableUnknownOwnerProvidedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected an an owner to be provided in configuration or an account to exist on Wagmi config.',\n );\n }\n}\n\n/**\n * This error is thrown when deploying a contract with no valid Wagmi configuration on the instance.\n *\n * @export\n * @class DeployableWagmiConfigurationRequiredError\n * @typedef {DeployableWagmiConfigurationRequiredError}\n * @extends {Error}\n */\nexport class DeployableWagmiConfigurationRequiredError extends Error {\n /**\n * Creates an instance of DeployableWagmiConfigurationRequiredError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected a valid Wagmi configuration to be available either on Deployable, or as argument to deploy.',\n );\n }\n}\n\n/**\n * This error is thrown when deploying a contract with no valid initialization payload.\n *\n * @export\n * @class DeployableMissingPayloadError\n * @typedef {DeployableMissingPayloadError}\n * @extends {Error}\n */\nexport class DeployableMissingPayloadError extends Error {\n /**\n * Creates an instance of DeployableMissingPayloadError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Expected a valid payload to be available either on Deployable or as argument to deploy.',\n );\n }\n}\n\n/**\n * This error is thrown when we receive a transaction receipt for a contract deployment without a contract address on it.\n *\n * @export\n * @class NoContractAddressUponReceiptError\n * @typedef {NoContractAddressUponReceiptError}\n * @extends {Error}\n */\nexport class NoContractAddressUponReceiptError extends Error {\n /**\n * The raw receipt we receive from [waitForTransactionReceipt](https://v1.viem.sh/docs/actions/public/waitForTransactionReceipt.html#waitfortransactionreceipt)\n *\n * @public\n * @readonly\n * @type {WaitForTransactionReceiptReturnType}\n */\n public readonly receipt: WaitForTransactionReceiptReturnType;\n /**\n * Creates an instance of NoContractAddressUponReceiptError.\n *\n * @constructor\n * @param {WaitForTransactionReceiptReturnType} receipt\n */\n constructor(receipt: WaitForTransactionReceiptReturnType) {\n super(`Expected a contract address to exist on receipt.`, {\n cause: receipt,\n });\n this.receipt = receipt;\n }\n}\n\n/**\n * This error is thrown when a target address was provided that doesn't match any supported interface for the given registry type.\n * For example, if you try to do `incentiveFromAddress()` with the address of a deployed `SimpleBudget`\n *\n * @export\n * @class InvalidComponentInterfaceError\n * @typedef {InvalidComponentInterfaceError}\n * @extends {Error}\n */\nexport class InvalidComponentInterfaceError extends Error {\n /**\n * Expected interface hashes.\n *\n * @public\n * @readonly\n * @type {Hex[]}\n */\n public readonly expected: Hex[] = [];\n /**\n * The actual interface hash.\n *\n * @public\n * @readonly\n * @type {Hex}\n */\n public readonly received: Hex = zeroHash;\n\n /**\n * Creates an instance of InvalidComponentInterfaceError.\n *\n * @constructor\n * @param {Hex[]} expected\n * @param {Hex} received\n */\n constructor(expected: Hex[], received: Hex) {\n super(`Address provided does not match any expected protocol interface`, {\n cause: { expected, received },\n });\n this.expected = expected;\n this.received = received;\n }\n}\n\n/**\n * This error is thrown when a param is not transparently stored onchain\n *\n * @export\n * @class UnparseableAbiParamError\n * @typedef {UnparseableAbiParamError}\n * @extends {Error}\n */\nexport class UnparseableAbiParamError extends Error {\n /**\n * the param index that is unparseable\n *\n * @type {number}\n */\n input_param_idx: number;\n /**\n * The given event that contains the unparseable param\n *\n * @type {AbiEvent}\n */\n event: AbiEvent;\n /**\n * Creates an instance of UnknownTransferPayloadSupplied.\n *\n * @constructor\n * @param {number} input_param_idx\n * @param {AbiEvent} event\n */\n constructor(input_param_idx: number, event: AbiEvent) {\n super(\n `Parameter is not transparently stored onchain. Parameter ${input_param_idx} in event ${event.name} cannot be used in an action`,\n { cause: event },\n );\n this.event = event;\n this.input_param_idx = input_param_idx;\n }\n}\n\n/**\n * This error is thrown when attempting a Budget transfer and arguments aren't of the type `FungibleTransferPayload` or `ERC1155TransferPayload`\n *\n * @see {@link FungibleTransferPayload}\n * @see {@link ERC1155TransferPayload}\n * @export\n * @class UnknownTransferPayloadSupplied\n * @typedef {UnknownTransferPayloadSupplied}\n * @extends {Error}\n */\nexport class UnknownTransferPayloadSupplied extends Error {\n /**\n * The given payload that does not conform to the correct payload shape.\n *\n * @type {unknown}\n */\n received: unknown;\n /**\n * Creates an instance of UnknownTransferPayloadSupplied.\n *\n * @constructor\n * @param {unknown} received\n */\n constructor(received: unknown) {\n super(\n `Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.`,\n { cause: received },\n );\n this.received = received;\n }\n}\n\n/**\n * This error is thrown during Boost creation when the budget doesn't authorize the Boost Core address.\n *\n * @export\n * @class BudgetMustAuthorizeBoostCore\n * @typedef {BudgetMustAuthorizeBoostCore}\n * @extends {Error}\n */\nexport class BudgetMustAuthorizeBoostCore extends Error {\n /**\n * Creates an instance of BudgetMustAuthorizeBoostCore.\n *\n * @constructor\n * @param {string} boostCoreAddress\n */\n constructor(boostCoreAddress: string) {\n super(\n `Budget needs to explicitly authorize ${boostCoreAddress}. You can retrieve this value from BoostCore.address`,\n );\n }\n}\n\n/**\n * Because this contract is a base implementation, it should not be initialized through the constructor. Instead, it should be cloned and initialized using the {@link BoostRegistry}\n *\n * @export\n * @class MustInitializeBudgetError\n * @typedef {MustInitializeBudgetError}\n * @extends {Error}\n */\nexport class MustInitializeBudgetError extends Error {\n /**\n * Creates an instance of MustInitializeBudgetError.\n */\n constructor() {\n super(`Budgets must be preinitialized before being used with a new Boost`);\n }\n}\n\n/**\n * The error is thrown when trying to reuse an existing deployed Incentive that isn't a base implementation.\n * The protocol doesn't allow this.\n *\n * @export\n * @class IncentiveNotCloneableError\n * @typedef {IncentiveNotCloneableError}\n * @extends {Error}\n */\nexport class IncentiveNotCloneableError extends Error {\n /**\n * Creates an instance of IncentiveNotCloneableError.\n *\n * @constructor\n * @param {Incentive} incentive\n */\n constructor(incentive: Incentive) {\n super(`Incentive not cloneable: ${incentive.constructor.name}`);\n }\n}\n\n/**\n * Thrown when encoding an EventAction payload and no action steps are provided\n *\n * @export\n * @class NoEventActionStepsProvidedError\n * @typedef {NoEventActionStepsProvidedError}\n * @extends {Error}\n */\nexport class NoEventActionStepsProvidedError extends Error {\n /**\n * Creates an instance of NoEventActionStepsProvidedError.\n *\n * @constructor\n */\n constructor() {\n super('Must supply at least one action step');\n }\n}\n\n/**\n * Thrown when encoding an EventAction payload and > 4 steps are provided\n *\n * @export\n * @class TooManyEventActionStepsProvidedError\n * @typedef {TooManyEventActionStepsProvidedError}\n * @extends {Error}\n */\nexport class TooManyEventActionStepsProvidedError extends Error {\n /**\n * Creates an instance of TooManyEventActionStepsProvidedError.\n *\n * @constructor\n */\n constructor() {\n super(\n 'Cannot supply more than 4 action steps with current protocol version',\n );\n }\n}\n\n/**\n * Function action validation context to help debug other validation errors\n *\n * @interface FunctionActionValidationMeta\n * @typedef {FunctionActionValidationMeta}\n */\ninterface FunctionActionValidationMeta {\n decodedArgs: readonly (string | bigint)[];\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n}\n/**\n * Event action validation context to help debug other validation errors\n *\n * @interface EventActionValidationMeta\n * @typedef {EventActionValidationMeta}\n */\ninterface EventActionValidationMeta {\n /**\n * The viem log being validated against\n *\n * @type {Log}\n */\n log?: EventLogs[0];\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n}\n\n/**\n * The base error thrown during event action validation extended by more specific validation errors.\n * Instantiated with relevent context data for more in depth debugging.\n *\n * @export\n * @class FieldActionValidationError\n * @typedef {FieldActionValidationError}\n * @extends {Error}\n */\nexport class FieldActionValidationError extends Error {\n /**\n * The function input arguments being validated against\n *\n * @type {decodedArgs}\n */\n decodedArgs?: readonly (string | bigint)[];\n /**\n * The viem log being validated against\n *\n * @type {Log}\n */\n log?: EventLogs[0];\n /**\n * The value pulled off the log being validated against\n *\n * @type {*}\n * biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits\n */\n fieldValue: any;\n /**\n * The criteria being used to compare during validation\n *\n * @type {Criteria}\n */\n criteria: Criteria;\n /**\n * Creates an instance of FieldActionValidationError.\n *\n * @constructor\n * @param {string} message\n * @param {EventActionValidationMeta} param0\n * @param {*} param0.fieldValue\n * @param {Criteria} param0.criteria\n * @param {Log} param0.log\n */\n constructor(\n message: string,\n {\n fieldValue,\n criteria,\n ...args\n }: EventActionValidationMeta | FunctionActionValidationMeta,\n ) {\n super(message);\n this.fieldValue = fieldValue;\n this.criteria = criteria;\n\n switch (true) {\n case 'log' in args:\n this.log = args.log;\n break;\n case 'decodedArgs' in args:\n this.decodedArgs = args.decodedArgs;\n }\n }\n}\n\n/**\n * Thrown when abi-decoded args on log is undefined\n *\n * @export\n * @class FieldValueUndefinedError\n * @typedef {FieldValueUndefinedError}\n * @extends {FieldActionValidationError}\n */\nexport class DecodedArgsMalformedError extends FieldActionValidationError {\n /**\n * Creates an instance of DecodedArgsUndefinedError.\n *\n * @constructor\n * @param {DecodedArgsMalformedError} metadata\n */\n constructor(\n metadata: EventActionValidationMeta | FunctionActionValidationMeta,\n ) {\n super(\n 'Decoded Args are malformed; Check which params are indexed',\n metadata,\n );\n }\n}\n\n/**\n * Thrown when field value on log is undefined\n *\n * @export\n * @class FieldValueUndefinedError\n * @typedef {FieldValueUndefinedError}\n * @extends {FieldActionValidationError}\n */\nexport class FieldValueUndefinedError extends FieldActionValidationError {\n /**\n * Creates an instance of FieldValueUndefinedError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(\n metadata: EventActionValidationMeta | FunctionActionValidationMeta,\n ) {\n super('Field value is undefined', metadata);\n }\n}\n\n/**\n * Thrown when a filter type is using a numerical operator but field type is not numerical\n *\n * @export\n * @class InvalidNumericalCriteriaError\n * @typedef {InvalidNumericalCriteriaError}\n * @extends {FieldActionValidationError}\n */\nexport class InvalidNumericalCriteriaError extends FieldActionValidationError {\n /**\n * Creates an instance of InvalidNumericalCriteria.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(\n metadata: EventActionValidationMeta | FunctionActionValidationMeta,\n ) {\n super(\n 'Numerical comparisons cannot be used with non-numerical criteria',\n metadata,\n );\n }\n}\n\n/**\n * Thrown when decoding function data fails.\n *\n * @export\n * @class FunctionDataDecodeError\n * @typedef {FunctionDataDecodeError}\n * @extends {Error}\n */\nexport class FunctionDataDecodeError extends Error {\n public abi: AbiFunction[];\n public originalError: Error;\n\n /**\n * Creates an instance of FunctionDataDecodeError.\n *\n * @constructor\n * @param {AbiFunction[]} abi - The ABI of the function.\n * @param {Error} originalError - The original error that was thrown.\n */\n constructor(abi: AbiFunction[], originalError: Error) {\n super(`Failed to decode function data: ${originalError.message}`);\n this.name = 'FunctionDataDecodeError';\n this.abi = abi;\n this.originalError = originalError;\n }\n}\n\n/**\n * Thrown when an the log's field value is being compared a field type that isn't bytes or string during event action validation\n *\n * @export\n * @class FieldValueNotComparableError\n * @typedef {FieldValueNotComparableError}\n * @extends {FieldActionValidationError}\n */\nexport class FieldValueNotComparableError extends FieldActionValidationError {\n /**\n * Creates an instance of FieldValueNotComparableError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(\n metadata: EventActionValidationMeta | FunctionActionValidationMeta,\n ) {\n super('Filter can only be used with bytes or string field type', metadata);\n }\n}\n\n/**\n * Thrown when an invalid filter type enum was provided event action validation.\n *\n * @export\n * @class UnrecognizedFilterTypeError\n * @typedef {UnrecognizedFilterTypeError}\n * @extends {FieldActionValidationError}\n */\nexport class UnrecognizedFilterTypeError extends FieldActionValidationError {\n /**\n * Creates an instance of UnrecognizedFilterTypeError.\n *\n * @constructor\n * @param {EventActionValidationMeta} metadata\n */\n constructor(\n metadata: EventActionValidationMeta | FunctionActionValidationMeta,\n ) {\n super('Invalid FilterType provided', metadata);\n }\n}\n"],"names":["BoostCoreNoIdentifierEmitted","ContractAddressRequiredError","DeployableAlreadyDeployedError","address","DeployableBuildParametersUnspecifiedError","DeployableUnknownOwnerProvidedError","DeployableWagmiConfigurationRequiredError","DeployableMissingPayloadError","NoContractAddressUponReceiptError","receipt","InvalidComponentInterfaceError","expected","received","zeroHash","UnparseableAbiParamError","input_param_idx","event","UnknownTransferPayloadSupplied","BudgetMustAuthorizeBoostCore","boostCoreAddress","MustInitializeBudgetError","IncentiveNotCloneableError","incentive","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","FieldActionValidationError","message","fieldValue","criteria","args","DecodedArgsMalformedError","metadata","FieldValueUndefinedError","InvalidNumericalCriteriaError","FunctionDataDecodeError","abi","originalError","FieldValueNotComparableError","UnrecognizedFilterTypeError"],"mappings":"wGA6BO,MAAMA,UAAqC,KAAM,CAMtD,aAAc,CACZ,MAAM,iEAAiE,CACzE,CACF,CAiBO,MAAMC,UAAqC,KAAM,CAMtD,aAAc,CACZ,MAAM,gEAAgE,CACxE,CACF,CAUO,MAAMC,UAAuC,KAAM,CAaxD,YAAYC,EAAiB,CAC3B,MACE,uEAAA,EAEF,KAAK,QAAUA,CACjB,CACF,CAUO,MAAMC,UAAkD,KAAM,CAMnE,aAAc,CACZ,MACE,2EAAA,CAEJ,CACF,CAUO,MAAMC,UAA4C,KAAM,CAM7D,aAAc,CACZ,MACE,8FAAA,CAEJ,CACF,CAUO,MAAMC,UAAkD,KAAM,CAMnE,aAAc,CACZ,MACE,sGAAA,CAEJ,CACF,CAUO,MAAMC,UAAsC,KAAM,CAMvD,aAAc,CACZ,MACE,yFAAA,CAEJ,CACF,CAUO,MAAMC,UAA0C,KAAM,CAe3D,YAAYC,EA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A,EAAK,IAChB,MACF,IAAK,gBAAiBA,EACpB,KAAK,YAAcA,EAAK,WAC5B,CACF,CACF,CAUO,MAAMC,UAAkCL,CAA2B,CAOxE,YACEM,EACA,CACA,MACE,6DACAA,CAAA,CAEJ,CACF,CAUO,MAAMC,UAAiCP,CAA2B,CAOvE,YACEM,EACA,CACA,MAAM,2BAA4BA,CAAQ,CAC5C,CACF,CAUO,MAAME,UAAsCR,CAA2B,CAO5E,YACEM,EACA,CACA,MACE,mEACAA,CAAA,CAEJ,CACF,CAUO,MAAMG,UAAgC,KAAM,CAWjD,YAAYC,EAAoBC,EAAsB,CAC9C,MAAA,mCAAmCA,EAAc,OAAO,EAAE,EAChE,KAAK,KAAO,0BACZ,KAAK,IAAMD,EACX,KAAK,cAAgBC,CACvB,CACF,CAUO,MAAMC,UAAqCZ,CAA2B,CAO3E,YACEM,EACA,CACA,MAAM,0DAA2DA,CAAQ,CAC3E,CACF,CAUO,MAAMO,UAAoCb,CAA2B,CAO1E,YACEM,EACA,CACA,MAAM,8BAA+BA,CAAQ,CAC/C,CACF"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AbiEvent, type AbiFunction, type Hex, type WaitForTransactionReceiptReturnType } from 'viem';
|
|
2
2
|
import type { Criteria } from './Actions/EventAction';
|
|
3
|
+
import type { EventLogs } from './Actions/EventAction';
|
|
3
4
|
import type { Incentive } from './Incentives/Incentive';
|
|
4
5
|
/**
|
|
5
6
|
* This error is thrown during Boost creation if no `BoostCreated` event was emitted.
|
|
@@ -195,6 +196,36 @@ export declare class InvalidComponentInterfaceError extends Error {
|
|
|
195
196
|
*/
|
|
196
197
|
constructor(expected: Hex[], received: Hex);
|
|
197
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* This error is thrown when a param is not transparently stored onchain
|
|
201
|
+
*
|
|
202
|
+
* @export
|
|
203
|
+
* @class UnparseableAbiParamError
|
|
204
|
+
* @typedef {UnparseableAbiParamError}
|
|
205
|
+
* @extends {Error}
|
|
206
|
+
*/
|
|
207
|
+
export declare class UnparseableAbiParamError extends Error {
|
|
208
|
+
/**
|
|
209
|
+
* the param index that is unparseable
|
|
210
|
+
*
|
|
211
|
+
* @type {number}
|
|
212
|
+
*/
|
|
213
|
+
input_param_idx: number;
|
|
214
|
+
/**
|
|
215
|
+
* The given event that contains the unparseable param
|
|
216
|
+
*
|
|
217
|
+
* @type {AbiEvent}
|
|
218
|
+
*/
|
|
219
|
+
event: AbiEvent;
|
|
220
|
+
/**
|
|
221
|
+
* Creates an instance of UnknownTransferPayloadSupplied.
|
|
222
|
+
*
|
|
223
|
+
* @constructor
|
|
224
|
+
* @param {number} input_param_idx
|
|
225
|
+
* @param {AbiEvent} event
|
|
226
|
+
*/
|
|
227
|
+
constructor(input_param_idx: number, event: AbiEvent);
|
|
228
|
+
}
|
|
198
229
|
/**
|
|
199
230
|
* This error is thrown when attempting a Budget transfer and arguments aren't of the type `FungibleTransferPayload` or `ERC1155TransferPayload`
|
|
200
231
|
*
|
|
@@ -301,6 +332,28 @@ export declare class TooManyEventActionStepsProvidedError extends Error {
|
|
|
301
332
|
*/
|
|
302
333
|
constructor();
|
|
303
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* Function action validation context to help debug other validation errors
|
|
337
|
+
*
|
|
338
|
+
* @interface FunctionActionValidationMeta
|
|
339
|
+
* @typedef {FunctionActionValidationMeta}
|
|
340
|
+
*/
|
|
341
|
+
interface FunctionActionValidationMeta {
|
|
342
|
+
decodedArgs: readonly (string | bigint)[];
|
|
343
|
+
/**
|
|
344
|
+
* The value pulled off the log being validated against
|
|
345
|
+
*
|
|
346
|
+
* @type {*}
|
|
347
|
+
* biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits
|
|
348
|
+
*/
|
|
349
|
+
fieldValue: any;
|
|
350
|
+
/**
|
|
351
|
+
* The criteria being used to compare during validation
|
|
352
|
+
*
|
|
353
|
+
* @type {Criteria}
|
|
354
|
+
*/
|
|
355
|
+
criteria: Criteria;
|
|
356
|
+
}
|
|
304
357
|
/**
|
|
305
358
|
* Event action validation context to help debug other validation errors
|
|
306
359
|
*
|
|
@@ -313,7 +366,7 @@ interface EventActionValidationMeta {
|
|
|
313
366
|
*
|
|
314
367
|
* @type {Log}
|
|
315
368
|
*/
|
|
316
|
-
log
|
|
369
|
+
log?: EventLogs[0];
|
|
317
370
|
/**
|
|
318
371
|
* The value pulled off the log being validated against
|
|
319
372
|
*
|
|
@@ -333,17 +386,23 @@ interface EventActionValidationMeta {
|
|
|
333
386
|
* Instantiated with relevent context data for more in depth debugging.
|
|
334
387
|
*
|
|
335
388
|
* @export
|
|
336
|
-
* @class
|
|
337
|
-
* @typedef {
|
|
389
|
+
* @class FieldActionValidationError
|
|
390
|
+
* @typedef {FieldActionValidationError}
|
|
338
391
|
* @extends {Error}
|
|
339
392
|
*/
|
|
340
|
-
export declare class
|
|
393
|
+
export declare class FieldActionValidationError extends Error {
|
|
394
|
+
/**
|
|
395
|
+
* The function input arguments being validated against
|
|
396
|
+
*
|
|
397
|
+
* @type {decodedArgs}
|
|
398
|
+
*/
|
|
399
|
+
decodedArgs?: readonly (string | bigint)[];
|
|
341
400
|
/**
|
|
342
401
|
* The viem log being validated against
|
|
343
402
|
*
|
|
344
403
|
* @type {Log}
|
|
345
404
|
*/
|
|
346
|
-
log
|
|
405
|
+
log?: EventLogs[0];
|
|
347
406
|
/**
|
|
348
407
|
* The value pulled off the log being validated against
|
|
349
408
|
*
|
|
@@ -358,7 +417,7 @@ export declare class EventActionValidationError extends Error {
|
|
|
358
417
|
*/
|
|
359
418
|
criteria: Criteria;
|
|
360
419
|
/**
|
|
361
|
-
* Creates an instance of
|
|
420
|
+
* Creates an instance of FieldActionValidationError.
|
|
362
421
|
*
|
|
363
422
|
* @constructor
|
|
364
423
|
* @param {string} message
|
|
@@ -367,7 +426,24 @@ export declare class EventActionValidationError extends Error {
|
|
|
367
426
|
* @param {Criteria} param0.criteria
|
|
368
427
|
* @param {Log} param0.log
|
|
369
428
|
*/
|
|
370
|
-
constructor(message: string, { fieldValue, criteria,
|
|
429
|
+
constructor(message: string, { fieldValue, criteria, ...args }: EventActionValidationMeta | FunctionActionValidationMeta);
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Thrown when abi-decoded args on log is undefined
|
|
433
|
+
*
|
|
434
|
+
* @export
|
|
435
|
+
* @class FieldValueUndefinedError
|
|
436
|
+
* @typedef {FieldValueUndefinedError}
|
|
437
|
+
* @extends {FieldActionValidationError}
|
|
438
|
+
*/
|
|
439
|
+
export declare class DecodedArgsMalformedError extends FieldActionValidationError {
|
|
440
|
+
/**
|
|
441
|
+
* Creates an instance of DecodedArgsUndefinedError.
|
|
442
|
+
*
|
|
443
|
+
* @constructor
|
|
444
|
+
* @param {DecodedArgsMalformedError} metadata
|
|
445
|
+
*/
|
|
446
|
+
constructor(metadata: EventActionValidationMeta | FunctionActionValidationMeta);
|
|
371
447
|
}
|
|
372
448
|
/**
|
|
373
449
|
* Thrown when field value on log is undefined
|
|
@@ -375,16 +451,16 @@ export declare class EventActionValidationError extends Error {
|
|
|
375
451
|
* @export
|
|
376
452
|
* @class FieldValueUndefinedError
|
|
377
453
|
* @typedef {FieldValueUndefinedError}
|
|
378
|
-
* @extends {
|
|
454
|
+
* @extends {FieldActionValidationError}
|
|
379
455
|
*/
|
|
380
|
-
export declare class FieldValueUndefinedError extends
|
|
456
|
+
export declare class FieldValueUndefinedError extends FieldActionValidationError {
|
|
381
457
|
/**
|
|
382
458
|
* Creates an instance of FieldValueUndefinedError.
|
|
383
459
|
*
|
|
384
460
|
* @constructor
|
|
385
461
|
* @param {EventActionValidationMeta} metadata
|
|
386
462
|
*/
|
|
387
|
-
constructor(metadata: EventActionValidationMeta);
|
|
463
|
+
constructor(metadata: EventActionValidationMeta | FunctionActionValidationMeta);
|
|
388
464
|
}
|
|
389
465
|
/**
|
|
390
466
|
* Thrown when a filter type is using a numerical operator but field type is not numerical
|
|
@@ -392,16 +468,36 @@ export declare class FieldValueUndefinedError extends EventActionValidationError
|
|
|
392
468
|
* @export
|
|
393
469
|
* @class InvalidNumericalCriteriaError
|
|
394
470
|
* @typedef {InvalidNumericalCriteriaError}
|
|
395
|
-
* @extends {
|
|
471
|
+
* @extends {FieldActionValidationError}
|
|
396
472
|
*/
|
|
397
|
-
export declare class InvalidNumericalCriteriaError extends
|
|
473
|
+
export declare class InvalidNumericalCriteriaError extends FieldActionValidationError {
|
|
398
474
|
/**
|
|
399
475
|
* Creates an instance of InvalidNumericalCriteria.
|
|
400
476
|
*
|
|
401
477
|
* @constructor
|
|
402
478
|
* @param {EventActionValidationMeta} metadata
|
|
403
479
|
*/
|
|
404
|
-
constructor(metadata: EventActionValidationMeta);
|
|
480
|
+
constructor(metadata: EventActionValidationMeta | FunctionActionValidationMeta);
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Thrown when decoding function data fails.
|
|
484
|
+
*
|
|
485
|
+
* @export
|
|
486
|
+
* @class FunctionDataDecodeError
|
|
487
|
+
* @typedef {FunctionDataDecodeError}
|
|
488
|
+
* @extends {Error}
|
|
489
|
+
*/
|
|
490
|
+
export declare class FunctionDataDecodeError extends Error {
|
|
491
|
+
abi: AbiFunction[];
|
|
492
|
+
originalError: Error;
|
|
493
|
+
/**
|
|
494
|
+
* Creates an instance of FunctionDataDecodeError.
|
|
495
|
+
*
|
|
496
|
+
* @constructor
|
|
497
|
+
* @param {AbiFunction[]} abi - The ABI of the function.
|
|
498
|
+
* @param {Error} originalError - The original error that was thrown.
|
|
499
|
+
*/
|
|
500
|
+
constructor(abi: AbiFunction[], originalError: Error);
|
|
405
501
|
}
|
|
406
502
|
/**
|
|
407
503
|
* Thrown when an the log's field value is being compared a field type that isn't bytes or string during event action validation
|
|
@@ -409,16 +505,16 @@ export declare class InvalidNumericalCriteriaError extends EventActionValidation
|
|
|
409
505
|
* @export
|
|
410
506
|
* @class FieldValueNotComparableError
|
|
411
507
|
* @typedef {FieldValueNotComparableError}
|
|
412
|
-
* @extends {
|
|
508
|
+
* @extends {FieldActionValidationError}
|
|
413
509
|
*/
|
|
414
|
-
export declare class FieldValueNotComparableError extends
|
|
510
|
+
export declare class FieldValueNotComparableError extends FieldActionValidationError {
|
|
415
511
|
/**
|
|
416
512
|
* Creates an instance of FieldValueNotComparableError.
|
|
417
513
|
*
|
|
418
514
|
* @constructor
|
|
419
515
|
* @param {EventActionValidationMeta} metadata
|
|
420
516
|
*/
|
|
421
|
-
constructor(metadata: EventActionValidationMeta);
|
|
517
|
+
constructor(metadata: EventActionValidationMeta | FunctionActionValidationMeta);
|
|
422
518
|
}
|
|
423
519
|
/**
|
|
424
520
|
* Thrown when an invalid filter type enum was provided event action validation.
|
|
@@ -426,16 +522,16 @@ export declare class FieldValueNotComparableError extends EventActionValidationE
|
|
|
426
522
|
* @export
|
|
427
523
|
* @class UnrecognizedFilterTypeError
|
|
428
524
|
* @typedef {UnrecognizedFilterTypeError}
|
|
429
|
-
* @extends {
|
|
525
|
+
* @extends {FieldActionValidationError}
|
|
430
526
|
*/
|
|
431
|
-
export declare class UnrecognizedFilterTypeError extends
|
|
527
|
+
export declare class UnrecognizedFilterTypeError extends FieldActionValidationError {
|
|
432
528
|
/**
|
|
433
529
|
* Creates an instance of UnrecognizedFilterTypeError.
|
|
434
530
|
*
|
|
435
531
|
* @constructor
|
|
436
532
|
* @param {EventActionValidationMeta} metadata
|
|
437
533
|
*/
|
|
438
|
-
constructor(metadata: EventActionValidationMeta);
|
|
534
|
+
constructor(metadata: EventActionValidationMeta | FunctionActionValidationMeta);
|
|
439
535
|
}
|
|
440
536
|
export {};
|
|
441
537
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":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