@boostxyz/sdk 0.0.0-alpha.9 → 1.1.0-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Action.cjs +1 -1
- package/dist/Actions/Action.cjs.map +1 -1
- package/dist/Actions/Action.js +2 -2
- package/dist/Actions/ContractAction.d.ts +11 -11
- package/dist/Actions/ContractAction.d.ts.map +1 -1
- package/dist/Actions/ERC721MintAction.d.ts +14 -14
- package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.cjs +1 -1
- package/dist/Actions/EventAction.cjs.map +1 -1
- package/dist/Actions/EventAction.d.ts +174 -41
- package/dist/Actions/EventAction.d.ts.map +1 -1
- package/dist/Actions/EventAction.js +557 -129
- 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 +423 -0
- package/dist/AllowLists/OpenAllowList.d.ts.map +1 -0
- package/dist/AllowLists/SimpleAllowList.cjs +1 -1
- package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
- package/dist/AllowLists/SimpleAllowList.d.ts +92 -37
- package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleAllowList.js +60 -75
- package/dist/AllowLists/SimpleAllowList.js.map +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs +1 -1
- package/dist/AllowLists/SimpleDenyList.cjs.map +1 -1
- package/dist/AllowLists/SimpleDenyList.d.ts +203 -11
- package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
- package/dist/AllowLists/SimpleDenyList.js +11 -112
- package/dist/AllowLists/SimpleDenyList.js.map +1 -1
- package/dist/Auth/PassthroughAuth.cjs +1 -1
- package/dist/Auth/PassthroughAuth.js +1 -1
- package/dist/Boost.cjs +1 -1
- package/dist/Boost.cjs.map +1 -1
- package/dist/Boost.d.ts +20 -21
- package/dist/Boost.d.ts.map +1 -1
- package/dist/Boost.js +43 -57
- package/dist/Boost.js.map +1 -1
- package/dist/BoostCore-Btl5BdAs.cjs +3 -0
- package/dist/BoostCore-Btl5BdAs.cjs.map +1 -0
- package/dist/BoostCore-CD56zbYX.js +2641 -0
- package/dist/BoostCore-CD56zbYX.js.map +1 -0
- package/dist/BoostCore.cjs +1 -2
- package/dist/BoostCore.cjs.map +1 -1
- package/dist/BoostCore.d.ts +749 -78
- package/dist/BoostCore.d.ts.map +1 -1
- package/dist/BoostCore.js +29 -1150
- package/dist/BoostCore.js.map +1 -1
- package/dist/BoostRegistry.cjs +1 -1
- package/dist/BoostRegistry.cjs.map +1 -1
- package/dist/BoostRegistry.d.ts +80 -25
- package/dist/BoostRegistry.d.ts.map +1 -1
- package/dist/BoostRegistry.js +164 -82
- package/dist/BoostRegistry.js.map +1 -1
- package/dist/Budgets/Budget.cjs +1 -1
- package/dist/Budgets/Budget.cjs.map +1 -1
- package/dist/Budgets/Budget.d.ts.map +1 -1
- package/dist/Budgets/Budget.js +2 -2
- package/dist/Budgets/Budget.js.map +1 -1
- package/dist/Budgets/ManagedBudget.cjs +1 -1
- package/dist/Budgets/ManagedBudget.cjs.map +1 -1
- package/dist/Budgets/ManagedBudget.d.ts +103 -221
- package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
- package/dist/Budgets/ManagedBudget.js +81 -298
- package/dist/Budgets/ManagedBudget.js.map +1 -1
- package/dist/Budgets/VestingBudget.d.ts +223 -89
- package/dist/Budgets/VestingBudget.d.ts.map +1 -1
- package/dist/Deployable/Contract.cjs +1 -1
- package/dist/Deployable/Contract.cjs.map +1 -1
- package/dist/Deployable/Contract.d.ts +4 -5
- package/dist/Deployable/Contract.d.ts.map +1 -1
- package/dist/Deployable/Contract.js +5 -7
- package/dist/Deployable/Contract.js.map +1 -1
- package/dist/Deployable/Deployable.cjs.map +1 -1
- package/dist/Deployable/Deployable.d.ts +1 -1
- package/dist/Deployable/Deployable.d.ts.map +1 -1
- package/dist/Deployable/Deployable.js +3 -5
- package/dist/Deployable/Deployable.js.map +1 -1
- package/dist/Deployable/DeployableTarget.cjs +1 -1
- package/dist/Deployable/DeployableTarget.cjs.map +1 -1
- package/dist/Deployable/DeployableTarget.d.ts +13 -13
- package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
- package/dist/Deployable/DeployableTarget.js +28 -25
- package/dist/Deployable/DeployableTarget.js.map +1 -1
- package/dist/Deployable/DeployableTargetWithRBAC.cjs +2 -0
- package/dist/Deployable/DeployableTargetWithRBAC.cjs.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts +248 -0
- package/dist/Deployable/DeployableTargetWithRBAC.d.ts.map +1 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js +320 -0
- package/dist/Deployable/DeployableTargetWithRBAC.js.map +1 -0
- package/dist/Incentive-CcnOIc8L.cjs +2 -0
- package/dist/Incentive-CcnOIc8L.cjs.map +1 -0
- package/dist/Incentive-rM5nKznp.js +313 -0
- package/dist/Incentive-rM5nKznp.js.map +1 -0
- package/dist/Incentives/AllowListIncentive.cjs +1 -1
- package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
- package/dist/Incentives/AllowListIncentive.d.ts +38 -16
- package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
- package/dist/Incentives/AllowListIncentive.js +43 -29
- package/dist/Incentives/AllowListIncentive.js.map +1 -1
- package/dist/Incentives/CGDAIncentive.cjs +1 -1
- package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
- package/dist/Incentives/CGDAIncentive.d.ts +234 -21
- package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
- package/dist/Incentives/CGDAIncentive.js +46 -32
- package/dist/Incentives/CGDAIncentive.js.map +1 -1
- package/dist/Incentives/ERC1155Incentive.d.ts +224 -37
- package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.cjs +1 -1
- package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
- package/dist/Incentives/ERC20Incentive.d.ts +234 -30
- package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
- package/dist/Incentives/ERC20Incentive.js +62 -46
- package/dist/Incentives/ERC20Incentive.js.map +1 -1
- package/dist/{Budgets/SimpleBudget.d.ts → Incentives/ERC20VariableCriteriaIncentive.d.ts} +333 -438
- package/dist/Incentives/ERC20VariableCriteriaIncentive.d.ts.map +1 -0
- package/dist/Incentives/ERC20VariableIncentive.d.ts +231 -29
- package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.cjs +1 -1
- package/dist/Incentives/Incentive.cjs.map +1 -1
- package/dist/Incentives/Incentive.d.ts +4 -4
- package/dist/Incentives/Incentive.d.ts.map +1 -1
- package/dist/Incentives/Incentive.js +16 -296
- package/dist/Incentives/Incentive.js.map +1 -1
- package/dist/Incentives/PointsIncentive.cjs +1 -1
- package/dist/Incentives/PointsIncentive.cjs.map +1 -1
- package/dist/Incentives/PointsIncentive.d.ts +40 -18
- package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
- package/dist/Incentives/PointsIncentive.js +38 -24
- package/dist/Incentives/PointsIncentive.js.map +1 -1
- package/dist/SimpleDenyList-BDXpY74P.js +133 -0
- package/dist/SimpleDenyList-BDXpY74P.js.map +1 -0
- package/dist/SimpleDenyList-DNj5qDWM.cjs +2 -0
- package/dist/SimpleDenyList-DNj5qDWM.cjs.map +1 -0
- package/dist/Validators/SignerValidator.cjs +1 -1
- package/dist/Validators/SignerValidator.cjs.map +1 -1
- package/dist/Validators/SignerValidator.d.ts +16 -16
- package/dist/Validators/SignerValidator.d.ts.map +1 -1
- package/dist/Validators/SignerValidator.js +32 -28
- package/dist/Validators/SignerValidator.js.map +1 -1
- package/dist/Validators/Validator.cjs +1 -1
- package/dist/Validators/Validator.cjs.map +1 -1
- package/dist/Validators/Validator.d.ts +1 -1
- package/dist/Validators/Validator.js +2 -2
- package/dist/Validators/Validator.js.map +1 -1
- package/dist/claiming.cjs.map +1 -1
- package/dist/claiming.d.ts +1 -1
- package/dist/claiming.js.map +1 -1
- package/dist/componentInterfaces-BBCFkrZv.js +14 -0
- package/dist/componentInterfaces-BBCFkrZv.js.map +1 -0
- package/dist/componentInterfaces-DRI_dQ-P.cjs +2 -0
- package/dist/componentInterfaces-DRI_dQ-P.cjs.map +1 -0
- package/dist/deployments-DF_6-7hH.cjs +2 -0
- package/dist/deployments-DF_6-7hH.cjs.map +1 -0
- package/dist/deployments-fJsWblwS.js +56 -0
- package/dist/deployments-fJsWblwS.js.map +1 -0
- package/dist/deployments.json +58 -0
- package/dist/errors.cjs +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +256 -20
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +183 -26
- package/dist/errors.js.map +1 -1
- package/dist/{generated-57_Kffpz.js → generated-CsNyWPKA.js} +3843 -2084
- package/dist/generated-CsNyWPKA.js.map +1 -0
- package/dist/generated-DHerxf1y.cjs +3 -0
- package/dist/generated-DHerxf1y.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +142 -108
- package/dist/index.js.map +1 -1
- package/dist/transfers.cjs.map +1 -1
- package/dist/transfers.d.ts +1 -1
- package/dist/transfers.js.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +26 -12
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +38 -23
- package/dist/utils.js.map +1 -1
- package/package.json +20 -10
- package/src/Actions/Action.test.ts +14 -13
- package/src/Actions/ContractAction.test.ts +10 -10
- package/src/Actions/ContractAction.ts +11 -12
- package/src/Actions/ERC721MintAction.test.ts +6 -6
- package/src/Actions/ERC721MintAction.ts +14 -15
- package/src/Actions/EventAction.test.ts +735 -109
- package/src/Actions/EventAction.ts +527 -88
- package/src/AllowLists/AllowList.test.ts +7 -7
- 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 +4 -4
- package/src/AllowLists/SimpleAllowList.ts +40 -61
- package/src/AllowLists/SimpleDenyList.test.ts +4 -4
- package/src/AllowLists/SimpleDenyList.ts +41 -17
- package/src/Auth/PassthroughAuth.test.ts +1 -1
- package/src/Boost.ts +21 -24
- package/src/BoostCore.test.ts +361 -306
- package/src/BoostCore.ts +403 -220
- package/src/BoostRegistry.test.ts +53 -0
- package/src/BoostRegistry.ts +161 -40
- package/src/Budgets/Budget.test.ts +2 -2
- package/src/Budgets/Budget.ts +1 -2
- package/src/Budgets/ManagedBudget.test.ts +106 -19
- package/src/Budgets/ManagedBudget.ts +49 -321
- package/src/Budgets/VestingBudget.test.ts +7 -7
- package/src/Budgets/VestingBudget.ts +36 -106
- package/src/Deployable/Contract.ts +4 -5
- package/src/Deployable/Deployable.ts +1 -1
- package/src/Deployable/DeployableTarget.ts +30 -19
- package/src/Deployable/DeployableTargetWithRBAC.test.ts +103 -0
- package/src/Deployable/DeployableTargetWithRBAC.ts +447 -0
- package/src/Incentives/AllowListIncentive.test.ts +12 -12
- package/src/Incentives/AllowListIncentive.ts +30 -15
- package/src/Incentives/CGDAIncentive.test.ts +9 -6
- package/src/Incentives/CGDAIncentive.ts +39 -18
- package/src/Incentives/ERC1155Incentive.test.ts +3 -3
- package/src/Incentives/ERC1155Incentive.ts +30 -29
- package/src/Incentives/ERC20Incentive.test.ts +9 -6
- package/src/Incentives/ERC20Incentive.ts +54 -27
- package/src/Incentives/ERC20VariableCriteriaIncentive.test.ts +184 -0
- package/src/Incentives/ERC20VariableCriteriaIncentive.ts +325 -0
- package/src/Incentives/ERC20VariableIncentive.test.ts +8 -11
- package/src/Incentives/ERC20VariableIncentive.ts +50 -26
- package/src/Incentives/Incentive.test.ts +4 -1
- package/src/Incentives/Incentive.ts +7 -6
- package/src/Incentives/PointsIncentive.test.ts +24 -25
- package/src/Incentives/PointsIncentive.ts +32 -17
- package/src/Validators/SignerValidator.test.ts +6 -6
- package/src/Validators/SignerValidator.ts +20 -17
- package/src/Validators/Validator.test.ts +2 -2
- package/src/Validators/Validator.ts +1 -1
- package/src/claiming.ts +1 -1
- package/src/errors.ts +345 -21
- package/src/index.test.ts +118 -36
- package/src/index.ts +5 -0
- package/src/transfers.ts +1 -1
- package/src/utils.test.ts +2 -2
- package/src/utils.ts +61 -12
- package/dist/Budgets/SimpleBudget.d.ts.map +0 -1
- package/dist/componentInterfaces-CKCBwG16.cjs +0 -2
- package/dist/componentInterfaces-CKCBwG16.cjs.map +0 -1
- package/dist/componentInterfaces-DYkaxBda.js +0 -13
- package/dist/componentInterfaces-DYkaxBda.js.map +0 -1
- package/dist/generated-57_Kffpz.js.map +0 -1
- package/dist/generated-wKBNvm48.cjs +0 -3
- package/dist/generated-wKBNvm48.cjs.map +0 -1
- package/src/Budgets/SimpleBudget.test.ts +0 -152
- package/src/Budgets/SimpleBudget.ts +0 -564
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
encodeAbiParameters,
|
|
19
19
|
} from 'viem';
|
|
20
20
|
import { signTypedData } from 'viem/accounts';
|
|
21
|
+
import { SignerValidator as SignerValidatorBases } from '../../dist/deployments.json';
|
|
21
22
|
import type {
|
|
22
23
|
DeployableOptions,
|
|
23
24
|
GenericDeployableParams,
|
|
@@ -306,10 +307,12 @@ export class SignerValidator extends DeployableTarget<
|
|
|
306
307
|
*
|
|
307
308
|
* @public
|
|
308
309
|
* @static
|
|
309
|
-
* @type {Address}
|
|
310
|
+
* @type {Record<number, Address>}
|
|
310
311
|
*/
|
|
311
|
-
public static override
|
|
312
|
-
.VITE_SIGNER_VALIDATOR_BASE
|
|
312
|
+
public static override bases: Record<number, Address> = {
|
|
313
|
+
31337: import.meta.env.VITE_SIGNER_VALIDATOR_BASE,
|
|
314
|
+
...(SignerValidatorBases as Record<number, Address>),
|
|
315
|
+
};
|
|
313
316
|
/**
|
|
314
317
|
* @inheritdoc
|
|
315
318
|
*
|
|
@@ -325,8 +328,8 @@ export class SignerValidator extends DeployableTarget<
|
|
|
325
328
|
* @public
|
|
326
329
|
* @async
|
|
327
330
|
* @param {Address} address
|
|
328
|
-
* @param {?ReadParams
|
|
329
|
-
* @returns {
|
|
331
|
+
* @param {?ReadParams} [params]
|
|
332
|
+
* @returns {Promise<boolean>}
|
|
330
333
|
*/
|
|
331
334
|
public async signers(
|
|
332
335
|
address: Address,
|
|
@@ -346,8 +349,8 @@ export class SignerValidator extends DeployableTarget<
|
|
|
346
349
|
* @public
|
|
347
350
|
* @async
|
|
348
351
|
* @param {SignerValidatorSignaturePayload} payload
|
|
349
|
-
* @param {?ReadParams
|
|
350
|
-
* @returns {
|
|
352
|
+
* @param {?ReadParams} [params]
|
|
353
|
+
* @returns {Promise<Hex>}
|
|
351
354
|
*/
|
|
352
355
|
public async hashSignerData(
|
|
353
356
|
payload: SignerValidatorSignaturePayload,
|
|
@@ -372,7 +375,7 @@ export class SignerValidator extends DeployableTarget<
|
|
|
372
375
|
* @public
|
|
373
376
|
* @async
|
|
374
377
|
* @param {SignerValidatorValidatePayload} payload
|
|
375
|
-
* @param {?WriteParams
|
|
378
|
+
* @param {?WriteParams} [params]
|
|
376
379
|
* @returns {Promise<boolean>} - True if the action has been validated based on the data payload
|
|
377
380
|
*/
|
|
378
381
|
protected async validate(
|
|
@@ -388,7 +391,7 @@ export class SignerValidator extends DeployableTarget<
|
|
|
388
391
|
* @public
|
|
389
392
|
* @async
|
|
390
393
|
* @param {SignerValidatorValidatePayload} payload
|
|
391
|
-
* @param {?WriteParams
|
|
394
|
+
* @param {?WriteParams} [params]
|
|
392
395
|
* @returns {Promise<boolean>} - True if the action has been validated based on the data payload
|
|
393
396
|
*/
|
|
394
397
|
protected async validateRaw(
|
|
@@ -421,8 +424,8 @@ export class SignerValidator extends DeployableTarget<
|
|
|
421
424
|
* @async
|
|
422
425
|
* @param {Address[]} addresses - The list of signers to update
|
|
423
426
|
* @param {boolean[]} allowed - The authorized status of each signer
|
|
424
|
-
* @param {?WriteParams
|
|
425
|
-
* @returns {
|
|
427
|
+
* @param {?WriteParams} [params]
|
|
428
|
+
* @returns {Promise<void>}
|
|
426
429
|
*/
|
|
427
430
|
public async setAuthorized(
|
|
428
431
|
addresses: Address[],
|
|
@@ -441,8 +444,8 @@ export class SignerValidator extends DeployableTarget<
|
|
|
441
444
|
* @async
|
|
442
445
|
* @param {Address[]} addresses - The list of signers to update
|
|
443
446
|
* @param {boolean[]} allowed - The authorized status of each signer
|
|
444
|
-
* @param {?WriteParams
|
|
445
|
-
* @returns {
|
|
447
|
+
* @param {?WriteParams} [params]
|
|
448
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
446
449
|
*/
|
|
447
450
|
public async setAuthorizedRaw(
|
|
448
451
|
addresses: Address[],
|
|
@@ -469,8 +472,8 @@ export class SignerValidator extends DeployableTarget<
|
|
|
469
472
|
* @public
|
|
470
473
|
* @async
|
|
471
474
|
* @param {Address} address
|
|
472
|
-
* @param {?WriteParams
|
|
473
|
-
* @returns {
|
|
475
|
+
* @param {?WriteParams} [params]
|
|
476
|
+
* @returns {Promise<{ hash: `0x${string}`; result: void; }>}
|
|
474
477
|
*/
|
|
475
478
|
public async setValidatorCallerRaw(
|
|
476
479
|
address: Address,
|
|
@@ -499,8 +502,8 @@ export class SignerValidator extends DeployableTarget<
|
|
|
499
502
|
* @public
|
|
500
503
|
* @async
|
|
501
504
|
* @param {Address} address
|
|
502
|
-
* @param {?WriteParams
|
|
503
|
-
* @returns {
|
|
505
|
+
* @param {?WriteParams} [params]
|
|
506
|
+
* @returns {Promise<void>}
|
|
504
507
|
*/
|
|
505
508
|
public async setValidatorCaller(
|
|
506
509
|
address: Address,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest';
|
|
2
|
-
import { defaultOptions } from '
|
|
3
|
-
import { testAccount } from '
|
|
2
|
+
import { defaultOptions } from '@boostxyz/test/helpers';
|
|
3
|
+
import { testAccount } from '@boostxyz/test/viem';
|
|
4
4
|
import { SignerValidator } from './SignerValidator';
|
|
5
5
|
import { validatorFromAddress } from './Validator';
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ export const ValidatorByComponentInterface = {
|
|
|
32
32
|
* @async
|
|
33
33
|
* @param {DeployableOptions} options
|
|
34
34
|
* @param {Address} address
|
|
35
|
-
* @returns {
|
|
35
|
+
* @returns {Promise<Validator>}
|
|
36
36
|
* @throws {@link InvalidComponentInterfaceError}
|
|
37
37
|
*/
|
|
38
38
|
export async function validatorFromAddress(
|
package/src/claiming.ts
CHANGED
|
@@ -40,7 +40,7 @@ export interface ClaimPayload {
|
|
|
40
40
|
* @param {ClaimPayload} param0
|
|
41
41
|
* @param {Address} param0.target - The address of the recipient
|
|
42
42
|
* @param {Hex} [param0.data=zeroHash] - The implementation-specific data for the claim, if needed
|
|
43
|
-
* @returns {
|
|
43
|
+
* @returns {Hex}
|
|
44
44
|
*/
|
|
45
45
|
export const prepareClaimPayload = ({
|
|
46
46
|
target,
|
package/src/errors.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type AbiEvent,
|
|
3
|
+
type AbiFunction,
|
|
2
4
|
type Hex,
|
|
3
5
|
type Log,
|
|
4
6
|
type WaitForTransactionReceiptReturnType,
|
|
5
7
|
zeroHash,
|
|
6
8
|
} from 'viem';
|
|
7
9
|
import type { Criteria } from './Actions/EventAction';
|
|
10
|
+
import type { EventLogs } from './Actions/EventAction';
|
|
8
11
|
import type { BoostRegistry } from './BoostRegistry';
|
|
9
12
|
import type { Incentive } from './Incentives/Incentive';
|
|
10
13
|
|
|
@@ -84,7 +87,7 @@ export class DeployableAlreadyDeployedError extends Error {
|
|
|
84
87
|
*/
|
|
85
88
|
constructor(address: string) {
|
|
86
89
|
super(
|
|
87
|
-
|
|
90
|
+
'Attempted to deploy a contract that already has an address configured',
|
|
88
91
|
);
|
|
89
92
|
this.address = address;
|
|
90
93
|
}
|
|
@@ -248,6 +251,44 @@ export class InvalidComponentInterfaceError extends Error {
|
|
|
248
251
|
}
|
|
249
252
|
}
|
|
250
253
|
|
|
254
|
+
/**
|
|
255
|
+
* This error is thrown when a param is not transparently stored onchain
|
|
256
|
+
*
|
|
257
|
+
* @export
|
|
258
|
+
* @class UnparseableAbiParamError
|
|
259
|
+
* @typedef {UnparseableAbiParamError}
|
|
260
|
+
* @extends {Error}
|
|
261
|
+
*/
|
|
262
|
+
export class UnparseableAbiParamError extends Error {
|
|
263
|
+
/**
|
|
264
|
+
* the param index that is unparseable
|
|
265
|
+
*
|
|
266
|
+
* @type {number}
|
|
267
|
+
*/
|
|
268
|
+
input_param_idx: number;
|
|
269
|
+
/**
|
|
270
|
+
* The given event that contains the unparseable param
|
|
271
|
+
*
|
|
272
|
+
* @type {AbiEvent}
|
|
273
|
+
*/
|
|
274
|
+
event: AbiEvent;
|
|
275
|
+
/**
|
|
276
|
+
* Creates an instance of UnknownTransferPayloadSupplied.
|
|
277
|
+
*
|
|
278
|
+
* @constructor
|
|
279
|
+
* @param {number} input_param_idx
|
|
280
|
+
* @param {AbiEvent} event
|
|
281
|
+
*/
|
|
282
|
+
constructor(input_param_idx: number, event: AbiEvent) {
|
|
283
|
+
super(
|
|
284
|
+
`Parameter is not transparently stored onchain. Parameter ${input_param_idx} in event ${event.name} cannot be used in an action`,
|
|
285
|
+
{ cause: event },
|
|
286
|
+
);
|
|
287
|
+
this.event = event;
|
|
288
|
+
this.input_param_idx = input_param_idx;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
251
292
|
/**
|
|
252
293
|
* This error is thrown when attempting a Budget transfer and arguments aren't of the type `FungibleTransferPayload` or `ERC1155TransferPayload`
|
|
253
294
|
*
|
|
@@ -380,6 +421,48 @@ export class TooManyEventActionStepsProvidedError extends Error {
|
|
|
380
421
|
}
|
|
381
422
|
}
|
|
382
423
|
|
|
424
|
+
/**
|
|
425
|
+
* The error is thrown when trying to reuse an existing deployed Incentive that isn't a base implementation.
|
|
426
|
+
*
|
|
427
|
+
* @export
|
|
428
|
+
* @class ValidationAbiMissingError
|
|
429
|
+
* @typedef {ValidationAbiMissingError}
|
|
430
|
+
* @extends {Error}
|
|
431
|
+
*/
|
|
432
|
+
export class ValidationAbiMissingError extends Error {
|
|
433
|
+
/**
|
|
434
|
+
* Creates an instance of ValidationAbiMissingError.
|
|
435
|
+
*
|
|
436
|
+
* @constructor
|
|
437
|
+
* @param {Hex} signature
|
|
438
|
+
*/
|
|
439
|
+
constructor(signature: Hex) {
|
|
440
|
+
super(`No known ABI for given signature: ${signature}`);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Function action validation context to help debug other validation errors
|
|
446
|
+
*
|
|
447
|
+
* @interface FunctionActionValidationMeta
|
|
448
|
+
* @typedef {FunctionActionValidationMeta}
|
|
449
|
+
*/
|
|
450
|
+
interface FunctionActionValidationMeta {
|
|
451
|
+
decodedArgs: readonly (string | bigint)[];
|
|
452
|
+
/**
|
|
453
|
+
* The value pulled off the log being validated against
|
|
454
|
+
*
|
|
455
|
+
* @type {*}
|
|
456
|
+
* biome-ignore lint/suspicious/noExplicitAny: this can be a few different types based on what the log emits
|
|
457
|
+
*/
|
|
458
|
+
fieldValue: any;
|
|
459
|
+
/**
|
|
460
|
+
* The criteria being used to compare during validation
|
|
461
|
+
*
|
|
462
|
+
* @type {Criteria}
|
|
463
|
+
*/
|
|
464
|
+
criteria: Criteria;
|
|
465
|
+
}
|
|
383
466
|
/**
|
|
384
467
|
* Event action validation context to help debug other validation errors
|
|
385
468
|
*
|
|
@@ -392,7 +475,7 @@ interface EventActionValidationMeta {
|
|
|
392
475
|
*
|
|
393
476
|
* @type {Log}
|
|
394
477
|
*/
|
|
395
|
-
log
|
|
478
|
+
log?: EventLogs[0];
|
|
396
479
|
/**
|
|
397
480
|
* The value pulled off the log being validated against
|
|
398
481
|
*
|
|
@@ -413,17 +496,23 @@ interface EventActionValidationMeta {
|
|
|
413
496
|
* Instantiated with relevent context data for more in depth debugging.
|
|
414
497
|
*
|
|
415
498
|
* @export
|
|
416
|
-
* @class
|
|
417
|
-
* @typedef {
|
|
499
|
+
* @class FieldActionValidationError
|
|
500
|
+
* @typedef {FieldActionValidationError}
|
|
418
501
|
* @extends {Error}
|
|
419
502
|
*/
|
|
420
|
-
export class
|
|
503
|
+
export class FieldActionValidationError extends Error {
|
|
504
|
+
/**
|
|
505
|
+
* The function input arguments being validated against
|
|
506
|
+
*
|
|
507
|
+
* @type {decodedArgs}
|
|
508
|
+
*/
|
|
509
|
+
decodedArgs?: readonly (string | bigint)[];
|
|
421
510
|
/**
|
|
422
511
|
* The viem log being validated against
|
|
423
512
|
*
|
|
424
513
|
* @type {Log}
|
|
425
514
|
*/
|
|
426
|
-
log
|
|
515
|
+
log?: EventLogs[0];
|
|
427
516
|
/**
|
|
428
517
|
* The value pulled off the log being validated against
|
|
429
518
|
*
|
|
@@ -438,7 +527,7 @@ export class EventActionValidationError extends Error {
|
|
|
438
527
|
*/
|
|
439
528
|
criteria: Criteria;
|
|
440
529
|
/**
|
|
441
|
-
* Creates an instance of
|
|
530
|
+
* Creates an instance of FieldActionValidationError.
|
|
442
531
|
*
|
|
443
532
|
* @constructor
|
|
444
533
|
* @param {string} message
|
|
@@ -449,12 +538,48 @@ export class EventActionValidationError extends Error {
|
|
|
449
538
|
*/
|
|
450
539
|
constructor(
|
|
451
540
|
message: string,
|
|
452
|
-
{
|
|
541
|
+
{
|
|
542
|
+
fieldValue,
|
|
543
|
+
criteria,
|
|
544
|
+
...args
|
|
545
|
+
}: EventActionValidationMeta | FunctionActionValidationMeta,
|
|
453
546
|
) {
|
|
454
547
|
super(message);
|
|
455
548
|
this.fieldValue = fieldValue;
|
|
456
549
|
this.criteria = criteria;
|
|
457
|
-
|
|
550
|
+
|
|
551
|
+
switch (true) {
|
|
552
|
+
case 'log' in args:
|
|
553
|
+
this.log = args.log;
|
|
554
|
+
break;
|
|
555
|
+
case 'decodedArgs' in args:
|
|
556
|
+
this.decodedArgs = args.decodedArgs;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Thrown when abi-decoded args on log is undefined
|
|
563
|
+
*
|
|
564
|
+
* @export
|
|
565
|
+
* @class FieldValueUndefinedError
|
|
566
|
+
* @typedef {FieldValueUndefinedError}
|
|
567
|
+
* @extends {FieldActionValidationError}
|
|
568
|
+
*/
|
|
569
|
+
export class DecodedArgsMalformedError extends FieldActionValidationError {
|
|
570
|
+
/**
|
|
571
|
+
* Creates an instance of DecodedArgsUndefinedError.
|
|
572
|
+
*
|
|
573
|
+
* @constructor
|
|
574
|
+
* @param {DecodedArgsMalformedError} metadata
|
|
575
|
+
*/
|
|
576
|
+
constructor(
|
|
577
|
+
metadata: EventActionValidationMeta | FunctionActionValidationMeta,
|
|
578
|
+
) {
|
|
579
|
+
super(
|
|
580
|
+
'Decoded Args are malformed; Check which params are indexed',
|
|
581
|
+
metadata,
|
|
582
|
+
);
|
|
458
583
|
}
|
|
459
584
|
}
|
|
460
585
|
|
|
@@ -464,16 +589,18 @@ export class EventActionValidationError extends Error {
|
|
|
464
589
|
* @export
|
|
465
590
|
* @class FieldValueUndefinedError
|
|
466
591
|
* @typedef {FieldValueUndefinedError}
|
|
467
|
-
* @extends {
|
|
592
|
+
* @extends {FieldActionValidationError}
|
|
468
593
|
*/
|
|
469
|
-
export class FieldValueUndefinedError extends
|
|
594
|
+
export class FieldValueUndefinedError extends FieldActionValidationError {
|
|
470
595
|
/**
|
|
471
596
|
* Creates an instance of FieldValueUndefinedError.
|
|
472
597
|
*
|
|
473
598
|
* @constructor
|
|
474
599
|
* @param {EventActionValidationMeta} metadata
|
|
475
600
|
*/
|
|
476
|
-
constructor(
|
|
601
|
+
constructor(
|
|
602
|
+
metadata: EventActionValidationMeta | FunctionActionValidationMeta,
|
|
603
|
+
) {
|
|
477
604
|
super('Field value is undefined', metadata);
|
|
478
605
|
}
|
|
479
606
|
}
|
|
@@ -484,16 +611,18 @@ export class FieldValueUndefinedError extends EventActionValidationError {
|
|
|
484
611
|
* @export
|
|
485
612
|
* @class InvalidNumericalCriteriaError
|
|
486
613
|
* @typedef {InvalidNumericalCriteriaError}
|
|
487
|
-
* @extends {
|
|
614
|
+
* @extends {FieldActionValidationError}
|
|
488
615
|
*/
|
|
489
|
-
export class InvalidNumericalCriteriaError extends
|
|
616
|
+
export class InvalidNumericalCriteriaError extends FieldActionValidationError {
|
|
490
617
|
/**
|
|
491
618
|
* Creates an instance of InvalidNumericalCriteria.
|
|
492
619
|
*
|
|
493
620
|
* @constructor
|
|
494
621
|
* @param {EventActionValidationMeta} metadata
|
|
495
622
|
*/
|
|
496
|
-
constructor(
|
|
623
|
+
constructor(
|
|
624
|
+
metadata: EventActionValidationMeta | FunctionActionValidationMeta,
|
|
625
|
+
) {
|
|
497
626
|
super(
|
|
498
627
|
'Numerical comparisons cannot be used with non-numerical criteria',
|
|
499
628
|
metadata,
|
|
@@ -501,22 +630,51 @@ export class InvalidNumericalCriteriaError extends EventActionValidationError {
|
|
|
501
630
|
}
|
|
502
631
|
}
|
|
503
632
|
|
|
633
|
+
/**
|
|
634
|
+
* Thrown when decoding function data fails.
|
|
635
|
+
*
|
|
636
|
+
* @export
|
|
637
|
+
* @class FunctionDataDecodeError
|
|
638
|
+
* @typedef {FunctionDataDecodeError}
|
|
639
|
+
* @extends {Error}
|
|
640
|
+
*/
|
|
641
|
+
export class FunctionDataDecodeError extends Error {
|
|
642
|
+
public abi: AbiFunction[];
|
|
643
|
+
public originalError: Error;
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Creates an instance of FunctionDataDecodeError.
|
|
647
|
+
*
|
|
648
|
+
* @constructor
|
|
649
|
+
* @param {AbiFunction[]} abi - The ABI of the function.
|
|
650
|
+
* @param {Error} originalError - The original error that was thrown.
|
|
651
|
+
*/
|
|
652
|
+
constructor(abi: AbiFunction[], originalError: Error) {
|
|
653
|
+
super(`Failed to decode function data: ${originalError.message}`);
|
|
654
|
+
this.name = 'FunctionDataDecodeError';
|
|
655
|
+
this.abi = abi;
|
|
656
|
+
this.originalError = originalError;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
504
660
|
/**
|
|
505
661
|
* Thrown when an the log's field value is being compared a field type that isn't bytes or string during event action validation
|
|
506
662
|
*
|
|
507
663
|
* @export
|
|
508
664
|
* @class FieldValueNotComparableError
|
|
509
665
|
* @typedef {FieldValueNotComparableError}
|
|
510
|
-
* @extends {
|
|
666
|
+
* @extends {FieldActionValidationError}
|
|
511
667
|
*/
|
|
512
|
-
export class FieldValueNotComparableError extends
|
|
668
|
+
export class FieldValueNotComparableError extends FieldActionValidationError {
|
|
513
669
|
/**
|
|
514
670
|
* Creates an instance of FieldValueNotComparableError.
|
|
515
671
|
*
|
|
516
672
|
* @constructor
|
|
517
673
|
* @param {EventActionValidationMeta} metadata
|
|
518
674
|
*/
|
|
519
|
-
constructor(
|
|
675
|
+
constructor(
|
|
676
|
+
metadata: EventActionValidationMeta | FunctionActionValidationMeta,
|
|
677
|
+
) {
|
|
520
678
|
super('Filter can only be used with bytes or string field type', metadata);
|
|
521
679
|
}
|
|
522
680
|
}
|
|
@@ -527,16 +685,182 @@ export class FieldValueNotComparableError extends EventActionValidationError {
|
|
|
527
685
|
* @export
|
|
528
686
|
* @class UnrecognizedFilterTypeError
|
|
529
687
|
* @typedef {UnrecognizedFilterTypeError}
|
|
530
|
-
* @extends {
|
|
688
|
+
* @extends {FieldActionValidationError}
|
|
531
689
|
*/
|
|
532
|
-
export class UnrecognizedFilterTypeError extends
|
|
690
|
+
export class UnrecognizedFilterTypeError extends FieldActionValidationError {
|
|
533
691
|
/**
|
|
534
692
|
* Creates an instance of UnrecognizedFilterTypeError.
|
|
535
693
|
*
|
|
536
694
|
* @constructor
|
|
537
695
|
* @param {EventActionValidationMeta} metadata
|
|
538
696
|
*/
|
|
539
|
-
constructor(
|
|
697
|
+
constructor(
|
|
698
|
+
metadata: EventActionValidationMeta | FunctionActionValidationMeta,
|
|
699
|
+
) {
|
|
540
700
|
super('Invalid FilterType provided', metadata);
|
|
541
701
|
}
|
|
542
702
|
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Thrown when no chain ID is provided in the Wagmi configuration.
|
|
706
|
+
*
|
|
707
|
+
* @export
|
|
708
|
+
* @class NoConnectedChainIdError
|
|
709
|
+
* @typedef {NoConnectedChainIdError}
|
|
710
|
+
* @extends {Error}
|
|
711
|
+
*/
|
|
712
|
+
export class NoConnectedChainIdError extends Error {
|
|
713
|
+
/**
|
|
714
|
+
* Creates an instance of NoConnectedChainIdError.
|
|
715
|
+
*
|
|
716
|
+
* @constructor
|
|
717
|
+
*/
|
|
718
|
+
constructor() {
|
|
719
|
+
super(
|
|
720
|
+
'Provided Wagmi configuration does not define `chainId` property with which to target protocol contracts',
|
|
721
|
+
);
|
|
722
|
+
this.name = 'NoConnectedChainIdError';
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Thrown when an invalid chain ID is provided that doesn't match any deployed protocol.
|
|
728
|
+
*
|
|
729
|
+
* @export
|
|
730
|
+
* @class InvalidProtocolChainIdError
|
|
731
|
+
* @typedef {InvalidProtocolChainIdError}
|
|
732
|
+
* @extends {Error}
|
|
733
|
+
*/
|
|
734
|
+
export class InvalidProtocolChainIdError extends Error {
|
|
735
|
+
/**
|
|
736
|
+
* Creates an instance of InvalidProtocolChainIdError.
|
|
737
|
+
*
|
|
738
|
+
* @constructor
|
|
739
|
+
* @param {number} chainId - The chain ID provided in the configuration.
|
|
740
|
+
* @param {number[]} validChainIds - A list of valid chain IDs where the protocol is deployed.
|
|
741
|
+
*/
|
|
742
|
+
constructor(chainId: number, validChainIds: number[]) {
|
|
743
|
+
super(
|
|
744
|
+
`Provided Wagmi configuration supplied a "chainId" where protocol is not deployed, provided: ${chainId}, but valid chains are: ${validChainIds}`,
|
|
745
|
+
);
|
|
746
|
+
this.name = 'InvalidProtocolChainIdError';
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Thrown when the incentive criteria cannot be fetched from the contract.
|
|
752
|
+
*
|
|
753
|
+
* @export
|
|
754
|
+
* @class IncentiveCriteriaNotFoundError
|
|
755
|
+
* @typedef {IncentiveCriteriaNotFoundError}
|
|
756
|
+
* @extends {Error}
|
|
757
|
+
*/
|
|
758
|
+
export class IncentiveCriteriaNotFoundError extends Error {
|
|
759
|
+
/**
|
|
760
|
+
* Creates an instance of IncentiveCriteriaNotFoundError.
|
|
761
|
+
*
|
|
762
|
+
* @constructor
|
|
763
|
+
* @param {Error} [e] - Optional error object for further context.
|
|
764
|
+
* @param {string} [message='Unable to fetch Incentive Criteria from contract'] - Custom error message.
|
|
765
|
+
*/
|
|
766
|
+
constructor(
|
|
767
|
+
e?: Error,
|
|
768
|
+
message = 'Unable to fetch Incentive Criteria from contract',
|
|
769
|
+
) {
|
|
770
|
+
super(message + (e ? `: ${e.message}` : ''));
|
|
771
|
+
this.name = 'IncentiveCriteriaNotFoundError';
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Thrown when no matching logs are found for a given event signature.
|
|
777
|
+
*
|
|
778
|
+
* @export
|
|
779
|
+
* @class NoMatchingLogsError
|
|
780
|
+
* @typedef {NoMatchingLogsError}
|
|
781
|
+
* @extends {Error}
|
|
782
|
+
*/
|
|
783
|
+
export class NoMatchingLogsError extends Error {
|
|
784
|
+
/**
|
|
785
|
+
* Creates an instance of NoMatchingLogsError.
|
|
786
|
+
*
|
|
787
|
+
* @constructor
|
|
788
|
+
* @param {string} signature - The event signature for which logs are being searched.
|
|
789
|
+
* @param {string} [message] - Optional custom error message.
|
|
790
|
+
*/
|
|
791
|
+
constructor(
|
|
792
|
+
signature: string,
|
|
793
|
+
message = `No logs found for event signature ${signature}`,
|
|
794
|
+
) {
|
|
795
|
+
super(message);
|
|
796
|
+
this.name = 'NoMatchingLogsError';
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Thrown when an invalid criteria type is provided.
|
|
802
|
+
*
|
|
803
|
+
* @export
|
|
804
|
+
* @class InvalidCriteriaTypeError
|
|
805
|
+
* @typedef {InvalidCriteriaTypeError}
|
|
806
|
+
* @extends {Error}
|
|
807
|
+
*/
|
|
808
|
+
export class InvalidCriteriaTypeError extends Error {
|
|
809
|
+
/**
|
|
810
|
+
* Creates an instance of InvalidCriteriaTypeError.
|
|
811
|
+
*
|
|
812
|
+
* @constructor
|
|
813
|
+
* @param {string} [criteriaType='unknown'] - The invalid criteria type that was provided.
|
|
814
|
+
* @param {string} [message] - Optional custom error message.
|
|
815
|
+
*/
|
|
816
|
+
constructor(
|
|
817
|
+
criteriaType = 'unknown',
|
|
818
|
+
message = `Invalid criteria type ${criteriaType}`,
|
|
819
|
+
) {
|
|
820
|
+
super(message);
|
|
821
|
+
this.name = 'InvalidCriteriaTypeError';
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Thrown when decoding function arguments fails.
|
|
827
|
+
*
|
|
828
|
+
* @export
|
|
829
|
+
* @class DecodedArgsError
|
|
830
|
+
* @typedef {DecodedArgsError}
|
|
831
|
+
* @extends {Error}
|
|
832
|
+
*/
|
|
833
|
+
export class DecodedArgsError extends Error {
|
|
834
|
+
/**
|
|
835
|
+
* Creates an instance of DecodedArgsError.
|
|
836
|
+
*
|
|
837
|
+
* @constructor
|
|
838
|
+
* @param {string} [message='Issue decoding args'] - Custom error message.
|
|
839
|
+
*/
|
|
840
|
+
constructor(message = 'Issue decoding args') {
|
|
841
|
+
super(message);
|
|
842
|
+
this.name = 'DecodedArgsError';
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Thrown when reading a Boost that does not exist
|
|
848
|
+
*
|
|
849
|
+
* @export
|
|
850
|
+
* @class BoostNotFoundError
|
|
851
|
+
* @typedef {BoostNotFoundError}
|
|
852
|
+
* @extends {Error}
|
|
853
|
+
*/
|
|
854
|
+
export class BoostNotFoundError extends Error {
|
|
855
|
+
public readonly id: string;
|
|
856
|
+
/**
|
|
857
|
+
* Creates an instance of BoostNotFoundError.
|
|
858
|
+
*
|
|
859
|
+
* @constructor
|
|
860
|
+
* @param {string} [id] - stringified boost id that does not exist
|
|
861
|
+
*/
|
|
862
|
+
constructor(id: string) {
|
|
863
|
+
super(`Boost with not found with id: ${id}`);
|
|
864
|
+
this.id = id;
|
|
865
|
+
}
|
|
866
|
+
}
|