@account-kit/plugingen 4.0.0-alpha.0

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 (171) hide show
  1. package/LICENSE +21 -0
  2. package/dist/esm/IPlugin.d.ts +474 -0
  3. package/dist/esm/IPlugin.js +397 -0
  4. package/dist/esm/IPlugin.js.map +1 -0
  5. package/dist/esm/cli.d.ts +2 -0
  6. package/dist/esm/cli.js +40 -0
  7. package/dist/esm/cli.js.map +1 -0
  8. package/dist/esm/commands/generate/index.d.ts +14 -0
  9. package/dist/esm/commands/generate/index.js +179 -0
  10. package/dist/esm/commands/generate/index.js.map +1 -0
  11. package/dist/esm/commands/generate/phases/contract-abi-gen.d.ts +2 -0
  12. package/dist/esm/commands/generate/phases/contract-abi-gen.js +9 -0
  13. package/dist/esm/commands/generate/phases/contract-abi-gen.js.map +1 -0
  14. package/dist/esm/commands/generate/phases/contract-addresses-gen.d.ts +2 -0
  15. package/dist/esm/commands/generate/phases/contract-addresses-gen.js +10 -0
  16. package/dist/esm/commands/generate/phases/contract-addresses-gen.js.map +1 -0
  17. package/dist/esm/commands/generate/phases/execution-abi-gen.d.ts +2 -0
  18. package/dist/esm/commands/generate/phases/execution-abi-gen.js +12 -0
  19. package/dist/esm/commands/generate/phases/execution-abi-gen.js.map +1 -0
  20. package/dist/esm/commands/generate/phases/plugin-actions/index.d.ts +2 -0
  21. package/dist/esm/commands/generate/phases/plugin-actions/index.js +118 -0
  22. package/dist/esm/commands/generate/phases/plugin-actions/index.js.map +1 -0
  23. package/dist/esm/commands/generate/phases/plugin-actions/management-actions.d.ts +2 -0
  24. package/dist/esm/commands/generate/phases/plugin-actions/management-actions.js +105 -0
  25. package/dist/esm/commands/generate/phases/plugin-actions/management-actions.js.map +1 -0
  26. package/dist/esm/commands/generate/phases/plugin-actions/read-actions.d.ts +2 -0
  27. package/dist/esm/commands/generate/phases/plugin-actions/read-actions.js +75 -0
  28. package/dist/esm/commands/generate/phases/plugin-actions/read-actions.js.map +1 -0
  29. package/dist/esm/commands/generate/phases/plugin-generator/get-contract-gen.d.ts +2 -0
  30. package/dist/esm/commands/generate/phases/plugin-generator/get-contract-gen.js +26 -0
  31. package/dist/esm/commands/generate/phases/plugin-generator/get-contract-gen.js.map +1 -0
  32. package/dist/esm/commands/generate/phases/plugin-generator/index.d.ts +2 -0
  33. package/dist/esm/commands/generate/phases/plugin-generator/index.js +20 -0
  34. package/dist/esm/commands/generate/phases/plugin-generator/index.js.map +1 -0
  35. package/dist/esm/commands/generate/phases/plugin-generator/meta-gen.d.ts +2 -0
  36. package/dist/esm/commands/generate/phases/plugin-generator/meta-gen.js +14 -0
  37. package/dist/esm/commands/generate/phases/plugin-generator/meta-gen.js.map +1 -0
  38. package/dist/esm/commands/generate/types.d.ts +16 -0
  39. package/dist/esm/commands/generate/types.js +2 -0
  40. package/dist/esm/commands/generate/types.js.map +1 -0
  41. package/dist/esm/commands/generate/utils.d.ts +4 -0
  42. package/dist/esm/commands/generate/utils.js +16 -0
  43. package/dist/esm/commands/generate/utils.js.map +1 -0
  44. package/dist/esm/commands/init.d.ts +5 -0
  45. package/dist/esm/commands/init.js +76 -0
  46. package/dist/esm/commands/init.js.map +1 -0
  47. package/dist/esm/config.d.ts +36 -0
  48. package/dist/esm/config.js +4 -0
  49. package/dist/esm/config.js.map +1 -0
  50. package/dist/esm/errors.d.ts +14 -0
  51. package/dist/esm/errors.js +37 -0
  52. package/dist/esm/errors.js.map +1 -0
  53. package/dist/esm/exports/config.d.ts +1 -0
  54. package/dist/esm/exports/config.js +2 -0
  55. package/dist/esm/exports/config.js.map +1 -0
  56. package/dist/esm/exports/index.d.ts +4 -0
  57. package/dist/esm/exports/index.js +5 -0
  58. package/dist/esm/exports/index.js.map +1 -0
  59. package/dist/esm/exports/types.d.ts +1 -0
  60. package/dist/esm/exports/types.js +2 -0
  61. package/dist/esm/exports/types.js.map +1 -0
  62. package/dist/esm/logger.d.ts +6 -0
  63. package/dist/esm/logger.js +30 -0
  64. package/dist/esm/logger.js.map +1 -0
  65. package/dist/esm/package.json +1 -0
  66. package/dist/esm/types.d.ts +6 -0
  67. package/dist/esm/types.js +2 -0
  68. package/dist/esm/types.js.map +1 -0
  69. package/dist/esm/utils/findConfig.d.ts +6 -0
  70. package/dist/esm/utils/findConfig.js +21 -0
  71. package/dist/esm/utils/findConfig.js.map +1 -0
  72. package/dist/esm/utils/format.d.ts +1 -0
  73. package/dist/esm/utils/format.js +10 -0
  74. package/dist/esm/utils/format.js.map +1 -0
  75. package/dist/esm/utils/isUsingTypescript.d.ts +1 -0
  76. package/dist/esm/utils/isUsingTypescript.js +19 -0
  77. package/dist/esm/utils/isUsingTypescript.js.map +1 -0
  78. package/dist/esm/utils/loadEnv.d.ts +4 -0
  79. package/dist/esm/utils/loadEnv.js +59 -0
  80. package/dist/esm/utils/loadEnv.js.map +1 -0
  81. package/dist/esm/utils/resolveConfig.d.ts +7 -0
  82. package/dist/esm/utils/resolveConfig.js +12 -0
  83. package/dist/esm/utils/resolveConfig.js.map +1 -0
  84. package/dist/esm/version.d.ts +1 -0
  85. package/dist/esm/version.js +2 -0
  86. package/dist/esm/version.js.map +1 -0
  87. package/dist/types/IPlugin.d.ts +475 -0
  88. package/dist/types/IPlugin.d.ts.map +1 -0
  89. package/dist/types/cli.d.ts +3 -0
  90. package/dist/types/cli.d.ts.map +1 -0
  91. package/dist/types/commands/generate/index.d.ts +17 -0
  92. package/dist/types/commands/generate/index.d.ts.map +1 -0
  93. package/dist/types/commands/generate/phases/contract-abi-gen.d.ts +3 -0
  94. package/dist/types/commands/generate/phases/contract-abi-gen.d.ts.map +1 -0
  95. package/dist/types/commands/generate/phases/contract-addresses-gen.d.ts +3 -0
  96. package/dist/types/commands/generate/phases/contract-addresses-gen.d.ts.map +1 -0
  97. package/dist/types/commands/generate/phases/execution-abi-gen.d.ts +3 -0
  98. package/dist/types/commands/generate/phases/execution-abi-gen.d.ts.map +1 -0
  99. package/dist/types/commands/generate/phases/plugin-actions/index.d.ts +3 -0
  100. package/dist/types/commands/generate/phases/plugin-actions/index.d.ts.map +1 -0
  101. package/dist/types/commands/generate/phases/plugin-actions/management-actions.d.ts +3 -0
  102. package/dist/types/commands/generate/phases/plugin-actions/management-actions.d.ts.map +1 -0
  103. package/dist/types/commands/generate/phases/plugin-actions/read-actions.d.ts +3 -0
  104. package/dist/types/commands/generate/phases/plugin-actions/read-actions.d.ts.map +1 -0
  105. package/dist/types/commands/generate/phases/plugin-generator/get-contract-gen.d.ts +3 -0
  106. package/dist/types/commands/generate/phases/plugin-generator/get-contract-gen.d.ts.map +1 -0
  107. package/dist/types/commands/generate/phases/plugin-generator/index.d.ts +3 -0
  108. package/dist/types/commands/generate/phases/plugin-generator/index.d.ts.map +1 -0
  109. package/dist/types/commands/generate/phases/plugin-generator/meta-gen.d.ts +3 -0
  110. package/dist/types/commands/generate/phases/plugin-generator/meta-gen.d.ts.map +1 -0
  111. package/dist/types/commands/generate/types.d.ts +17 -0
  112. package/dist/types/commands/generate/types.d.ts.map +1 -0
  113. package/dist/types/commands/generate/utils.d.ts +5 -0
  114. package/dist/types/commands/generate/utils.d.ts.map +1 -0
  115. package/dist/types/commands/init.d.ts +8 -0
  116. package/dist/types/commands/init.d.ts.map +1 -0
  117. package/dist/types/config.d.ts +59 -0
  118. package/dist/types/config.d.ts.map +1 -0
  119. package/dist/types/errors.d.ts +15 -0
  120. package/dist/types/errors.d.ts.map +1 -0
  121. package/dist/types/exports/config.d.ts +2 -0
  122. package/dist/types/exports/config.d.ts.map +1 -0
  123. package/dist/types/exports/index.d.ts +5 -0
  124. package/dist/types/exports/index.d.ts.map +1 -0
  125. package/dist/types/exports/types.d.ts +2 -0
  126. package/dist/types/exports/types.d.ts.map +1 -0
  127. package/dist/types/logger.d.ts +7 -0
  128. package/dist/types/logger.d.ts.map +1 -0
  129. package/dist/types/types.d.ts +7 -0
  130. package/dist/types/types.d.ts.map +1 -0
  131. package/dist/types/utils/findConfig.d.ts +15 -0
  132. package/dist/types/utils/findConfig.d.ts.map +1 -0
  133. package/dist/types/utils/format.d.ts +2 -0
  134. package/dist/types/utils/format.d.ts.map +1 -0
  135. package/dist/types/utils/isUsingTypescript.d.ts +2 -0
  136. package/dist/types/utils/isUsingTypescript.d.ts.map +1 -0
  137. package/dist/types/utils/loadEnv.d.ts +5 -0
  138. package/dist/types/utils/loadEnv.d.ts.map +1 -0
  139. package/dist/types/utils/resolveConfig.d.ts +15 -0
  140. package/dist/types/utils/resolveConfig.d.ts.map +1 -0
  141. package/dist/types/version.d.ts +2 -0
  142. package/dist/types/version.d.ts.map +1 -0
  143. package/package.json +83 -0
  144. package/src/IPlugin.ts +396 -0
  145. package/src/cli.ts +44 -0
  146. package/src/commands/generate/index.ts +270 -0
  147. package/src/commands/generate/phases/contract-abi-gen.ts +12 -0
  148. package/src/commands/generate/phases/contract-addresses-gen.ts +18 -0
  149. package/src/commands/generate/phases/execution-abi-gen.ts +20 -0
  150. package/src/commands/generate/phases/plugin-actions/index.ts +151 -0
  151. package/src/commands/generate/phases/plugin-actions/management-actions.ts +141 -0
  152. package/src/commands/generate/phases/plugin-actions/read-actions.ts +97 -0
  153. package/src/commands/generate/phases/plugin-generator/get-contract-gen.ts +30 -0
  154. package/src/commands/generate/phases/plugin-generator/index.ts +27 -0
  155. package/src/commands/generate/phases/plugin-generator/meta-gen.ts +17 -0
  156. package/src/commands/generate/types.ts +18 -0
  157. package/src/commands/generate/utils.ts +26 -0
  158. package/src/commands/init.ts +93 -0
  159. package/src/config.ts +79 -0
  160. package/src/errors.ts +58 -0
  161. package/src/exports/config.ts +1 -0
  162. package/src/exports/index.ts +7 -0
  163. package/src/exports/types.ts +1 -0
  164. package/src/logger.ts +36 -0
  165. package/src/types.ts +11 -0
  166. package/src/utils/findConfig.ts +37 -0
  167. package/src/utils/format.ts +11 -0
  168. package/src/utils/isUsingTypescript.ts +22 -0
  169. package/src/utils/loadEnv.ts +91 -0
  170. package/src/utils/resolveConfig.ts +25 -0
  171. package/src/version.ts +3 -0
@@ -0,0 +1,3 @@
1
+ import type { Phase } from "../../types";
2
+ export declare const AccountReadActionsGenPhase: Phase;
3
+ //# sourceMappingURL=read-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-actions.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/generate/phases/plugin-actions/read-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,eAAO,MAAM,0BAA0B,EAAE,KA2FxC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Phase } from "../../types";
2
+ export declare const GetContractGenPhase: Phase;
3
+ //# sourceMappingURL=get-contract-gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-contract-gen.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/generate/phases/plugin-generator/get-contract-gen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,mBAAmB,EAAE,KA0BjC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Phase } from "../../types";
2
+ export declare const PluginGeneratorPhase: Phase;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/generate/phases/plugin-generator/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC,eAAO,MAAM,oBAAoB,EAAE,KAoBlC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Phase } from "../../types";
2
+ export declare const MetaGenPhase: Phase;
3
+ //# sourceMappingURL=meta-gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta-gen.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/generate/phases/plugin-generator/meta-gen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,KAa1B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { GetContractReturnType, PublicClient } from "viem";
2
+ import type { Config, PluginConfig } from "../../config.js";
3
+ import type { IPluginAbi } from "../../IPlugin.js";
4
+ export type PhaseInput = {
5
+ content: string[];
6
+ addImport: (moduleName: string, member: {
7
+ name: string;
8
+ isType?: boolean;
9
+ }) => void;
10
+ addType: (typeName: string, typeDef: string, isPublic?: boolean) => void;
11
+ pluginConfig: PluginConfig;
12
+ config: Config;
13
+ contract: GetContractReturnType<typeof IPluginAbi, PublicClient>;
14
+ hasReadMethods?: boolean;
15
+ };
16
+ export type Phase = (input: PhaseInput) => Promise<PhaseInput>;
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,CACT,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KACvC,IAAI,CAAC;IACV,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,qBAAqB,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC,CAAC;IACjE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type AbiFunction } from "abitype";
2
+ import { type Abi, type Address } from "viem";
3
+ export declare const executionAbiConst: (name: string) => string;
4
+ export declare const extractExecutionAbi: (executionFunctions: readonly Address[], abi: Abi) => AbiFunction[];
5
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAc,KAAK,GAAG,EAAgB,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAExE,eAAO,MAAM,iBAAiB,SAAU,MAAM,WACf,CAAC;AAEhC,eAAO,MAAM,mBAAmB,uBACV,SAAS,OAAO,EAAE,eAErC,WAAW,EAgBb,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type InitOptions = {
2
+ /** Path to config file */
3
+ config?: string;
4
+ /** Directory to init config file */
5
+ root?: string;
6
+ };
7
+ export declare function init(options?: InitOptions): Promise<string>;
8
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/init.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,WAAW,GAAG;IACxB,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAOF,wBAAsB,IAAI,CAAC,OAAO,GAAE,WAAgB,mBAoEnD"}
@@ -0,0 +1,59 @@
1
+ import type { Abi, Address, Chain, Hex, parseAbiParameters } from "viem";
2
+ import type { Evaluate, MaybeArray, MaybePromise } from "./types";
3
+ export type ContractConfig<chainId extends number = number, requiredChainId extends number | undefined = undefined> = {
4
+ /**
5
+ * Contract ABI
6
+ */
7
+ abi: Abi;
8
+ /**
9
+ * Contract address or addresses.
10
+ *
11
+ * Accepts an object `{ [chainId]: address }` to support multiple chains.
12
+ *
13
+ * @example
14
+ * '0x314159265dd8dbb310642f98f50c066173c1259b'
15
+ *
16
+ * @example
17
+ * {
18
+ * 1: '0x314159265dd8dbb310642f98f50c066173c1259b',
19
+ * 5: '0x112234455c3a32fd11230c42e7bccd4a84e02010',
20
+ * }
21
+ */
22
+ address?: Address | (requiredChainId extends number ? Record<requiredChainId, Address> & Partial<Record<chainId, Address>> : Record<chainId, Address>) | undefined;
23
+ /**
24
+ * Name of contract.
25
+ */
26
+ name: string;
27
+ };
28
+ export type Contract = Evaluate<ContractConfig & {
29
+ /** Generated string content */
30
+ content: string;
31
+ /** Meta info about contract */
32
+ meta: {
33
+ abiName: string;
34
+ addressName?: string | undefined;
35
+ configName?: string | undefined;
36
+ };
37
+ }>;
38
+ export type PluginConfig = {
39
+ abi: Abi;
40
+ addresses: Record<number, Address>;
41
+ chain?: Chain;
42
+ rpcUrl?: string;
43
+ name: string;
44
+ installConfig?: {
45
+ initAbiParams: ReturnType<typeof parseAbiParameters> | [];
46
+ dependencies?: {
47
+ plugin: PluginConfig;
48
+ functionId: Hex;
49
+ }[];
50
+ };
51
+ };
52
+ export type Config = {
53
+ chain: Chain;
54
+ rpcUrl: string;
55
+ outDir?: string;
56
+ plugins: PluginConfig[];
57
+ };
58
+ export declare function defineConfig(config: MaybeArray<Config> | (() => MaybePromise<MaybeArray<Config>>)): MaybeArray<Config> | (() => MaybePromise<MaybeArray<Config>>);
59
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAElE,MAAM,MAAM,cAAc,CACxB,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/B,eAAe,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,IACpD;IACF;;OAEG;IACH,GAAG,EAAE,GAAG,CAAC;IACT;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EACJ,OAAO,GACP,CAAC,eAAe,SAAS,MAAM,GAC3B,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,GACpE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,GAC7B,SAAS,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAC7B,cAAc,GAAG;IACf,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACjC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACjC,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,GAAG,CAAC;IACT,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE;QACd,aAAa,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,GAAG,EAAE,CAAC;QAC1D,YAAY,CAAC,EAAE;YACb,MAAM,EAAE,YAAY,CAAC;YACrB,UAAU,EAAE,GAAG,CAAC;SACjB,EAAE,CAAC;KACL,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB,CAAC;AAEF,wBAAgB,YAAY,CAC1B,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,+BAAjC,aAAa,WAAW,MAAM,CAAC,CAAC,EAGrE"}
@@ -0,0 +1,15 @@
1
+ import { type z } from "zod";
2
+ declare class ValidationError extends Error {
3
+ details: Zod.ZodIssue[];
4
+ constructor(message: string, options: {
5
+ details: Zod.ZodIssue[];
6
+ });
7
+ }
8
+ export declare function fromZodError(zError: z.ZodError, { maxIssuesInMessage, issueSeparator, prefixSeparator, prefix, }?: {
9
+ maxIssuesInMessage?: number;
10
+ issueSeparator?: string;
11
+ prefixSeparator?: string;
12
+ prefix?: string;
13
+ }): ValidationError;
14
+ export {};
15
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,cAAM,eAAgB,SAAQ,KAAK;IACjC,OAAO,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;gBAGtB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QACP,OAAO,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;KACzB;CAKJ;AAGD,wBAAgB,YAAY,CAC1B,MAAM,EAAE,CAAC,CAAC,QAAQ,EAClB,EACE,kBAAuB,EACvB,cAAuB,EACvB,eAAwB,EACxB,MAA2B,GAC5B,GAAE;IACD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACZ,GACL,eAAe,CA0BjB"}
@@ -0,0 +1,2 @@
1
+ export { defineConfig, type Config, type PluginConfig } from "../config.js";
2
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/exports/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { defineConfig, type Config, type PluginConfig } from "../config.js";
2
+ export * as logger from "../logger.js";
3
+ export { loadEnv } from "../utils/loadEnv.js";
4
+ export { VERSION } from "../version.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5E,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { IPluginAbi } from "../IPlugin.js";
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/exports/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare function success(...args: any[]): void;
2
+ export declare function info(...args: any[]): void;
3
+ export declare function log(...args: any[]): void;
4
+ export declare function warn(...args: any[]): void;
5
+ export declare function error(...args: any[]): void;
6
+ export declare function spinner(): import("ora").Ora;
7
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAUA,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,QAErC;AAED,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,QAElC;AAED,wBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,QAEjC;AAED,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,QAElC;AAED,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,QAEnC;AAED,wBAAgB,OAAO,sBAKtB"}
@@ -0,0 +1,7 @@
1
+ export type Evaluate<type> = {
2
+ [key in keyof type]: type[key];
3
+ } & unknown;
4
+ export type MaybeArray<T> = T | T[];
5
+ export type MaybePromise<T> = T | Promise<T>;
6
+ export type RequiredBy<TType, TKeys extends keyof TType> = Required<Pick<TType, TKeys>> & Omit<TType, TKeys>;
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,QAAQ,CAAC,IAAI,IAAI;KAAG,GAAG,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;CAAE,GAAG,OAAO,CAAC;AAE1E,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAEpC,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7C,MAAM,MAAM,UAAU,CAAC,KAAK,EAAE,KAAK,SAAS,MAAM,KAAK,IAAI,QAAQ,CACjE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CACnB,GACC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ type FindConfigParameters = {
2
+ /** Config file name */
3
+ config?: string;
4
+ /** Config file directory */
5
+ root?: string;
6
+ };
7
+ /**
8
+ * Resolves path to plugingen CLI config file.
9
+ *
10
+ * @param parameters - optional override parameters for finding the config object
11
+ * @returns the path to the config file
12
+ */
13
+ export declare function findConfig(parameters?: FindConfigParameters): Promise<string | undefined>;
14
+ export {};
15
+ //# sourceMappingURL=findConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findConfig.d.ts","sourceRoot":"","sources":["../../../src/utils/findConfig.ts"],"names":[],"mappings":"AAcA,KAAK,oBAAoB,GAAG;IAC1B,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,UAAU,GAAE,oBAAyB,+BASrE"}
@@ -0,0 +1,2 @@
1
+ export declare function format(content: string): Promise<string>;
2
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/utils/format.ts"],"names":[],"mappings":"AAGA,wBAAsB,MAAM,CAAC,OAAO,EAAE,MAAM,mBAO3C"}
@@ -0,0 +1,2 @@
1
+ export declare function getIsUsingTypeScript(): Promise<boolean>;
2
+ //# sourceMappingURL=isUsingTypescript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isUsingTypescript.d.ts","sourceRoot":"","sources":["../../../src/utils/isUsingTypescript.ts"],"names":[],"mappings":"AAGA,wBAAsB,oBAAoB,qBAkBzC"}
@@ -0,0 +1,5 @@
1
+ export declare function loadEnv(config?: {
2
+ mode?: string;
3
+ envDir?: string;
4
+ }): Record<string, string>;
5
+ //# sourceMappingURL=loadEnv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadEnv.d.ts","sourceRoot":"","sources":["../../../src/utils/loadEnv.ts"],"names":[],"mappings":"AAQA,wBAAgB,OAAO,CACrB,MAAM,GAAE;IACN,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACZ,GACL,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8CxB"}
@@ -0,0 +1,15 @@
1
+ import type { Config } from "../config";
2
+ import type { MaybeArray } from "../types";
3
+ type ResolveConfigParameters = {
4
+ /** Path to config file */
5
+ configPath: string;
6
+ };
7
+ /**
8
+ * Bundles and returns config object from path.
9
+ *
10
+ * @param parameters - Parameters to resolve config
11
+ * @returns an array of the config objects
12
+ */
13
+ export declare function resolveConfig(parameters: ResolveConfigParameters): Promise<MaybeArray<Config>>;
14
+ export {};
15
+ //# sourceMappingURL=resolveConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveConfig.d.ts","sourceRoot":"","sources":["../../../src/utils/resolveConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,KAAK,uBAAuB,GAAG;IAC7B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,UAAU,EAAE,uBAAuB,GAClC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAO7B"}
@@ -0,0 +1,2 @@
1
+ export declare const VERSION = "4.0.0-alpha.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@account-kit/plugingen",
3
+ "version": "4.0.0-alpha.0",
4
+ "description": "A CLI tool that enables you to generate TS code for your ERC-6900 plugins",
5
+ "author": "Alchemy",
6
+ "license": "MIT",
7
+ "private": false,
8
+ "type": "module",
9
+ "main": "./dist/esm/exports/index.js",
10
+ "types": "./dist/types/exports/index.d.ts",
11
+ "typings": "./dist/types/exports/index.d.ts",
12
+ "sideEffects": false,
13
+ "files": [
14
+ "dist",
15
+ "src/**/*.ts",
16
+ "!dist/**/*.tsbuildinfo",
17
+ "!vitest.config.ts",
18
+ "!.env",
19
+ "!src/**/*.test.ts",
20
+ "!src/__tests__/**/*"
21
+ ],
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/types/exports/index.d.ts",
25
+ "default": "./dist/esm/exports/index.js"
26
+ },
27
+ "./config": {
28
+ "types": "./dist/types/exports/config.d.ts",
29
+ "default": "./dist/esm/exports/config.js"
30
+ },
31
+ "./package.json": "./package.json"
32
+ },
33
+ "bin": {
34
+ "plugingen": "./dist/esm/cli.js"
35
+ },
36
+ "scripts": {
37
+ "prebuild": "node --loader ts-node/esm ./inject-version.ts",
38
+ "build": "yarn clean && yarn build:esm && yarn build:types",
39
+ "build:esm": "tsc --project tsconfig.build.json --module es2020 --outDir ./dist/esm --removeComments && echo > ./dist/esm/package.json '{\"type\":\"module\"}'",
40
+ "build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
41
+ "postbuild": "chmod +x ./dist/esm/cli.js",
42
+ "clean": "rm -rf ./dist"
43
+ },
44
+ "devDependencies": {
45
+ "@types/fs-extra": "^11.0.4",
46
+ "typescript": "^5.0.4",
47
+ "typescript-template": "*",
48
+ "vitest": "^0.31.0"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public",
52
+ "registry": "https://registry.npmjs.org/"
53
+ },
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "git+https://github.com/alchemyplatform/aa-sdk.git"
57
+ },
58
+ "bugs": {
59
+ "url": "https://github.com/alchemyplatform/aa-sdk/issues"
60
+ },
61
+ "homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
62
+ "dependencies": {
63
+ "@aa-sdk/core": "^4.0.0-alpha.0",
64
+ "bundle-require": "^4.0.2",
65
+ "cac": "^6.7.14",
66
+ "change-case": "^5.4.3",
67
+ "chokidar": "^3.6.0",
68
+ "dedent": "^1.5.1",
69
+ "esbuild": "^0.20.1",
70
+ "find-up": "^7.0.0",
71
+ "fs-extra": "^11.2.0",
72
+ "ora": "^8.0.1",
73
+ "pathe": "^1.1.2",
74
+ "picocolors": "^1.0.0",
75
+ "prettier": "^3.2.5",
76
+ "viem": "2.8.6",
77
+ "zod": "^3.22.4"
78
+ },
79
+ "peerDependencies": {
80
+ "viem": "2.8.6"
81
+ },
82
+ "gitHead": "bd1788c2bd7f28ba762a06c649f30b544f8bade9"
83
+ }