@boostxyz/sdk 0.0.0-alpha.11 → 0.0.0-alpha.13

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.
Files changed (154) hide show
  1. package/dist/Actions/Action.cjs +1 -1
  2. package/dist/Actions/Action.js +1 -1
  3. package/dist/Actions/ContractAction.d.ts +2 -2
  4. package/dist/Actions/ContractAction.d.ts.map +1 -1
  5. package/dist/Actions/ERC721MintAction.d.ts +2 -2
  6. package/dist/Actions/ERC721MintAction.d.ts.map +1 -1
  7. package/dist/Actions/EventAction.cjs +1 -1
  8. package/dist/Actions/EventAction.cjs.map +1 -1
  9. package/dist/Actions/EventAction.d.ts +117 -33
  10. package/dist/Actions/EventAction.d.ts.map +1 -1
  11. package/dist/Actions/EventAction.js +309 -121
  12. package/dist/Actions/EventAction.js.map +1 -1
  13. package/dist/AllowLists/AllowList.cjs +1 -1
  14. package/dist/AllowLists/AllowList.js +2 -2
  15. package/dist/AllowLists/SimpleAllowList.cjs +1 -1
  16. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -1
  17. package/dist/AllowLists/SimpleAllowList.d.ts +2 -2
  18. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -1
  19. package/dist/AllowLists/SimpleAllowList.js +23 -19
  20. package/dist/AllowLists/SimpleAllowList.js.map +1 -1
  21. package/dist/AllowLists/SimpleDenyList.cjs +1 -1
  22. package/dist/AllowLists/SimpleDenyList.d.ts +2 -2
  23. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -1
  24. package/dist/AllowLists/SimpleDenyList.js +6 -5
  25. package/dist/AllowLists/SimpleDenyList.js.map +1 -1
  26. package/dist/Auth/PassthroughAuth.cjs +1 -1
  27. package/dist/Auth/PassthroughAuth.js +1 -1
  28. package/dist/BoostCore.cjs +2 -2
  29. package/dist/BoostCore.cjs.map +1 -1
  30. package/dist/BoostCore.d.ts +27 -5
  31. package/dist/BoostCore.d.ts.map +1 -1
  32. package/dist/BoostCore.js +438 -347
  33. package/dist/BoostCore.js.map +1 -1
  34. package/dist/BoostRegistry.cjs +1 -1
  35. package/dist/BoostRegistry.cjs.map +1 -1
  36. package/dist/BoostRegistry.d.ts +26 -5
  37. package/dist/BoostRegistry.d.ts.map +1 -1
  38. package/dist/BoostRegistry.js +125 -64
  39. package/dist/BoostRegistry.js.map +1 -1
  40. package/dist/Budgets/Budget.cjs +1 -1
  41. package/dist/Budgets/Budget.js +1 -1
  42. package/dist/Budgets/ManagedBudget.cjs +1 -1
  43. package/dist/Budgets/ManagedBudget.cjs.map +1 -1
  44. package/dist/Budgets/ManagedBudget.d.ts +2 -2
  45. package/dist/Budgets/ManagedBudget.d.ts.map +1 -1
  46. package/dist/Budgets/ManagedBudget.js +41 -37
  47. package/dist/Budgets/ManagedBudget.js.map +1 -1
  48. package/dist/Budgets/SimpleBudget.d.ts +2 -2
  49. package/dist/Budgets/SimpleBudget.d.ts.map +1 -1
  50. package/dist/Budgets/VestingBudget.d.ts +2 -2
  51. package/dist/Budgets/VestingBudget.d.ts.map +1 -1
  52. package/dist/Deployable/DeployableTarget.cjs +1 -1
  53. package/dist/Deployable/DeployableTarget.cjs.map +1 -1
  54. package/dist/Deployable/DeployableTarget.d.ts +6 -6
  55. package/dist/Deployable/DeployableTarget.d.ts.map +1 -1
  56. package/dist/Deployable/DeployableTarget.js +22 -17
  57. package/dist/Deployable/DeployableTarget.js.map +1 -1
  58. package/dist/Incentives/AllowListIncentive.cjs +1 -1
  59. package/dist/Incentives/AllowListIncentive.cjs.map +1 -1
  60. package/dist/Incentives/AllowListIncentive.d.ts +2 -2
  61. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -1
  62. package/dist/Incentives/AllowListIncentive.js +17 -13
  63. package/dist/Incentives/AllowListIncentive.js.map +1 -1
  64. package/dist/Incentives/CGDAIncentive.cjs +1 -1
  65. package/dist/Incentives/CGDAIncentive.cjs.map +1 -1
  66. package/dist/Incentives/CGDAIncentive.d.ts +14 -2
  67. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -1
  68. package/dist/Incentives/CGDAIncentive.js +27 -23
  69. package/dist/Incentives/CGDAIncentive.js.map +1 -1
  70. package/dist/Incentives/ERC1155Incentive.d.ts +2 -2
  71. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -1
  72. package/dist/Incentives/ERC20Incentive.cjs +1 -1
  73. package/dist/Incentives/ERC20Incentive.cjs.map +1 -1
  74. package/dist/Incentives/ERC20Incentive.d.ts +2 -2
  75. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -1
  76. package/dist/Incentives/ERC20Incentive.js +17 -13
  77. package/dist/Incentives/ERC20Incentive.js.map +1 -1
  78. package/dist/Incentives/ERC20VariableIncentive.d.ts +2 -2
  79. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -1
  80. package/dist/Incentives/Incentive.cjs +1 -1
  81. package/dist/Incentives/Incentive.cjs.map +1 -1
  82. package/dist/Incentives/Incentive.js +34 -30
  83. package/dist/Incentives/Incentive.js.map +1 -1
  84. package/dist/Incentives/PointsIncentive.cjs +1 -1
  85. package/dist/Incentives/PointsIncentive.cjs.map +1 -1
  86. package/dist/Incentives/PointsIncentive.d.ts +2 -2
  87. package/dist/Incentives/PointsIncentive.d.ts.map +1 -1
  88. package/dist/Incentives/PointsIncentive.js +13 -9
  89. package/dist/Incentives/PointsIncentive.js.map +1 -1
  90. package/dist/{SimpleDenyList-4PtOPXTc.js → SimpleDenyList-C21O9Yfi.js} +23 -19
  91. package/dist/SimpleDenyList-C21O9Yfi.js.map +1 -0
  92. package/dist/SimpleDenyList-DeJRKD2D.cjs +2 -0
  93. package/dist/{SimpleDenyList-4PtOPXTc.js.map → SimpleDenyList-DeJRKD2D.cjs.map} +1 -1
  94. package/dist/Validators/SignerValidator.cjs +1 -1
  95. package/dist/Validators/SignerValidator.cjs.map +1 -1
  96. package/dist/Validators/SignerValidator.d.ts +2 -2
  97. package/dist/Validators/SignerValidator.d.ts.map +1 -1
  98. package/dist/Validators/SignerValidator.js +18 -14
  99. package/dist/Validators/SignerValidator.js.map +1 -1
  100. package/dist/Validators/Validator.cjs +1 -1
  101. package/dist/Validators/Validator.js +1 -1
  102. package/dist/deployments-BvFcK_eR.js +40 -0
  103. package/dist/deployments-BvFcK_eR.js.map +1 -0
  104. package/dist/deployments-Ho4PnGCS.cjs +2 -0
  105. package/dist/deployments-Ho4PnGCS.cjs.map +1 -0
  106. package/dist/deployments.json +38 -0
  107. package/dist/errors.cjs +1 -1
  108. package/dist/errors.cjs.map +1 -1
  109. package/dist/errors.d.ts +122 -20
  110. package/dist/errors.d.ts.map +1 -1
  111. package/dist/errors.js +98 -28
  112. package/dist/errors.js.map +1 -1
  113. package/dist/{generated-BDeDiaCK.js → generated-LpgSHrH0.js} +150 -110
  114. package/dist/generated-LpgSHrH0.js.map +1 -0
  115. package/dist/generated-tq_HLZJ0.cjs +3 -0
  116. package/dist/generated-tq_HLZJ0.cjs.map +1 -0
  117. package/dist/index.cjs +1 -1
  118. package/dist/index.js +115 -108
  119. package/dist/utils.cjs +1 -1
  120. package/dist/utils.cjs.map +1 -1
  121. package/dist/utils.d.ts +25 -11
  122. package/dist/utils.d.ts.map +1 -1
  123. package/dist/utils.js +38 -23
  124. package/dist/utils.js.map +1 -1
  125. package/package.json +10 -6
  126. package/src/Actions/Action.test.ts +8 -4
  127. package/src/Actions/ContractAction.ts +5 -3
  128. package/src/Actions/ERC721MintAction.ts +5 -3
  129. package/src/Actions/EventAction.test.ts +528 -100
  130. package/src/Actions/EventAction.ts +302 -60
  131. package/src/AllowLists/AllowList.test.ts +1 -1
  132. package/src/AllowLists/SimpleAllowList.ts +6 -3
  133. package/src/AllowLists/SimpleDenyList.ts +6 -3
  134. package/src/BoostCore.test.ts +31 -91
  135. package/src/BoostCore.ts +137 -34
  136. package/src/BoostRegistry.ts +89 -21
  137. package/src/Budgets/ManagedBudget.ts +6 -4
  138. package/src/Budgets/SimpleBudget.ts +4 -3
  139. package/src/Budgets/VestingBudget.ts +4 -3
  140. package/src/Deployable/DeployableTarget.ts +22 -11
  141. package/src/Incentives/AllowListIncentive.ts +6 -3
  142. package/src/Incentives/CGDAIncentive.ts +6 -3
  143. package/src/Incentives/ERC1155Incentive.ts +4 -3
  144. package/src/Incentives/ERC20Incentive.ts +6 -3
  145. package/src/Incentives/ERC20VariableIncentive.ts +6 -3
  146. package/src/Incentives/PointsIncentive.ts +6 -3
  147. package/src/Validators/SignerValidator.ts +6 -3
  148. package/src/errors.ts +177 -21
  149. package/src/utils.ts +60 -11
  150. package/dist/SimpleDenyList-CqT0BMP7.cjs +0 -2
  151. package/dist/SimpleDenyList-CqT0BMP7.cjs.map +0 -1
  152. package/dist/generated-BDeDiaCK.js.map +0 -1
  153. package/dist/generated-wKBNvm48.cjs +0 -3
  154. package/dist/generated-wKBNvm48.cjs.map +0 -1
@@ -0,0 +1,38 @@
1
+ {
2
+ "AllowListIncentive": {
3
+ "11155111": "0x8d80dfac4927387E6819B76b850aF50d2E29835a"
4
+ },
5
+ "BoostCore": {
6
+ "11155111": "0x0561e8fB1EFD614eb905CB93D548Bb217Ad07B92"
7
+ },
8
+ "BoostRegistry": {
9
+ "11155111": "0x6659255D4Aa39a975c7C841D5d898969fc3F75aa"
10
+ },
11
+ "CGDAIncentive": {
12
+ "11155111": "0x47d4cF86829cAf2e410E7D08005e37b51B8c19A4"
13
+ },
14
+ "ERC20Incentive": {
15
+ "11155111": "0x3efa476a81Bcf5426aA4b026CEC588EA3839dB18"
16
+ },
17
+ "ERC20VariableIncentive": {
18
+ "11155111": "0x08AC38DB2f723Db15fa8Cd6c7Bb12C5dA5743875"
19
+ },
20
+ "EventAction": {
21
+ "11155111": "0x2bD655240116b18f5b9F24E4b7b51B87B7b33D37"
22
+ },
23
+ "ManagedBudget": {
24
+ "11155111": "0xC7091Ca16F98C661F3B64b4fA0D85ffFFE93f5BD"
25
+ },
26
+ "PointsIncentive": {
27
+ "11155111": "0xcE8f0F83afea8514287bcb74cf82F40A7Acc6e95"
28
+ },
29
+ "SignerValidator": {
30
+ "11155111": "0x9d08826e771BD939088d5eAc28E0c8864dcb98cf"
31
+ },
32
+ "SimpleAllowList": {
33
+ "11155111": "0x9A3848B6B35d406d758892C6b4b00042cCbc96AD"
34
+ },
35
+ "SimpleDenyList": {
36
+ "11155111": "0x7eb4E958D42b64fd1c4Ce947d05a755fCC7C30B7"
37
+ }
38
+ }
package/dist/errors.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=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 y extends Error{constructor(r){super("Expected a contract address to exist on receipt.",{cause:r}),this.receipt=r}}class v extends Error{constructor(r,t){super("Address provided does not match any expected protocol interface",{cause:{expected:r,received:t}}),this.expected=[],this.received=a.zeroHash,this.expected=r,this.received=t}}class m extends Error{constructor(r){super("Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.",{cause:r}),this.received=r}}class b extends Error{constructor(r){super(`Budget needs to explicitly authorize ${r}. You can retrieve this value from BoostCore.address`)}}class g extends Error{constructor(){super("Budgets must be preinitialized before being used with a new Boost")}}class h extends Error{constructor(r){super(`Incentive not cloneable: ${r.constructor.name}`)}}class x extends Error{constructor(){super("Must supply at least one action step")}}class f extends Error{constructor(){super("Cannot supply more than 4 action steps with current protocol version")}}class o extends Error{constructor(r,{fieldValue:t,criteria:s,log:n}){super(r),this.fieldValue=t,this.criteria=s,this.log=n}}class C extends o{constructor(r){super("Field value is undefined",r)}}class A extends o{constructor(r){super("Numerical comparisons cannot be used with non-numerical criteria",r)}}class I extends o{constructor(r){super("Filter can only be used with bytes or string field type",r)}}class w extends o{constructor(r){super("Invalid FilterType provided",r)}}exports.BoostCoreNoIdentifierEmitted=i;exports.BudgetMustAuthorizeBoostCore=b;exports.ContractAddressRequiredError=d;exports.DeployableAlreadyDeployedError=c;exports.DeployableBuildParametersUnspecifiedError=l;exports.DeployableMissingPayloadError=E;exports.DeployableUnknownOwnerProvidedError=u;exports.DeployableWagmiConfigurationRequiredError=p;exports.EventActionValidationError=o;exports.FieldValueNotComparableError=I;exports.FieldValueUndefinedError=C;exports.IncentiveNotCloneableError=h;exports.InvalidComponentInterfaceError=v;exports.InvalidNumericalCriteriaError=A;exports.MustInitializeBudgetError=g;exports.NoContractAddressUponReceiptError=y;exports.NoEventActionStepsProvidedError=x;exports.TooManyEventActionStepsProvidedError=f;exports.UnknownTransferPayloadSupplied=m;exports.UnrecognizedFilterTypeError=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=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 h extends Error{constructor(r){super("Expected a contract address to exist on receipt.",{cause:r}),this.receipt=r}}class m extends Error{constructor(r,o){super("Address provided does not match any expected protocol interface",{cause:{expected:r,received:o}}),this.expected=[],this.received=a.zeroHash,this.expected=r,this.received=o}}class y 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 g extends Error{constructor(r){super("Did not provide a valid FungibleTransferPayload or ERC1155 transfer payload.",{cause:r}),this.received=r}}class v extends Error{constructor(r){super(`Budget needs to explicitly authorize ${r}. You can retrieve this value from BoostCore.address`)}}class b 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 C extends Error{constructor(){super("Cannot supply more than 4 action steps with current protocol version")}}class t extends Error{constructor(r,{fieldValue:o,criteria:n,...s}){switch(super(r),this.fieldValue=o,this.criteria=n,!0){case"log"in s:this.log=s.log;break;case"decodedArgs"in s:this.decodedArgs=s.decodedArgs}}}class A extends t{constructor(r){super("Decoded Args are malformed; Check which params are indexed",r)}}class D extends t{constructor(r){super("Field value is undefined",r)}}class I extends t{constructor(r){super("Numerical comparisons cannot be used with non-numerical criteria",r)}}class P extends Error{constructor(r,o){super(`Failed to decode function data: ${o.message}`),this.name="FunctionDataDecodeError",this.abi=r,this.originalError=o}}class w extends t{constructor(r){super("Filter can only be used with bytes or string field type",r)}}class F extends t{constructor(r){super("Invalid FilterType provided",r)}}class N extends Error{constructor(){super("Provided Wagmi configuration does not define `chainId` property with which to target protocol contracts")}}class B extends Error{constructor(r,o){super(`Provided Wagmi configuration supplied a "chainId" where protocol is not deployed, provided: ${r}, but valid chains are: ${o}`)}}exports.BoostCoreNoIdentifierEmitted=i;exports.BudgetMustAuthorizeBoostCore=v;exports.ContractAddressRequiredError=d;exports.DecodedArgsMalformedError=A;exports.DeployableAlreadyDeployedError=c;exports.DeployableBuildParametersUnspecifiedError=l;exports.DeployableMissingPayloadError=E;exports.DeployableUnknownOwnerProvidedError=u;exports.DeployableWagmiConfigurationRequiredError=p;exports.FieldActionValidationError=t;exports.FieldValueNotComparableError=w;exports.FieldValueUndefinedError=D;exports.FunctionDataDecodeError=P;exports.IncentiveNotCloneableError=x;exports.InvalidComponentInterfaceError=m;exports.InvalidNumericalCriteriaError=I;exports.InvalidProtocolChainIdError=B;exports.MustInitializeBudgetError=b;exports.NoConnectedChainIdError=N;exports.NoContractAddressUponReceiptError=h;exports.NoEventActionStepsProvidedError=f;exports.TooManyEventActionStepsProvidedError=C;exports.UnknownTransferPayloadSupplied=g;exports.UnparseableAbiParamError=y;exports.UnrecognizedFilterTypeError=F;
2
2
  //# sourceMappingURL=errors.cjs.map
@@ -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,YA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,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\nexport class NoConnectedChainIdError extends Error {\n constructor() {\n super(\n 'Provided Wagmi configuration does not define `chainId` property with which to target protocol contracts',\n );\n }\n}\n\nexport class InvalidProtocolChainIdError extends Error {\n constructor(chainId: number, validChainIds: number[]) {\n super(\n `Provided Wagmi configuration supplied a \"chainId\" where protocol is not deployed, provided: ${chainId}, but valid chains are: ${validChainIds}`,\n );\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","NoConnectedChainIdError","InvalidProtocolChainIdError","chainId","validChainIds"],"mappings":"wGA6BO,MAAMA,UAAqC,KAAM,CAMtD,aAAc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ACZ,MACE,yGAAA,CAEJ,CACF,CAEO,MAAMC,UAAoC,KAAM,CACrD,YAAYC,EAAiBC,EAAyB,CACpD,MACE,+FAA+FD,CAAO,2BAA2BC,CAAa,EAAA,CAElJ,CACF"}
package/dist/errors.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { type Hex, type Log, type WaitForTransactionReceiptReturnType } from 'viem';
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: 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 EventActionValidationError
337
- * @typedef {EventActionValidationError}
389
+ * @class FieldActionValidationError
390
+ * @typedef {FieldActionValidationError}
338
391
  * @extends {Error}
339
392
  */
340
- export declare class EventActionValidationError extends Error {
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: 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 EventActionValidationError.
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, log }: EventActionValidationMeta);
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 {EventActionValidationError}
454
+ * @extends {FieldActionValidationError}
379
455
  */
380
- export declare class FieldValueUndefinedError extends EventActionValidationError {
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 {EventActionValidationError}
471
+ * @extends {FieldActionValidationError}
396
472
  */
397
- export declare class InvalidNumericalCriteriaError extends EventActionValidationError {
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 {EventActionValidationError}
508
+ * @extends {FieldActionValidationError}
413
509
  */
414
- export declare class FieldValueNotComparableError extends EventActionValidationError {
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,22 @@ export declare class FieldValueNotComparableError extends EventActionValidationE
426
522
  * @export
427
523
  * @class UnrecognizedFilterTypeError
428
524
  * @typedef {UnrecognizedFilterTypeError}
429
- * @extends {EventActionValidationError}
525
+ * @extends {FieldActionValidationError}
430
526
  */
431
- export declare class UnrecognizedFilterTypeError extends EventActionValidationError {
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);
535
+ }
536
+ export declare class NoConnectedChainIdError extends Error {
537
+ constructor();
538
+ }
539
+ export declare class InvalidProtocolChainIdError extends Error {
540
+ constructor(chainId: number, validChainIds: number[]);
439
541
  }
440
542
  export {};
441
543
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,GAAG,EACR,KAAK,mCAAmC,EAEzC,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD;;;;OAIG;;CAIJ;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD;;;;OAIG;;CAIJ;AAED;;;;;;;GAOG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;IACvD;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;gBACS,OAAO,EAAE,MAAM;CAM5B;AAED;;;;;;;GAOG;AACH,qBAAa,yCAA0C,SAAQ,KAAK;IAClE;;;;OAIG;;CAMJ;AAED;;;;;;;GAOG;AACH,qBAAa,mCAAoC,SAAQ,KAAK;IAC5D;;;;OAIG;;CAMJ;AAED;;;;;;;GAOG;AACH,qBAAa,yCAA0C,SAAQ,KAAK;IAClE;;;;OAIG;;CAMJ;AAED;;;;;;;GAOG;AACH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EAAE,yBAAyB,GAAG,4BAA4B;CAc9D;AAED;;;;;;;GAOG;AACH,qBAAa,yBAA0B,SAAQ,0BAA0B;IACvE;;;;;OAKG;gBAED,QAAQ,EAAE,yBAAyB,GAAG,4BAA4B;CAOrE;AAED;;;;;;;GAOG;AACH,qBAAa,wBAAyB,SAAQ,0BAA0B;IACtE;;;;;OAKG;gBAED,QAAQ,EAAE,yBAAyB,GAAG,4BAA4B;CAIrE;AAED;;;;;;;GAOG;AACH,qBAAa,6BAA8B,SAAQ,0BAA0B;IAC3E;;;;;OAKG;gBAED,QAAQ,EAAE,yBAAyB,GAAG,4BAA4B;CAOrE;AAED;;;;;;;GAOG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IACzC,GAAG,EAAE,WAAW,EAAE,CAAC;IACnB,aAAa,EAAE,KAAK,CAAC;IAE5B;;;;;;OAMG;gBACS,GAAG,EAAE,WAAW,EAAE,EAAE,aAAa,EAAE,KAAK;CAMrD;AAED;;;;;;;GAOG;AACH,qBAAa,4BAA6B,SAAQ,0BAA0B;IAC1E;;;;;OAKG;gBAED,QAAQ,EAAE,yBAAyB,GAAG,4BAA4B;CAIrE;AAED;;;;;;;GAOG;AACH,qBAAa,2BAA4B,SAAQ,0BAA0B;IACzE;;;;;OAKG;gBAED,QAAQ,EAAE,yBAAyB,GAAG,4BAA4B;CAIrE;AAED,qBAAa,uBAAwB,SAAQ,KAAK;;CAMjD;AAED,qBAAa,2BAA4B,SAAQ,KAAK;gBACxC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE;CAKrD"}
package/dist/errors.js CHANGED
@@ -1,5 +1,5 @@
1
- import { zeroHash as a } from "viem";
2
- class c extends Error {
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 d extends Error {
12
+ class i extends Error {
13
13
  /**
14
14
  * Creates an instance of ContractAddressRequiredError.
15
15
  *
@@ -68,7 +68,7 @@ class E extends Error {
68
68
  );
69
69
  }
70
70
  }
71
- class x extends Error {
71
+ class h extends Error {
72
72
  /**
73
73
  * Creates an instance of DeployableMissingPayloadError.
74
74
  *
@@ -80,7 +80,7 @@ class x extends Error {
80
80
  );
81
81
  }
82
82
  }
83
- class h extends Error {
83
+ class m extends Error {
84
84
  /**
85
85
  * Creates an instance of NoContractAddressUponReceiptError.
86
86
  *
@@ -93,7 +93,7 @@ class h extends Error {
93
93
  }), this.receipt = r;
94
94
  }
95
95
  }
96
- class m extends Error {
96
+ class x extends Error {
97
97
  /**
98
98
  * Creates an instance of InvalidComponentInterfaceError.
99
99
  *
@@ -104,7 +104,22 @@ class m extends Error {
104
104
  constructor(r, o) {
105
105
  super("Address provided does not match any expected protocol interface", {
106
106
  cause: { expected: r, received: o }
107
- }), this.expected = [], this.received = a, this.expected = r, this.received = o;
107
+ }), this.expected = [], this.received = n, this.expected = r, this.received = o;
108
+ }
109
+ }
110
+ class g 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(r, o) {
119
+ super(
120
+ `Parameter is not transparently stored onchain. Parameter ${r} in event ${o.name} cannot be used in an action`,
121
+ { cause: o }
122
+ ), this.event = o, this.input_param_idx = r;
108
123
  }
109
124
  }
110
125
  class y extends Error {
@@ -142,7 +157,7 @@ class b extends Error {
142
157
  super("Budgets must be preinitialized before being used with a new Boost");
143
158
  }
144
159
  }
145
- class g extends Error {
160
+ class f extends Error {
146
161
  /**
147
162
  * Creates an instance of IncentiveNotCloneableError.
148
163
  *
@@ -153,7 +168,7 @@ class g extends Error {
153
168
  super(`Incentive not cloneable: ${r.constructor.name}`);
154
169
  }
155
170
  }
156
- class f extends Error {
171
+ class w extends Error {
157
172
  /**
158
173
  * Creates an instance of NoEventActionStepsProvidedError.
159
174
  *
@@ -177,7 +192,7 @@ class C extends Error {
177
192
  }
178
193
  class t extends Error {
179
194
  /**
180
- * Creates an instance of EventActionValidationError.
195
+ * Creates an instance of FieldActionValidationError.
181
196
  *
182
197
  * @constructor
183
198
  * @param {string} message
@@ -186,11 +201,35 @@ class t extends Error {
186
201
  * @param {Criteria} param0.criteria
187
202
  * @param {Log} param0.log
188
203
  */
189
- constructor(r, { fieldValue: o, criteria: s, log: n }) {
190
- super(r), this.fieldValue = o, this.criteria = s, this.log = n;
204
+ constructor(r, {
205
+ fieldValue: o,
206
+ criteria: a,
207
+ ...s
208
+ }) {
209
+ switch (super(r), 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
+ }
216
+ }
217
+ }
218
+ class A extends t {
219
+ /**
220
+ * Creates an instance of DecodedArgsUndefinedError.
221
+ *
222
+ * @constructor
223
+ * @param {DecodedArgsMalformedError} metadata
224
+ */
225
+ constructor(r) {
226
+ super(
227
+ "Decoded Args are malformed; Check which params are indexed",
228
+ r
229
+ );
191
230
  }
192
231
  }
193
- class w extends t {
232
+ class D extends t {
194
233
  /**
195
234
  * Creates an instance of FieldValueUndefinedError.
196
235
  *
@@ -201,7 +240,7 @@ class w extends t {
201
240
  super("Field value is undefined", r);
202
241
  }
203
242
  }
204
- class A extends t {
243
+ class I extends t {
205
244
  /**
206
245
  * Creates an instance of InvalidNumericalCriteria.
207
246
  *
@@ -215,7 +254,19 @@ class A extends t {
215
254
  );
216
255
  }
217
256
  }
218
- class B extends t {
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(r, o) {
266
+ super(`Failed to decode function data: ${o.message}`), this.name = "FunctionDataDecodeError", this.abi = r, this.originalError = o;
267
+ }
268
+ }
269
+ class F extends t {
219
270
  /**
220
271
  * Creates an instance of FieldValueNotComparableError.
221
272
  *
@@ -226,7 +277,7 @@ class B extends t {
226
277
  super("Filter can only be used with bytes or string field type", r);
227
278
  }
228
279
  }
229
- class I extends t {
280
+ class B extends t {
230
281
  /**
231
282
  * Creates an instance of UnrecognizedFilterTypeError.
232
283
  *
@@ -237,26 +288,45 @@ class I extends t {
237
288
  super("Invalid FilterType provided", r);
238
289
  }
239
290
  }
291
+ class N extends Error {
292
+ constructor() {
293
+ super(
294
+ "Provided Wagmi configuration does not define `chainId` property with which to target protocol contracts"
295
+ );
296
+ }
297
+ }
298
+ class U extends Error {
299
+ constructor(r, o) {
300
+ super(
301
+ `Provided Wagmi configuration supplied a "chainId" where protocol is not deployed, provided: ${r}, but valid chains are: ${o}`
302
+ );
303
+ }
304
+ }
240
305
  export {
241
- c as BoostCoreNoIdentifierEmitted,
306
+ d as BoostCoreNoIdentifierEmitted,
242
307
  v as BudgetMustAuthorizeBoostCore,
243
- d as ContractAddressRequiredError,
308
+ i as ContractAddressRequiredError,
309
+ A as DecodedArgsMalformedError,
244
310
  l as DeployableAlreadyDeployedError,
245
311
  u as DeployableBuildParametersUnspecifiedError,
246
- x as DeployableMissingPayloadError,
312
+ h as DeployableMissingPayloadError,
247
313
  p as DeployableUnknownOwnerProvidedError,
248
314
  E as DeployableWagmiConfigurationRequiredError,
249
- t as EventActionValidationError,
250
- B as FieldValueNotComparableError,
251
- w as FieldValueUndefinedError,
252
- g as IncentiveNotCloneableError,
253
- m as InvalidComponentInterfaceError,
254
- A as InvalidNumericalCriteriaError,
315
+ t as FieldActionValidationError,
316
+ F as FieldValueNotComparableError,
317
+ D as FieldValueUndefinedError,
318
+ P as FunctionDataDecodeError,
319
+ f as IncentiveNotCloneableError,
320
+ x as InvalidComponentInterfaceError,
321
+ I as InvalidNumericalCriteriaError,
322
+ U as InvalidProtocolChainIdError,
255
323
  b as MustInitializeBudgetError,
256
- h as NoContractAddressUponReceiptError,
257
- f as NoEventActionStepsProvidedError,
324
+ N as NoConnectedChainIdError,
325
+ m as NoContractAddressUponReceiptError,
326
+ w as NoEventActionStepsProvidedError,
258
327
  C as TooManyEventActionStepsProvidedError,
259
328
  y as UnknownTransferPayloadSupplied,
260
- I as UnrecognizedFilterTypeError
329
+ g as UnparseableAbiParamError,
330
+ B as UnrecognizedFilterTypeError
261
331
  };
262
332
  //# sourceMappingURL=errors.js.map