@boostxyz/sdk 0.0.0-alpha.3 → 0.0.0-alpha.6

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 (176) hide show
  1. package/dist/Actions/Action.cjs +2 -1
  2. package/dist/Actions/Action.cjs.map +1 -0
  3. package/dist/Actions/Action.d.ts +1 -1
  4. package/dist/Actions/Action.d.ts.map +1 -1
  5. package/dist/Actions/Action.js +15 -13
  6. package/dist/Actions/Action.js.map +1 -0
  7. package/dist/Actions/EventAction.cjs +1 -0
  8. package/dist/Actions/EventAction.cjs.map +1 -0
  9. package/dist/Actions/EventAction.js +1 -0
  10. package/dist/Actions/EventAction.js.map +1 -0
  11. package/dist/AllowLists/AllowList.cjs +2 -1
  12. package/dist/AllowLists/AllowList.cjs.map +1 -0
  13. package/dist/AllowLists/AllowList.d.ts +1 -2
  14. package/dist/AllowLists/AllowList.d.ts.map +1 -1
  15. package/dist/AllowLists/AllowList.js +16 -14
  16. package/dist/AllowLists/AllowList.js.map +1 -0
  17. package/dist/AllowLists/SimpleAllowList.cjs +1 -0
  18. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
  19. package/dist/AllowLists/SimpleAllowList.js +1 -0
  20. package/dist/AllowLists/SimpleAllowList.js.map +1 -0
  21. package/dist/AllowLists/SimpleDenyList.cjs +1 -0
  22. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
  23. package/dist/AllowLists/SimpleDenyList.js +1 -0
  24. package/dist/AllowLists/SimpleDenyList.js.map +1 -0
  25. package/dist/Auth/Auth.cjs +1 -0
  26. package/dist/Auth/Auth.cjs.map +1 -0
  27. package/dist/Auth/Auth.js +1 -0
  28. package/dist/Auth/Auth.js.map +1 -0
  29. package/dist/Auth/PassthroughAuth.cjs +1 -0
  30. package/dist/Auth/PassthroughAuth.cjs.map +1 -0
  31. package/dist/Auth/PassthroughAuth.js +1 -0
  32. package/dist/Auth/PassthroughAuth.js.map +1 -0
  33. package/dist/Boost.cjs +1 -0
  34. package/dist/Boost.cjs.map +1 -0
  35. package/dist/Boost.js +1 -0
  36. package/dist/Boost.js.map +1 -0
  37. package/dist/BoostCore.cjs +1 -0
  38. package/dist/BoostCore.cjs.map +1 -0
  39. package/dist/BoostCore.js +1 -0
  40. package/dist/BoostCore.js.map +1 -0
  41. package/dist/BoostRegistry.cjs +1 -0
  42. package/dist/BoostRegistry.cjs.map +1 -0
  43. package/dist/BoostRegistry.js +1 -0
  44. package/dist/BoostRegistry.js.map +1 -0
  45. package/dist/Budgets/Budget.cjs +2 -1
  46. package/dist/Budgets/Budget.cjs.map +1 -0
  47. package/dist/Budgets/Budget.d.ts +1 -1
  48. package/dist/Budgets/Budget.d.ts.map +1 -1
  49. package/dist/Budgets/Budget.js +14 -12
  50. package/dist/Budgets/Budget.js.map +1 -0
  51. package/dist/Budgets/ManagedBudget.cjs +1 -0
  52. package/dist/Budgets/ManagedBudget.cjs.map +1 -0
  53. package/dist/Budgets/ManagedBudget.js +1 -0
  54. package/dist/Budgets/ManagedBudget.js.map +1 -0
  55. package/dist/Deployable/Contract.cjs +1 -0
  56. package/dist/Deployable/Contract.cjs.map +1 -0
  57. package/dist/Deployable/Contract.js +1 -0
  58. package/dist/Deployable/Contract.js.map +1 -0
  59. package/dist/Deployable/Deployable.cjs +1 -0
  60. package/dist/Deployable/Deployable.cjs.map +1 -0
  61. package/dist/Deployable/Deployable.js +1 -0
  62. package/dist/Deployable/Deployable.js.map +1 -0
  63. package/dist/Deployable/DeployableTarget.cjs +1 -0
  64. package/dist/Deployable/DeployableTarget.cjs.map +1 -0
  65. package/dist/Deployable/DeployableTarget.js +1 -0
  66. package/dist/Deployable/DeployableTarget.js.map +1 -0
  67. package/dist/Incentives/AllowListIncentive.cjs +1 -0
  68. package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
  69. package/dist/Incentives/AllowListIncentive.js +1 -0
  70. package/dist/Incentives/AllowListIncentive.js.map +1 -0
  71. package/dist/Incentives/CGDAIncentive.cjs +1 -0
  72. package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
  73. package/dist/Incentives/CGDAIncentive.js +1 -0
  74. package/dist/Incentives/CGDAIncentive.js.map +1 -0
  75. package/dist/Incentives/ERC20Incentive.cjs +1 -0
  76. package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
  77. package/dist/Incentives/ERC20Incentive.js +1 -0
  78. package/dist/Incentives/ERC20Incentive.js.map +1 -0
  79. package/dist/Incentives/Incentive.cjs +2 -1
  80. package/dist/Incentives/Incentive.cjs.map +1 -0
  81. package/dist/Incentives/Incentive.d.ts +1 -4
  82. package/dist/Incentives/Incentive.d.ts.map +1 -1
  83. package/dist/Incentives/Incentive.js +39 -36
  84. package/dist/Incentives/Incentive.js.map +1 -0
  85. package/dist/Incentives/PointsIncentive.cjs +1 -0
  86. package/dist/Incentives/PointsIncentive.cjs.map +1 -0
  87. package/dist/Incentives/PointsIncentive.js +1 -0
  88. package/dist/Incentives/PointsIncentive.js.map +1 -0
  89. package/dist/Validators/SignerValidator.cjs +1 -0
  90. package/dist/Validators/SignerValidator.cjs.map +1 -0
  91. package/dist/Validators/SignerValidator.js +1 -0
  92. package/dist/Validators/SignerValidator.js.map +1 -0
  93. package/dist/Validators/Validator.cjs +2 -1
  94. package/dist/Validators/Validator.cjs.map +1 -0
  95. package/dist/Validators/Validator.d.ts +1 -1
  96. package/dist/Validators/Validator.d.ts.map +1 -1
  97. package/dist/Validators/Validator.js +9 -7
  98. package/dist/Validators/Validator.js.map +1 -0
  99. package/dist/componentInterfaces-CKCBwG16.cjs +2 -0
  100. package/dist/componentInterfaces-CKCBwG16.cjs.map +1 -0
  101. package/dist/componentInterfaces-DYkaxBda.js +13 -0
  102. package/dist/componentInterfaces-DYkaxBda.js.map +1 -0
  103. package/dist/errors.cjs +1 -0
  104. package/dist/errors.cjs.map +1 -0
  105. package/dist/errors.js +1 -0
  106. package/dist/errors.js.map +1 -0
  107. package/dist/generated-Cd-Fe7W7.cjs +1 -0
  108. package/dist/generated-Cd-Fe7W7.cjs.map +1 -0
  109. package/dist/generated-DGpIVcv5.js +1 -0
  110. package/dist/generated-DGpIVcv5.js.map +1 -0
  111. package/dist/index.cjs +1 -0
  112. package/dist/index.cjs.map +1 -0
  113. package/dist/index.js +1 -0
  114. package/dist/index.js.map +1 -0
  115. package/dist/utils.cjs +1 -0
  116. package/dist/utils.cjs.map +1 -0
  117. package/dist/utils.d.ts +1 -1
  118. package/dist/utils.d.ts.map +1 -1
  119. package/dist/utils.js +1 -0
  120. package/dist/utils.js.map +1 -0
  121. package/package.json +5 -3
  122. package/src/Actions/Action.test.ts +77 -0
  123. package/src/Actions/Action.ts +61 -0
  124. package/src/Actions/ContractAction.test.ts +199 -0
  125. package/src/Actions/ContractAction.ts +238 -0
  126. package/src/Actions/ERC721MintAction.test.ts +112 -0
  127. package/src/Actions/ERC721MintAction.ts +238 -0
  128. package/src/Actions/EventAction.test.ts +182 -0
  129. package/src/Actions/EventAction.ts +382 -0
  130. package/src/AllowLists/AllowList.test.ts +64 -0
  131. package/src/AllowLists/AllowList.ts +60 -0
  132. package/src/AllowLists/SimpleAllowList.test.ts +52 -0
  133. package/src/AllowLists/SimpleAllowList.ts +240 -0
  134. package/src/AllowLists/SimpleDenyList.test.ts +52 -0
  135. package/src/AllowLists/SimpleDenyList.ts +289 -0
  136. package/src/Auth/Auth.ts +11 -0
  137. package/src/Auth/PassthroughAuth.test.ts +12 -0
  138. package/src/Auth/PassthroughAuth.ts +80 -0
  139. package/src/Boost.ts +155 -0
  140. package/src/BoostCore.test.ts +846 -0
  141. package/src/BoostCore.ts +1192 -0
  142. package/src/BoostRegistry.ts +449 -0
  143. package/src/Budgets/Budget.test.ts +27 -0
  144. package/src/Budgets/Budget.ts +61 -0
  145. package/src/Budgets/ManagedBudget.test.ts +154 -0
  146. package/src/Budgets/ManagedBudget.ts +743 -0
  147. package/src/Budgets/SimpleBudget.test.ts +152 -0
  148. package/src/Budgets/SimpleBudget.ts +521 -0
  149. package/src/Budgets/VestingBudget.test.ts +123 -0
  150. package/src/Budgets/VestingBudget.ts +532 -0
  151. package/src/Deployable/Contract.ts +229 -0
  152. package/src/Deployable/Deployable.ts +244 -0
  153. package/src/Deployable/DeployableTarget.ts +210 -0
  154. package/src/Incentives/AllowListIncentive.test.ts +146 -0
  155. package/src/Incentives/AllowListIncentive.ts +290 -0
  156. package/src/Incentives/CGDAIncentive.test.ts +136 -0
  157. package/src/Incentives/CGDAIncentive.ts +364 -0
  158. package/src/Incentives/ERC1155Incentive.test.ts +98 -0
  159. package/src/Incentives/ERC1155Incentive.ts +384 -0
  160. package/src/Incentives/ERC20Incentive.test.ts +141 -0
  161. package/src/Incentives/ERC20Incentive.ts +417 -0
  162. package/src/Incentives/ERC20VariableIncentive.test.ts +156 -0
  163. package/src/Incentives/ERC20VariableIncentive.ts +368 -0
  164. package/src/Incentives/Incentive.test.ts +92 -0
  165. package/src/Incentives/Incentive.ts +85 -0
  166. package/src/Incentives/PointsIncentive.test.ts +142 -0
  167. package/src/Incentives/PointsIncentive.ts +303 -0
  168. package/src/Validators/SignerValidator.test.ts +163 -0
  169. package/src/Validators/SignerValidator.ts +272 -0
  170. package/src/Validators/Validator.test.ts +21 -0
  171. package/src/Validators/Validator.ts +55 -0
  172. package/src/errors.ts +524 -0
  173. package/src/index.test.ts +40 -0
  174. package/src/index.ts +50 -0
  175. package/src/utils.test.ts +44 -0
  176. package/src/utils.ts +2247 -0
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../generated-Cd-Fe7W7.cjs"),a=require("@wagmi/core"),s=require("../errors.cjs"),c=require("./EventAction.cjs"),e={"0x7687b0ed":c.EventAction};async function f(n,t){const o=await a.readContract(n.config,{abi:i.X,functionName:"getComponentInterface",address:t}),r=e[o];if(!r)throw new s.InvalidComponentInterfaceError(Object.keys(e),o);return new r(n,t)}exports.EventAction=c.EventAction;exports.ActionByComponentInterface=e;exports.actionFromAddress=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../generated-Cd-Fe7W7.cjs"),a=require("../componentInterfaces-CKCBwG16.cjs"),s=require("@wagmi/core"),f=require("../errors.cjs"),c=require("./EventAction.cjs"),e={[a.AEventAction]:c.EventAction};async function u(n,t){const o=await s.readContract(n.config,{abi:i.X,functionName:"getComponentInterface",address:t}),r=e[o];if(!r)throw new f.InvalidComponentInterfaceError(Object.keys(e),o);return new r(n,t)}exports.EventAction=c.EventAction;exports.ActionByComponentInterface=e;exports.actionFromAddress=u;
2
+ //# sourceMappingURL=Action.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Action.cjs","sources":["../../src/Actions/Action.ts"],"sourcesContent":["import { aActionAbi } from '@boostxyz/evm';\nimport { AEventAction } from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport { EventAction } from './EventAction';\n\nexport {\n // ContractAction,\n // ERC721MintAction,\n EventAction,\n};\n\n/**\n * A union type representing all valid protocol Action implementations\n *\n * @export\n * @typedef {Action}\n */\nexport type Action = EventAction; // | ContractAction | ERC721MintAction\n\n/**\n * A map of Action component interfaces to their constructors.\n *\n * @type {{ \"0x7687b0ed\": EventAction; }}\n */\nexport const ActionByComponentInterface = {\n // ['0x6c3129aa']: ContractAction,\n // ['0x97e083eb']: ERC721MintAction,\n [AEventAction as Hex]: EventAction,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Promise<EventAction>}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function actionFromAddress(\n options: DeployableOptions,\n address: Address,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aActionAbi,\n functionName: 'getComponentInterface',\n address,\n })) as keyof typeof ActionByComponentInterface;\n const Ctor = ActionByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(ActionByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["ActionByComponentInterface","AEventAction","EventAction","actionFromAddress","options","address","interfaceId","readContract","aActionAbi","Ctor","InvalidComponentInterfaceError"],"mappings":"iQA2BaA,EAA6B,CAGxC,CAACC,EAAmB,YAAA,EAAGC,EAAA,WACzB,EAYsB,eAAAC,EACpBC,EACAC,EACA,CACA,MAAMC,EAAe,MAAMC,eAAaH,EAAQ,OAAQ,CACtD,IAAKI,EAAA,EACL,aAAc,wBACd,QAAAH,CAAA,CACD,EACKI,EAAOT,EAA2BM,CAAW,EACnD,GAAI,CAACG,EACH,MAAM,IAAIC,EAAA,+BACR,OAAO,KAAKV,CAA0B,EACtCM,CAAA,EAGG,OAAA,IAAIG,EAAKL,EAASC,CAAO,CAClC"}
@@ -15,7 +15,7 @@ export type Action = EventAction;
15
15
  * @type {{ "0x7687b0ed": EventAction; }}
16
16
  */
17
17
  export declare const ActionByComponentInterface: {
18
- "0x7687b0ed": typeof EventAction;
18
+ [x: string]: typeof EventAction;
19
19
  };
20
20
  /**
21
21
  * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.
@@ -1 +1 @@
1
- {"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../src/Actions/Action.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAGL,WAAW,GACZ,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAEjC;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;;CAItC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,OAAO,wBAejB"}
1
+ {"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../src/Actions/Action.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAGL,WAAW,GACZ,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAEjC;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;;CAItC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,OAAO,wBAejB"}
@@ -1,27 +1,29 @@
1
1
  import { X as c } from "../generated-DGpIVcv5.js";
2
- import { readContract as i } from "@wagmi/core";
3
- import { InvalidComponentInterfaceError as m } from "../errors.js";
4
- import { EventAction as a } from "./EventAction.js";
2
+ import { A as i } from "../componentInterfaces-DYkaxBda.js";
3
+ import { readContract as m } from "@wagmi/core";
4
+ import { InvalidComponentInterfaceError as a } from "../errors.js";
5
+ import { EventAction as f } from "./EventAction.js";
5
6
  const e = {
6
7
  // ['0x6c3129aa']: ContractAction,
7
8
  // ['0x97e083eb']: ERC721MintAction,
8
- "0x7687b0ed": a
9
+ [i]: f
9
10
  };
10
- async function d(t, n) {
11
- const o = await i(t.config, {
11
+ async function w(t, o) {
12
+ const n = await m(t.config, {
12
13
  abi: c,
13
14
  functionName: "getComponentInterface",
14
- address: n
15
- }), r = e[o];
15
+ address: o
16
+ }), r = e[n];
16
17
  if (!r)
17
- throw new m(
18
+ throw new a(
18
19
  Object.keys(e),
19
- o
20
+ n
20
21
  );
21
- return new r(t, n);
22
+ return new r(t, o);
22
23
  }
23
24
  export {
24
25
  e as ActionByComponentInterface,
25
- a as EventAction,
26
- d as actionFromAddress
26
+ f as EventAction,
27
+ w as actionFromAddress
27
28
  };
29
+ //# sourceMappingURL=Action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Action.js","sources":["../../src/Actions/Action.ts"],"sourcesContent":["import { aActionAbi } from '@boostxyz/evm';\nimport { AEventAction } from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport { EventAction } from './EventAction';\n\nexport {\n // ContractAction,\n // ERC721MintAction,\n EventAction,\n};\n\n/**\n * A union type representing all valid protocol Action implementations\n *\n * @export\n * @typedef {Action}\n */\nexport type Action = EventAction; // | ContractAction | ERC721MintAction\n\n/**\n * A map of Action component interfaces to their constructors.\n *\n * @type {{ \"0x7687b0ed\": EventAction; }}\n */\nexport const ActionByComponentInterface = {\n // ['0x6c3129aa']: ContractAction,\n // ['0x97e083eb']: ERC721MintAction,\n [AEventAction as Hex]: EventAction,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Promise<EventAction>}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function actionFromAddress(\n options: DeployableOptions,\n address: Address,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aActionAbi,\n functionName: 'getComponentInterface',\n address,\n })) as keyof typeof ActionByComponentInterface;\n const Ctor = ActionByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(ActionByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["ActionByComponentInterface","AEventAction","EventAction","actionFromAddress","options","address","interfaceId","readContract","aActionAbi","Ctor","InvalidComponentInterfaceError"],"mappings":";;;;;AA2BO,MAAMA,IAA6B;AAAA;AAAA;AAAA,EAGxC,CAACC,CAAmB,GAAGC;AACzB;AAYsB,eAAAC,EACpBC,GACAC,GACA;AACA,QAAMC,IAAe,MAAMC,EAAaH,EAAQ,QAAQ;AAAA,IACtD,KAAKI;AAAAA,IACL,cAAc;AAAA,IACd,SAAAH;AAAA,EAAA,CACD,GACKI,IAAOT,EAA2BM,CAAW;AACnD,MAAI,CAACG;AACH,UAAM,IAAIC;AAAA,MACR,OAAO,KAAKV,CAA0B;AAAA,MACtCM;AAAA,IAAA;AAGG,SAAA,IAAIG,EAAKL,GAASC,CAAO;AAClC;"}
@@ -1 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-Cd-Fe7W7.cjs"),A=require("@boostxyz/signatures/events"),u=require("viem"),T=require("viem/actions"),S=require("../Deployable/DeployableTarget.cjs"),i=require("../errors.cjs"),a=require("../utils.cjs"),_="0x60a0604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b60805161239f6100c85f395f61034a015261239f5ff3fe608060405260043610610090575f3560e01c80639bc1cf81116100585780639bc1cf811461017d578063c26624e8146101a7578063d7768c47146101e3578063dbdf21101461021f578063ddd6ab081461024957610090565b806301ffc9a71461009457806309c5eabe146100d057806328d6183b14610101578063393df8cb1461012b578063439fab9114610155575b5f80fd5b34801561009f575f80fd5b506100ba60048036038101906100b5919061145c565b610273565b6040516100c791906114a1565b60405180910390f35b6100ea60048036038101906100e5919061151b565b6102ec565b6040516100f89291906115d6565b60405180910390f35b34801561010c575f80fd5b50610115610321565b6040516101229190611613565b60405180910390f35b348015610136575f80fd5b5061013f610348565b60405161014c91906116a6565b60405180910390f35b348015610160575f80fd5b5061017b6004803603810190610176919061151b565b61036c565b005b348015610188575f80fd5b506101916103f9565b60405161019e91906119de565b60405180910390f35b3480156101b2575f80fd5b506101cd60048036038101906101c89190611a31565b610686565b6040516101da9190611acf565b60405180910390f35b3480156101ee575f80fd5b506102096004803603810190610204919061151b565b6108f1565b6040516102169190611aef565b60405180910390f35b34801561022a575f80fd5b50610233610925565b6040516102409190611b62565b60405180910390f35b348015610254575f80fd5b5061025d610a3c565b60405161026a9190611b8a565b60405180910390f35b5f7f7687b0ed000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806102e557506102e482610a48565b5b9050919050565b5f60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f7f7687b0ed00000000000000000000000000000000000000000000000000000000905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f610375610ac1565b905080546003825580156103a75760018160011c14303b1061039e5763f92ee8a95f526004601cfd5b818160ff1b1b91505b506103bf83838101906103ba9190612035565b610aea565b80156103f4576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b60606001805480602002602001604051908101604052809291908181526020015f905b8282101561067d578382905f5260205f2090600302016040518060a00160405290815f82015f9054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160049054906101000a900460ff1660018111156104b4576104b36116f7565b5b60018111156104c6576104c56116f7565b5b81526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182016040518060800160405290815f82015f9054906101000a900460ff16600481111561056e5761056d6116f7565b5b60048111156105805761057f6116f7565b5b81526020015f820160019054906101000a900460ff1660038111156105a8576105a76116f7565b5b60038111156105ba576105b96116f7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff1681526020016001820180546105ea906120a9565b80601f0160208091040260200160405190810160405280929190818152602001828054610616906120a9565b80156106615780601f1061063857610100808354040283529160200191610661565b820191905f5260205f20905b81548152906001019060200180831161064457829003601f168201915b505050505081525050815250508152602001906001019061041c565b50505050905090565b61068e6112c1565b600182815481106106a2576106a16120d9565b5b905f5260205f2090600302016040518060a00160405290815f82015f9054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160049054906101000a900460ff1660018111156107305761072f6116f7565b5b6001811115610742576107416116f7565b5b81526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182016040518060800160405290815f82015f9054906101000a900460ff1660048111156107ea576107e96116f7565b5b60048111156107fc576107fb6116f7565b5b81526020015f820160019054906101000a900460ff166003811115610824576108236116f7565b5b6003811115610836576108356116f7565b5b81526020015f820160029054906101000a900460ff1660ff1660ff168152602001600182018054610866906120a9565b80601f0160208091040260200160405190810160405280929190818152602001828054610892906120a9565b80156108dd5780601f106108b4576101008083540402835291602001916108dd565b820191905f5260205f20905b8154815290600101906020018083116108c057829003601f168201915b505050505081525050815250509050919050565b60606040517fd623472500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61092d61133c565b5f6040518060800160405290815f82015f9054906101000a900460ff16600181111561095c5761095b6116f7565b5b600181111561096e5761096d6116f7565b5b81526020015f820160019054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f820160059054906101000a900460ff1660ff1660ff1681526020015f820160069054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905090565b5f600180549050905090565b5f7fe6715795000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610aba5750610ab9826111bb565b5b9050919050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610af2611234565b805f01515f80820151815f015f6101000a81548160ff02191690836001811115610b1f57610b1e6116f7565b5b02179055506020820151815f0160016101000a81548163ffffffff021916908360e01c02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505060018160200151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610c2857610c276116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610cc457610cc36116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610cf357610cf26116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610d2d919061229a565b505050505060018160400151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610daa57610da96116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610e4657610e456116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610e7557610e746116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081610eaf919061229a565b505050505060018160600151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff02191690836001811115610f2c57610f2b6116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff02191690836004811115610fc857610fc76116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115610ff757610ff66116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff1602179055506060820151816001019081611031919061229a565b505050505060018160800151908060018154018082558091505060019003905f5260205f2090600302015f909190919091505f820151815f015f6101000a81548163ffffffff021916908360e01c02179055506020820151815f0160046101000a81548160ff021916908360018111156110ae576110ad6116f7565b5b02179055506040820151815f0160056101000a81548160ff021916908360ff1602179055506060820151815f0160066101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816001015f820151815f015f6101000a81548160ff0219169083600481111561114a576111496116f7565b5b02179055506020820151815f0160016101000a81548160ff02191690836003811115611179576111786116f7565b5b02179055506040820151815f0160026101000a81548160ff021916908360ff16021790555060608201518160010190816111b3919061229a565b505050505050565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061122d575061122c82611258565b5b9050919050565b5f61123d610ac1565b905080546001166112555763d7e6bcf85f526004601cfd5b50565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6040518060a001604052805f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f6001811115611304576113036116f7565b5b81526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020016113366113aa565b81525090565b60405180608001604052805f600181111561135a576113596116f7565b5b81526020015f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020015f60ff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681525090565b60405180608001604052805f60048111156113c8576113c76116f7565b5b81526020015f60038111156113e0576113df6116f7565b5b81526020015f60ff168152602001606081525090565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61143b81611407565b8114611445575f80fd5b50565b5f8135905061145681611432565b92915050565b5f60208284031215611471576114706113ff565b5b5f61147e84828501611448565b91505092915050565b5f8115159050919050565b61149b81611487565b82525050565b5f6020820190506114b45f830184611492565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f8401126114db576114da6114ba565b5b8235905067ffffffffffffffff8111156114f8576114f76114be565b5b602083019150836001820283011115611514576115136114c2565b5b9250929050565b5f8060208385031215611531576115306113ff565b5b5f83013567ffffffffffffffff81111561154e5761154d611403565b5b61155a858286016114c6565b92509250509250929050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6115a882611566565b6115b28185611570565b93506115c2818560208601611580565b6115cb8161158e565b840191505092915050565b5f6040820190506115e95f830185611492565b81810360208301526115fb818461159e565b90509392505050565b61160d81611407565b82525050565b5f6020820190506116265f830184611604565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f61166e6116696116648461162c565b61164b565b61162c565b9050919050565b5f61167f82611654565b9050919050565b5f61169082611675565b9050919050565b6116a081611686565b82525050565b5f6020820190506116b95f830184611697565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6116f181611407565b82525050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110611735576117346116f7565b5b50565b5f81905061174582611724565b919050565b5f61175482611738565b9050919050565b6117648161174a565b82525050565b5f60ff82169050919050565b61177f8161176a565b82525050565b5f61178f8261162c565b9050919050565b61179f81611785565b82525050565b600581106117b6576117b56116f7565b5b50565b5f8190506117c6826117a5565b919050565b5f6117d5826117b9565b9050919050565b6117e5816117cb565b82525050565b600481106117fc576117fb6116f7565b5b50565b5f81905061180c826117eb565b919050565b5f61181b826117ff565b9050919050565b61182b81611811565b82525050565b5f82825260208201905092915050565b5f61184b82611566565b6118558185611831565b9350611865818560208601611580565b61186e8161158e565b840191505092915050565b5f608083015f83015161188e5f8601826117dc565b5060208301516118a16020860182611822565b5060408301516118b46040860182611776565b50606083015184820360608601526118cc8282611841565b9150508091505092915050565b5f60a083015f8301516118ee5f8601826116e8565b506020830151611901602086018261175b565b5060408301516119146040860182611776565b5060608301516119276060860182611796565b506080830151848203608086015261193f8282611879565b9150508091505092915050565b5f61195783836118d9565b905092915050565b5f602082019050919050565b5f611975826116bf565b61197f81856116c9565b935083602082028501611991856116d9565b805f5b858110156119cc57848403895281516119ad858261194c565b94506119b88361195f565b925060208a01995050600181019050611994565b50829750879550505050505092915050565b5f6020820190508181035f8301526119f6818461196b565b905092915050565b5f819050919050565b611a10816119fe565b8114611a1a575f80fd5b50565b5f81359050611a2b81611a07565b92915050565b5f60208284031215611a4657611a456113ff565b5b5f611a5384828501611a1d565b91505092915050565b5f60a083015f830151611a715f8601826116e8565b506020830151611a84602086018261175b565b506040830151611a976040860182611776565b506060830151611aaa6060860182611796565b5060808301518482036080860152611ac28282611879565b9150508091505092915050565b5f6020820190508181035f830152611ae78184611a5c565b905092915050565b5f6020820190508181035f830152611b07818461159e565b905092915050565b608082015f820151611b235f85018261175b565b506020820151611b3660208501826116e8565b506040820151611b496040850182611776565b506060820151611b5c6060850182611796565b50505050565b5f608082019050611b755f830184611b0f565b92915050565b611b84816119fe565b82525050565b5f602082019050611b9d5f830184611b7b565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b611bdd8261158e565b810181811067ffffffffffffffff82111715611bfc57611bfb611ba7565b5b80604052505050565b5f611c0e6113f6565b9050611c1a8282611bd4565b919050565b5f80fd5b60028110611c2f575f80fd5b50565b5f81359050611c4081611c23565b92915050565b611c4f8161176a565b8114611c59575f80fd5b50565b5f81359050611c6a81611c46565b92915050565b611c7981611785565b8114611c83575f80fd5b50565b5f81359050611c9481611c70565b92915050565b5f60808284031215611caf57611cae611ba3565b5b611cb96080611c05565b90505f611cc884828501611c32565b5f830152506020611cdb84828501611448565b6020830152506040611cef84828501611c5c565b6040830152506060611d0384828501611c86565b60608301525092915050565b60058110611d1b575f80fd5b50565b5f81359050611d2c81611d0f565b92915050565b60048110611d3e575f80fd5b50565b5f81359050611d4f81611d32565b92915050565b5f80fd5b5f67ffffffffffffffff821115611d7357611d72611ba7565b5b611d7c8261158e565b9050602081019050919050565b828183375f83830152505050565b5f611da9611da484611d59565b611c05565b905082815260208101848484011115611dc557611dc4611d55565b5b611dd0848285611d89565b509392505050565b5f82601f830112611dec57611deb6114ba565b5b8135611dfc848260208601611d97565b91505092915050565b5f60808284031215611e1a57611e19611ba3565b5b611e246080611c05565b90505f611e3384828501611d1e565b5f830152506020611e4684828501611d41565b6020830152506040611e5a84828501611c5c565b604083015250606082013567ffffffffffffffff811115611e7e57611e7d611c1f565b5b611e8a84828501611dd8565b60608301525092915050565b5f60a08284031215611eab57611eaa611ba3565b5b611eb560a0611c05565b90505f611ec484828501611448565b5f830152506020611ed784828501611c32565b6020830152506040611eeb84828501611c5c565b6040830152506060611eff84828501611c86565b606083015250608082013567ffffffffffffffff811115611f2357611f22611c1f565b5b611f2f84828501611e05565b60808301525092915050565b5f6101008284031215611f5157611f50611ba3565b5b611f5b60a0611c05565b90505f611f6a84828501611c9a565b5f83015250608082013567ffffffffffffffff811115611f8d57611f8c611c1f565b5b611f9984828501611e96565b60208301525060a082013567ffffffffffffffff811115611fbd57611fbc611c1f565b5b611fc984828501611e96565b60408301525060c082013567ffffffffffffffff811115611fed57611fec611c1f565b5b611ff984828501611e96565b60608301525060e082013567ffffffffffffffff81111561201d5761201c611c1f565b5b61202984828501611e96565b60808301525092915050565b5f6020828403121561204a576120496113ff565b5b5f82013567ffffffffffffffff81111561206757612066611403565b5b61207384828501611f3b565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806120c057607f821691505b6020821081036120d3576120d261207c565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026121627fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612127565b61216c8683612127565b95508019841693508086168417925050509392505050565b5f61219e612199612194846119fe565b61164b565b6119fe565b9050919050565b5f819050919050565b6121b783612184565b6121cb6121c3826121a5565b848454612133565b825550505050565b5f90565b6121df6121d3565b6121ea8184846121ae565b505050565b5b8181101561220d576122025f826121d7565b6001810190506121f0565b5050565b601f8211156122525761222381612106565b61222c84612118565b8101602085101561223b578190505b61224f61224785612118565b8301826121ef565b50505b505050565b5f82821c905092915050565b5f6122725f1984600802612257565b1980831691505092915050565b5f61228a8383612263565b9150826002028217905092915050565b6122a382611566565b67ffffffffffffffff8111156122bc576122bb611ba7565b5b6122c682546120a9565b6122d1828285612211565b5f60209050601f831160018114612302575f84156122f0578287015190505b6122fa858261227f565b865550612361565b601f19841661231086612106565b5f5b8281101561233757848901518255600182019150602085019450602081019050612312565b868310156123545784890151612350601f891682612263565b8355505b6001600288020188555050505b50505050505056fea2646970667358221220232ad425d6a3fa9ff7de7b59ca0cdff9b09b560e5493bdfd8320e53da80c045964736f6c634300081a0033";var h={VITE_ALLOWLIST_INCENTIVE_BASE:"0x5Cd43Ea5541e1D6FF36962E6e6C11f0bf9d573d4",VITE_BOOST_REGISTRY_ADDRESS:"0x5cb8D869f2EE4e3D987Ac7bEB37D6812f5346DFC",VITE_CGDA_INCENTIVE_BASE:"0x147c3aBFF7Ab7867B206A8c652Cd59D3BE41Dc3E",VITE_ERC20_INCENTIVE_BASE:"0xDCfbb7767B281Fd2d39fc7c39A9f89dC61E81f0d",VITE_POINTS_INCENTIVE_BASE:"0x881c78Ba2d10894a8f4f6996C0FB5bA8AE627AAb",VITE_SIMPLE_DENYLIST_BASE:"0x41A7c1aCC75BEccD11B8F586510759883092460F",VITE_BOOST_CORE_ADDRESS:"0xF4905b327904E5797840fd8cD7F300001a34122f",VITE_SIMPLE_ALLOWLIST_BASE:"0x11556926AaA421e96e06a7A679C680813122db7D",VITE_ERC20_VARIABLE_INCENTIVE_BASE:"0xA7b6c33828693d431C64e59A27d985c4DfB19B95",VITE_MANAGED_BUDGET_BASE:"0x0b51f997fa15867134fA34366FCeA63Bee93C087",VITE_SIGNER_VALIDATOR_BASE:"0x749c6fDd62727E11e3200571de7CfBb61DFbA93b",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const o=class o extends S.DeployableTarget{constructor(){super(...arguments),this.abi=s.W}async getActionStep(f,b){return(await this.getActionSteps(b)).at(f)}async getActionSteps(f){const b=await s.$f(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f});return a.dedupeActionSteps(b)}async getActionStepsCount(f){return(await this.getActionSteps(f)).length}async getActionClaimant(f){return s.Gf(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...f})}async execute(f,b){return this.awaitResult(this.executeRaw(f,b))}async executeRaw(f,b){const{request:e,result:c}=await s.tv(this._config,{address:this.assertValidAddress(),...this.optionallyAttachAccount(),...b,args:[f]});return{hash:await s.Xf(this._config,e),result:c}}async validateActionSteps(f){const b=await this.getActionSteps(f);for(const e of b)if(!await this.isActionStepValid(e,f))return!1;return!0}async isActionStepValid(f,b){const e=f.actionParameter,c=f.signature;let t;if(b!=null&&b.knownEvents?t=b.knownEvents[c]:t=A.abi[c],!t)throw new Error(`No known ABI for given event signature: ${c}`);const n=f.targetContract,d=(b==null?void 0:b.logs)||await T.getLogs(this._config.getClient({chainId:b==null?void 0:b.chainId}),{...b,address:n,event:t});if(!d.length)return!1;for(let r of d)if(!this.validateLogAgainstCriteria(e,r))return!1;return!0}async validateLogAgainstCriteria(f,b){const e=b.topics.at(f.fieldIndex);if(e===void 0)throw new i.FieldValueUndefinedError({log:b,criteria:f,fieldValue:e});switch(f.filterType){case a.FilterType.EQUAL:return f.fieldType===a.PrimitiveType.ADDRESS?u.isAddressEqual(f.filterData,`0x${e.slice(-40)}`):e===f.filterData;case a.FilterType.NOT_EQUAL:return e!==f.filterData;case a.FilterType.GREATER_THAN:if(f.fieldType===a.PrimitiveType.UINT)return BigInt(e)>BigInt(f.filterData);throw new i.InvalidNumericalCriteriaError({log:b,criteria:f,fieldValue:e});case a.FilterType.LESS_THAN:if(f.fieldType===a.PrimitiveType.UINT)return BigInt(e)<BigInt(f.filterData);throw new i.InvalidNumericalCriteriaError({log:b,criteria:f,fieldValue:e});case a.FilterType.CONTAINS:if(f.fieldType===a.PrimitiveType.BYTES||f.fieldType===a.PrimitiveType.STRING)return e.includes(f.filterData);throw new i.FieldValueNotComparableError({log:b,criteria:f,fieldValue:e});default:throw new i.UnrecognizedFilterTypeError({log:b,criteria:f,fieldValue:e})}}buildParameters(f,b){const[e,c]=this.validateDeploymentConfig(f,b);let t;if(a.isEventActionPayloadSimple(e)){let n=e.actionSteps.filter(r=>!!r);if(n.length===0)throw new i.NoEventActionStepsProvidedError;if(n.length>4)throw new i.TooManyEventActionStepsProvidedError;let d=Array.from({length:4},(r,E)=>n.at(E)||n.slice(0,E).at(-1));t={actionClaimant:e.actionClaimant,actionStepOne:d.at(0),actionStepTwo:d.at(1),actionStepThree:d.at(2),actionStepFour:d.at(3)}}else t=e;return{abi:s.W,bytecode:_,args:[a.prepareEventActionPayload(t)],...this.optionallyAttachAccount(c.account)}}};o.base=h.VITE_EVENT_ACTION_BASE,o.registryType=a.RegistryType.ACTION;let l=o;exports.EventAction=l;
2
+ //# sourceMappingURL=EventAction.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventAction.cjs","sources":["../../src/Actions/EventAction.ts"],"sourcesContent":["import {\n eventActionAbi,\n readEventActionGetActionClaimant,\n readEventActionGetActionStep,\n readEventActionGetActionSteps,\n readEventActionGetActionStepsCount,\n simulateEventActionExecute,\n writeEventActionExecute,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/actions/EventAction.sol/EventAction.json';\nimport events from '@boostxyz/signatures/events';\nimport {\n type Abi,\n type AbiEvent,\n type Address,\n type ContractEventName,\n type Hex,\n type Log,\n isAddressEqual,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n FieldValueNotComparableError,\n FieldValueUndefinedError,\n InvalidNumericalCriteriaError,\n NoEventActionStepsProvidedError,\n TooManyEventActionStepsProvidedError,\n UnrecognizedFilterTypeError,\n} from '../errors';\nimport {\n type ActionClaimant,\n type ActionStep,\n type Criteria,\n type EventActionPayload,\n type EventActionPayloadRaw,\n FilterType,\n type GetLogsParams,\n PrimitiveType,\n type ReadParams,\n RegistryType,\n type WriteParams,\n dedupeActionSteps,\n isEventActionPayloadSimple,\n prepareEventActionPayload,\n} from '../utils';\n\nexport type { EventActionPayload };\n\n/**\n * A generic event action\n *\n * @export\n * @class EventAction\n * @typedef {EventAction}\n * @extends {DeployableTarget<EventActionPayload>}\n */\nexport class EventAction extends DeployableTarget<\n EventActionPayload,\n typeof eventActionAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = eventActionAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env.VITE_EVENT_ACTION_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ACTION;\n\n /**\n * Gets a specific action event by index\n *\n * @public\n * @async\n * @param {number} index The index of the action event to retrieve\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStep'>} [params]\n * @returns {Promise<ActionStep>}\n */\n public async getActionStep(\n index: number,\n params?: ReadParams<typeof eventActionAbi, 'getActionStep'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.at(index);\n }\n\n /**\n * Gets all action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'>} [params]\n * @returns {Promise<ActionStep[]>}\n */\n public async getActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'>,\n ) {\n const steps = (await readEventActionGetActionSteps(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n })) as ActionStep[];\n return dedupeActionSteps(steps);\n }\n\n /**\n * Gets the count of action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStepsCount'>} [params]\n * @returns {Promise<bigint>}\n */\n public async getActionStepsCount(\n params?: ReadParams<typeof eventActionAbi, 'getActionStepsCount'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.length;\n }\n\n /**\n * Retrieves the payload describing how claimants can be identified from logs or function calls.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionClaimant'>} [params]\n * @returns {Promise<ActionClaimant>}\n */\n public async getActionClaimant(\n params?: ReadParams<typeof eventActionAbi, 'getActionClaimant'>,\n ) {\n return readEventActionGetActionClaimant(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<ActionClaimant>;\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {Promise<readonly [boolean, `0x${string}`]>}\n */\n public async execute(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n return this.awaitResult(this.executeRaw(data, params));\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {unknown}\n */\n public async executeRaw(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n const { request, result } = await simulateEventActionExecute(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n args: [data],\n });\n const hash = await writeEventActionExecute(this._config, request);\n return { hash, result };\n }\n\n /**\n * Retrieves action steps, and uses them to validate against, and optionally fetch logs that match the step's signature.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n * GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async validateActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const actionSteps = await this.getActionSteps(params);\n for (const actionStep of actionSteps) {\n if (!(await this.isActionStepValid(actionStep, params))) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a single action step with a given criteria against logs.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {ActionStep} actionStep\n * @param {?GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async isActionStepValid(\n actionStep: ActionStep,\n params?: GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const criteria = actionStep.actionParameter;\n const signature = actionStep.signature;\n let event: AbiEvent;\n // Lookup ABI based on event signature\n if (params?.knownEvents) {\n event = params.knownEvents[signature] as AbiEvent;\n } else {\n event = (events.abi as Record<Hex, AbiEvent>)[signature] as AbiEvent;\n }\n if (!event) {\n throw new Error(`No known ABI for given event signature: ${signature}`);\n }\n const targetContract = actionStep.targetContract;\n // Get all logs matching the event signature from the target contract\n const logs =\n params?.logs ||\n (await getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n ...(params as any),\n address: targetContract,\n event,\n }));\n if (!logs.length) return false;\n for (let log of logs) {\n if (!this.validateLogAgainstCriteria(criteria, log)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a {@link Log} against a given criteria.\n *\n * @param {Criteria} criteria - The criteria to validate against.\n * @param {Log} log - The Viem event log.\n * @returns {Promise<boolean>} - Returns true if the log passes the criteria, false otherwise.\n */\n public async validateLogAgainstCriteria(criteria: Criteria, log: Log) {\n const fieldValue = log.topics.at(criteria.fieldIndex);\n if (fieldValue === undefined) {\n throw new FieldValueUndefinedError({ log, criteria, fieldValue });\n }\n // Type narrow based on criteria.filterType\n switch (criteria.filterType) {\n case FilterType.EQUAL:\n if (criteria.fieldType === PrimitiveType.ADDRESS) {\n return isAddressEqual(\n criteria.filterData,\n `0x${fieldValue.slice(-40)}`,\n );\n }\n return fieldValue === criteria.filterData;\n\n case FilterType.NOT_EQUAL:\n return fieldValue !== criteria.filterData;\n\n case FilterType.GREATER_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) > BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.LESS_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) < BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.CONTAINS:\n if (\n criteria.fieldType === PrimitiveType.BYTES ||\n criteria.fieldType === PrimitiveType.STRING\n ) {\n return fieldValue.includes(criteria.filterData);\n }\n throw new FieldValueNotComparableError({ log, criteria, fieldValue });\n\n default:\n throw new UnrecognizedFilterTypeError({ log, criteria, fieldValue });\n }\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?EventActionPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: EventActionPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n let rawPayload: EventActionPayloadRaw;\n if (isEventActionPayloadSimple(payload)) {\n // filter out any falsy potential values\n let tmpSteps = payload.actionSteps.filter((step) => !!step);\n if (tmpSteps.length === 0) {\n throw new NoEventActionStepsProvidedError();\n }\n if (tmpSteps.length > 4) {\n throw new TooManyEventActionStepsProvidedError();\n }\n let steps: ActionStep[] = Array.from({ length: 4 }, (_, i) => {\n // use either the provided step at the given index, or reuse the previous step\n // should aways exist\n return tmpSteps.at(i)! || tmpSteps.slice(0, i).at(-1)!;\n });\n rawPayload = {\n actionClaimant: payload.actionClaimant,\n actionStepOne: steps.at(0)!,\n actionStepTwo: steps.at(1)!,\n actionStepThree: steps.at(2)!,\n actionStepFour: steps.at(3)!,\n };\n } else {\n rawPayload = payload;\n }\n return {\n abi: eventActionAbi,\n bytecode: bytecode as Hex,\n args: [prepareEventActionPayload(rawPayload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["_EventAction","DeployableTarget","eventActionAbi","index","params","steps","readEventActionGetActionSteps","dedupeActionSteps","readEventActionGetActionClaimant","data","request","result","simulateEventActionExecute","writeEventActionExecute","actionSteps","actionStep","criteria","signature","event","events","targetContract","logs","getLogs","log","fieldValue","FieldValueUndefinedError","FilterType","PrimitiveType","isAddressEqual","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError","_payload","_options","payload","options","rawPayload","isEventActionPayloadSimple","tmpSteps","step","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","_","i","bytecode","prepareEventActionPayload","define_import_meta_env_default","RegistryType","EventAction"],"mappings":"o2mBA6DO,MAAMA,EAAN,MAAMA,UAAoBC,EAAAA,gBAG/B,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAWL,KAAyB,IAAMC,GAAA,CA2B/B,MAAa,cACXC,EACAC,EACA,CAEO,OADO,MAAM,KAAK,eAAeA,CAAM,GACjC,GAAGD,CAAK,CACvB,CAUA,MAAa,eACXC,EACA,CACA,MAAMC,EAAS,MAAMC,KAA8B,KAAK,QAAS,CAC/D,QAAS,KAAK,mBAAmB,EACjC,GAAG,KAAK,wBAAwB,EAEhC,GAAIF,CAAA,CACL,EACD,OAAOG,EAAAA,kBAAkBF,CAAK,CAChC,CAUA,MAAa,oBACXD,EACA,CAEA,OADc,MAAM,KAAK,eAAeA,CAAM,GACjC,MACf,CAUA,MAAa,kBACXA,EACA,CACO,OAAAI,EAAA,GAAiC,KAAK,QAAS,CACpD,QAAS,KAAK,mBAAmB,EACjC,GAAG,KAAK,wBAAwB,EAEhC,GAAIJ,CAAA,CACL,CACH,CAWA,MAAa,QACXK,EACAL,EACA,CACA,OAAO,KAAK,YAAY,KAAK,WAAWK,EAAML,CAAM,CAAC,CACvD,CAWA,MAAa,WACXK,EACAL,EACA,CACA,KAAM,CAAE,QAAAM,EAAS,OAAAC,CAAA,EAAW,MAAMC,EAAA,GAA2B,KAAK,QAAS,CACzE,QAAS,KAAK,mBAAmB,EACjC,GAAG,KAAK,wBAAwB,EAEhC,GAAIR,EACJ,KAAM,CAACK,CAAI,CAAA,CACZ,EAEM,MAAA,CAAE,KADI,MAAMI,EAAwB,GAAA,KAAK,QAASH,CAAO,EACjD,OAAAC,EACjB,CAeA,MAAa,oBACXP,EAKA,CACA,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,EAAM,GAAG,CAAC,EAC3B,eAAgBA,EAAM,GAAG,CAAC,CAAA,CAC5B,MAEa+B,EAAAF,EAER,MAAA,CACL,IAAKhC,EAAA,EACL,SAAA0C,EACA,KAAM,CAACC,4BAA0BT,CAAU,CAAC,EAC5C,GAAG,KAAK,wBAAwBD,EAAQ,OAAO,CAAA,CAEnD,CACF,EA7SyBnC,EAAA,KAAgB8C,EAAgB,uBAQvD9C,EAAuB,aAA6B+C,EAAa,aAAA,OA3B5D,IAAMC,EAANhD"}
@@ -227,3 +227,4 @@ let A = o;
227
227
  export {
228
228
  A as EventAction
229
229
  };
230
+ //# sourceMappingURL=EventAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventAction.js","sources":["../../src/Actions/EventAction.ts"],"sourcesContent":["import {\n eventActionAbi,\n readEventActionGetActionClaimant,\n readEventActionGetActionStep,\n readEventActionGetActionSteps,\n readEventActionGetActionStepsCount,\n simulateEventActionExecute,\n writeEventActionExecute,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/actions/EventAction.sol/EventAction.json';\nimport events from '@boostxyz/signatures/events';\nimport {\n type Abi,\n type AbiEvent,\n type Address,\n type ContractEventName,\n type Hex,\n type Log,\n isAddressEqual,\n} from 'viem';\nimport { getLogs } from 'viem/actions';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport {\n FieldValueNotComparableError,\n FieldValueUndefinedError,\n InvalidNumericalCriteriaError,\n NoEventActionStepsProvidedError,\n TooManyEventActionStepsProvidedError,\n UnrecognizedFilterTypeError,\n} from '../errors';\nimport {\n type ActionClaimant,\n type ActionStep,\n type Criteria,\n type EventActionPayload,\n type EventActionPayloadRaw,\n FilterType,\n type GetLogsParams,\n PrimitiveType,\n type ReadParams,\n RegistryType,\n type WriteParams,\n dedupeActionSteps,\n isEventActionPayloadSimple,\n prepareEventActionPayload,\n} from '../utils';\n\nexport type { EventActionPayload };\n\n/**\n * A generic event action\n *\n * @export\n * @class EventAction\n * @typedef {EventAction}\n * @extends {DeployableTarget<EventActionPayload>}\n */\nexport class EventAction extends DeployableTarget<\n EventActionPayload,\n typeof eventActionAbi\n> {\n /**\n * @inheritdoc\n *\n * @public\n * @readonly\n * @type {*}\n */\n public override readonly abi = eventActionAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env.VITE_EVENT_ACTION_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ACTION;\n\n /**\n * Gets a specific action event by index\n *\n * @public\n * @async\n * @param {number} index The index of the action event to retrieve\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStep'>} [params]\n * @returns {Promise<ActionStep>}\n */\n public async getActionStep(\n index: number,\n params?: ReadParams<typeof eventActionAbi, 'getActionStep'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.at(index);\n }\n\n /**\n * Gets all action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'>} [params]\n * @returns {Promise<ActionStep[]>}\n */\n public async getActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'>,\n ) {\n const steps = (await readEventActionGetActionSteps(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n })) as ActionStep[];\n return dedupeActionSteps(steps);\n }\n\n /**\n * Gets the count of action events\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionStepsCount'>} [params]\n * @returns {Promise<bigint>}\n */\n public async getActionStepsCount(\n params?: ReadParams<typeof eventActionAbi, 'getActionStepsCount'>,\n ) {\n const steps = await this.getActionSteps(params);\n return steps.length;\n }\n\n /**\n * Retrieves the payload describing how claimants can be identified from logs or function calls.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionClaimant'>} [params]\n * @returns {Promise<ActionClaimant>}\n */\n public async getActionClaimant(\n params?: ReadParams<typeof eventActionAbi, 'getActionClaimant'>,\n ) {\n return readEventActionGetActionClaimant(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n }) as Promise<ActionClaimant>;\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {Promise<readonly [boolean, `0x${string}`]>}\n */\n public async execute(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n return this.awaitResult(this.executeRaw(data, params));\n }\n\n /**\n * Executes a prepared event action\n *\n * @public\n * @async\n * @param {Hex} data\n * @param {?WriteParams<typeof eventActionAbi, 'execute'>} [params]\n * @returns {unknown}\n */\n public async executeRaw(\n data: Hex,\n params?: WriteParams<typeof eventActionAbi, 'execute'>,\n ) {\n const { request, result } = await simulateEventActionExecute(this._config, {\n address: this.assertValidAddress(),\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n args: [data],\n });\n const hash = await writeEventActionExecute(this._config, request);\n return { hash, result };\n }\n\n /**\n * Retrieves action steps, and uses them to validate against, and optionally fetch logs that match the step's signature.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {?ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n * GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async validateActionSteps(\n params?: ReadParams<typeof eventActionAbi, 'getActionSteps'> &\n GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const actionSteps = await this.getActionSteps(params);\n for (const actionStep of actionSteps) {\n if (!(await this.isActionStepValid(actionStep, params))) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a single action step with a given criteria against logs.\n * If logs are provided in the optional `params` argument, then those logs will be used instead of fetched with the configured client.\n *\n * @public\n * @async\n * @param {ActionStep} actionStep\n * @param {?GetLogsParams<Abi, ContractEventName<Abi>> & {\n * knownEvents?: Record<Hex, AbiEvent>;\n * logs?: Log[];\n * }} [params]\n * @returns {Promise<boolean>}\n */\n public async isActionStepValid(\n actionStep: ActionStep,\n params?: GetLogsParams<Abi, ContractEventName<Abi>> & {\n knownEvents?: Record<Hex, AbiEvent>;\n logs?: Log[];\n },\n ) {\n const criteria = actionStep.actionParameter;\n const signature = actionStep.signature;\n let event: AbiEvent;\n // Lookup ABI based on event signature\n if (params?.knownEvents) {\n event = params.knownEvents[signature] as AbiEvent;\n } else {\n event = (events.abi as Record<Hex, AbiEvent>)[signature] as AbiEvent;\n }\n if (!event) {\n throw new Error(`No known ABI for given event signature: ${signature}`);\n }\n const targetContract = actionStep.targetContract;\n // Get all logs matching the event signature from the target contract\n const logs =\n params?.logs ||\n (await getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // biome-ignore lint/suspicious/noExplicitAny: <explanation>\n ...(params as any),\n address: targetContract,\n event,\n }));\n if (!logs.length) return false;\n for (let log of logs) {\n if (!this.validateLogAgainstCriteria(criteria, log)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Validates a {@link Log} against a given criteria.\n *\n * @param {Criteria} criteria - The criteria to validate against.\n * @param {Log} log - The Viem event log.\n * @returns {Promise<boolean>} - Returns true if the log passes the criteria, false otherwise.\n */\n public async validateLogAgainstCriteria(criteria: Criteria, log: Log) {\n const fieldValue = log.topics.at(criteria.fieldIndex);\n if (fieldValue === undefined) {\n throw new FieldValueUndefinedError({ log, criteria, fieldValue });\n }\n // Type narrow based on criteria.filterType\n switch (criteria.filterType) {\n case FilterType.EQUAL:\n if (criteria.fieldType === PrimitiveType.ADDRESS) {\n return isAddressEqual(\n criteria.filterData,\n `0x${fieldValue.slice(-40)}`,\n );\n }\n return fieldValue === criteria.filterData;\n\n case FilterType.NOT_EQUAL:\n return fieldValue !== criteria.filterData;\n\n case FilterType.GREATER_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) > BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.LESS_THAN:\n if (criteria.fieldType === PrimitiveType.UINT) {\n return BigInt(fieldValue) < BigInt(criteria.filterData);\n }\n throw new InvalidNumericalCriteriaError({ log, criteria, fieldValue });\n\n case FilterType.CONTAINS:\n if (\n criteria.fieldType === PrimitiveType.BYTES ||\n criteria.fieldType === PrimitiveType.STRING\n ) {\n return fieldValue.includes(criteria.filterData);\n }\n throw new FieldValueNotComparableError({ log, criteria, fieldValue });\n\n default:\n throw new UnrecognizedFilterTypeError({ log, criteria, fieldValue });\n }\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?EventActionPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: EventActionPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n let rawPayload: EventActionPayloadRaw;\n if (isEventActionPayloadSimple(payload)) {\n // filter out any falsy potential values\n let tmpSteps = payload.actionSteps.filter((step) => !!step);\n if (tmpSteps.length === 0) {\n throw new NoEventActionStepsProvidedError();\n }\n if (tmpSteps.length > 4) {\n throw new TooManyEventActionStepsProvidedError();\n }\n let steps: ActionStep[] = Array.from({ length: 4 }, (_, i) => {\n // use either the provided step at the given index, or reuse the previous step\n // should aways exist\n return tmpSteps.at(i)! || tmpSteps.slice(0, i).at(-1)!;\n });\n rawPayload = {\n actionClaimant: payload.actionClaimant,\n actionStepOne: steps.at(0)!,\n actionStepTwo: steps.at(1)!,\n actionStepThree: steps.at(2)!,\n actionStepFour: steps.at(3)!,\n };\n } else {\n rawPayload = payload;\n }\n return {\n abi: eventActionAbi,\n bytecode: bytecode as Hex,\n args: [prepareEventActionPayload(rawPayload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["_EventAction","DeployableTarget","eventActionAbi","index","params","steps","readEventActionGetActionSteps","dedupeActionSteps","readEventActionGetActionClaimant","data","request","result","simulateEventActionExecute","writeEventActionExecute","actionSteps","actionStep","criteria","signature","event","events","targetContract","logs","getLogs","log","fieldValue","FieldValueUndefinedError","FilterType","PrimitiveType","isAddressEqual","InvalidNumericalCriteriaError","FieldValueNotComparableError","UnrecognizedFilterTypeError","_payload","_options","payload","options","rawPayload","isEventActionPayloadSimple","tmpSteps","step","NoEventActionStepsProvidedError","TooManyEventActionStepsProvidedError","_","i","bytecode","prepareEventActionPayload","define_import_meta_env_default","RegistryType","EventAction"],"mappings":";;;;;;;;;AA6DO,MAAMA,IAAN,MAAMA,UAAoBC,EAG/B;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAWL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA2B/B,MAAa,cACXC,GACAC,GACA;AAEO,YADO,MAAM,KAAK,eAAeA,CAAM,GACjC,GAAGD,CAAK;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,eACXC,GACA;AACA,UAAMC,IAAS,MAAMC,EAA8B,KAAK,SAAS;AAAA,MAC/D,SAAS,KAAK,mBAAmB;AAAA,MACjC,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIF;AAAA,IAAA,CACL;AACD,WAAOG,EAAkBF,CAAK;AAAA,EACh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AAC;AAAA,QACzB,iBAAiBA,EAAM,GAAG,CAAC;AAAA,QAC3B,gBAAgBA,EAAM,GAAG,CAAC;AAAA,MAAA;AAAA,IAC5B;AAEa,MAAA+B,IAAAF;AAER,WAAA;AAAA,MACL,KAAKhC;AAAAA,MACL,UAAA0C;AAAA,MACA,MAAM,CAACC,EAA0BT,CAAU,CAAC;AAAA,MAC5C,GAAG,KAAK,wBAAwBD,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;AA7SyBnC,EAAA,OAAgB8C,EAAgB,wBAQvD9C,EAAuB,eAA6B+C,EAAa;AA3B5D,IAAMC,IAANhD;"}
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../generated-Cd-Fe7W7.cjs"),c=require("@wagmi/core"),a=require("../errors.cjs"),i=require("./SimpleAllowList.cjs"),l=require("./SimpleDenyList.cjs"),e={"0x8ba1fc24":i.SimpleAllowList,"0x3d30a22c":l.SimpleDenyList};async function m(t,n){const o=await c.readContract(t.config,{abi:s.oe,functionName:"getComponentInterface",address:n}),r=e[o];if(!r)throw new a.InvalidComponentInterfaceError(Object.keys(e),o);return new r(t,n)}exports.SimpleAllowList=i.SimpleAllowList;exports.SimpleDenyList=l.SimpleDenyList;exports.AllowListByComponentInterface=e;exports.allowListFromAddress=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-Cd-Fe7W7.cjs"),r=require("../componentInterfaces-CKCBwG16.cjs"),m=require("@wagmi/core"),a=require("../errors.cjs"),l=require("./SimpleAllowList.cjs"),s=require("./SimpleDenyList.cjs"),e={[r.ASimpleAllowList]:l.SimpleAllowList,[r.ASimpleDenyList]:s.SimpleDenyList};async function p(t,n){const o=await m.readContract(t.config,{abi:c.oe,functionName:"getComponentInterface",address:n}),i=e[o];if(!i)throw new a.InvalidComponentInterfaceError(Object.keys(e),o);return new i(t,n)}exports.SimpleAllowList=l.SimpleAllowList;exports.SimpleDenyList=s.SimpleDenyList;exports.AllowListByComponentInterface=e;exports.allowListFromAddress=p;
2
+ //# sourceMappingURL=AllowList.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllowList.cjs","sources":["../../src/AllowLists/AllowList.ts"],"sourcesContent":["import { aAllowListAbi } from '@boostxyz/evm';\nimport {\n ASimpleAllowList,\n ASimpleDenyList,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport { SimpleAllowList } from './SimpleAllowList';\nimport { SimpleDenyList } from './SimpleDenyList';\n\nexport { SimpleAllowList, SimpleDenyList };\n\n/**\n * A union type representing all valid protocol AllowList implementations\n *\n * @export\n * @typedef {AllowList}\n */\nexport type AllowList = SimpleAllowList | SimpleDenyList;\n\n/**\n * A map of AllowList component interfaces to their constructors.\n *\n * @type {{ \"0x2bc9016b\": SimpleAllowList; \"0x9d585f63\": SimpleDenyList; }}\n */\nexport const AllowListByComponentInterface = {\n [ASimpleAllowList as Hex]: SimpleAllowList,\n [ASimpleDenyList as Hex]: SimpleDenyList,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Promise<SimpleAllowList | SimpleDenyList>}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function allowListFromAddress(\n options: DeployableOptions,\n address: Address,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aAllowListAbi,\n functionName: 'getComponentInterface',\n address,\n })) as keyof typeof AllowListByComponentInterface;\n const Ctor = AllowListByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(AllowListByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["AllowListByComponentInterface","ASimpleAllowList","SimpleAllowList","ASimpleDenyList","SimpleDenyList","allowListFromAddress","options","address","interfaceId","readContract","aAllowListAbi","Ctor","InvalidComponentInterfaceError"],"mappings":"uSA2BaA,EAAgC,CAC3C,CAACC,EAAuB,gBAAA,EAAGC,EAAA,gBAC3B,CAACC,EAAsB,eAAA,EAAGC,EAAA,cAC5B,EAYsB,eAAAC,EACpBC,EACAC,EACA,CACA,MAAMC,EAAe,MAAMC,eAAaH,EAAQ,OAAQ,CACtD,IAAKI,EAAA,GACL,aAAc,wBACd,QAAAH,CAAA,CACD,EACKI,EAAOX,EAA8BQ,CAAW,EACtD,GAAI,CAACG,EACH,MAAM,IAAIC,EAAA,+BACR,OAAO,KAAKZ,CAA6B,EACzCQ,CAAA,EAGG,OAAA,IAAIG,EAAKL,EAASC,CAAO,CAClC"}
@@ -16,8 +16,7 @@ export type AllowList = SimpleAllowList | SimpleDenyList;
16
16
  * @type {{ "0x2bc9016b": SimpleAllowList; "0x9d585f63": SimpleDenyList; }}
17
17
  */
18
18
  export declare const AllowListByComponentInterface: {
19
- "0x8ba1fc24": typeof SimpleAllowList;
20
- "0x3d30a22c": typeof SimpleDenyList;
19
+ [x: string]: typeof SimpleDenyList | typeof SimpleAllowList;
21
20
  };
22
21
  /**
23
22
  * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.
@@ -1 +1 @@
1
- {"version":3,"file":"AllowList.d.ts","sourceRoot":"","sources":["../../src/AllowLists/AllowList.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,cAAc,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;CAGzC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,OAAO,6CAejB"}
1
+ {"version":3,"file":"AllowList.d.ts","sourceRoot":"","sources":["../../src/AllowLists/AllowList.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,cAAc,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;CAGzC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,OAAO,6CAejB"}
@@ -1,28 +1,30 @@
1
1
  import { o as i } from "../generated-DGpIVcv5.js";
2
- import { readContract as m } from "@wagmi/core";
3
- import { InvalidComponentInterfaceError as a } from "../errors.js";
4
- import { SimpleAllowList as c } from "./SimpleAllowList.js";
5
- import { SimpleDenyList as f } from "./SimpleDenyList.js";
2
+ import { a as m, b as a } from "../componentInterfaces-DYkaxBda.js";
3
+ import { readContract as f } from "@wagmi/core";
4
+ import { InvalidComponentInterfaceError as c } from "../errors.js";
5
+ import { SimpleAllowList as l } from "./SimpleAllowList.js";
6
+ import { SimpleDenyList as p } from "./SimpleDenyList.js";
6
7
  const n = {
7
- "0x8ba1fc24": c,
8
- "0x3d30a22c": f
8
+ [m]: l,
9
+ [a]: p
9
10
  };
10
11
  async function I(o, t) {
11
- const r = await m(o.config, {
12
+ const e = await f(o.config, {
12
13
  abi: i,
13
14
  functionName: "getComponentInterface",
14
15
  address: t
15
- }), e = n[r];
16
- if (!e)
17
- throw new a(
16
+ }), r = n[e];
17
+ if (!r)
18
+ throw new c(
18
19
  Object.keys(n),
19
- r
20
+ e
20
21
  );
21
- return new e(o, t);
22
+ return new r(o, t);
22
23
  }
23
24
  export {
24
25
  n as AllowListByComponentInterface,
25
- c as SimpleAllowList,
26
- f as SimpleDenyList,
26
+ l as SimpleAllowList,
27
+ p as SimpleDenyList,
27
28
  I as allowListFromAddress
28
29
  };
30
+ //# sourceMappingURL=AllowList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AllowList.js","sources":["../../src/AllowLists/AllowList.ts"],"sourcesContent":["import { aAllowListAbi } from '@boostxyz/evm';\nimport {\n ASimpleAllowList,\n ASimpleDenyList,\n} from '@boostxyz/evm/deploys/componentInterfaces.json';\nimport { readContract } from '@wagmi/core';\nimport type { Address, Hex } from 'viem';\nimport type { DeployableOptions } from '../Deployable/Deployable';\nimport { InvalidComponentInterfaceError } from '../errors';\nimport { SimpleAllowList } from './SimpleAllowList';\nimport { SimpleDenyList } from './SimpleDenyList';\n\nexport { SimpleAllowList, SimpleDenyList };\n\n/**\n * A union type representing all valid protocol AllowList implementations\n *\n * @export\n * @typedef {AllowList}\n */\nexport type AllowList = SimpleAllowList | SimpleDenyList;\n\n/**\n * A map of AllowList component interfaces to their constructors.\n *\n * @type {{ \"0x2bc9016b\": SimpleAllowList; \"0x9d585f63\": SimpleDenyList; }}\n */\nexport const AllowListByComponentInterface = {\n [ASimpleAllowList as Hex]: SimpleAllowList,\n [ASimpleDenyList as Hex]: SimpleDenyList,\n};\n\n/**\n * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.\n *\n * @export\n * @async\n * @param {DeployableOptions} options\n * @param {Address} address\n * @returns {Promise<SimpleAllowList | SimpleDenyList>}\n * @throws {@link InvalidComponentInterfaceError}\n */\nexport async function allowListFromAddress(\n options: DeployableOptions,\n address: Address,\n) {\n const interfaceId = (await readContract(options.config, {\n abi: aAllowListAbi,\n functionName: 'getComponentInterface',\n address,\n })) as keyof typeof AllowListByComponentInterface;\n const Ctor = AllowListByComponentInterface[interfaceId];\n if (!Ctor) {\n throw new InvalidComponentInterfaceError(\n Object.keys(AllowListByComponentInterface) as Hex[],\n interfaceId as Hex,\n );\n }\n return new Ctor(options, address);\n}\n"],"names":["AllowListByComponentInterface","ASimpleAllowList","SimpleAllowList","ASimpleDenyList","SimpleDenyList","allowListFromAddress","options","address","interfaceId","readContract","aAllowListAbi","Ctor","InvalidComponentInterfaceError"],"mappings":";;;;;;AA2BO,MAAMA,IAAgC;AAAA,EAC3C,CAACC,CAAuB,GAAGC;AAAA,EAC3B,CAACC,CAAsB,GAAGC;AAC5B;AAYsB,eAAAC,EACpBC,GACAC,GACA;AACA,QAAMC,IAAe,MAAMC,EAAaH,EAAQ,QAAQ;AAAA,IACtD,KAAKI;AAAAA,IACL,cAAc;AAAA,IACd,SAAAH;AAAA,EAAA,CACD,GACKI,IAAOX,EAA8BQ,CAAW;AACtD,MAAI,CAACG;AACH,UAAM,IAAIC;AAAA,MACR,OAAO,KAAKZ,CAA6B;AAAA,MACzCQ;AAAA,IAAA;AAGG,SAAA,IAAIG,EAAKL,GAASC,CAAO;AAClC;"}
@@ -1 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../generated-Cd-Fe7W7.cjs"),n=require("@wagmi/core"),o=require("viem"),l=require("../Deployable/DeployableTarget.cjs"),h=require("../errors.cjs"),i=require("../utils.cjs"),u="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b61140e806100bd5f395ff3fe608060405260043610610113575f3560e01c80634a4ee7b11161009f57806398332bbc1161006357806398332bbc1461031d578063e3f756de14610347578063f04e283e14610383578063f2fde38b1461039f578063fee81cf4146103bb57610113565b80634a4ee7b114610287578063514e62fc146102a357806354d1f13d146102df578063715018a6146102e95780638da5cb5b146102f357610113565b806325692962116100e657806325692962146101c757806328d6183b146101d15780632de94807146101fb5780633abb060414610237578063439fab911461025f57610113565b806301ffc9a714610117578063183a4f6e146101535780631c10893f1461016f5780631cd64df41461018b575b5f80fd5b348015610122575f80fd5b5061013d60048036038101906101389190610d51565b6103f7565b60405161014a9190610d96565b60405180910390f35b61016d60048036038101906101689190610de2565b610470565b005b61018960048036038101906101849190610e67565b61047d565b005b348015610196575f80fd5b506101b160048036038101906101ac9190610e67565b610493565b6040516101be9190610d96565b60405180910390f35b6101cf6104a9565b005b3480156101dc575f80fd5b506101e56104fa565b6040516101f29190610eb4565b60405180910390f35b348015610206575f80fd5b50610221600480360381019061021c9190610ecd565b610521565b60405161022e9190610f07565b60405180910390f35b348015610242575f80fd5b5061025d60048036038101906102589190610fd6565b61053a565b005b34801561026a575f80fd5b50610285600480360381019061028091906110a9565b610647565b005b6102a1600480360381019061029c9190610e67565b61076f565b005b3480156102ae575f80fd5b506102c960048036038101906102c49190610e67565b610785565b6040516102d69190610d96565b60405180910390f35b6102e761079c565b005b6102f16107d5565b005b3480156102fe575f80fd5b506103076107e8565b6040516103149190611103565b60405180910390f35b348015610328575f80fd5b50610331610810565b60405161033e9190610f07565b60405180910390f35b348015610352575f80fd5b5061036d6004803603810190610368919061111c565b610815565b60405161037a9190610d96565b60405180910390f35b61039d60048036038101906103989190610ecd565b610868565b005b6103b960048036038101906103b49190610ecd565b6108a6565b005b3480156103c6575f80fd5b506103e160048036038101906103dc9190610ecd565b6108cf565b6040516103ee9190610f07565b60405180910390f35b5f7f8ba1fc24000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806104695750610468826108e8565b5b9050919050565b61047a3382610961565b50565b610485610970565b61048f82826109a7565b5050565b5f818261049f85610521565b1614905092915050565b5f6104b26109b7565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f8ba1fc2400000000000000000000000000000000000000000000000000000000905090565b5f638b78c6d8600c52815f526020600c20549050919050565b6002610545816109c1565b828290508585905014610584576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b8585905081101561063f578383828181106105a4576105a3611179565b5b90506020020160208101906105b991906111d0565b5f808888858181106105ce576105cd611179565b5b90506020020160208101906105e39190610ecd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610586565b505050505050565b5f6106506109e8565b905080546003825580156106825760018160011c14303b106106795763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f808484810190610694919061137e565b915091506106a182610a11565b6106ac8260026109a7565b5f5b81518110156107325760015f808484815181106106ce576106cd611179565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506106ae565b505050801561076a576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b610777610970565b6107818282610961565b5050565b5f808261079185610521565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b6107dd610970565b6107e65f610ae7565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b600281565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1690509392505050565b610870610970565b63389a75e1600c52805f526020600c20805442111561089657636f5e88185f526004601cfd5b5f8155506108a381610ae7565b50565b6108ae610970565b8060601b6108c357637448fbae5f526004601cfd5b6108cc81610ae7565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fe2089f79000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061095a575061095982610bad565b5b9050919050565b61096c82825f610c26565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146109a5576382b429005f526004601cfd5b565b6109b382826001610c26565b5050565b5f6202a300905090565b638b78c6d8600c52335f52806020600c2054166109e5576382b429005f526004601cfd5b50565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b610a19610c7e565b15610a91577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805415610a5357630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a350610ae4565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b610aef610c7e565b15610b54577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610baa565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610c1f5750610c1e82610c82565b5b9050919050565b638b78c6d8600c52825f526020600c20805483811783610c4857848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f80a3505050505050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610d3081610cfc565b8114610d3a575f80fd5b50565b5f81359050610d4b81610d27565b92915050565b5f60208284031215610d6657610d65610cf4565b5b5f610d7384828501610d3d565b91505092915050565b5f8115159050919050565b610d9081610d7c565b82525050565b5f602082019050610da95f830184610d87565b92915050565b5f819050919050565b610dc181610daf565b8114610dcb575f80fd5b50565b5f81359050610ddc81610db8565b92915050565b5f60208284031215610df757610df6610cf4565b5b5f610e0484828501610dce565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610e3682610e0d565b9050919050565b610e4681610e2c565b8114610e50575f80fd5b50565b5f81359050610e6181610e3d565b92915050565b5f8060408385031215610e7d57610e7c610cf4565b5b5f610e8a85828601610e53565b9250506020610e9b85828601610dce565b9150509250929050565b610eae81610cfc565b82525050565b5f602082019050610ec75f830184610ea5565b92915050565b5f60208284031215610ee257610ee1610cf4565b5b5f610eef84828501610e53565b91505092915050565b610f0181610daf565b82525050565b5f602082019050610f1a5f830184610ef8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112610f4157610f40610f20565b5b8235905067ffffffffffffffff811115610f5e57610f5d610f24565b5b602083019150836020820283011115610f7a57610f79610f28565b5b9250929050565b5f8083601f840112610f9657610f95610f20565b5b8235905067ffffffffffffffff811115610fb357610fb2610f24565b5b602083019150836020820283011115610fcf57610fce610f28565b5b9250929050565b5f805f8060408587031215610fee57610fed610cf4565b5b5f85013567ffffffffffffffff81111561100b5761100a610cf8565b5b61101787828801610f2c565b9450945050602085013567ffffffffffffffff81111561103a57611039610cf8565b5b61104687828801610f81565b925092505092959194509250565b5f8083601f84011261106957611068610f20565b5b8235905067ffffffffffffffff81111561108657611085610f24565b5b6020830191508360018202830111156110a2576110a1610f28565b5b9250929050565b5f80602083850312156110bf576110be610cf4565b5b5f83013567ffffffffffffffff8111156110dc576110db610cf8565b5b6110e885828601611054565b92509250509250929050565b6110fd81610e2c565b82525050565b5f6020820190506111165f8301846110f4565b92915050565b5f805f6040848603121561113357611132610cf4565b5b5f61114086828701610e53565b935050602084013567ffffffffffffffff81111561116157611160610cf8565b5b61116d86828701611054565b92509250509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6111af81610d7c565b81146111b9575f80fd5b50565b5f813590506111ca816111a6565b92915050565b5f602082840312156111e5576111e4610cf4565b5b5f6111f2848285016111bc565b91505092915050565b5f61120582610e0d565b9050919050565b611215816111fb565b811461121f575f80fd5b50565b5f813590506112308161120c565b92915050565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61127c82611236565b810181811067ffffffffffffffff8211171561129b5761129a611246565b5b80604052505050565b5f6112ad610ceb565b90506112b98282611273565b919050565b5f67ffffffffffffffff8211156112d8576112d7611246565b5b602082029050602081019050919050565b5f6112fb6112f6846112be565b6112a4565b9050808382526020820190506020840283018581111561131e5761131d610f28565b5b835b8181101561134757806113338882610e53565b845260208401935050602081019050611320565b5050509392505050565b5f82601f83011261136557611364610f20565b5b81356113758482602086016112e9565b91505092915050565b5f806040838503121561139457611393610cf4565b5b5f6113a185828601611222565b925050602083013567ffffffffffffffff8111156113c2576113c1610cf8565b5b6113ce85828601611351565b915050925092905056fea264697066735822122094368c65f566939d0b9827de55e44a26c567f89bc0bf24103275890d9278dc0164736f6c634300081a0033",A=2n,s=class s extends l.DeployableTarget{constructor(){super(...arguments),this.abi=c.T}async isAllowed(b,e){return await c.JN(this._config,{address:this.assertValidAddress(),args:[b,o.zeroHash],...this.optionallyAttachAccount(),...e})}async setAllowed(b,e,f){return this.awaitResult(this.setAllowedRaw(b,e,f))}async setAllowedRaw(b,e,f){const{request:a,result:d}=await c.Ah(this._config,{address:this.assertValidAddress(),args:[b,e],...this.optionallyAttachAccount(),...f});return{hash:await c.lh(this._config,a),result:d}}async grantRoles(b,e,f){return this.awaitResult(this.grantRolesRaw(b,e,f))}async grantRolesRaw(b,e,f){const{request:a,result:d}=await c.bh(this._config,{address:this.assertValidAddress(),args:[b,e],...this.optionallyAttachAccount(),...f});return{hash:await c.ih(this._config,a),result:d}}buildParameters(b,e){var d;const[f,a]=this.validateDeploymentConfig(b,e);if(!f.owner||f.owner===o.zeroAddress){const t=a.account?a.account.address:a.config?n.getAccount(a.config).address:(d=this._account)==null?void 0:d.address;if(t)f.owner=t;else throw new h.DeployableUnknownOwnerProvidedError}return{abi:c.T,bytecode:u,args:[i.prepareSimpleAllowListPayload(f)],...this.optionallyAttachAccount(a.account)}}};s.base="0x11556926AaA421e96e06a7A679C680813122db7D",s.registryType=i.RegistryType.ALLOW_LIST;let r=s;exports.simpleAllowListAbi=c.T;exports.LIST_MANAGER_ROLE=A;exports.SimpleAllowList=r;
2
+ //# sourceMappingURL=SimpleAllowList.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleAllowList.cjs","sources":["../../src/AllowLists/SimpleAllowList.ts"],"sourcesContent":["import {\n readSimpleAllowListIsAllowed,\n simpleAllowListAbi,\n simulateSimpleAllowListGrantRoles,\n simulateSimpleAllowListSetAllowed,\n writeSimpleAllowListGrantRoles,\n writeSimpleAllowListSetAllowed,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleAllowList.sol/SimpleAllowList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type SimpleAllowListPayload,\n prepareSimpleAllowListPayload,\n} from '../utils';\n\nexport { simpleAllowListAbi };\nexport type { SimpleAllowListPayload };\n\n/**\n * A generic `viem.Log` event with support for `SimpleAllowList` event types.\n *\n * @export\n * @typedef {SimpleAllowListLog}\n * @template {ContractEventName<\n * typeof simpleAllowListAbi\n * >} [event=ContractEventName<typeof simpleAllowListAbi>]\n */\nexport type SimpleAllowListLog<\n event extends ContractEventName<\n typeof simpleAllowListAbi\n > = ContractEventName<typeof simpleAllowListAbi>,\n> = GenericLog<typeof simpleAllowListAbi, event>;\n\n/**\n * A constant representing the list manager's role\n *\n * @type {2n}\n */\nexport const LIST_MANAGER_ROLE = 2n;\n/**\n * A simple implementation of an AllowList that checks if a user is authorized based on a list of allowed addresses\n *\n * @export\n * @class SimpleAllowList\n * @typedef {SimpleAllowList}\n * @extends {DeployableTarget<SimpleAllowListPayload>}\n */\nexport class SimpleAllowList extends DeployableTarget<\n SimpleAllowListPayload,\n typeof simpleAllowListAbi\n> {\n public override readonly abi = simpleAllowListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIMPLE_ALLOWLIST_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Check if a user is authorized.\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ): Promise<boolean> {\n return await readSimpleAllowListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<void>}\n */\n public async setAllowed(\n addresses: Address[],\n allowed: boolean[],\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ) {\n return this.awaitResult(this.setAllowedRaw(addresses, allowed, params));\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<void>}\n */\n public async setAllowedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ) {\n const { request, result } = await simulateSimpleAllowListSetAllowed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleAllowListSetAllowed(this._config, request);\n return { hash, result };\n }\n\n /**\n * Allows the owner to grant `user` `roles`.\n *\n * @public\n * @async\n * @param {Address} address\n * @param {bigint} role\n * @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]\n * @returns {Promise<void>}\n */\n public async grantRoles(\n address: Address,\n role: bigint,\n params?: ReadParams<typeof simpleAllowListAbi, 'grantRoles'>,\n ) {\n return this.awaitResult(this.grantRolesRaw(address, role, params));\n }\n\n /**\n * Allows the owner to grant `user` `roles`.\n *\n * @public\n * @async\n * @param {Address} address\n * @param {bigint} role\n * @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]\n * @returns {Promise<void>}\n */\n public async grantRolesRaw(\n address: Address,\n role: bigint,\n params?: ReadParams<typeof simpleAllowListAbi, 'grantRoles'>,\n ) {\n const { request, result } = await simulateSimpleAllowListGrantRoles(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [address, role],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleAllowListGrantRoles(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleAllowListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleAllowListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleAllowListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleAllowListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["LIST_MANAGER_ROLE","_SimpleAllowList","DeployableTarget","simpleAllowListAbi","address","params","readSimpleAllowListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleAllowListSetAllowed","writeSimpleAllowListSetAllowed","role","simulateSimpleAllowListGrantRoles","writeSimpleAllowListGrantRoles","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleAllowListPayload","RegistryType","SimpleAllowList"],"mappings":"0qVAsDaA,EAAoB,GASpBC,EAAN,MAAMA,UAA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A,YAAa,CACnD,MAAMC,EAAQF,EAAQ,QAClBA,EAAQ,QAAQ,QAChBA,EAAQ,OACNG,EAAA,WAAWH,EAAQ,MAAM,EAAE,SAC3BI,EAAA,KAAK,WAAL,YAAAA,EAAe,QACrB,GAAIF,EACFH,EAAQ,MAAQG,MAEhB,OAAM,IAAIG,EAAoC,mCAElD,CACO,MAAA,CACL,IAAKtB,EAAA,EACL,SAAAuB,EACA,KAAM,CAACC,gCAA8BR,CAAO,CAAC,EAC7C,GAAG,KAAK,wBAAwBC,EAAQ,OAAO,CAAA,CAEnD,CACF,EApKyBnB,EAAA,KAAgB,6CASvCA,EAAuB,aAA6B2B,EAAa,aAAA,WArB5D,IAAMC,EAAN5B"}
@@ -136,3 +136,4 @@ export {
136
136
  r as SimpleAllowList,
137
137
  t as simpleAllowListAbi
138
138
  };
139
+ //# sourceMappingURL=SimpleAllowList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleAllowList.js","sources":["../../src/AllowLists/SimpleAllowList.ts"],"sourcesContent":["import {\n readSimpleAllowListIsAllowed,\n simpleAllowListAbi,\n simulateSimpleAllowListGrantRoles,\n simulateSimpleAllowListSetAllowed,\n writeSimpleAllowListGrantRoles,\n writeSimpleAllowListSetAllowed,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleAllowList.sol/SimpleAllowList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type SimpleAllowListPayload,\n prepareSimpleAllowListPayload,\n} from '../utils';\n\nexport { simpleAllowListAbi };\nexport type { SimpleAllowListPayload };\n\n/**\n * A generic `viem.Log` event with support for `SimpleAllowList` event types.\n *\n * @export\n * @typedef {SimpleAllowListLog}\n * @template {ContractEventName<\n * typeof simpleAllowListAbi\n * >} [event=ContractEventName<typeof simpleAllowListAbi>]\n */\nexport type SimpleAllowListLog<\n event extends ContractEventName<\n typeof simpleAllowListAbi\n > = ContractEventName<typeof simpleAllowListAbi>,\n> = GenericLog<typeof simpleAllowListAbi, event>;\n\n/**\n * A constant representing the list manager's role\n *\n * @type {2n}\n */\nexport const LIST_MANAGER_ROLE = 2n;\n/**\n * A simple implementation of an AllowList that checks if a user is authorized based on a list of allowed addresses\n *\n * @export\n * @class SimpleAllowList\n * @typedef {SimpleAllowList}\n * @extends {DeployableTarget<SimpleAllowListPayload>}\n */\nexport class SimpleAllowList extends DeployableTarget<\n SimpleAllowListPayload,\n typeof simpleAllowListAbi\n> {\n public override readonly abi = simpleAllowListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIMPLE_ALLOWLIST_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Check if a user is authorized.\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ): Promise<boolean> {\n return await readSimpleAllowListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<void>}\n */\n public async setAllowed(\n addresses: Address[],\n allowed: boolean[],\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ) {\n return this.awaitResult(this.setAllowedRaw(addresses, allowed, params));\n }\n\n /**\n * Set the allowed status of a user. The length of the `users_` and `allowed_` arrays must be the same.\n * This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The allowed status of each user\n * @param {?ReadParams<typeof simpleAllowListAbi, 'setAllowed'>} [params]\n * @returns {Promise<void>}\n */\n public async setAllowedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: ReadParams<typeof simpleAllowListAbi, 'setAllowed'>,\n ) {\n const { request, result } = await simulateSimpleAllowListSetAllowed(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleAllowListSetAllowed(this._config, request);\n return { hash, result };\n }\n\n /**\n * Allows the owner to grant `user` `roles`.\n *\n * @public\n * @async\n * @param {Address} address\n * @param {bigint} role\n * @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]\n * @returns {Promise<void>}\n */\n public async grantRoles(\n address: Address,\n role: bigint,\n params?: ReadParams<typeof simpleAllowListAbi, 'grantRoles'>,\n ) {\n return this.awaitResult(this.grantRolesRaw(address, role, params));\n }\n\n /**\n * Allows the owner to grant `user` `roles`.\n *\n * @public\n * @async\n * @param {Address} address\n * @param {bigint} role\n * @param {?ReadParams<typeof simpleAllowListAbi, 'grantRoles'>} [params]\n * @returns {Promise<void>}\n */\n public async grantRolesRaw(\n address: Address,\n role: bigint,\n params?: ReadParams<typeof simpleAllowListAbi, 'grantRoles'>,\n ) {\n const { request, result } = await simulateSimpleAllowListGrantRoles(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [address, role],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleAllowListGrantRoles(this._config, request);\n return { hash, result };\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleAllowListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleAllowListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleAllowListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleAllowListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["LIST_MANAGER_ROLE","_SimpleAllowList","DeployableTarget","simpleAllowListAbi","address","params","readSimpleAllowListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleAllowListSetAllowed","writeSimpleAllowListSetAllowed","role","simulateSimpleAllowListGrantRoles","writeSimpleAllowListGrantRoles","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleAllowListPayload","RegistryType","SimpleAllowList"],"mappings":";;;;;;s6UAsDaA,IAAoB,IASpBC,IAAN,MAAMA,UAAwBC,EAGnC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4B/B,MAAa,UACXC,GACAC,GACkB;A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A,QACpB,GAAG,KAAK,wBAAwB;AAAA;AAAA,QAEhC,GAAIT;AAAA,MACN;AAAA,IAAA;AAGK,WAAA,EAAE,MADI,MAAMW,EAA+B,KAAK,SAASN,CAAO,GACxD,QAAAC;EACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACdM,GACAC,GACyB;;AACzB,UAAM,CAACC,GAASC,CAAO,IAAI,KAAK;AAAA,MAC9BH;AAAA,MACAC;AAAA,IAAA;AAEF,QAAI,CAACC,EAAQ,SAASA,EAAQ,UAAUE,GAAa;AACnD,YAAMC,IAAQF,EAAQ,UAClBA,EAAQ,QAAQ,UAChBA,EAAQ,SACNG,EAAWH,EAAQ,MAAM,EAAE,WAC3BI,IAAA,KAAK,aAAL,gBAAAA,EAAe;AACrB,UAAIF;AACF,QAAAH,EAAQ,QAAQG;AAAA;AAEhB,cAAM,IAAIG,EAAoC;AAAA,IAElD;AACO,WAAA;AAAA,MACL,KAAKtB;AAAAA,MACL,UAAAuB;AAAA,MACA,MAAM,CAACC,EAA8BR,CAAO,CAAC;AAAA,MAC7C,GAAG,KAAK,wBAAwBC,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;AApKyBnB,EAAA,OAAgB,8CASvCA,EAAuB,eAA6B2B,EAAa;AArB5D,IAAMC,IAAN5B;"}
@@ -1 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../generated-Cd-Fe7W7.cjs"),n=require("@wagmi/core"),o=require("viem"),l=require("../Deployable/DeployableTarget.cjs"),u=require("../errors.cjs"),i=require("../utils.cjs"),h="0x6080604052348015600e575f80fd5b50601b601f60201b60201c565b60b0565b5f602c608760201b60201c565b90508054600181161560455763f92ee8a95f526004601cfd5b8160c01c808260011c146082578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6110ac806100bd5f395ff3fe6080604052600436106100a6575f3560e01c8063715018a611610063578063715018a6146101745780638da5cb5b1461017e578063e3f756de146101a8578063f04e283e146101e4578063f2fde38b14610200578063fee81cf41461021c576100a6565b806301ffc9a7146100aa578063141973b0146100e6578063256929621461010e57806328d6183b14610118578063439fab911461014257806354d1f13d1461016a575b5f80fd5b3480156100b5575f80fd5b506100d060048036038101906100cb9190610a82565b610258565b6040516100dd9190610ac7565b60405180910390f35b3480156100f1575f80fd5b5061010c60048036038101906101079190610b96565b6102d1565b005b6101166103da565b005b348015610123575f80fd5b5061012c61042b565b6040516101399190610c23565b60405180910390f35b34801561014d575f80fd5b5061016860048036038101906101639190610c91565b610452565b005b61017261056f565b005b61017c6105a8565b005b348015610189575f80fd5b506101926105bb565b60405161019f9190610d1b565b60405180910390f35b3480156101b3575f80fd5b506101ce60048036038101906101c99190610d5e565b6105e3565b6040516101db9190610ac7565b60405180910390f35b6101fe60048036038101906101f99190610dbb565b610637565b005b61021a60048036038101906102159190610dbb565b610675565b005b348015610227575f80fd5b50610242600480360381019061023d9190610dbb565b61069e565b60405161024f9190610dfe565b60405180910390f35b5f7f3d30a22c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806102ca57506102c9826106b7565b5b9050919050565b6102d9610730565b818190508484905014610318576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b848490508110156103d35782828281811061033857610337610e17565b5b905060200201602081019061034d9190610e6e565b5f8087878581811061036257610361610e17565b5b90506020020160208101906103779190610dbb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550808060010191505061031a565b5050505050565b5f6103e3610767565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f7f3d30a22c00000000000000000000000000000000000000000000000000000000905090565b5f61045b610771565b9050805460038255801561048d5760018160011c14303b106104845763f92ee8a95f526004601cfd5b818160ff1b1b91505b505f80848481019061049f919061101c565b915091506104ac8261079a565b5f5b81518110156105325760015f808484815181106104ce576104cd610e17565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555080806001019150506104ae565b505050801561056a576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b6105b0610730565b6105b95f610870565b565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161590509392505050565b61063f610730565b63389a75e1600c52805f526020600c20805442111561066557636f5e88185f526004601cfd5b5f81555061067281610870565b50565b61067d610730565b8060601b61069257637448fbae5f526004601cfd5b61069b81610870565b50565b5f63389a75e1600c52815f526020600c20549050919050565b5f7fe2089f79000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610729575061072882610936565b5b9050919050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610765576382b429005f526004601cfd5b565b5f6202a300905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf6011325f1b905090565b6107a26109af565b1561081a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278054156107dc57630dc149f05f526004601cfd5b8160601b60601c9150811560ff1b82178155815f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35061086d565b8060601b60601c9050807fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392755805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a35b50565b6108786109af565b156108dd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217815550610933565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3818155505b50565b5f7f6ab67a0d000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806109a857506109a7826109b3565b5b9050919050565b5f90565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610a6181610a2d565b8114610a6b575f80fd5b50565b5f81359050610a7c81610a58565b92915050565b5f60208284031215610a9757610a96610a25565b5b5f610aa484828501610a6e565b91505092915050565b5f8115159050919050565b610ac181610aad565b82525050565b5f602082019050610ada5f830184610ab8565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112610b0157610b00610ae0565b5b8235905067ffffffffffffffff811115610b1e57610b1d610ae4565b5b602083019150836020820283011115610b3a57610b39610ae8565b5b9250929050565b5f8083601f840112610b5657610b55610ae0565b5b8235905067ffffffffffffffff811115610b7357610b72610ae4565b5b602083019150836020820283011115610b8f57610b8e610ae8565b5b9250929050565b5f805f8060408587031215610bae57610bad610a25565b5b5f85013567ffffffffffffffff811115610bcb57610bca610a29565b5b610bd787828801610aec565b9450945050602085013567ffffffffffffffff811115610bfa57610bf9610a29565b5b610c0687828801610b41565b925092505092959194509250565b610c1d81610a2d565b82525050565b5f602082019050610c365f830184610c14565b92915050565b5f8083601f840112610c5157610c50610ae0565b5b8235905067ffffffffffffffff811115610c6e57610c6d610ae4565b5b602083019150836001820283011115610c8a57610c89610ae8565b5b9250929050565b5f8060208385031215610ca757610ca6610a25565b5b5f83013567ffffffffffffffff811115610cc457610cc3610a29565b5b610cd085828601610c3c565b92509250509250929050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610d0582610cdc565b9050919050565b610d1581610cfb565b82525050565b5f602082019050610d2e5f830184610d0c565b92915050565b610d3d81610cfb565b8114610d47575f80fd5b50565b5f81359050610d5881610d34565b92915050565b5f805f60408486031215610d7557610d74610a25565b5b5f610d8286828701610d4a565b935050602084013567ffffffffffffffff811115610da357610da2610a29565b5b610daf86828701610c3c565b92509250509250925092565b5f60208284031215610dd057610dcf610a25565b5b5f610ddd84828501610d4a565b91505092915050565b5f819050919050565b610df881610de6565b82525050565b5f602082019050610e115f830184610def565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b610e4d81610aad565b8114610e57575f80fd5b50565b5f81359050610e6881610e44565b92915050565b5f60208284031215610e8357610e82610a25565b5b5f610e9084828501610e5a565b91505092915050565b5f610ea382610cdc565b9050919050565b610eb381610e99565b8114610ebd575f80fd5b50565b5f81359050610ece81610eaa565b92915050565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610f1a82610ed4565b810181811067ffffffffffffffff82111715610f3957610f38610ee4565b5b80604052505050565b5f610f4b610a1c565b9050610f578282610f11565b919050565b5f67ffffffffffffffff821115610f7657610f75610ee4565b5b602082029050602081019050919050565b5f610f99610f9484610f5c565b610f42565b90508083825260208201905060208402830185811115610fbc57610fbb610ae8565b5b835b81811015610fe55780610fd18882610d4a565b845260208401935050602081019050610fbe565b5050509392505050565b5f82601f83011261100357611002610ae0565b5b8135611013848260208601610f87565b91505092915050565b5f806040838503121561103257611031610a25565b5b5f61103f85828601610ec0565b925050602083013567ffffffffffffffff8111156110605761105f610a29565b5b61106c85828601610fef565b915050925092905056fea2646970667358221220f8901ba0ad91db050edba1d0412882eecda8dba26237dd3383d77357c2f7173964736f6c634300081a0033",t=class t extends l.DeployableTarget{constructor(){super(...arguments),this.abi=d.S}async isAllowed(b,a){return await d.A2(this._config,{address:this.assertValidAddress(),args:[b,o.zeroHash],...this.optionallyAttachAccount(),...a})}async setDenied(b,a,f){return this.awaitResult(this.setDeniedRaw(b,a,f))}async setDeniedRaw(b,a,f){const{request:e,result:c}=await d.k2(this._config,{address:this.assertValidAddress(),args:[b,a],...this.optionallyAttachAccount(),...f});return{hash:await d.B2(this._config,e),result:c}}buildParameters(b,a){var c;const[f,e]=this.validateDeploymentConfig(b,a);if(!f.owner||f.owner===o.zeroAddress){const s=e.account?e.account.address:e.config?n.getAccount(e.config).address:(c=this._account)==null?void 0:c.address;if(s)f.owner=s;else throw new u.DeployableUnknownOwnerProvidedError}return{abi:d.S,bytecode:h,args:[i.prepareSimpleDenyListPayload(f)],...this.optionallyAttachAccount(e.account)}}};t.base="0x41A7c1aCC75BEccD11B8F586510759883092460F",t.registryType=i.RegistryType.ALLOW_LIST;let r=t;exports.simpleDenyListAbi=d.S;exports.SimpleDenyList=r;
2
+ //# sourceMappingURL=SimpleDenyList.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleDenyList.cjs","sources":["../../src/AllowLists/SimpleDenyList.ts"],"sourcesContent":["import {\n readSimpleDenyListIsAllowed,\n simpleDenyListAbi,\n simulateSimpleDenyListSetDenied,\n writeSimpleDenyListSetDenied,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleDenyList.sol/SimpleDenyList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type SimpleDenyListPayload,\n type WriteParams,\n prepareSimpleDenyListPayload,\n} from '../utils';\n\nexport { simpleDenyListAbi };\nexport type { SimpleDenyListPayload };\n\n/**\n * A generic `viem.Log` event with support for `SimpleDenyList` event types.\n *\n * @export\n * @typedef {SimpleDenyListLog}\n * @template {ContractEventName<typeof simpleDenyListAbi>} [event=ContractEventName<\n * typeof simpleDenyListAbi\n * >]\n */\nexport type SimpleDenyListLog<\n event extends ContractEventName<typeof simpleDenyListAbi> = ContractEventName<\n typeof simpleDenyListAbi\n >,\n> = GenericLog<typeof simpleDenyListAbi, event>;\n\n/**\n * A simple implementation of an AllowList that implicitly allows all addresses except those explicitly added to the deny list\n *\n * @export\n * @class SimpleDenyList\n * @typedef {SimpleDenyList}\n * @extends {DeployableTarget<SimpleDenyListPayload>}\n */\nexport class SimpleDenyList extends DeployableTarget<\n SimpleDenyListPayload,\n typeof simpleDenyListAbi\n> {\n public override readonly abi = simpleDenyListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIMPLE_DENYLIST_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Check if a user is authorized (i.e. not denied)\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams<typeof simpleDenyListAbi, 'isAllowed'>} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams<typeof simpleDenyListAbi, 'isAllowed'>,\n ): Promise<boolean> {\n return await readSimpleDenyListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams<typeof simpleDenyListAbi, 'setDenied'>} [params]\n * @returns {unknown}\n */\n public async setDenied(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof simpleDenyListAbi, 'setDenied'>,\n ) {\n return this.awaitResult(this.setDeniedRaw(addresses, allowed, params));\n }\n\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams<typeof simpleDenyListAbi, 'setDenied'>} [params]\n * @returns {unknown}\n */\n public async setDeniedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof simpleDenyListAbi, 'setDenied'>,\n ) {\n const { request, result } = await simulateSimpleDenyListSetDenied(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleDenyListSetDenied(this._config, request);\n return { hash, result };\n }\n\n // /**\n // * A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs].\n // * Accepts `eventName` and `eventNames` as optional parameters to narrow the returned log types.\n // * @example\n // * ```ts\n // * const logs = contract.getLogs({ eventName: 'EventName' })\n // * const logs = contract.getLogs({ eventNames: ['EventName'] })\n // * ```\n // * @public\n // * @async\n // * @template {ContractEventName<typeof simpleDenyListAbi>} event\n // * @template {ExtractAbiEvent<\n // * typeof simpleDenyListAbi,\n // * event\n // * >} [abiEvent=ExtractAbiEvent<typeof simpleDenyListAbi, event>]\n // * @param {?Omit<\n // * GetLogsParams<typeof simpleDenyListAbi, event, abiEvent, abiEvent[]>,\n // * 'event' | 'events'\n // * > & {\n // * eventName?: event;\n // * eventNames?: event[];\n // * }} [params]\n // * @returns {Promise<GetLogsReturnType<abiEvent, abiEvent[]>>}\n // */\n // public async getLogs<\n // event extends ContractEventName<typeof simpleDenyListAbi>,\n // const abiEvent extends ExtractAbiEvent<\n // typeof simpleDenyListAbi,\n // event\n // > = ExtractAbiEvent<typeof simpleDenyListAbi, event>,\n // >(\n // params?: Omit<\n // GetLogsParams<typeof simpleDenyListAbi, event, abiEvent, abiEvent[]>,\n // 'event' | 'events'\n // > & {\n // eventName?: event;\n // eventNames?: event[];\n // },\n // ): Promise<GetLogsReturnType<abiEvent, abiEvent[]>> {\n // return getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wag\n // ...(params as any),\n // ...(params?.eventName\n // ? {\n // event: getAbiItem({\n // abi: simpleDenyListAbi,\n // name: params.eventName,\n // // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n // } as any),\n // }\n // : {}),\n // ...(params?.eventNames\n // ? {\n // events: params.eventNames.map((name) =>\n // getAbiItem({\n // abi: simpleDenyListAbi,\n // name,\n // // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n // } as any),\n // ),\n // }\n // : {}),\n // address: this.assertValidAddress(),\n // });\n // }\n\n // /**\n // * A typed wrapper for `wagmi.watchContractEvent`\n // *\n // * @public\n // * @async\n // * @template {ContractEventName<typeof simpleDenyListAbi>} event\n // * @param {(log: SimpleDenyListLog<event>) => unknown} cb\n // * @param {?WatchParams<typeof simpleDenyListAbi, event> & {\n // * eventName?: event;\n // * }} [params]\n // * @returns {unknown, params?: any) => unknown} Unsubscribe function\n // */\n // public async subscribe<\n // event extends ContractEventName<typeof simpleDenyListAbi>,\n // >(\n // cb: (log: SimpleDenyListLog<event>) => unknown,\n // params?: WatchParams<typeof simpleDenyListAbi, event> & {\n // eventName?: event;\n // },\n // ) {\n // return watchContractEvent<\n // typeof this._config,\n // (typeof this._config)['chains'][number]['id'],\n // typeof simpleDenyListAbi,\n // event\n // >(this._config, {\n // // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n // ...(params as any),\n // eventName: params?.eventName,\n // abi: simpleDenyListAbi,\n // address: this.assertValidAddress(),\n // onLogs: (logs) => {\n // for (let l of logs) {\n // cb(l as unknown as SimpleDenyListLog<event>);\n // }\n // },\n // });\n // }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleDenyListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleDenyListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleDenyListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleDenyListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["_SimpleDenyList","DeployableTarget","simpleDenyListAbi","address","params","readSimpleDenyListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleDenyListSetDenied","writeSimpleDenyListSetDenied","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleDenyListPayload","RegistryType","SimpleDenyList"],"mappings":"s+RAwDaA,EAAN,MAAMA,UAAuBC,EAAAA,gBAGlC,CAHK,aAAA,CAAA,MAAA,GAAA,SAAA,EAIL,KAAyB,IAAMC,GAAA,CA4B/B,MAAa,UACXC,EACAC,EACkB,CACX,OAAA,MAAMC,EA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impleDenyList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleDenyList.js","sources":["../../src/AllowLists/SimpleDenyList.ts"],"sourcesContent":["import {\n readSimpleDenyListIsAllowed,\n simpleDenyListAbi,\n simulateSimpleDenyListSetDenied,\n writeSimpleDenyListSetDenied,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/allowlists/SimpleDenyList.sol/SimpleDenyList.json';\nimport { getAccount } from '@wagmi/core';\nimport {\n type Address,\n type ContractEventName,\n type Hex,\n zeroAddress,\n zeroHash,\n} from 'viem';\nimport type {\n DeployableOptions,\n GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport { DeployableUnknownOwnerProvidedError } from '../errors';\nimport {\n type GenericLog,\n type ReadParams,\n RegistryType,\n type SimpleDenyListPayload,\n type WriteParams,\n prepareSimpleDenyListPayload,\n} from '../utils';\n\nexport { simpleDenyListAbi };\nexport type { SimpleDenyListPayload };\n\n/**\n * A generic `viem.Log` event with support for `SimpleDenyList` event types.\n *\n * @export\n * @typedef {SimpleDenyListLog}\n * @template {ContractEventName<typeof simpleDenyListAbi>} [event=ContractEventName<\n * typeof simpleDenyListAbi\n * >]\n */\nexport type SimpleDenyListLog<\n event extends ContractEventName<typeof simpleDenyListAbi> = ContractEventName<\n typeof simpleDenyListAbi\n >,\n> = GenericLog<typeof simpleDenyListAbi, event>;\n\n/**\n * A simple implementation of an AllowList that implicitly allows all addresses except those explicitly added to the deny list\n *\n * @export\n * @class SimpleDenyList\n * @typedef {SimpleDenyList}\n * @extends {DeployableTarget<SimpleDenyListPayload>}\n */\nexport class SimpleDenyList extends DeployableTarget<\n SimpleDenyListPayload,\n typeof simpleDenyListAbi\n> {\n public override readonly abi = simpleDenyListAbi;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {Address}\n */\n public static override base: Address = import.meta.env\n .VITE_SIMPLE_DENYLIST_BASE;\n /**\n * @inheritdoc\n *\n * @public\n * @static\n * @type {RegistryType}\n */\n public static override registryType: RegistryType = RegistryType.ALLOW_LIST;\n\n /**\n * Check if a user is authorized (i.e. not denied)\n *\n * @public\n * @async\n * @param {Address} address - The address of the user\n * @param {?ReadParams<typeof simpleDenyListAbi, 'isAllowed'>} [params]\n * @returns {Promise<boolean>} - True if the user is authorized\n */\n public async isAllowed(\n address: Address,\n params?: ReadParams<typeof simpleDenyListAbi, 'isAllowed'>,\n ): Promise<boolean> {\n return await readSimpleDenyListIsAllowed(this._config, {\n address: this.assertValidAddress(),\n args: [address, zeroHash],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams<typeof simpleDenyListAbi, 'setDenied'>} [params]\n * @returns {unknown}\n */\n public async setDenied(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof simpleDenyListAbi, 'setDenied'>,\n ) {\n return this.awaitResult(this.setDeniedRaw(addresses, allowed, params));\n }\n\n /**\n * Set the denied status of a user. The length of the `users_` and `denied_` arrays must be the same. This function can only be called by the owner\n *\n * @public\n * @async\n * @param {Address[]} addresses - The list of users to update\n * @param {boolean[]} allowed - The denied status of each user\n * @param {?WriteParams<typeof simpleDenyListAbi, 'setDenied'>} [params]\n * @returns {unknown}\n */\n public async setDeniedRaw(\n addresses: Address[],\n allowed: boolean[],\n params?: WriteParams<typeof simpleDenyListAbi, 'setDenied'>,\n ) {\n const { request, result } = await simulateSimpleDenyListSetDenied(\n this._config,\n {\n address: this.assertValidAddress(),\n args: [addresses, allowed],\n ...this.optionallyAttachAccount(),\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n },\n );\n const hash = await writeSimpleDenyListSetDenied(this._config, request);\n return { hash, result };\n }\n\n // /**\n // * A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs].\n // * Accepts `eventName` and `eventNames` as optional parameters to narrow the returned log types.\n // * @example\n // * ```ts\n // * const logs = contract.getLogs({ eventName: 'EventName' })\n // * const logs = contract.getLogs({ eventNames: ['EventName'] })\n // * ```\n // * @public\n // * @async\n // * @template {ContractEventName<typeof simpleDenyListAbi>} event\n // * @template {ExtractAbiEvent<\n // * typeof simpleDenyListAbi,\n // * event\n // * >} [abiEvent=ExtractAbiEvent<typeof simpleDenyListAbi, event>]\n // * @param {?Omit<\n // * GetLogsParams<typeof simpleDenyListAbi, event, abiEvent, abiEvent[]>,\n // * 'event' | 'events'\n // * > & {\n // * eventName?: event;\n // * eventNames?: event[];\n // * }} [params]\n // * @returns {Promise<GetLogsReturnType<abiEvent, abiEvent[]>>}\n // */\n // public async getLogs<\n // event extends ContractEventName<typeof simpleDenyListAbi>,\n // const abiEvent extends ExtractAbiEvent<\n // typeof simpleDenyListAbi,\n // event\n // > = ExtractAbiEvent<typeof simpleDenyListAbi, event>,\n // >(\n // params?: Omit<\n // GetLogsParams<typeof simpleDenyListAbi, event, abiEvent, abiEvent[]>,\n // 'event' | 'events'\n // > & {\n // eventName?: event;\n // eventNames?: event[];\n // },\n // ): Promise<GetLogsReturnType<abiEvent, abiEvent[]>> {\n // return getLogs(this._config.getClient({ chainId: params?.chainId }), {\n // // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wag\n // ...(params as any),\n // ...(params?.eventName\n // ? {\n // event: getAbiItem({\n // abi: simpleDenyListAbi,\n // name: params.eventName,\n // // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n // } as any),\n // }\n // : {}),\n // ...(params?.eventNames\n // ? {\n // events: params.eventNames.map((name) =>\n // getAbiItem({\n // abi: simpleDenyListAbi,\n // name,\n // // biome-ignore lint/suspicious/noExplicitAny: awkward abi intersection issue\n // } as any),\n // ),\n // }\n // : {}),\n // address: this.assertValidAddress(),\n // });\n // }\n\n // /**\n // * A typed wrapper for `wagmi.watchContractEvent`\n // *\n // * @public\n // * @async\n // * @template {ContractEventName<typeof simpleDenyListAbi>} event\n // * @param {(log: SimpleDenyListLog<event>) => unknown} cb\n // * @param {?WatchParams<typeof simpleDenyListAbi, event> & {\n // * eventName?: event;\n // * }} [params]\n // * @returns {unknown, params?: any) => unknown} Unsubscribe function\n // */\n // public async subscribe<\n // event extends ContractEventName<typeof simpleDenyListAbi>,\n // >(\n // cb: (log: SimpleDenyListLog<event>) => unknown,\n // params?: WatchParams<typeof simpleDenyListAbi, event> & {\n // eventName?: event;\n // },\n // ) {\n // return watchContractEvent<\n // typeof this._config,\n // (typeof this._config)['chains'][number]['id'],\n // typeof simpleDenyListAbi,\n // event\n // >(this._config, {\n // // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n // ...(params as any),\n // eventName: params?.eventName,\n // abi: simpleDenyListAbi,\n // address: this.assertValidAddress(),\n // onLogs: (logs) => {\n // for (let l of logs) {\n // cb(l as unknown as SimpleDenyListLog<event>);\n // }\n // },\n // });\n // }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?SimpleDenyListPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: SimpleDenyListPayload,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [payload, options] = this.validateDeploymentConfig(\n _payload,\n _options,\n );\n if (!payload.owner || payload.owner === zeroAddress) {\n const owner = options.account\n ? options.account.address\n : options.config\n ? getAccount(options.config).address\n : this._account?.address;\n if (owner) {\n payload.owner = owner;\n } else {\n throw new DeployableUnknownOwnerProvidedError();\n }\n }\n return {\n abi: simpleDenyListAbi,\n bytecode: bytecode as Hex,\n args: [prepareSimpleDenyListPayload(payload)],\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["_SimpleDenyList","DeployableTarget","simpleDenyListAbi","address","params","readSimpleDenyListIsAllowed","zeroHash","addresses","allowed","request","result","simulateSimpleDenyListSetDenied","writeSimpleDenyListSetDenied","_payload","_options","payload","options","zeroAddress","owner","getAccount","_a","DeployableUnknownOwnerProvidedError","bytecode","prepareSimpleDenyListPayload","RegistryType","SimpleDenyList"],"mappings":";;;;;;kuRAwDaA,IAAN,MAAMA,UAAuBC,EAGlC;AAAA,EAHK,cAAA;AAAA,UAAA,GAAA,SAAA,GAIL,KAAyB,MAAMC;AAAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4B/B,MAAa,UACXC,GACAC,GACkB;AACX,WAAA,MAAMC,EAA4B,KAAK,SAAS;AAAA,MACrD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACF,GAASG,CAAQ;AAAA,MACxB,GAAG,KAAK,wBAAwB;AAAA;AAAA,MAEhC,GAAIF;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAa,UACXG,GACAC,GACAJ,GACA;AACA,WAAO,KAAK,YAAY,KAAK,aAAaG,GAAWC,GAASJ,CAAM,CAAC;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAa,aACXG,GACAC,GACAJ,GACA;AACA,UAAM,EAAE,SAAAK,GAAS,QAAAC,EAAO,IAAI,MAAMC;AAAAA,MAChC,KAAK;AAAA,MACL;AAAA,QACE,SAAS,KAAK,mBAAmB;AAAA,QACjC,MAAM,CAACJ,GAAWC,CAAO;AAAA,QACzB,GAAG,KAAK,wBAAwB;AAAA;AAAA,QAEhC,GAAIJ;AAAA,MACN;AAAA,IAAA;AAGK,WAAA,EAAE,MADI,MAAMQ,EAA6B,KA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O;AAAA,IAAA;AAAA,EAEnD;AACF;AA5NyBhB,EAAA,OAAgB,8CASvCA,EAAuB,eAA6BwB,EAAa;AArB5D,IAAMC,IAANzB;"}
@@ -1 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./PassthroughAuth.cjs");exports.PassthroughAuth=t.PassthroughAuth;
2
+ //# sourceMappingURL=Auth.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Auth.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/Auth/Auth.js CHANGED
@@ -2,3 +2,4 @@ import { PassthroughAuth as r } from "./PassthroughAuth.js";
2
2
  export {
3
3
  r as PassthroughAuth
4
4
  };
5
+ //# sourceMappingURL=Auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Auth.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../generated-Cd-Fe7W7.cjs"),a=require("../Deployable/Deployable.cjs"),s="0x6080604052348015600e575f80fd5b506101598061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063fe9fbb801461002d575b5f80fd5b610047600480360381019061004291906100c5565b61005d565b604051610054919061010a565b60405180910390f35b5f60019050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100948261006b565b9050919050565b6100a48161008a565b81146100ae575f80fd5b50565b5f813590506100bf8161009b565b92915050565b5f602082840312156100da576100d9610067565b5b5f6100e7848285016100b1565b91505092915050565b5f8115159050919050565b610104816100f0565b82525050565b5f60208201905061011d5f8301846100fb565b9291505056fea2646970667358221220d69fb5c3af806c7aa7833655670f5929f23f7d101298880775d4b9c7c8d0e62f64736f6c634300081a0033";class d extends a.Deployable{constructor(){super(...arguments),this.abi=f.ze}async isAuthorized(b,e){return f.TA(this._config,{address:this.assertValidAddress(),args:[b],...e})}buildParameters(b,e){const[o,t]=this.validateDeploymentConfig({},e);return{abi:f.ze,bytecode:s,args:[],...this.optionallyAttachAccount(t.account)}}}exports.passthroughAuthAbi=f.ze;exports.PassthroughAuth=d;
2
+ //# sourceMappingURL=PassthroughAuth.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PassthroughAuth.cjs","sources":["../../src/Auth/PassthroughAuth.ts"],"sourcesContent":["import {\n passthroughAuthAbi,\n readPassthroughAuthIsAuthorized,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/auth/PassthroughAuth.sol/PassthroughAuth.json';\nimport type { Address, ContractEventName, Hex } from 'viem';\nimport {\n Deployable,\n type DeployableOptions,\n type GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport type { GenericLog, ReadParams } from '../utils';\n\nexport { passthroughAuthAbi };\n\n/**\n * A generic `viem.Log` event with support for `PassthroughAuth` event types.\n *\n * @export\n * @typedef {PassthroughAuthLog}\n * @template {ContractEventName<\n * typeof passthroughAuthAbi\n * >} [event=ContractEventName<typeof passthroughAuthAbi>]\n */\nexport type PassthroughAuthLog<\n event extends ContractEventName<\n typeof passthroughAuthAbi\n > = ContractEventName<typeof passthroughAuthAbi>,\n> = GenericLog<typeof passthroughAuthAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class PassthroughAuth\n * @typedef {PassthroughAuth}\n * @extends {DeployableTarget<PassthroughAuthPayload>}\n */\nexport class PassthroughAuth extends Deployable<\n // biome-ignore lint/suspicious/noExplicitAny: takes no parameters\n any,\n typeof passthroughAuthAbi\n> {\n public override readonly abi = passthroughAuthAbi;\n\n public async isAuthorized(\n address: Address,\n params?: ReadParams<typeof passthroughAuthAbi, 'isAuthorized'>,\n ) {\n return readPassthroughAuthIsAuthorized(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PassthroughAuthPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: never,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [_, options] = this.validateDeploymentConfig({}, _options);\n return {\n abi: passthroughAuthAbi,\n bytecode: bytecode as Hex,\n // biome-ignore lint/suspicious/noExplicitAny: <takes no payload>\n args: [] as any,\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["PassthroughAuth","Deployable","passthroughAuthAbi","address","params","readPassthroughAuthIsAuthorized","_payload","_options","_","options","bytecode"],"mappings":"w5BAuCO,MAAMA,UAAwBC,EAAAA,UAInC,CAJK,aAAA,CAAA,MAAA,GAAA,SAAA,EAKL,KAAyB,IAAMC,IAAA,CAE/B,MAAa,aACXC,EACAC,EACA,CACO,OAAAC,EAAA,GAAgC,KAAK,QAAS,CACnD,QAAS,KAAK,mBAAmB,EACjC,KAAM,CAACF,CAAO,EAEd,GAAIC,CAAA,CACL,CACH,CAUgB,gBACdE,EACAC,EACyB,CACnB,KAAA,CAACC,EAAGC,CAAO,EAAI,KAAK,yBAAyB,CAAA,EAAIF,CAAQ,EACxD,MAAA,CACL,IAAKL,EAAA,GACL,SAAAQ,EAEA,KAAM,CAAC,EACP,GAAG,KAAK,wBAAwBD,EAAQ,OAAO,CAAA,CAEnD,CACF"}
@@ -36,3 +36,4 @@ export {
36
36
  n as PassthroughAuth,
37
37
  a as passthroughAuthAbi
38
38
  };
39
+ //# sourceMappingURL=PassthroughAuth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PassthroughAuth.js","sources":["../../src/Auth/PassthroughAuth.ts"],"sourcesContent":["import {\n passthroughAuthAbi,\n readPassthroughAuthIsAuthorized,\n} from '@boostxyz/evm';\nimport { bytecode } from '@boostxyz/evm/artifacts/contracts/auth/PassthroughAuth.sol/PassthroughAuth.json';\nimport type { Address, ContractEventName, Hex } from 'viem';\nimport {\n Deployable,\n type DeployableOptions,\n type GenericDeployableParams,\n} from '../Deployable/Deployable';\nimport { DeployableTarget } from '../Deployable/DeployableTarget';\nimport type { GenericLog, ReadParams } from '../utils';\n\nexport { passthroughAuthAbi };\n\n/**\n * A generic `viem.Log` event with support for `PassthroughAuth` event types.\n *\n * @export\n * @typedef {PassthroughAuthLog}\n * @template {ContractEventName<\n * typeof passthroughAuthAbi\n * >} [event=ContractEventName<typeof passthroughAuthAbi>]\n */\nexport type PassthroughAuthLog<\n event extends ContractEventName<\n typeof passthroughAuthAbi\n > = ContractEventName<typeof passthroughAuthAbi>,\n> = GenericLog<typeof passthroughAuthAbi, event>;\n\n/**\n * A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers\n *\n * @export\n * @class PassthroughAuth\n * @typedef {PassthroughAuth}\n * @extends {DeployableTarget<PassthroughAuthPayload>}\n */\nexport class PassthroughAuth extends Deployable<\n // biome-ignore lint/suspicious/noExplicitAny: takes no parameters\n any,\n typeof passthroughAuthAbi\n> {\n public override readonly abi = passthroughAuthAbi;\n\n public async isAuthorized(\n address: Address,\n params?: ReadParams<typeof passthroughAuthAbi, 'isAuthorized'>,\n ) {\n return readPassthroughAuthIsAuthorized(this._config, {\n address: this.assertValidAddress(),\n args: [address],\n // biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally\n ...(params as any),\n });\n }\n\n /**\n * @inheritdoc\n *\n * @public\n * @param {?PassthroughAuthPayload} [_payload]\n * @param {?DeployableOptions} [_options]\n * @returns {GenericDeployableParams}\n */\n public override buildParameters(\n _payload?: never,\n _options?: DeployableOptions,\n ): GenericDeployableParams {\n const [_, options] = this.validateDeploymentConfig({}, _options);\n return {\n abi: passthroughAuthAbi,\n bytecode: bytecode as Hex,\n // biome-ignore lint/suspicious/noExplicitAny: <takes no payload>\n args: [] as any,\n ...this.optionallyAttachAccount(options.account),\n };\n }\n}\n"],"names":["PassthroughAuth","Deployable","passthroughAuthAbi","address","params","readPassthroughAuthIsAuthorized","_payload","_options","_","options","bytecode"],"mappings":";;;AAuCO,MAAMA,UAAwBC,EAInC;AAAA,EAJK,cAAA;AAAA,UAAA,GAAA,SAAA,GAKL,KAAyB,MAAMC;AAAAA,EAAA;AAAA,EAE/B,MAAa,aACXC,GACAC,GACA;AACO,WAAAC,EAAgC,KAAK,SAAS;AAAA,MACnD,SAAS,KAAK,mBAAmB;AAAA,MACjC,MAAM,CAACF,CAAO;AAAA;AAAA,MAEd,GAAIC;AAAA,IAAA,CACL;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUgB,gBACdE,GACAC,GACyB;AACnB,UAAA,CAACC,GAAGC,CAAO,IAAI,KAAK,yBAAyB,CAAA,GAAIF,CAAQ;AACxD,WAAA;AAAA,MACL,KAAKL;AAAAA,MACL,UAAAQ;AAAA;AAAA,MAEA,MAAM,CAAC;AAAA,MACP,GAAG,KAAK,wBAAwBD,EAAQ,OAAO;AAAA,IAAA;AAAA,EAEnD;AACF;"}
package/dist/Boost.cjs CHANGED
@@ -1 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("viem");class s{constructor(t){this.id=t.id,this.budget=t.budget,this.action=t.action,this.validator=t.validator,this.allowList=t.allowList,this.incentives=t.incentives,this.protocolFee=t.protocolFee||0n,this.referralFee=t.referralFee||0n,this.maxParticipants=t.maxParticipants||0n,this.owner=t.owner||e.zeroAddress}}exports.Boost=s;
2
+ //# sourceMappingURL=Boost.cjs.map