@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.
- package/LICENSE +21 -0
- package/dist/esm/IPlugin.d.ts +474 -0
- package/dist/esm/IPlugin.js +397 -0
- package/dist/esm/IPlugin.js.map +1 -0
- package/dist/esm/cli.d.ts +2 -0
- package/dist/esm/cli.js +40 -0
- package/dist/esm/cli.js.map +1 -0
- package/dist/esm/commands/generate/index.d.ts +14 -0
- package/dist/esm/commands/generate/index.js +179 -0
- package/dist/esm/commands/generate/index.js.map +1 -0
- package/dist/esm/commands/generate/phases/contract-abi-gen.d.ts +2 -0
- package/dist/esm/commands/generate/phases/contract-abi-gen.js +9 -0
- package/dist/esm/commands/generate/phases/contract-abi-gen.js.map +1 -0
- package/dist/esm/commands/generate/phases/contract-addresses-gen.d.ts +2 -0
- package/dist/esm/commands/generate/phases/contract-addresses-gen.js +10 -0
- package/dist/esm/commands/generate/phases/contract-addresses-gen.js.map +1 -0
- package/dist/esm/commands/generate/phases/execution-abi-gen.d.ts +2 -0
- package/dist/esm/commands/generate/phases/execution-abi-gen.js +12 -0
- package/dist/esm/commands/generate/phases/execution-abi-gen.js.map +1 -0
- package/dist/esm/commands/generate/phases/plugin-actions/index.d.ts +2 -0
- package/dist/esm/commands/generate/phases/plugin-actions/index.js +118 -0
- package/dist/esm/commands/generate/phases/plugin-actions/index.js.map +1 -0
- package/dist/esm/commands/generate/phases/plugin-actions/management-actions.d.ts +2 -0
- package/dist/esm/commands/generate/phases/plugin-actions/management-actions.js +105 -0
- package/dist/esm/commands/generate/phases/plugin-actions/management-actions.js.map +1 -0
- package/dist/esm/commands/generate/phases/plugin-actions/read-actions.d.ts +2 -0
- package/dist/esm/commands/generate/phases/plugin-actions/read-actions.js +75 -0
- package/dist/esm/commands/generate/phases/plugin-actions/read-actions.js.map +1 -0
- package/dist/esm/commands/generate/phases/plugin-generator/get-contract-gen.d.ts +2 -0
- package/dist/esm/commands/generate/phases/plugin-generator/get-contract-gen.js +26 -0
- package/dist/esm/commands/generate/phases/plugin-generator/get-contract-gen.js.map +1 -0
- package/dist/esm/commands/generate/phases/plugin-generator/index.d.ts +2 -0
- package/dist/esm/commands/generate/phases/plugin-generator/index.js +20 -0
- package/dist/esm/commands/generate/phases/plugin-generator/index.js.map +1 -0
- package/dist/esm/commands/generate/phases/plugin-generator/meta-gen.d.ts +2 -0
- package/dist/esm/commands/generate/phases/plugin-generator/meta-gen.js +14 -0
- package/dist/esm/commands/generate/phases/plugin-generator/meta-gen.js.map +1 -0
- package/dist/esm/commands/generate/types.d.ts +16 -0
- package/dist/esm/commands/generate/types.js +2 -0
- package/dist/esm/commands/generate/types.js.map +1 -0
- package/dist/esm/commands/generate/utils.d.ts +4 -0
- package/dist/esm/commands/generate/utils.js +16 -0
- package/dist/esm/commands/generate/utils.js.map +1 -0
- package/dist/esm/commands/init.d.ts +5 -0
- package/dist/esm/commands/init.js +76 -0
- package/dist/esm/commands/init.js.map +1 -0
- package/dist/esm/config.d.ts +36 -0
- package/dist/esm/config.js +4 -0
- package/dist/esm/config.js.map +1 -0
- package/dist/esm/errors.d.ts +14 -0
- package/dist/esm/errors.js +37 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/exports/config.d.ts +1 -0
- package/dist/esm/exports/config.js +2 -0
- package/dist/esm/exports/config.js.map +1 -0
- package/dist/esm/exports/index.d.ts +4 -0
- package/dist/esm/exports/index.js +5 -0
- package/dist/esm/exports/index.js.map +1 -0
- package/dist/esm/exports/types.d.ts +1 -0
- package/dist/esm/exports/types.js +2 -0
- package/dist/esm/exports/types.js.map +1 -0
- package/dist/esm/logger.d.ts +6 -0
- package/dist/esm/logger.js +30 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/types.d.ts +6 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/findConfig.d.ts +6 -0
- package/dist/esm/utils/findConfig.js +21 -0
- package/dist/esm/utils/findConfig.js.map +1 -0
- package/dist/esm/utils/format.d.ts +1 -0
- package/dist/esm/utils/format.js +10 -0
- package/dist/esm/utils/format.js.map +1 -0
- package/dist/esm/utils/isUsingTypescript.d.ts +1 -0
- package/dist/esm/utils/isUsingTypescript.js +19 -0
- package/dist/esm/utils/isUsingTypescript.js.map +1 -0
- package/dist/esm/utils/loadEnv.d.ts +4 -0
- package/dist/esm/utils/loadEnv.js +59 -0
- package/dist/esm/utils/loadEnv.js.map +1 -0
- package/dist/esm/utils/resolveConfig.d.ts +7 -0
- package/dist/esm/utils/resolveConfig.js +12 -0
- package/dist/esm/utils/resolveConfig.js.map +1 -0
- package/dist/esm/version.d.ts +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/types/IPlugin.d.ts +475 -0
- package/dist/types/IPlugin.d.ts.map +1 -0
- package/dist/types/cli.d.ts +3 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/commands/generate/index.d.ts +17 -0
- package/dist/types/commands/generate/index.d.ts.map +1 -0
- package/dist/types/commands/generate/phases/contract-abi-gen.d.ts +3 -0
- package/dist/types/commands/generate/phases/contract-abi-gen.d.ts.map +1 -0
- package/dist/types/commands/generate/phases/contract-addresses-gen.d.ts +3 -0
- package/dist/types/commands/generate/phases/contract-addresses-gen.d.ts.map +1 -0
- package/dist/types/commands/generate/phases/execution-abi-gen.d.ts +3 -0
- package/dist/types/commands/generate/phases/execution-abi-gen.d.ts.map +1 -0
- package/dist/types/commands/generate/phases/plugin-actions/index.d.ts +3 -0
- package/dist/types/commands/generate/phases/plugin-actions/index.d.ts.map +1 -0
- package/dist/types/commands/generate/phases/plugin-actions/management-actions.d.ts +3 -0
- package/dist/types/commands/generate/phases/plugin-actions/management-actions.d.ts.map +1 -0
- package/dist/types/commands/generate/phases/plugin-actions/read-actions.d.ts +3 -0
- package/dist/types/commands/generate/phases/plugin-actions/read-actions.d.ts.map +1 -0
- package/dist/types/commands/generate/phases/plugin-generator/get-contract-gen.d.ts +3 -0
- package/dist/types/commands/generate/phases/plugin-generator/get-contract-gen.d.ts.map +1 -0
- package/dist/types/commands/generate/phases/plugin-generator/index.d.ts +3 -0
- package/dist/types/commands/generate/phases/plugin-generator/index.d.ts.map +1 -0
- package/dist/types/commands/generate/phases/plugin-generator/meta-gen.d.ts +3 -0
- package/dist/types/commands/generate/phases/plugin-generator/meta-gen.d.ts.map +1 -0
- package/dist/types/commands/generate/types.d.ts +17 -0
- package/dist/types/commands/generate/types.d.ts.map +1 -0
- package/dist/types/commands/generate/utils.d.ts +5 -0
- package/dist/types/commands/generate/utils.d.ts.map +1 -0
- package/dist/types/commands/init.d.ts +8 -0
- package/dist/types/commands/init.d.ts.map +1 -0
- package/dist/types/config.d.ts +59 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/errors.d.ts +15 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/exports/config.d.ts +2 -0
- package/dist/types/exports/config.d.ts.map +1 -0
- package/dist/types/exports/index.d.ts +5 -0
- package/dist/types/exports/index.d.ts.map +1 -0
- package/dist/types/exports/types.d.ts +2 -0
- package/dist/types/exports/types.d.ts.map +1 -0
- package/dist/types/logger.d.ts +7 -0
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/types.d.ts +7 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils/findConfig.d.ts +15 -0
- package/dist/types/utils/findConfig.d.ts.map +1 -0
- package/dist/types/utils/format.d.ts +2 -0
- package/dist/types/utils/format.d.ts.map +1 -0
- package/dist/types/utils/isUsingTypescript.d.ts +2 -0
- package/dist/types/utils/isUsingTypescript.d.ts.map +1 -0
- package/dist/types/utils/loadEnv.d.ts +5 -0
- package/dist/types/utils/loadEnv.d.ts.map +1 -0
- package/dist/types/utils/resolveConfig.d.ts +15 -0
- package/dist/types/utils/resolveConfig.d.ts.map +1 -0
- package/dist/types/version.d.ts +2 -0
- package/dist/types/version.d.ts.map +1 -0
- package/package.json +83 -0
- package/src/IPlugin.ts +396 -0
- package/src/cli.ts +44 -0
- package/src/commands/generate/index.ts +270 -0
- package/src/commands/generate/phases/contract-abi-gen.ts +12 -0
- package/src/commands/generate/phases/contract-addresses-gen.ts +18 -0
- package/src/commands/generate/phases/execution-abi-gen.ts +20 -0
- package/src/commands/generate/phases/plugin-actions/index.ts +151 -0
- package/src/commands/generate/phases/plugin-actions/management-actions.ts +141 -0
- package/src/commands/generate/phases/plugin-actions/read-actions.ts +97 -0
- package/src/commands/generate/phases/plugin-generator/get-contract-gen.ts +30 -0
- package/src/commands/generate/phases/plugin-generator/index.ts +27 -0
- package/src/commands/generate/phases/plugin-generator/meta-gen.ts +17 -0
- package/src/commands/generate/types.ts +18 -0
- package/src/commands/generate/utils.ts +26 -0
- package/src/commands/init.ts +93 -0
- package/src/config.ts +79 -0
- package/src/errors.ts +58 -0
- package/src/exports/config.ts +1 -0
- package/src/exports/index.ts +7 -0
- package/src/exports/types.ts +1 -0
- package/src/logger.ts +36 -0
- package/src/types.ts +11 -0
- package/src/utils/findConfig.ts +37 -0
- package/src/utils/format.ts +11 -0
- package/src/utils/isUsingTypescript.ts +22 -0
- package/src/utils/loadEnv.ts +91 -0
- package/src/utils/resolveConfig.ts +25 -0
- package/src/version.ts +3 -0
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"isUsingTypescript.d.ts","sourceRoot":"","sources":["../../../src/utils/isUsingTypescript.ts"],"names":[],"mappings":"AAGA,wBAAsB,oBAAoB,qBAkBzC"}
|
|
@@ -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 @@
|
|
|
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
|
+
}
|