@boostxyz/sdk 0.0.0-alpha.11 → 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 +1 -1
- 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.js +2 -2
- package/dist/AllowLists/SimpleAllowList.js +1 -1
- package/dist/AllowLists/SimpleDenyList.js +2 -2
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.js +2 -2
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.js +1 -1
- package/dist/Budgets/Budget.js +1 -1
- package/dist/Budgets/ManagedBudget.js +1 -1
- package/dist/Deployable/DeployableTarget.js +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/Incentive.js +12 -12
- package/dist/Incentives/PointsIncentive.js +1 -1
- package/dist/{SimpleDenyList-4PtOPXTc.js → SimpleDenyList-IJ9Ipya7.js} +2 -2
- package/dist/{SimpleDenyList-4PtOPXTc.js.map → SimpleDenyList-IJ9Ipya7.js.map} +1 -1
- package/dist/Validators/SignerValidator.js +1 -1
- package/dist/Validators/Validator.js +1 -1
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +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 +58 -55
- package/package.json +8 -5
- package/src/Actions/Action.test.ts +8 -4
- package/src/Actions/EventAction.test.ts +528 -100
- package/src/Actions/EventAction.ts +296 -58
- package/src/errors.ts +160 -20
package/dist/errors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { zeroHash as
|
|
2
|
-
class
|
|
1
|
+
import { zeroHash as n } from "viem";
|
|
2
|
+
class d extends Error {
|
|
3
3
|
/**
|
|
4
4
|
* Creates an instance of BoostCoreNoIdentifierEmitted.
|
|
5
5
|
*
|
|
@@ -9,7 +9,7 @@ class c extends Error {
|
|
|
9
9
|
super('No "BoostCreated" log was emitted from which to extract boostId');
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
class
|
|
12
|
+
class i extends Error {
|
|
13
13
|
/**
|
|
14
14
|
* Creates an instance of ContractAddressRequiredError.
|
|
15
15
|
*
|
|
@@ -26,10 +26,10 @@ class l extends Error {
|
|
|
26
26
|
* @constructor
|
|
27
27
|
* @param {string} address
|
|
28
28
|
*/
|
|
29
|
-
constructor(
|
|
29
|
+
constructor(e) {
|
|
30
30
|
super(
|
|
31
31
|
"Attempted to deploy a contract that already has an address configured"
|
|
32
|
-
), this.address =
|
|
32
|
+
), this.address = e;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
class u extends Error {
|
|
@@ -68,7 +68,7 @@ class E extends Error {
|
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
class
|
|
71
|
+
class h extends Error {
|
|
72
72
|
/**
|
|
73
73
|
* Creates an instance of DeployableMissingPayloadError.
|
|
74
74
|
*
|
|
@@ -80,20 +80,20 @@ class x extends Error {
|
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
class
|
|
83
|
+
class m extends Error {
|
|
84
84
|
/**
|
|
85
85
|
* Creates an instance of NoContractAddressUponReceiptError.
|
|
86
86
|
*
|
|
87
87
|
* @constructor
|
|
88
88
|
* @param {WaitForTransactionReceiptReturnType} receipt
|
|
89
89
|
*/
|
|
90
|
-
constructor(
|
|
90
|
+
constructor(e) {
|
|
91
91
|
super("Expected a contract address to exist on receipt.", {
|
|
92
|
-
cause:
|
|
93
|
-
}), this.receipt =
|
|
92
|
+
cause: e
|
|
93
|
+
}), this.receipt = e;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
class
|
|
96
|
+
class x extends Error {
|
|
97
97
|
/**
|
|
98
98
|
* Creates an instance of InvalidComponentInterfaceError.
|
|
99
99
|
*
|
|
@@ -101,40 +101,55 @@ class m extends Error {
|
|
|
101
101
|
* @param {Hex[]} expected
|
|
102
102
|
* @param {Hex} received
|
|
103
103
|
*/
|
|
104
|
-
constructor(
|
|
104
|
+
constructor(e, o) {
|
|
105
105
|
super("Address provided does not match any expected protocol interface", {
|
|
106
|
-
cause: { expected:
|
|
107
|
-
}), this.expected = [], this.received =
|
|
106
|
+
cause: { expected: e, received: o }
|
|
107
|
+
}), this.expected = [], this.received = n, this.expected = e, this.received = o;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
class y extends Error {
|
|
111
|
+
/**
|
|
112
|
+
* Creates an instance of UnknownTransferPayloadSupplied.
|
|
113
|
+
*
|
|
114
|
+
* @constructor
|
|
115
|
+
* @param {number} input_param_idx
|
|
116
|
+
* @param {AbiEvent} event
|
|
117
|
+
*/
|
|
118
|
+
constructor(e, o) {
|
|
119
|
+
super(
|
|
120
|
+
`Parameter is not transparently stored onchain. Parameter ${e} in event ${o.name} cannot be used in an action`,
|
|
121
|
+
{ cause: o }
|
|
122
|
+
), this.event = o, this.input_param_idx = e;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
class b extends Error {
|
|
111
126
|
/**
|
|
112
127
|
* Creates an instance of UnknownTransferPayloadSupplied.
|
|
113
128
|
*
|
|
114
129
|
* @constructor
|
|
115
130
|
* @param {unknown} received
|
|
116
131
|
*/
|
|
117
|
-
constructor(
|
|
132
|
+
constructor(e) {
|
|
118
133
|
super(
|
|
119
134
|
"Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.",
|
|
120
|
-
{ cause:
|
|
121
|
-
), this.received =
|
|
135
|
+
{ cause: e }
|
|
136
|
+
), this.received = e;
|
|
122
137
|
}
|
|
123
138
|
}
|
|
124
|
-
class
|
|
139
|
+
class g extends Error {
|
|
125
140
|
/**
|
|
126
141
|
* Creates an instance of BudgetMustAuthorizeBoostCore.
|
|
127
142
|
*
|
|
128
143
|
* @constructor
|
|
129
144
|
* @param {string} boostCoreAddress
|
|
130
145
|
*/
|
|
131
|
-
constructor(
|
|
146
|
+
constructor(e) {
|
|
132
147
|
super(
|
|
133
|
-
`Budget needs to explicitly authorize ${
|
|
148
|
+
`Budget needs to explicitly authorize ${e}. You can retrieve this value from BoostCore.address`
|
|
134
149
|
);
|
|
135
150
|
}
|
|
136
151
|
}
|
|
137
|
-
class
|
|
152
|
+
class v extends Error {
|
|
138
153
|
/**
|
|
139
154
|
* Creates an instance of MustInitializeBudgetError.
|
|
140
155
|
*/
|
|
@@ -142,18 +157,18 @@ class b extends Error {
|
|
|
142
157
|
super("Budgets must be preinitialized before being used with a new Boost");
|
|
143
158
|
}
|
|
144
159
|
}
|
|
145
|
-
class
|
|
160
|
+
class f extends Error {
|
|
146
161
|
/**
|
|
147
162
|
* Creates an instance of IncentiveNotCloneableError.
|
|
148
163
|
*
|
|
149
164
|
* @constructor
|
|
150
165
|
* @param {Incentive} incentive
|
|
151
166
|
*/
|
|
152
|
-
constructor(
|
|
153
|
-
super(`Incentive not cloneable: ${
|
|
167
|
+
constructor(e) {
|
|
168
|
+
super(`Incentive not cloneable: ${e.constructor.name}`);
|
|
154
169
|
}
|
|
155
170
|
}
|
|
156
|
-
class
|
|
171
|
+
class A extends Error {
|
|
157
172
|
/**
|
|
158
173
|
* Creates an instance of NoEventActionStepsProvidedError.
|
|
159
174
|
*
|
|
@@ -163,7 +178,7 @@ class f extends Error {
|
|
|
163
178
|
super("Must supply at least one action step");
|
|
164
179
|
}
|
|
165
180
|
}
|
|
166
|
-
class
|
|
181
|
+
class D extends Error {
|
|
167
182
|
/**
|
|
168
183
|
* Creates an instance of TooManyEventActionStepsProvidedError.
|
|
169
184
|
*
|
|
@@ -177,7 +192,7 @@ class C extends Error {
|
|
|
177
192
|
}
|
|
178
193
|
class t extends Error {
|
|
179
194
|
/**
|
|
180
|
-
* Creates an instance of
|
|
195
|
+
* Creates an instance of FieldActionValidationError.
|
|
181
196
|
*
|
|
182
197
|
* @constructor
|
|
183
198
|
* @param {string} message
|
|
@@ -186,35 +201,71 @@ class t extends Error {
|
|
|
186
201
|
* @param {Criteria} param0.criteria
|
|
187
202
|
* @param {Log} param0.log
|
|
188
203
|
*/
|
|
189
|
-
constructor(
|
|
190
|
-
|
|
204
|
+
constructor(e, {
|
|
205
|
+
fieldValue: o,
|
|
206
|
+
criteria: a,
|
|
207
|
+
...s
|
|
208
|
+
}) {
|
|
209
|
+
switch (super(e), this.fieldValue = o, this.criteria = a, !0) {
|
|
210
|
+
case "log" in s:
|
|
211
|
+
this.log = s.log;
|
|
212
|
+
break;
|
|
213
|
+
case "decodedArgs" in s:
|
|
214
|
+
this.decodedArgs = s.decodedArgs;
|
|
215
|
+
}
|
|
191
216
|
}
|
|
192
217
|
}
|
|
193
218
|
class w extends t {
|
|
219
|
+
/**
|
|
220
|
+
* Creates an instance of DecodedArgsUndefinedError.
|
|
221
|
+
*
|
|
222
|
+
* @constructor
|
|
223
|
+
* @param {DecodedArgsMalformedError} metadata
|
|
224
|
+
*/
|
|
225
|
+
constructor(e) {
|
|
226
|
+
super(
|
|
227
|
+
"Decoded Args are malformed; Check which params are indexed",
|
|
228
|
+
e
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
class C extends t {
|
|
194
233
|
/**
|
|
195
234
|
* Creates an instance of FieldValueUndefinedError.
|
|
196
235
|
*
|
|
197
236
|
* @constructor
|
|
198
237
|
* @param {EventActionValidationMeta} metadata
|
|
199
238
|
*/
|
|
200
|
-
constructor(
|
|
201
|
-
super("Field value is undefined",
|
|
239
|
+
constructor(e) {
|
|
240
|
+
super("Field value is undefined", e);
|
|
202
241
|
}
|
|
203
242
|
}
|
|
204
|
-
class
|
|
243
|
+
class F extends t {
|
|
205
244
|
/**
|
|
206
245
|
* Creates an instance of InvalidNumericalCriteria.
|
|
207
246
|
*
|
|
208
247
|
* @constructor
|
|
209
248
|
* @param {EventActionValidationMeta} metadata
|
|
210
249
|
*/
|
|
211
|
-
constructor(
|
|
250
|
+
constructor(e) {
|
|
212
251
|
super(
|
|
213
252
|
"Numerical comparisons cannot be used with non-numerical criteria",
|
|
214
|
-
|
|
253
|
+
e
|
|
215
254
|
);
|
|
216
255
|
}
|
|
217
256
|
}
|
|
257
|
+
class P extends Error {
|
|
258
|
+
/**
|
|
259
|
+
* Creates an instance of FunctionDataDecodeError.
|
|
260
|
+
*
|
|
261
|
+
* @constructor
|
|
262
|
+
* @param {AbiFunction[]} abi - The ABI of the function.
|
|
263
|
+
* @param {Error} originalError - The original error that was thrown.
|
|
264
|
+
*/
|
|
265
|
+
constructor(e, o) {
|
|
266
|
+
super(`Failed to decode function data: ${o.message}`), this.name = "FunctionDataDecodeError", this.abi = e, this.originalError = o;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
218
269
|
class B extends t {
|
|
219
270
|
/**
|
|
220
271
|
* Creates an instance of FieldValueNotComparableError.
|
|
@@ -222,8 +273,8 @@ class B extends t {
|
|
|
222
273
|
* @constructor
|
|
223
274
|
* @param {EventActionValidationMeta} metadata
|
|
224
275
|
*/
|
|
225
|
-
constructor(
|
|
226
|
-
super("Filter can only be used with bytes or string field type",
|
|
276
|
+
constructor(e) {
|
|
277
|
+
super("Filter can only be used with bytes or string field type", e);
|
|
227
278
|
}
|
|
228
279
|
}
|
|
229
280
|
class I extends t {
|
|
@@ -233,30 +284,33 @@ class I extends t {
|
|
|
233
284
|
* @constructor
|
|
234
285
|
* @param {EventActionValidationMeta} metadata
|
|
235
286
|
*/
|
|
236
|
-
constructor(
|
|
237
|
-
super("Invalid FilterType provided",
|
|
287
|
+
constructor(e) {
|
|
288
|
+
super("Invalid FilterType provided", e);
|
|
238
289
|
}
|
|
239
290
|
}
|
|
240
291
|
export {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
292
|
+
d as BoostCoreNoIdentifierEmitted,
|
|
293
|
+
g as BudgetMustAuthorizeBoostCore,
|
|
294
|
+
i as ContractAddressRequiredError,
|
|
295
|
+
w as DecodedArgsMalformedError,
|
|
244
296
|
l as DeployableAlreadyDeployedError,
|
|
245
297
|
u as DeployableBuildParametersUnspecifiedError,
|
|
246
|
-
|
|
298
|
+
h as DeployableMissingPayloadError,
|
|
247
299
|
p as DeployableUnknownOwnerProvidedError,
|
|
248
300
|
E as DeployableWagmiConfigurationRequiredError,
|
|
249
|
-
t as
|
|
301
|
+
t as FieldActionValidationError,
|
|
250
302
|
B as FieldValueNotComparableError,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
303
|
+
C as FieldValueUndefinedError,
|
|
304
|
+
P as FunctionDataDecodeError,
|
|
305
|
+
f as IncentiveNotCloneableError,
|
|
306
|
+
x as InvalidComponentInterfaceError,
|
|
307
|
+
F as InvalidNumericalCriteriaError,
|
|
308
|
+
v as MustInitializeBudgetError,
|
|
309
|
+
m as NoContractAddressUponReceiptError,
|
|
310
|
+
A as NoEventActionStepsProvidedError,
|
|
311
|
+
D as TooManyEventActionStepsProvidedError,
|
|
312
|
+
b as UnknownTransferPayloadSupplied,
|
|
313
|
+
y as UnparseableAbiParamError,
|
|
260
314
|
I as UnrecognizedFilterTypeError
|
|
261
315
|
};
|
|
262
316
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","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":";AA0BO,MAAMA,UAAqC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtD,cAAc;AACZ,UAAM,iEAAiE;AAAA,EACzE;AACF;AAiBO,MAAMC,UAAqC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtD,cAAc;AACZ,UAAM,gEAAgE;AAAA,EACxE;AACF;AAUO,MAAMC,UAAuC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaxD,YAAYC,GAAiB;AAC3B;AAAA,MACE;AAAA,IAAA,GAEF,KAAK,UAAUA;AAAA,EACjB;AACF;AAUO,MAAMC,UAAkD,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnE,cAAc;AACZ;AAAA,MACE;AAAA,IAAA;AAAA,EAEJ;AACF;AAUO,MAAMC,UAA4C,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM7D,cAAc;AACZ;AAAA,MACE;AAAA,IAAA;AAAA,EAEJ;AACF;AAUO,MAAMC,UAAkD,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnE,cAAc;AACZ;AAAA,MACE;AAAA,IAAA;AAAA,EAEJ;AACF;AAUO,MAAMC,UAAsC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvD,cAAc;AACZ;AAAA,MACE;AAAA,IAAA;AAAA,EAEJ;AACF;AAUO,MAAMC,UAA0C,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAe3D,YAAYC,GAA8C;AACxD,UAAM,oDAAoD;AAAA,MACxD,O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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8BpD,YACEC,GACA,EAAE,YAAAC,GAAY,UAAAC,GAAU,KAAAC,KACxB;AACA,UAAMH,CAAO,GACb,KAAK,aAAaC,GAClB,KAAK,WAAWC,GAChB,KAAK,MAAMC;AAAA,EACb;AACF;AAUO,MAAMC,UAAiCL,EAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOvE,YAAYM,GAAqC;AAC/C,UAAM,4BAA4BA,CAAQ;AAAA,EAC5C;AACF;AAUO,MAAMC,UAAsCP,EAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO5E,YAAYM,GAAqC;AAC/C;AAAA,MACE;AAAA,MACAA;AAAA,IAAA;AAAA,EAEJ;AACF;AAUO,MAAME,UAAqCR,EAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO3E,YAAYM,GAAqC;AAC/C,UAAM,2DAA2DA,CAAQ;AAAA,EAC3E;AACF;AAUO,MAAMG,UAAoCT,EAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1E,YAAYM,GAAqC;AAC/C,UAAM,+BAA+BA,CAAQ;AAAA,EAC/C;AACF;"}
|
|
1
|
+
{"version":3,"file":"errors.js","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":";AA6BO,MAAMA,UAAqC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtD,cAAc;AACZ,UAAM,iEAAiE;AAAA,EACzE;AACF;AAiBO,MAAMC,UAAqC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtD,cAAc;AACZ,UAAM,gEAAgE;AAAA,EACxE;AACF;AAUO,MAAMC,UAAuC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaxD,YAAYC,GAAiB;AAC3B;AAAA,MACE;AAAA,IAAA,GAEF,KAAK,UAAUA;AAAA,EACjB;AACF;AAUO,MAAMC,UAAkD,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnE,cAAc;AACZ;AAAA,MACE;AAAA,IAAA;AAAA,EAEJ;AACF;AAUO,MAAMC,UAA4C,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM7D,cAAc;AACZ;AAAA,MACE;AAAA,IAAA;AAAA,EAEJ;AACF;AAUO,MAAMC,UAAkD,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnE,cAAc;AACZ;AAAA,MACE;AAAA,IAAA;AAAA,EAEJ;AACF;AAUO,MAAMC,UAAsC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AA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,UAAgC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWjD,YAAYC,GAAoBC,GAAsB;AAC9C,UAAA,mCAAmCA,EAAc,OAAO,EAAE,GAChE,KAAK,OAAO,2BACZ,KAAK,MAAMD,GACX,KAAK,gBAAgBC;AAAA,EACvB;AACF;AAUO,MAAMC,UAAqCZ,EAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO3E,YACEM,GACA;AACA,UAAM,2DAA2DA,CAAQ;AAAA,EAC3E;AACF;AAUO,MAAMO,UAAoCb,EAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1E,YACEM,GACA;AACA,UAAM,+BAA+BA,CAAQ;AAAA,EAC/C;AACF;"}
|
|
@@ -4502,7 +4502,7 @@ export {
|
|
|
4502
4502
|
fe as Z,
|
|
4503
4503
|
St as _,
|
|
4504
4504
|
ie as a,
|
|
4505
|
-
|
|
4505
|
+
Tt as a$,
|
|
4506
4506
|
Te as a0,
|
|
4507
4507
|
de as a1,
|
|
4508
4508
|
hn as a2,
|
|
@@ -4534,12 +4534,12 @@ export {
|
|
|
4534
4534
|
Tn as aS,
|
|
4535
4535
|
In as aT,
|
|
4536
4536
|
fn as aU,
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4537
|
+
b as aV,
|
|
4538
|
+
ht as aW,
|
|
4539
|
+
Nt as aX,
|
|
4540
|
+
vt as aY,
|
|
4541
|
+
wt as aZ,
|
|
4542
|
+
ft as a_,
|
|
4543
4543
|
Ge as aa,
|
|
4544
4544
|
Ve as ab,
|
|
4545
4545
|
We as ac,
|
|
@@ -4567,19 +4567,19 @@ export {
|
|
|
4567
4567
|
ct as ay,
|
|
4568
4568
|
lt as az,
|
|
4569
4569
|
ye as b,
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4570
|
+
gt as b0,
|
|
4571
|
+
Mt as b1,
|
|
4572
|
+
zt as b2,
|
|
4573
|
+
Ot as b3,
|
|
4574
|
+
Ct as b4,
|
|
4575
|
+
At as b5,
|
|
4576
|
+
It as b6,
|
|
4577
|
+
se as b7,
|
|
4578
|
+
z as b8,
|
|
4579
|
+
Rt as b9,
|
|
4580
|
+
xt as ba,
|
|
4581
|
+
Ht as bb,
|
|
4582
|
+
_t as bc,
|
|
4583
4583
|
xe as bd,
|
|
4584
4584
|
Ne as be,
|
|
4585
4585
|
Re as bf,
|
|
@@ -4622,4 +4622,4 @@ export {
|
|
|
4622
4622
|
tn as y,
|
|
4623
4623
|
Q as z
|
|
4624
4624
|
};
|
|
4625
|
-
//# sourceMappingURL=generated-
|
|
4625
|
+
//# sourceMappingURL=generated-HGddZXHJ.js.map
|