@boostxyz/sdk 0.0.0-alpha.10

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 (242) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +7 -0
  3. package/dist/Actions/Action.cjs +2 -0
  4. package/dist/Actions/Action.cjs.map +1 -0
  5. package/dist/Actions/Action.d.ts +31 -0
  6. package/dist/Actions/Action.d.ts.map +1 -0
  7. package/dist/Actions/Action.js +29 -0
  8. package/dist/Actions/Action.js.map +1 -0
  9. package/dist/Actions/ContractAction.d.ts +370 -0
  10. package/dist/Actions/ContractAction.d.ts.map +1 -0
  11. package/dist/Actions/ERC721MintAction.d.ts +513 -0
  12. package/dist/Actions/ERC721MintAction.d.ts.map +1 -0
  13. package/dist/Actions/EventAction.cjs +2 -0
  14. package/dist/Actions/EventAction.cjs.map +1 -0
  15. package/dist/Actions/EventAction.d.ts +694 -0
  16. package/dist/Actions/EventAction.d.ts.map +1 -0
  17. package/dist/Actions/EventAction.js +491 -0
  18. package/dist/Actions/EventAction.js.map +1 -0
  19. package/dist/AllowLists/AllowList.cjs +2 -0
  20. package/dist/AllowLists/AllowList.cjs.map +1 -0
  21. package/dist/AllowLists/AllowList.d.ts +32 -0
  22. package/dist/AllowLists/AllowList.d.ts.map +1 -0
  23. package/dist/AllowLists/AllowList.js +30 -0
  24. package/dist/AllowLists/AllowList.js.map +1 -0
  25. package/dist/AllowLists/SimpleAllowList.cjs +2 -0
  26. package/dist/AllowLists/SimpleAllowList.cjs.map +1 -0
  27. package/dist/AllowLists/SimpleAllowList.d.ts +481 -0
  28. package/dist/AllowLists/SimpleAllowList.d.ts.map +1 -0
  29. package/dist/AllowLists/SimpleAllowList.js +154 -0
  30. package/dist/AllowLists/SimpleAllowList.js.map +1 -0
  31. package/dist/AllowLists/SimpleDenyList.cjs +2 -0
  32. package/dist/AllowLists/SimpleDenyList.cjs.map +1 -0
  33. package/dist/AllowLists/SimpleDenyList.d.ts +335 -0
  34. package/dist/AllowLists/SimpleDenyList.d.ts.map +1 -0
  35. package/dist/AllowLists/SimpleDenyList.js +115 -0
  36. package/dist/AllowLists/SimpleDenyList.js.map +1 -0
  37. package/dist/Auth/Auth.cjs +2 -0
  38. package/dist/Auth/Auth.cjs.map +1 -0
  39. package/dist/Auth/Auth.d.ts +10 -0
  40. package/dist/Auth/Auth.d.ts.map +1 -0
  41. package/dist/Auth/Auth.js +5 -0
  42. package/dist/Auth/Auth.js.map +1 -0
  43. package/dist/Auth/PassthroughAuth.cjs +2 -0
  44. package/dist/Auth/PassthroughAuth.cjs.map +1 -0
  45. package/dist/Auth/PassthroughAuth.d.ts +51 -0
  46. package/dist/Auth/PassthroughAuth.d.ts.map +1 -0
  47. package/dist/Auth/PassthroughAuth.js +39 -0
  48. package/dist/Auth/PassthroughAuth.js.map +1 -0
  49. package/dist/Boost.cjs +2 -0
  50. package/dist/Boost.cjs.map +1 -0
  51. package/dist/Boost.d.ts +234 -0
  52. package/dist/Boost.d.ts.map +1 -0
  53. package/dist/Boost.js +162 -0
  54. package/dist/Boost.js.map +1 -0
  55. package/dist/BoostCore.cjs +3 -0
  56. package/dist/BoostCore.cjs.map +1 -0
  57. package/dist/BoostCore.d.ts +498 -0
  58. package/dist/BoostCore.d.ts.map +1 -0
  59. package/dist/BoostCore.js +1153 -0
  60. package/dist/BoostCore.js.map +1 -0
  61. package/dist/BoostRegistry.cjs +2 -0
  62. package/dist/BoostRegistry.cjs.map +1 -0
  63. package/dist/BoostRegistry.d.ts +243 -0
  64. package/dist/BoostRegistry.d.ts.map +1 -0
  65. package/dist/BoostRegistry.js +262 -0
  66. package/dist/BoostRegistry.js.map +1 -0
  67. package/dist/Budgets/Budget.cjs +2 -0
  68. package/dist/Budgets/Budget.cjs.map +1 -0
  69. package/dist/Budgets/Budget.d.ts +31 -0
  70. package/dist/Budgets/Budget.d.ts.map +1 -0
  71. package/dist/Budgets/Budget.js +29 -0
  72. package/dist/Budgets/Budget.js.map +1 -0
  73. package/dist/Budgets/ManagedBudget.cjs +2 -0
  74. package/dist/Budgets/ManagedBudget.cjs.map +1 -0
  75. package/dist/Budgets/ManagedBudget.d.ts +1103 -0
  76. package/dist/Budgets/ManagedBudget.d.ts.map +1 -0
  77. package/dist/Budgets/ManagedBudget.js +516 -0
  78. package/dist/Budgets/ManagedBudget.js.map +1 -0
  79. package/dist/Budgets/SimpleBudget.d.ts +824 -0
  80. package/dist/Budgets/SimpleBudget.d.ts.map +1 -0
  81. package/dist/Budgets/VestingBudget.d.ts +778 -0
  82. package/dist/Budgets/VestingBudget.d.ts.map +1 -0
  83. package/dist/Deployable/Contract.cjs +2 -0
  84. package/dist/Deployable/Contract.cjs.map +1 -0
  85. package/dist/Deployable/Contract.d.ts +125 -0
  86. package/dist/Deployable/Contract.d.ts.map +1 -0
  87. package/dist/Deployable/Contract.js +150 -0
  88. package/dist/Deployable/Contract.js.map +1 -0
  89. package/dist/Deployable/Deployable.cjs +2 -0
  90. package/dist/Deployable/Deployable.cjs.map +1 -0
  91. package/dist/Deployable/Deployable.d.ts +161 -0
  92. package/dist/Deployable/Deployable.d.ts.map +1 -0
  93. package/dist/Deployable/Deployable.js +131 -0
  94. package/dist/Deployable/Deployable.js.map +1 -0
  95. package/dist/Deployable/DeployableTarget.cjs +2 -0
  96. package/dist/Deployable/DeployableTarget.cjs.map +1 -0
  97. package/dist/Deployable/DeployableTarget.d.ts +116 -0
  98. package/dist/Deployable/DeployableTarget.d.ts.map +1 -0
  99. package/dist/Deployable/DeployableTarget.js +132 -0
  100. package/dist/Deployable/DeployableTarget.js.map +1 -0
  101. package/dist/Incentives/AllowListIncentive.cjs +2 -0
  102. package/dist/Incentives/AllowListIncentive.cjs.map +1 -0
  103. package/dist/Incentives/AllowListIncentive.d.ts +513 -0
  104. package/dist/Incentives/AllowListIncentive.d.ts.map +1 -0
  105. package/dist/Incentives/AllowListIncentive.js +201 -0
  106. package/dist/Incentives/AllowListIncentive.js.map +1 -0
  107. package/dist/Incentives/CGDAIncentive.cjs +2 -0
  108. package/dist/Incentives/CGDAIncentive.cjs.map +1 -0
  109. package/dist/Incentives/CGDAIncentive.d.ts +644 -0
  110. package/dist/Incentives/CGDAIncentive.d.ts.map +1 -0
  111. package/dist/Incentives/CGDAIncentive.js +271 -0
  112. package/dist/Incentives/CGDAIncentive.js.map +1 -0
  113. package/dist/Incentives/ERC1155Incentive.d.ts +713 -0
  114. package/dist/Incentives/ERC1155Incentive.d.ts.map +1 -0
  115. package/dist/Incentives/ERC20Incentive.cjs +2 -0
  116. package/dist/Incentives/ERC20Incentive.cjs.map +1 -0
  117. package/dist/Incentives/ERC20Incentive.d.ts +666 -0
  118. package/dist/Incentives/ERC20Incentive.d.ts.map +1 -0
  119. package/dist/Incentives/ERC20Incentive.js +312 -0
  120. package/dist/Incentives/ERC20Incentive.js.map +1 -0
  121. package/dist/Incentives/ERC20VariableIncentive.d.ts +582 -0
  122. package/dist/Incentives/ERC20VariableIncentive.d.ts.map +1 -0
  123. package/dist/Incentives/Incentive.cjs +2 -0
  124. package/dist/Incentives/Incentive.cjs.map +1 -0
  125. package/dist/Incentives/Incentive.d.ts +36 -0
  126. package/dist/Incentives/Incentive.d.ts.map +1 -0
  127. package/dist/Incentives/Incentive.js +299 -0
  128. package/dist/Incentives/Incentive.js.map +1 -0
  129. package/dist/Incentives/PointsIncentive.cjs +2 -0
  130. package/dist/Incentives/PointsIncentive.cjs.map +1 -0
  131. package/dist/Incentives/PointsIncentive.d.ts +659 -0
  132. package/dist/Incentives/PointsIncentive.d.ts.map +1 -0
  133. package/dist/Incentives/PointsIncentive.js +215 -0
  134. package/dist/Incentives/PointsIncentive.js.map +1 -0
  135. package/dist/Validators/SignerValidator.cjs +2 -0
  136. package/dist/Validators/SignerValidator.cjs.map +1 -0
  137. package/dist/Validators/SignerValidator.d.ts +745 -0
  138. package/dist/Validators/SignerValidator.d.ts.map +1 -0
  139. package/dist/Validators/SignerValidator.js +293 -0
  140. package/dist/Validators/SignerValidator.js.map +1 -0
  141. package/dist/Validators/Validator.cjs +2 -0
  142. package/dist/Validators/Validator.cjs.map +1 -0
  143. package/dist/Validators/Validator.d.ts +31 -0
  144. package/dist/Validators/Validator.d.ts.map +1 -0
  145. package/dist/Validators/Validator.js +27 -0
  146. package/dist/Validators/Validator.js.map +1 -0
  147. package/dist/claiming.cjs +2 -0
  148. package/dist/claiming.cjs.map +1 -0
  149. package/dist/claiming.d.ts +43 -0
  150. package/dist/claiming.d.ts.map +1 -0
  151. package/dist/claiming.js +17 -0
  152. package/dist/claiming.js.map +1 -0
  153. package/dist/componentInterfaces-CKCBwG16.cjs +2 -0
  154. package/dist/componentInterfaces-CKCBwG16.cjs.map +1 -0
  155. package/dist/componentInterfaces-DYkaxBda.js +13 -0
  156. package/dist/componentInterfaces-DYkaxBda.js.map +1 -0
  157. package/dist/errors.cjs +2 -0
  158. package/dist/errors.cjs.map +1 -0
  159. package/dist/errors.d.ts +441 -0
  160. package/dist/errors.d.ts.map +1 -0
  161. package/dist/errors.js +262 -0
  162. package/dist/errors.js.map +1 -0
  163. package/dist/generated-BDeDiaCK.js +4625 -0
  164. package/dist/generated-BDeDiaCK.js.map +1 -0
  165. package/dist/generated-wKBNvm48.cjs +3 -0
  166. package/dist/generated-wKBNvm48.cjs.map +1 -0
  167. package/dist/index.cjs +2 -0
  168. package/dist/index.cjs.map +1 -0
  169. package/dist/index.d.ts +25 -0
  170. package/dist/index.d.ts.map +1 -0
  171. package/dist/index.js +113 -0
  172. package/dist/index.js.map +1 -0
  173. package/dist/transfers.cjs +2 -0
  174. package/dist/transfers.cjs.map +1 -0
  175. package/dist/transfers.d.ts +198 -0
  176. package/dist/transfers.d.ts.map +1 -0
  177. package/dist/transfers.js +84 -0
  178. package/dist/transfers.js.map +1 -0
  179. package/dist/utils.cjs +2 -0
  180. package/dist/utils.cjs.map +1 -0
  181. package/dist/utils.d.ts +116 -0
  182. package/dist/utils.d.ts.map +1 -0
  183. package/dist/utils.js +30 -0
  184. package/dist/utils.js.map +1 -0
  185. package/package.json +211 -0
  186. package/src/Actions/Action.test.ts +75 -0
  187. package/src/Actions/Action.ts +61 -0
  188. package/src/Actions/ContractAction.test.ts +197 -0
  189. package/src/Actions/ContractAction.ts +301 -0
  190. package/src/Actions/ERC721MintAction.test.ts +112 -0
  191. package/src/Actions/ERC721MintAction.ts +292 -0
  192. package/src/Actions/EventAction.test.ts +205 -0
  193. package/src/Actions/EventAction.ts +811 -0
  194. package/src/AllowLists/AllowList.test.ts +64 -0
  195. package/src/AllowLists/AllowList.ts +60 -0
  196. package/src/AllowLists/SimpleAllowList.test.ts +52 -0
  197. package/src/AllowLists/SimpleAllowList.ts +284 -0
  198. package/src/AllowLists/SimpleDenyList.test.ts +52 -0
  199. package/src/AllowLists/SimpleDenyList.ts +227 -0
  200. package/src/Auth/Auth.ts +11 -0
  201. package/src/Auth/PassthroughAuth.test.ts +12 -0
  202. package/src/Auth/PassthroughAuth.ts +80 -0
  203. package/src/Boost.ts +290 -0
  204. package/src/BoostCore.test.ts +773 -0
  205. package/src/BoostCore.ts +1261 -0
  206. package/src/BoostRegistry.ts +467 -0
  207. package/src/Budgets/Budget.test.ts +27 -0
  208. package/src/Budgets/Budget.ts +61 -0
  209. package/src/Budgets/ManagedBudget.test.ts +154 -0
  210. package/src/Budgets/ManagedBudget.ts +796 -0
  211. package/src/Budgets/SimpleBudget.test.ts +152 -0
  212. package/src/Budgets/SimpleBudget.ts +564 -0
  213. package/src/Budgets/VestingBudget.test.ts +123 -0
  214. package/src/Budgets/VestingBudget.ts +602 -0
  215. package/src/Deployable/Contract.ts +229 -0
  216. package/src/Deployable/Deployable.ts +250 -0
  217. package/src/Deployable/DeployableTarget.ts +223 -0
  218. package/src/Incentives/AllowListIncentive.test.ts +143 -0
  219. package/src/Incentives/AllowListIncentive.ts +334 -0
  220. package/src/Incentives/CGDAIncentive.test.ts +132 -0
  221. package/src/Incentives/CGDAIncentive.ts +468 -0
  222. package/src/Incentives/ERC1155Incentive.test.ts +87 -0
  223. package/src/Incentives/ERC1155Incentive.ts +466 -0
  224. package/src/Incentives/ERC20Incentive.test.ts +130 -0
  225. package/src/Incentives/ERC20Incentive.ts +482 -0
  226. package/src/Incentives/ERC20VariableIncentive.test.ts +136 -0
  227. package/src/Incentives/ERC20VariableIncentive.ts +420 -0
  228. package/src/Incentives/Incentive.test.ts +92 -0
  229. package/src/Incentives/Incentive.ts +85 -0
  230. package/src/Incentives/PointsIncentive.test.ts +139 -0
  231. package/src/Incentives/PointsIncentive.ts +365 -0
  232. package/src/Validators/SignerValidator.test.ts +159 -0
  233. package/src/Validators/SignerValidator.ts +681 -0
  234. package/src/Validators/Validator.test.ts +21 -0
  235. package/src/Validators/Validator.ts +55 -0
  236. package/src/claiming.ts +56 -0
  237. package/src/errors.ts +542 -0
  238. package/src/index.test.ts +40 -0
  239. package/src/index.ts +53 -0
  240. package/src/transfers.ts +284 -0
  241. package/src/utils.test.ts +44 -0
  242. package/src/utils.ts +198 -0
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../generated-wKBNvm48.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"}
@@ -0,0 +1,31 @@
1
+ import type { Address } from 'viem';
2
+ import type { DeployableOptions } from '../Deployable/Deployable';
3
+ import { EventAction } from './EventAction';
4
+ export { EventAction, };
5
+ /**
6
+ * A union type representing all valid protocol Action implementations
7
+ *
8
+ * @export
9
+ * @typedef {Action}
10
+ */
11
+ export type Action = EventAction;
12
+ /**
13
+ * A map of Action component interfaces to their constructors.
14
+ *
15
+ * @type {{ "0x7687b0ed": EventAction; }}
16
+ */
17
+ export declare const ActionByComponentInterface: {
18
+ [x: string]: typeof EventAction;
19
+ };
20
+ /**
21
+ * A function that will read a contract's component interface using `getComponentInterface` and return the correct instantiated instance.
22
+ *
23
+ * @export
24
+ * @async
25
+ * @param {DeployableOptions} options
26
+ * @param {Address} address
27
+ * @returns {Promise<EventAction>}
28
+ * @throws {@link InvalidComponentInterfaceError}
29
+ */
30
+ export declare function actionFromAddress(options: DeployableOptions, address: Address): Promise<EventAction>;
31
+ //# sourceMappingURL=Action.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,29 @@
1
+ import { X as c } from "../generated-BDeDiaCK.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";
6
+ const e = {
7
+ // ['0x6c3129aa']: ContractAction,
8
+ // ['0x97e083eb']: ERC721MintAction,
9
+ [i]: f
10
+ };
11
+ async function w(t, o) {
12
+ const n = await m(t.config, {
13
+ abi: c,
14
+ functionName: "getComponentInterface",
15
+ address: o
16
+ }), r = e[n];
17
+ if (!r)
18
+ throw new a(
19
+ Object.keys(e),
20
+ n
21
+ );
22
+ return new r(t, o);
23
+ }
24
+ export {
25
+ e as ActionByComponentInterface,
26
+ f as EventAction,
27
+ w as actionFromAddress
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;"}
@@ -0,0 +1,370 @@
1
+ import { contractActionAbi } from '@boostxyz/evm';
2
+ import { type Abi, type Address, type ContractEventName, type Hex } from 'viem';
3
+ import type { DeployableOptions, GenericDeployableParams } from '../Deployable/Deployable';
4
+ import { DeployableTarget } from '../Deployable/DeployableTarget';
5
+ import { type GenericLog, type ReadParams, RegistryType, type WriteParams } from '../utils';
6
+ export { contractActionAbi };
7
+ /**
8
+ * The object representation of a `ContractAction.InitPayload`
9
+ *
10
+ * @export
11
+ * @interface ContractActionPayload
12
+ * @typedef {ContractActionPayload}
13
+ */
14
+ export interface ContractActionPayload {
15
+ /**
16
+ * The chain ID on which the target exists
17
+ *
18
+ * @type {bigint}
19
+ */
20
+ chainId: bigint;
21
+ /**
22
+ * The target contract address
23
+ *
24
+ * @type {Address}
25
+ */
26
+ target: Address;
27
+ /**
28
+ * The selector for the function to be called
29
+ *
30
+ * @type {Hex}
31
+ */
32
+ selector: Hex;
33
+ /**
34
+ * The native token value to send with the function call
35
+ *
36
+ * @type {bigint}
37
+ */
38
+ value: bigint;
39
+ }
40
+ /**
41
+ * A generic `viem.Log` event with support for `ContractAction` event types.
42
+ *
43
+ * @export
44
+ * @typedef {ContractActionLog}
45
+ * @template {ContractEventName<typeof contractActionAbi>} [event=ContractEventName<
46
+ * typeof contractActionAbi
47
+ * >]
48
+ */
49
+ export type ContractActionLog<event extends ContractEventName<typeof contractActionAbi> = ContractEventName<typeof contractActionAbi>> = GenericLog<typeof contractActionAbi, event>;
50
+ /**
51
+ * A generic contract action
52
+ *
53
+ * @export
54
+ * @class ContractAction
55
+ * @typedef {ContractAction}
56
+ * @extends {DeployableTarget<ContractActionPayload>}
57
+ */
58
+ export declare class ContractAction<ContractActionAbi extends Abi = typeof contractActionAbi> extends DeployableTarget<ContractActionPayload, ContractActionAbi> {
59
+ readonly abi: readonly [{
60
+ readonly type: "constructor";
61
+ readonly inputs: readonly [];
62
+ readonly stateMutability: "nonpayable";
63
+ }, {
64
+ readonly type: "error";
65
+ readonly inputs: readonly [];
66
+ readonly name: "CloneAlreadyInitialized";
67
+ }, {
68
+ readonly type: "error";
69
+ readonly inputs: readonly [];
70
+ readonly name: "InitializerNotImplemented";
71
+ }, {
72
+ readonly type: "error";
73
+ readonly inputs: readonly [];
74
+ readonly name: "InvalidInitialization";
75
+ }, {
76
+ readonly type: "error";
77
+ readonly inputs: readonly [];
78
+ readonly name: "InvalidInitializationData";
79
+ }, {
80
+ readonly type: "error";
81
+ readonly inputs: readonly [];
82
+ readonly name: "NotInitializing";
83
+ }, {
84
+ readonly type: "error";
85
+ readonly inputs: readonly [{
86
+ readonly name: "targetChainId";
87
+ readonly internalType: "uint256";
88
+ readonly type: "uint256";
89
+ }];
90
+ readonly name: "TargetChainUnsupported";
91
+ }, {
92
+ readonly type: "event";
93
+ readonly anonymous: false;
94
+ readonly inputs: readonly [{
95
+ readonly name: "executor";
96
+ readonly internalType: "address";
97
+ readonly type: "address";
98
+ readonly indexed: true;
99
+ }, {
100
+ readonly name: "caller";
101
+ readonly internalType: "address";
102
+ readonly type: "address";
103
+ readonly indexed: false;
104
+ }, {
105
+ readonly name: "success";
106
+ readonly internalType: "bool";
107
+ readonly type: "bool";
108
+ readonly indexed: false;
109
+ }, {
110
+ readonly name: "data";
111
+ readonly internalType: "bytes";
112
+ readonly type: "bytes";
113
+ readonly indexed: false;
114
+ }];
115
+ readonly name: "ActionExecuted";
116
+ }, {
117
+ readonly type: "event";
118
+ readonly anonymous: false;
119
+ readonly inputs: readonly [{
120
+ readonly name: "user";
121
+ readonly internalType: "address";
122
+ readonly type: "address";
123
+ readonly indexed: true;
124
+ }, {
125
+ readonly name: "isValidated";
126
+ readonly internalType: "bool";
127
+ readonly type: "bool";
128
+ readonly indexed: false;
129
+ }, {
130
+ readonly name: "data";
131
+ readonly internalType: "bytes";
132
+ readonly type: "bytes";
133
+ readonly indexed: false;
134
+ }];
135
+ readonly name: "ActionValidated";
136
+ }, {
137
+ readonly type: "event";
138
+ readonly anonymous: false;
139
+ readonly inputs: readonly [{
140
+ readonly name: "version";
141
+ readonly internalType: "uint64";
142
+ readonly type: "uint64";
143
+ readonly indexed: false;
144
+ }];
145
+ readonly name: "Initialized";
146
+ }, {
147
+ readonly type: "function";
148
+ readonly inputs: readonly [];
149
+ readonly name: "VALIDATOR";
150
+ readonly outputs: readonly [{
151
+ readonly name: "";
152
+ readonly internalType: "contract AValidator";
153
+ readonly type: "address";
154
+ }];
155
+ readonly stateMutability: "view";
156
+ }, {
157
+ readonly type: "function";
158
+ readonly inputs: readonly [];
159
+ readonly name: "chainId";
160
+ readonly outputs: readonly [{
161
+ readonly name: "";
162
+ readonly internalType: "uint256";
163
+ readonly type: "uint256";
164
+ }];
165
+ readonly stateMutability: "view";
166
+ }, {
167
+ readonly type: "function";
168
+ readonly inputs: readonly [{
169
+ readonly name: "data_";
170
+ readonly internalType: "bytes";
171
+ readonly type: "bytes";
172
+ }];
173
+ readonly name: "execute";
174
+ readonly outputs: readonly [{
175
+ readonly name: "";
176
+ readonly internalType: "bool";
177
+ readonly type: "bool";
178
+ }, {
179
+ readonly name: "";
180
+ readonly internalType: "bytes";
181
+ readonly type: "bytes";
182
+ }];
183
+ readonly stateMutability: "payable";
184
+ }, {
185
+ readonly type: "function";
186
+ readonly inputs: readonly [];
187
+ readonly name: "getComponentInterface";
188
+ readonly outputs: readonly [{
189
+ readonly name: "";
190
+ readonly internalType: "bytes4";
191
+ readonly type: "bytes4";
192
+ }];
193
+ readonly stateMutability: "pure";
194
+ }, {
195
+ readonly type: "function";
196
+ readonly inputs: readonly [{
197
+ readonly name: "data_";
198
+ readonly internalType: "bytes";
199
+ readonly type: "bytes";
200
+ }];
201
+ readonly name: "initialize";
202
+ readonly outputs: readonly [];
203
+ readonly stateMutability: "nonpayable";
204
+ }, {
205
+ readonly type: "function";
206
+ readonly inputs: readonly [{
207
+ readonly name: "data_";
208
+ readonly internalType: "bytes";
209
+ readonly type: "bytes";
210
+ }];
211
+ readonly name: "prepare";
212
+ readonly outputs: readonly [{
213
+ readonly name: "bytes_";
214
+ readonly internalType: "bytes";
215
+ readonly type: "bytes";
216
+ }];
217
+ readonly stateMutability: "view";
218
+ }, {
219
+ readonly type: "function";
220
+ readonly inputs: readonly [];
221
+ readonly name: "selector";
222
+ readonly outputs: readonly [{
223
+ readonly name: "";
224
+ readonly internalType: "bytes4";
225
+ readonly type: "bytes4";
226
+ }];
227
+ readonly stateMutability: "view";
228
+ }, {
229
+ readonly type: "function";
230
+ readonly inputs: readonly [{
231
+ readonly name: "interfaceId";
232
+ readonly internalType: "bytes4";
233
+ readonly type: "bytes4";
234
+ }];
235
+ readonly name: "supportsInterface";
236
+ readonly outputs: readonly [{
237
+ readonly name: "";
238
+ readonly internalType: "bool";
239
+ readonly type: "bool";
240
+ }];
241
+ readonly stateMutability: "view";
242
+ }, {
243
+ readonly type: "function";
244
+ readonly inputs: readonly [];
245
+ readonly name: "target";
246
+ readonly outputs: readonly [{
247
+ readonly name: "";
248
+ readonly internalType: "address";
249
+ readonly type: "address";
250
+ }];
251
+ readonly stateMutability: "view";
252
+ }, {
253
+ readonly type: "function";
254
+ readonly inputs: readonly [];
255
+ readonly name: "value";
256
+ readonly outputs: readonly [{
257
+ readonly name: "";
258
+ readonly internalType: "uint256";
259
+ readonly type: "uint256";
260
+ }];
261
+ readonly stateMutability: "view";
262
+ }];
263
+ /**
264
+ * @inheritdoc
265
+ *
266
+ * @public
267
+ * @static
268
+ * @type {Address}
269
+ */
270
+ static base: Address;
271
+ /**
272
+ * @inheritdoc
273
+ *
274
+ * @public
275
+ * @static
276
+ * @type {RegistryType}
277
+ */
278
+ static registryType: RegistryType;
279
+ /**
280
+ * The target chain ID
281
+ *
282
+ * @public
283
+ * @async
284
+ * @param {?ReadParams<typeof contractActionAbi, 'chainId'>} [params]
285
+ * @returns {Promise<bigint>}
286
+ */
287
+ chainId(params?: ReadParams<typeof contractActionAbi, 'chainId'>): Promise<bigint>;
288
+ /**
289
+ * The target contract
290
+ *
291
+ * @public
292
+ * @async
293
+ * @param {?ReadParams<typeof contractActionAbi, 'target'>} [params]
294
+ * @returns {Promise<`0x${string}`>}
295
+ */
296
+ target(params?: ReadParams<typeof contractActionAbi, 'target'>): Promise<`0x${string}`>;
297
+ /**
298
+ * The selector for the function to be called
299
+ *
300
+ * @example `function mint(address to, uint256 amount)`
301
+ * @public
302
+ * @async
303
+ * @param {?ReadParams<typeof contractActionAbi, 'selector'>} [params]
304
+ * @returns {Promise<`0x${string}`>}
305
+ */
306
+ selector(params?: ReadParams<typeof contractActionAbi, 'selector'>): Promise<`0x${string}`>;
307
+ /**
308
+ * The native token value to send with the function call
309
+ *
310
+ * @public
311
+ * @async
312
+ * @param {?ReadParams<typeof contractActionAbi, 'value'>} [params]
313
+ * @returns {Promise<bigint>}
314
+ */
315
+ value(params?: ReadParams<typeof contractActionAbi, 'value'>): Promise<bigint>;
316
+ /**
317
+ * Executes a prepared contract action
318
+ *
319
+ * @public
320
+ * @async
321
+ * @param {Hex} data
322
+ * @param {?WriteParams<typeof contractActionAbi, 'execute'>} [params]
323
+ * @returns {Promise<readonly [boolean, `0x${string}`]>}
324
+ */
325
+ execute(data: Hex, params?: WriteParams<typeof contractActionAbi, 'execute'>): Promise<readonly [boolean, `0x${string}`]>;
326
+ /**
327
+ * Executes a prepared contract action
328
+ *
329
+ * @public
330
+ * @async
331
+ * @param {Hex} data
332
+ * @param {?WriteParams<typeof contractActionAbi, 'execute'>} [params]
333
+ * @returns {unknown}
334
+ */
335
+ executeRaw(data: Hex, params?: WriteParams<typeof contractActionAbi, 'execute'>): Promise<{
336
+ hash: `0x${string}`;
337
+ result: readonly [boolean, `0x${string}`];
338
+ }>;
339
+ /**
340
+ * The encoded execution payload
341
+ *
342
+ * @public
343
+ * @async
344
+ * @param {Hex} calldata
345
+ * @param {?ReadParams<typeof contractActionAbi, 'prepare'>} [params]
346
+ * @returns {unknown}
347
+ */
348
+ prepare(calldata: Hex, params?: ReadParams<typeof contractActionAbi, 'prepare'>): Promise<`0x${string}`>;
349
+ /**
350
+ * @inheritdoc
351
+ *
352
+ * @public
353
+ * @param {?ContractActionPayload} [_payload]
354
+ * @param {?DeployableOptions} [_options]
355
+ * @returns {GenericDeployableParams}
356
+ */
357
+ buildParameters(_payload?: ContractActionPayload, _options?: DeployableOptions): GenericDeployableParams;
358
+ }
359
+ /**
360
+ * Given a {@link ContractActionPayload}, properly encode a `ContractAction.InitPayload` for use with {@link ContractAction} initialization.
361
+ *
362
+ * @param {ContractActionPayload} param0
363
+ * @param {bigint} param0.chainId - The chain ID on which the target exists
364
+ * @param {Address} param0.target - The target contract address
365
+ * @param {Hex} param0.selector - The selector for the function to be called
366
+ * @param {bigint} param0.value - The native token value to send with the function call
367
+ * @returns {Hex}
368
+ */
369
+ export declare function prepareContractActionPayload({ chainId, target, selector, value, }: ContractActionPayload): `0x${string}`;
370
+ //# sourceMappingURL=ContractAction.d.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