@namera-ai/cli 0.1.4 → 1.0.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/README.md +91 -221
- package/dist/index.js +1660 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -50
- package/LICENSE +0 -201
- package/dist/commands/index.mjs +0 -21
- package/dist/commands/index.mjs.map +0 -1
- package/dist/commands/keystore/create.mjs +0 -74
- package/dist/commands/keystore/create.mjs.map +0 -1
- package/dist/commands/keystore/decrypt.mjs +0 -71
- package/dist/commands/keystore/decrypt.mjs.map +0 -1
- package/dist/commands/keystore/import.mjs +0 -84
- package/dist/commands/keystore/import.mjs.map +0 -1
- package/dist/commands/keystore/index.mjs +0 -28
- package/dist/commands/keystore/index.mjs.map +0 -1
- package/dist/commands/keystore/info.mjs +0 -62
- package/dist/commands/keystore/info.mjs.map +0 -1
- package/dist/commands/keystore/list.mjs +0 -46
- package/dist/commands/keystore/list.mjs.map +0 -1
- package/dist/commands/keystore/remove.mjs +0 -51
- package/dist/commands/keystore/remove.mjs.map +0 -1
- package/dist/commands/mcp/index.mjs +0 -13
- package/dist/commands/mcp/index.mjs.map +0 -1
- package/dist/commands/mcp/start.mjs +0 -82
- package/dist/commands/mcp/start.mjs.map +0 -1
- package/dist/commands/schema/index.mjs +0 -53
- package/dist/commands/schema/index.mjs.map +0 -1
- package/dist/commands/session-key/create/index.mjs +0 -87
- package/dist/commands/session-key/create/index.mjs.map +0 -1
- package/dist/commands/session-key/create/prompts/base.mjs +0 -52
- package/dist/commands/session-key/create/prompts/base.mjs.map +0 -1
- package/dist/commands/session-key/create/prompts/call.mjs +0 -85
- package/dist/commands/session-key/create/prompts/call.mjs.map +0 -1
- package/dist/commands/session-key/create/prompts/common.mjs +0 -27
- package/dist/commands/session-key/create/prompts/common.mjs.map +0 -1
- package/dist/commands/session-key/create/prompts/gas.mjs +0 -19
- package/dist/commands/session-key/create/prompts/gas.mjs.map +0 -1
- package/dist/commands/session-key/create/prompts/index.mjs +0 -44
- package/dist/commands/session-key/create/prompts/index.mjs.map +0 -1
- package/dist/commands/session-key/create/prompts/rate-limit.mjs +0 -40
- package/dist/commands/session-key/create/prompts/rate-limit.mjs.map +0 -1
- package/dist/commands/session-key/create/prompts/signature-caller.mjs +0 -26
- package/dist/commands/session-key/create/prompts/signature-caller.mjs.map +0 -1
- package/dist/commands/session-key/create/prompts/timestamp.mjs +0 -32
- package/dist/commands/session-key/create/prompts/timestamp.mjs.map +0 -1
- package/dist/commands/session-key/index.mjs +0 -26
- package/dist/commands/session-key/index.mjs.map +0 -1
- package/dist/commands/session-key/info.mjs +0 -64
- package/dist/commands/session-key/info.mjs.map +0 -1
- package/dist/commands/session-key/list.mjs +0 -54
- package/dist/commands/session-key/list.mjs.map +0 -1
- package/dist/commands/session-key/remove.mjs +0 -51
- package/dist/commands/session-key/remove.mjs.map +0 -1
- package/dist/commands/session-key/status.mjs +0 -64
- package/dist/commands/session-key/status.mjs.map +0 -1
- package/dist/commands/smart-account/create.mjs +0 -94
- package/dist/commands/smart-account/create.mjs.map +0 -1
- package/dist/commands/smart-account/import.mjs +0 -45
- package/dist/commands/smart-account/import.mjs.map +0 -1
- package/dist/commands/smart-account/index.mjs +0 -30
- package/dist/commands/smart-account/index.mjs.map +0 -1
- package/dist/commands/smart-account/info.mjs +0 -66
- package/dist/commands/smart-account/info.mjs.map +0 -1
- package/dist/commands/smart-account/list.mjs +0 -48
- package/dist/commands/smart-account/list.mjs.map +0 -1
- package/dist/commands/smart-account/remove.mjs +0 -54
- package/dist/commands/smart-account/remove.mjs.map +0 -1
- package/dist/commands/smart-account/status.mjs +0 -63
- package/dist/commands/smart-account/status.mjs.map +0 -1
- package/dist/dto/index.mjs +0 -6
- package/dist/dto/keystore.mjs +0 -44
- package/dist/dto/keystore.mjs.map +0 -1
- package/dist/dto/mcp.mjs +0 -13
- package/dist/dto/mcp.mjs.map +0 -1
- package/dist/dto/session-key.mjs +0 -54
- package/dist/dto/session-key.mjs.map +0 -1
- package/dist/dto/smart-account.mjs +0 -45
- package/dist/dto/smart-account.mjs.map +0 -1
- package/dist/flags/global.mjs +0 -29
- package/dist/flags/global.mjs.map +0 -1
- package/dist/flags/shared.mjs +0 -11
- package/dist/flags/shared.mjs.map +0 -1
- package/dist/helpers/humanize.mjs +0 -153
- package/dist/helpers/humanize.mjs.map +0 -1
- package/dist/helpers/paths.mjs +0 -31
- package/dist/helpers/paths.mjs.map +0 -1
- package/dist/helpers/policy.mjs +0 -89
- package/dist/helpers/policy.mjs.map +0 -1
- package/dist/helpers/pretty.mjs +0 -71
- package/dist/helpers/pretty.mjs.map +0 -1
- package/dist/index.d.mts +0 -2
- package/dist/index.mjs +0 -36
- package/dist/index.mjs.map +0 -1
- package/dist/layers/config.mjs +0 -124
- package/dist/layers/config.mjs.map +0 -1
- package/dist/layers/index.mjs +0 -11
- package/dist/layers/keystore.mjs +0 -225
- package/dist/layers/keystore.mjs.map +0 -1
- package/dist/layers/mcp-context.mjs +0 -8
- package/dist/layers/mcp-context.mjs.map +0 -1
- package/dist/layers/mcp.mjs +0 -31
- package/dist/layers/mcp.mjs.map +0 -1
- package/dist/layers/output.mjs +0 -21
- package/dist/layers/output.mjs.map +0 -1
- package/dist/layers/prompt.mjs +0 -78
- package/dist/layers/prompt.mjs.map +0 -1
- package/dist/layers/session-key.mjs +0 -218
- package/dist/layers/session-key.mjs.map +0 -1
- package/dist/layers/smart-account.mjs +0 -175
- package/dist/layers/smart-account.mjs.map +0 -1
- package/dist/layers/web3.mjs +0 -83
- package/dist/layers/web3.mjs.map +0 -1
- package/dist/mcp/helpers/common.mjs +0 -9
- package/dist/mcp/helpers/common.mjs.map +0 -1
- package/dist/mcp/helpers/index.mjs +0 -4
- package/dist/mcp/helpers/session-key.mjs +0 -129
- package/dist/mcp/helpers/session-key.mjs.map +0 -1
- package/dist/mcp/index.mjs +0 -43
- package/dist/mcp/index.mjs.map +0 -1
- package/dist/mcp/mcp.mjs +0 -15
- package/dist/mcp/mcp.mjs.map +0 -1
- package/dist/mcp/tools/account/address.mjs +0 -20
- package/dist/mcp/tools/account/address.mjs.map +0 -1
- package/dist/mcp/tools/account/get-balance.mjs +0 -54
- package/dist/mcp/tools/account/get-balance.mjs.map +0 -1
- package/dist/mcp/tools/account/index.mjs +0 -15
- package/dist/mcp/tools/account/index.mjs.map +0 -1
- package/dist/mcp/tools/read/index.mjs +0 -11
- package/dist/mcp/tools/read/index.mjs.map +0 -1
- package/dist/mcp/tools/read/read-contract.mjs +0 -49
- package/dist/mcp/tools/read/read-contract.mjs.map +0 -1
- package/dist/mcp/tools/transaction/execute-transaction.mjs +0 -38
- package/dist/mcp/tools/transaction/execute-transaction.mjs.map +0 -1
- package/dist/mcp/tools/transaction/index.mjs +0 -15
- package/dist/mcp/tools/transaction/index.mjs.map +0 -1
- package/dist/mcp/tools/transaction/native-transfer.mjs +0 -59
- package/dist/mcp/tools/transaction/native-transfer.mjs.map +0 -1
- package/dist/schema/chain.mjs +0 -124
- package/dist/schema/chain.mjs.map +0 -1
- package/dist/schema/common.mjs +0 -29
- package/dist/schema/common.mjs.map +0 -1
- package/dist/schema/index.mjs +0 -5
- package/dist/schema/policy.mjs +0 -114
- package/dist/schema/policy.mjs.map +0 -1
- package/dist/schema/tx.mjs +0 -19
- package/dist/schema/tx.mjs.map +0 -1
- package/dist/types/index.mjs +0 -11
- package/dist/types/index.mjs.map +0 -1
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { ImportSmartAccountParams } from "../../dto/smart-account.mjs";
|
|
3
|
-
import "../../dto/index.mjs";
|
|
4
|
-
import { getGlobalFlags } from "../../flags/global.mjs";
|
|
5
|
-
import { SmartAccountManager, SmartAccountManagerError } from "../../layers/smart-account.mjs";
|
|
6
|
-
import { OutputFormatter } from "../../layers/output.mjs";
|
|
7
|
-
import "../../layers/index.mjs";
|
|
8
|
-
import { Console, Effect, Schema } from "effect";
|
|
9
|
-
import { Command } from "effect/unstable/cli";
|
|
10
|
-
//#region src/commands/smart-account/import.ts
|
|
11
|
-
const handler = () => Effect.gen(function* () {
|
|
12
|
-
const smartAccountManager = yield* SmartAccountManager;
|
|
13
|
-
const outputFormatter = yield* OutputFormatter;
|
|
14
|
-
const globalFlags = yield* getGlobalFlags();
|
|
15
|
-
if (globalFlags.params._tag === "None") return yield* Effect.fail(new SmartAccountManagerError({
|
|
16
|
-
code: "SmartAccountImportError",
|
|
17
|
-
message: "Smart Account import is only supported via JSON params"
|
|
18
|
-
}));
|
|
19
|
-
const params = Schema.decodeUnknownSync(Schema.fromJsonString(ImportSmartAccountParams))(globalFlags.params.value);
|
|
20
|
-
const res = yield* smartAccountManager.importSmartAccount(params);
|
|
21
|
-
const data = {
|
|
22
|
-
alias: res.alias,
|
|
23
|
-
address: res.data.smartAccountAddress,
|
|
24
|
-
owner: res.data.ownerAlias,
|
|
25
|
-
index: Number(res.data.index),
|
|
26
|
-
kernelVersion: res.data.kernelVersion
|
|
27
|
-
};
|
|
28
|
-
if (globalFlags.quiet) return;
|
|
29
|
-
const output = yield* outputFormatter.format(data, globalFlags.out);
|
|
30
|
-
yield* Console.log(output);
|
|
31
|
-
});
|
|
32
|
-
/**
|
|
33
|
-
* Command that imports a smart account using JSON params only.
|
|
34
|
-
*/
|
|
35
|
-
const importSmartAccountCommand = Command.make("import", {}, () => handler()).pipe(Command.withAlias("i"), Command.withDescription("Import a smart account"), Command.withExamples([{
|
|
36
|
-
command: `namera smart-account import --params '{"alias":"my-smart","ownerAlias":"my-owner","index":0,"kernelVersion":"0.3.2","smartAccountAddress":"0x1bC710cbA70f8Ce638dC5c8F50FDb05d87a7D652","entryPointVersion":"0.7","ownerType":"ecdsa"}'`,
|
|
37
|
-
description: "Import a smart account with json params"
|
|
38
|
-
}, {
|
|
39
|
-
command: "namera schema smart-account.import",
|
|
40
|
-
description: "Get the schema for the smart account import command"
|
|
41
|
-
}]));
|
|
42
|
-
//#endregion
|
|
43
|
-
export { importSmartAccountCommand };
|
|
44
|
-
|
|
45
|
-
//# sourceMappingURL=import.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import.mjs","names":["SmartAccountManager.SmartAccountManager","OutputFormatter.OutputFormatter"],"sources":["../../../src/commands/smart-account/import.ts"],"sourcesContent":["import { Console, Effect, Schema } from \"effect\";\nimport { Command } from \"effect/unstable/cli\";\n\nimport { ImportSmartAccountParams } from \"@/dto\";\nimport { getGlobalFlags } from \"@/flags/global\";\nimport { OutputFormatter, SmartAccountManager } from \"@/layers\";\nimport { SmartAccountManagerError } from \"@/layers/smart-account\";\n\nconst handler = () =>\n Effect.gen(function* () {\n const smartAccountManager = yield* SmartAccountManager.SmartAccountManager;\n const outputFormatter = yield* OutputFormatter.OutputFormatter;\n\n const globalFlags = yield* getGlobalFlags();\n\n if (globalFlags.params._tag === \"None\") {\n return yield* Effect.fail(\n new SmartAccountManagerError({\n code: \"SmartAccountImportError\",\n message: \"Smart Account import is only supported via JSON params\",\n }),\n );\n }\n\n const params = Schema.decodeUnknownSync(\n Schema.fromJsonString(ImportSmartAccountParams),\n )(globalFlags.params.value);\n\n const res = yield* smartAccountManager.importSmartAccount(params);\n\n const data = {\n alias: res.alias,\n address: res.data.smartAccountAddress,\n owner: res.data.ownerAlias,\n index: Number(res.data.index),\n kernelVersion: res.data.kernelVersion,\n };\n\n if (globalFlags.quiet) return;\n\n const output = yield* outputFormatter.format(data, globalFlags.out);\n yield* Console.log(output);\n });\n\n/**\n * Command that imports a smart account using JSON params only.\n */\nexport const importSmartAccountCommand = Command.make(\"import\", {}, () =>\n handler(),\n).pipe(\n Command.withAlias(\"i\"),\n Command.withDescription(\"Import a smart account\"),\n Command.withExamples([\n {\n command: `namera smart-account import --params '{\"alias\":\"my-smart\",\"ownerAlias\":\"my-owner\",\"index\":0,\"kernelVersion\":\"0.3.2\",\"smartAccountAddress\":\"0x1bC710cbA70f8Ce638dC5c8F50FDb05d87a7D652\",\"entryPointVersion\":\"0.7\",\"ownerType\":\"ecdsa\"}'`,\n description: \"Import a smart account with json params\",\n },\n {\n command: \"namera schema smart-account.import\",\n description: \"Get the schema for the smart account import command\",\n },\n ]),\n);\n"],"mappings":";;;;;;;;;;AAQA,MAAM,gBACJ,OAAO,IAAI,aAAa;CACtB,MAAM,sBAAsB,OAAOA;CACnC,MAAM,kBAAkB,OAAOC;CAE/B,MAAM,cAAc,OAAO,gBAAgB;AAE3C,KAAI,YAAY,OAAO,SAAS,OAC9B,QAAO,OAAO,OAAO,KACnB,IAAI,yBAAyB;EAC3B,MAAM;EACN,SAAS;EACV,CAAC,CACH;CAGH,MAAM,SAAS,OAAO,kBACpB,OAAO,eAAe,yBAAyB,CAChD,CAAC,YAAY,OAAO,MAAM;CAE3B,MAAM,MAAM,OAAO,oBAAoB,mBAAmB,OAAO;CAEjE,MAAM,OAAO;EACX,OAAO,IAAI;EACX,SAAS,IAAI,KAAK;EAClB,OAAO,IAAI,KAAK;EAChB,OAAO,OAAO,IAAI,KAAK,MAAM;EAC7B,eAAe,IAAI,KAAK;EACzB;AAED,KAAI,YAAY,MAAO;CAEvB,MAAM,SAAS,OAAO,gBAAgB,OAAO,MAAM,YAAY,IAAI;AACnE,QAAO,QAAQ,IAAI,OAAO;EAC1B;;;;AAKJ,MAAa,4BAA4B,QAAQ,KAAK,UAAU,EAAE,QAChE,SAAS,CACV,CAAC,KACA,QAAQ,UAAU,IAAI,EACtB,QAAQ,gBAAgB,yBAAyB,EACjD,QAAQ,aAAa,CACnB;CACE,SAAS;CACT,aAAa;CACd,EACD;CACE,SAAS;CACT,aAAa;CACd,CACF,CAAC,CACH"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createSmartAccountCommand } from "./create.mjs";
|
|
3
|
-
import { importSmartAccountCommand } from "./import.mjs";
|
|
4
|
-
import { getSmartAccountInfoCommand } from "./info.mjs";
|
|
5
|
-
import { listSmartAccountsCommand } from "./list.mjs";
|
|
6
|
-
import { removeSmartAccountCommand } from "./remove.mjs";
|
|
7
|
-
import { getSmartAccountStatus } from "./status.mjs";
|
|
8
|
-
import { Effect } from "effect";
|
|
9
|
-
import { CliError, Command } from "effect/unstable/cli";
|
|
10
|
-
//#region src/commands/smart-account/index.ts
|
|
11
|
-
/**
|
|
12
|
-
* Root command group for smart-account lifecycle actions.
|
|
13
|
-
*
|
|
14
|
-
* Includes create, list, info, remove, status, and import subcommands.
|
|
15
|
-
*/
|
|
16
|
-
const smartAccountCommands = Command.make("smart-account", {}, () => Effect.fail(new CliError.ShowHelp({
|
|
17
|
-
commandPath: ["namera", "smart-account"],
|
|
18
|
-
errors: []
|
|
19
|
-
}))).pipe(Command.withAlias("sa"), Command.withDescription("Smart Account management utilities."), Command.withSubcommands([
|
|
20
|
-
createSmartAccountCommand,
|
|
21
|
-
listSmartAccountsCommand,
|
|
22
|
-
getSmartAccountInfoCommand,
|
|
23
|
-
removeSmartAccountCommand,
|
|
24
|
-
getSmartAccountStatus,
|
|
25
|
-
importSmartAccountCommand
|
|
26
|
-
]));
|
|
27
|
-
//#endregion
|
|
28
|
-
export { smartAccountCommands };
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/commands/smart-account/index.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport { CliError, Command } from \"effect/unstable/cli\";\n\nimport { createSmartAccountCommand } from \"./create\";\nimport { importSmartAccountCommand } from \"./import\";\nimport { getSmartAccountInfoCommand } from \"./info\";\nimport { listSmartAccountsCommand } from \"./list\";\nimport { removeSmartAccountCommand } from \"./remove\";\nimport { getSmartAccountStatus } from \"./status\";\n\n/**\n * Root command group for smart-account lifecycle actions.\n *\n * Includes create, list, info, remove, status, and import subcommands.\n */\nexport const smartAccountCommands = Command.make(\"smart-account\", {}, () =>\n Effect.fail(\n new CliError.ShowHelp({\n commandPath: [\"namera\", \"smart-account\"],\n errors: [],\n }),\n ),\n).pipe(\n Command.withAlias(\"sa\"),\n Command.withDescription(\"Smart Account management utilities.\"),\n Command.withSubcommands([\n createSmartAccountCommand,\n listSmartAccountsCommand,\n getSmartAccountInfoCommand,\n removeSmartAccountCommand,\n getSmartAccountStatus,\n importSmartAccountCommand,\n ]),\n);\n"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAa,uBAAuB,QAAQ,KAAK,iBAAiB,EAAE,QAClE,OAAO,KACL,IAAI,SAAS,SAAS;CACpB,aAAa,CAAC,UAAU,gBAAgB;CACxC,QAAQ,EAAE;CACX,CAAC,CACH,CACF,CAAC,KACA,QAAQ,UAAU,KAAK,EACvB,QAAQ,gBAAgB,sCAAsC,EAC9D,QAAQ,gBAAgB;CACtB;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,CACH"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { GetKeystoreParams } from "../../dto/keystore.mjs";
|
|
3
|
-
import "../../dto/index.mjs";
|
|
4
|
-
import { getGlobalFlags } from "../../flags/global.mjs";
|
|
5
|
-
import { SmartAccountManager } from "../../layers/smart-account.mjs";
|
|
6
|
-
import { OutputFormatter } from "../../layers/output.mjs";
|
|
7
|
-
import "../../layers/index.mjs";
|
|
8
|
-
import { Console, Effect, Schema } from "effect";
|
|
9
|
-
import { Command, Flag } from "effect/unstable/cli";
|
|
10
|
-
//#region src/commands/smart-account/info.ts
|
|
11
|
-
const handler = (flagAlias) => Effect.gen(function* () {
|
|
12
|
-
const smartAccountManager = yield* SmartAccountManager;
|
|
13
|
-
const outputFormatter = yield* OutputFormatter;
|
|
14
|
-
const globalFlags = yield* getGlobalFlags();
|
|
15
|
-
let params;
|
|
16
|
-
if (globalFlags.params._tag === "Some") params = Schema.decodeUnknownSync(Schema.fromJsonString(GetKeystoreParams))(globalFlags.params.value);
|
|
17
|
-
else {
|
|
18
|
-
let alias;
|
|
19
|
-
if (flagAlias._tag === "Some") alias = flagAlias.value;
|
|
20
|
-
else alias = (yield* smartAccountManager.selectSmartAccount({ message: "Select Smart Account:" })).alias;
|
|
21
|
-
params = { alias };
|
|
22
|
-
}
|
|
23
|
-
const res = yield* smartAccountManager.getSmartAccount(params);
|
|
24
|
-
const data = {
|
|
25
|
-
alias: res.alias,
|
|
26
|
-
address: res.data.smartAccountAddress,
|
|
27
|
-
owner: res.data.ownerAlias,
|
|
28
|
-
index: Number(res.data.index),
|
|
29
|
-
kernelVersion: res.data.kernelVersion
|
|
30
|
-
};
|
|
31
|
-
if (globalFlags.quiet) return;
|
|
32
|
-
const output = yield* outputFormatter.format(data, globalFlags.out);
|
|
33
|
-
yield* Console.log(output);
|
|
34
|
-
});
|
|
35
|
-
const alias = Flag.string("alias").pipe(Flag.withDescription("The alias of the smart account to retrieve"), Flag.withAlias("a"), Flag.optional);
|
|
36
|
-
/**
|
|
37
|
-
* Command that returns stored metadata for a smart account.
|
|
38
|
-
*
|
|
39
|
-
* Accepts alias via flag or JSON params, otherwise prompts for selection.
|
|
40
|
-
*/
|
|
41
|
-
const getSmartAccountInfoCommand = Command.make("info", { alias }, ({ alias }) => handler(alias)).pipe(Command.withDescription("Get information about a smart account"), Command.withExamples([
|
|
42
|
-
{
|
|
43
|
-
command: "namera smart-account info",
|
|
44
|
-
description: "Get information about a smart account with alias prompt"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
command: "namera smart-account info --alias my-smart",
|
|
48
|
-
description: "Get information about a smart account with alias 'my-smart'"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
command: `namera smart-account info --params '{"alias":"my-smart"}'`,
|
|
52
|
-
description: "Get information about a smart account with json params"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
command: "namera smart-account info --alias my-wallet --output json",
|
|
56
|
-
description: "Get information about a smart account in json format"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
command: "namera schema smart-account.info",
|
|
60
|
-
description: "Get the schema for the smart account info command"
|
|
61
|
-
}
|
|
62
|
-
]));
|
|
63
|
-
//#endregion
|
|
64
|
-
export { getSmartAccountInfoCommand };
|
|
65
|
-
|
|
66
|
-
//# sourceMappingURL=info.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"info.mjs","names":["SmartAccountManager.SmartAccountManager","OutputFormatter.OutputFormatter"],"sources":["../../../src/commands/smart-account/info.ts"],"sourcesContent":["import { Console, Effect, type Option, Schema } from \"effect\";\nimport { Command, Flag } from \"effect/unstable/cli\";\n\nimport { GetKeystoreParams } from \"@/dto\";\nimport { getGlobalFlags } from \"@/flags/global\";\nimport { OutputFormatter, SmartAccountManager } from \"@/layers\";\n\nconst handler = (flagAlias: Option.Option<string>) =>\n Effect.gen(function* () {\n const smartAccountManager = yield* SmartAccountManager.SmartAccountManager;\n const outputFormatter = yield* OutputFormatter.OutputFormatter;\n\n const globalFlags = yield* getGlobalFlags();\n\n let params: GetKeystoreParams;\n\n if (globalFlags.params._tag === \"Some\") {\n params = Schema.decodeUnknownSync(\n Schema.fromJsonString(GetKeystoreParams),\n )(globalFlags.params.value);\n } else {\n let alias: string;\n\n if (flagAlias._tag === \"Some\") {\n alias = flagAlias.value;\n } else {\n const res = yield* smartAccountManager.selectSmartAccount({\n message: \"Select Smart Account:\",\n });\n alias = res.alias;\n }\n\n params = { alias };\n }\n\n const res = yield* smartAccountManager.getSmartAccount(params);\n\n const data = {\n alias: res.alias,\n address: res.data.smartAccountAddress,\n owner: res.data.ownerAlias,\n index: Number(res.data.index),\n kernelVersion: res.data.kernelVersion,\n };\n\n if (globalFlags.quiet) return;\n\n const output = yield* outputFormatter.format(data, globalFlags.out);\n yield* Console.log(output);\n });\n\nconst alias = Flag.string(\"alias\").pipe(\n Flag.withDescription(\"The alias of the smart account to retrieve\"),\n Flag.withAlias(\"a\"),\n Flag.optional,\n);\n\n/**\n * Command that returns stored metadata for a smart account.\n *\n * Accepts alias via flag or JSON params, otherwise prompts for selection.\n */\nexport const getSmartAccountInfoCommand = Command.make(\n \"info\",\n { alias },\n ({ alias }) => handler(alias),\n).pipe(\n Command.withDescription(\"Get information about a smart account\"),\n Command.withExamples([\n {\n command: \"namera smart-account info\",\n description: \"Get information about a smart account with alias prompt\",\n },\n {\n command: \"namera smart-account info --alias my-smart\",\n description:\n \"Get information about a smart account with alias 'my-smart'\",\n },\n {\n command: `namera smart-account info --params '{\"alias\":\"my-smart\"}'`,\n description: \"Get information about a smart account with json params\",\n },\n {\n command: \"namera smart-account info --alias my-wallet --output json\",\n description: \"Get information about a smart account in json format\",\n },\n {\n command: \"namera schema smart-account.info\",\n description: \"Get the schema for the smart account info command\",\n },\n ]),\n);\n"],"mappings":";;;;;;;;;;AAOA,MAAM,WAAW,cACf,OAAO,IAAI,aAAa;CACtB,MAAM,sBAAsB,OAAOA;CACnC,MAAM,kBAAkB,OAAOC;CAE/B,MAAM,cAAc,OAAO,gBAAgB;CAE3C,IAAI;AAEJ,KAAI,YAAY,OAAO,SAAS,OAC9B,UAAS,OAAO,kBACd,OAAO,eAAe,kBAAkB,CACzC,CAAC,YAAY,OAAO,MAAM;MACtB;EACL,IAAI;AAEJ,MAAI,UAAU,SAAS,OACrB,SAAQ,UAAU;MAKlB,UAAQ,OAHW,oBAAoB,mBAAmB,EACxD,SAAS,yBACV,CAAC,EACU;AAGd,WAAS,EAAE,OAAO;;CAGpB,MAAM,MAAM,OAAO,oBAAoB,gBAAgB,OAAO;CAE9D,MAAM,OAAO;EACX,OAAO,IAAI;EACX,SAAS,IAAI,KAAK;EAClB,OAAO,IAAI,KAAK;EAChB,OAAO,OAAO,IAAI,KAAK,MAAM;EAC7B,eAAe,IAAI,KAAK;EACzB;AAED,KAAI,YAAY,MAAO;CAEvB,MAAM,SAAS,OAAO,gBAAgB,OAAO,MAAM,YAAY,IAAI;AACnE,QAAO,QAAQ,IAAI,OAAO;EAC1B;AAEJ,MAAM,QAAQ,KAAK,OAAO,QAAQ,CAAC,KACjC,KAAK,gBAAgB,6CAA6C,EAClE,KAAK,UAAU,IAAI,EACnB,KAAK,SACN;;;;;;AAOD,MAAa,6BAA6B,QAAQ,KAChD,QACA,EAAE,OAAO,GACR,EAAE,YAAY,QAAQ,MAAM,CAC9B,CAAC,KACA,QAAQ,gBAAgB,wCAAwC,EAChE,QAAQ,aAAa;CACnB;EACE,SAAS;EACT,aAAa;EACd;CACD;EACE,SAAS;EACT,aACE;EACH;CACD;EACE,SAAS;EACT,aAAa;EACd;CACD;EACE,SAAS;EACT,aAAa;EACd;CACD;EACE,SAAS;EACT,aAAa;EACd;CACF,CAAC,CACH"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { getGlobalFlags } from "../../flags/global.mjs";
|
|
3
|
-
import { SmartAccountManager } from "../../layers/smart-account.mjs";
|
|
4
|
-
import { OutputFormatter } from "../../layers/output.mjs";
|
|
5
|
-
import "../../layers/index.mjs";
|
|
6
|
-
import { Console, Effect } from "effect";
|
|
7
|
-
import { Command } from "effect/unstable/cli";
|
|
8
|
-
//#region src/commands/smart-account/list.ts
|
|
9
|
-
const handler = () => Effect.gen(function* () {
|
|
10
|
-
const smartAccountManager = yield* SmartAccountManager;
|
|
11
|
-
const outputFormatter = yield* OutputFormatter;
|
|
12
|
-
const globalFlags = yield* getGlobalFlags();
|
|
13
|
-
const data = (yield* smartAccountManager.listSmartAccounts()).map((d) => ({
|
|
14
|
-
alias: d.alias,
|
|
15
|
-
address: d.data.smartAccountAddress,
|
|
16
|
-
owner: d.data.ownerAlias,
|
|
17
|
-
index: Number(d.data.index),
|
|
18
|
-
kernelVersion: d.data.kernelVersion
|
|
19
|
-
}));
|
|
20
|
-
if (globalFlags.quiet) return;
|
|
21
|
-
const output = yield* outputFormatter.format(data, globalFlags.out);
|
|
22
|
-
yield* Console.log(output);
|
|
23
|
-
});
|
|
24
|
-
/**
|
|
25
|
-
* Command that lists all locally stored smart accounts.
|
|
26
|
-
*/
|
|
27
|
-
const listSmartAccountsCommand = Command.make("list", {}, () => handler()).pipe(Command.withAlias("ls"), Command.withDescription("List all smart accounts"), Command.withExamples([
|
|
28
|
-
{
|
|
29
|
-
command: "namera smart-account list",
|
|
30
|
-
description: "List all smart accounts"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
command: "namera smart-account list --output json",
|
|
34
|
-
description: "List all smart accounts in json format"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
command: "namera smart-account list --output ndjson",
|
|
38
|
-
description: "List all smart accounts in ndjson format"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
command: "namera schema smart-account.list",
|
|
42
|
-
description: "Get the schema for the list smart account command"
|
|
43
|
-
}
|
|
44
|
-
]));
|
|
45
|
-
//#endregion
|
|
46
|
-
export { listSmartAccountsCommand };
|
|
47
|
-
|
|
48
|
-
//# sourceMappingURL=list.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.mjs","names":["SmartAccountManager.SmartAccountManager","OutputFormatter.OutputFormatter"],"sources":["../../../src/commands/smart-account/list.ts"],"sourcesContent":["import { Console, Effect } from \"effect\";\nimport { Command } from \"effect/unstable/cli\";\n\nimport { getGlobalFlags } from \"@/flags/global\";\nimport { OutputFormatter, SmartAccountManager } from \"@/layers\";\n\nconst handler = () =>\n Effect.gen(function* () {\n const smartAccountManager = yield* SmartAccountManager.SmartAccountManager;\n const outputFormatter = yield* OutputFormatter.OutputFormatter;\n const globalFlags = yield* getGlobalFlags();\n\n const res = yield* smartAccountManager.listSmartAccounts();\n\n const data = res.map((d) => ({\n alias: d.alias,\n address: d.data.smartAccountAddress,\n owner: d.data.ownerAlias,\n index: Number(d.data.index),\n kernelVersion: d.data.kernelVersion,\n }));\n\n if (globalFlags.quiet) return;\n\n const output = yield* outputFormatter.format(data, globalFlags.out);\n yield* Console.log(output);\n });\n\n/**\n * Command that lists all locally stored smart accounts.\n */\nexport const listSmartAccountsCommand = Command.make(\"list\", {}, () =>\n handler(),\n).pipe(\n Command.withAlias(\"ls\"),\n Command.withDescription(\"List all smart accounts\"),\n Command.withExamples([\n {\n command: \"namera smart-account list\",\n description: \"List all smart accounts\",\n },\n {\n command: \"namera smart-account list --output json\",\n description: \"List all smart accounts in json format\",\n },\n {\n command: \"namera smart-account list --output ndjson\",\n description: \"List all smart accounts in ndjson format\",\n },\n {\n command: \"namera schema smart-account.list\",\n description: \"Get the schema for the list smart account command\",\n },\n ]),\n);\n"],"mappings":";;;;;;;;AAMA,MAAM,gBACJ,OAAO,IAAI,aAAa;CACtB,MAAM,sBAAsB,OAAOA;CACnC,MAAM,kBAAkB,OAAOC;CAC/B,MAAM,cAAc,OAAO,gBAAgB;CAI3C,MAAM,QAAO,OAFM,oBAAoB,mBAAmB,EAEzC,KAAK,OAAO;EAC3B,OAAO,EAAE;EACT,SAAS,EAAE,KAAK;EAChB,OAAO,EAAE,KAAK;EACd,OAAO,OAAO,EAAE,KAAK,MAAM;EAC3B,eAAe,EAAE,KAAK;EACvB,EAAE;AAEH,KAAI,YAAY,MAAO;CAEvB,MAAM,SAAS,OAAO,gBAAgB,OAAO,MAAM,YAAY,IAAI;AACnE,QAAO,QAAQ,IAAI,OAAO;EAC1B;;;;AAKJ,MAAa,2BAA2B,QAAQ,KAAK,QAAQ,EAAE,QAC7D,SAAS,CACV,CAAC,KACA,QAAQ,UAAU,KAAK,EACvB,QAAQ,gBAAgB,0BAA0B,EAClD,QAAQ,aAAa;CACnB;EACE,SAAS;EACT,aAAa;EACd;CACD;EACE,SAAS;EACT,aAAa;EACd;CACD;EACE,SAAS;EACT,aAAa;EACd;CACD;EACE,SAAS;EACT,aAAa;EACd;CACF,CAAC,CACH"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { RemoveSmartAccountParams } from "../../dto/smart-account.mjs";
|
|
3
|
-
import "../../dto/index.mjs";
|
|
4
|
-
import { getGlobalFlags } from "../../flags/global.mjs";
|
|
5
|
-
import { SmartAccountManager } from "../../layers/smart-account.mjs";
|
|
6
|
-
import { OutputFormatter } from "../../layers/output.mjs";
|
|
7
|
-
import "../../layers/index.mjs";
|
|
8
|
-
import { Console, Effect, Schema } from "effect";
|
|
9
|
-
import { Command, Flag } from "effect/unstable/cli";
|
|
10
|
-
//#region src/commands/smart-account/remove.ts
|
|
11
|
-
const handler = (flagAlias) => Effect.gen(function* () {
|
|
12
|
-
const smartAccountManager = yield* SmartAccountManager;
|
|
13
|
-
const outputFormatter = yield* OutputFormatter;
|
|
14
|
-
const globalFlags = yield* getGlobalFlags();
|
|
15
|
-
let params;
|
|
16
|
-
if (globalFlags.params._tag === "Some") params = Schema.decodeUnknownSync(Schema.fromJsonString(RemoveSmartAccountParams))(globalFlags.params.value);
|
|
17
|
-
else {
|
|
18
|
-
let alias;
|
|
19
|
-
if (flagAlias._tag === "Some") alias = flagAlias.value;
|
|
20
|
-
else alias = (yield* smartAccountManager.selectSmartAccount({ message: "Select Smart Account:" })).alias;
|
|
21
|
-
params = { alias };
|
|
22
|
-
}
|
|
23
|
-
yield* smartAccountManager.removeSmartAccount(params);
|
|
24
|
-
const data = { success: true };
|
|
25
|
-
if (globalFlags.quiet) return;
|
|
26
|
-
const output = yield* outputFormatter.format(data, globalFlags.out);
|
|
27
|
-
yield* Console.log(output);
|
|
28
|
-
});
|
|
29
|
-
const alias = Flag.string("alias").pipe(Flag.withDescription("The alias of the smart account to remove"), Flag.withAlias("a"), Flag.optional);
|
|
30
|
-
/**
|
|
31
|
-
* Command that removes a locally stored smart account by alias.
|
|
32
|
-
*/
|
|
33
|
-
const removeSmartAccountCommand = Command.make("remove", { alias }, ({ alias }) => handler(alias)).pipe(Command.withAlias("rm"), Command.withDescription("Remove a Smart Account"), Command.withExamples([
|
|
34
|
-
{
|
|
35
|
-
command: "namera smart-account remove",
|
|
36
|
-
description: "Remove a smart-account with alias prompt"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
command: "namera smart-account remove --alias my-smart",
|
|
40
|
-
description: "Remove a smart account with alias 'my-smart'"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
command: `namera smart-account remove --params '{"alias":"my-smart"}'`,
|
|
44
|
-
description: "Remove a smart account with json params"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
command: "namera schema smart-account.remove",
|
|
48
|
-
description: "Get the schema for the remove smart account command"
|
|
49
|
-
}
|
|
50
|
-
]));
|
|
51
|
-
//#endregion
|
|
52
|
-
export { removeSmartAccountCommand };
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=remove.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove.mjs","names":["SmartAccountManager.SmartAccountManager","OutputFormatter.OutputFormatter"],"sources":["../../../src/commands/smart-account/remove.ts"],"sourcesContent":["import { Console, Effect, type Option, Schema } from \"effect\";\nimport { Command, Flag } from \"effect/unstable/cli\";\n\nimport { RemoveSmartAccountParams } from \"@/dto\";\nimport { getGlobalFlags } from \"@/flags/global\";\nimport { OutputFormatter, SmartAccountManager } from \"@/layers\";\n\nconst handler = (flagAlias: Option.Option<string>) =>\n Effect.gen(function* () {\n const smartAccountManager = yield* SmartAccountManager.SmartAccountManager;\n const outputFormatter = yield* OutputFormatter.OutputFormatter;\n const globalFlags = yield* getGlobalFlags();\n\n let params: RemoveSmartAccountParams;\n\n if (globalFlags.params._tag === \"Some\") {\n params = Schema.decodeUnknownSync(\n Schema.fromJsonString(RemoveSmartAccountParams),\n )(globalFlags.params.value);\n } else {\n let alias: string;\n\n if (flagAlias._tag === \"Some\") {\n alias = flagAlias.value;\n } else {\n const res = yield* smartAccountManager.selectSmartAccount({\n message: \"Select Smart Account:\",\n });\n alias = res.alias;\n }\n\n params = { alias };\n }\n\n yield* smartAccountManager.removeSmartAccount(params);\n\n const data = { success: true };\n\n if (globalFlags.quiet) return;\n const output = yield* outputFormatter.format(data, globalFlags.out);\n yield* Console.log(output);\n });\n\nconst alias = Flag.string(\"alias\").pipe(\n Flag.withDescription(\"The alias of the smart account to remove\"),\n Flag.withAlias(\"a\"),\n Flag.optional,\n);\n\n/**\n * Command that removes a locally stored smart account by alias.\n */\nexport const removeSmartAccountCommand = Command.make(\n \"remove\",\n { alias },\n ({ alias }) => handler(alias),\n).pipe(\n Command.withAlias(\"rm\"),\n Command.withDescription(\"Remove a Smart Account\"),\n Command.withExamples([\n {\n command: \"namera smart-account remove\",\n description: \"Remove a smart-account with alias prompt\",\n },\n {\n command: \"namera smart-account remove --alias my-smart\",\n description: \"Remove a smart account with alias 'my-smart'\",\n },\n {\n command: `namera smart-account remove --params '{\"alias\":\"my-smart\"}'`,\n description: \"Remove a smart account with json params\",\n },\n {\n command: \"namera schema smart-account.remove\",\n description: \"Get the schema for the remove smart account command\",\n },\n ]),\n);\n"],"mappings":";;;;;;;;;;AAOA,MAAM,WAAW,cACf,OAAO,IAAI,aAAa;CACtB,MAAM,sBAAsB,OAAOA;CACnC,MAAM,kBAAkB,OAAOC;CAC/B,MAAM,cAAc,OAAO,gBAAgB;CAE3C,IAAI;AAEJ,KAAI,YAAY,OAAO,SAAS,OAC9B,UAAS,OAAO,kBACd,OAAO,eAAe,yBAAyB,CAChD,CAAC,YAAY,OAAO,MAAM;MACtB;EACL,IAAI;AAEJ,MAAI,UAAU,SAAS,OACrB,SAAQ,UAAU;MAKlB,UAAQ,OAHW,oBAAoB,mBAAmB,EACxD,SAAS,yBACV,CAAC,EACU;AAGd,WAAS,EAAE,OAAO;;AAGpB,QAAO,oBAAoB,mBAAmB,OAAO;CAErD,MAAM,OAAO,EAAE,SAAS,MAAM;AAE9B,KAAI,YAAY,MAAO;CACvB,MAAM,SAAS,OAAO,gBAAgB,OAAO,MAAM,YAAY,IAAI;AACnE,QAAO,QAAQ,IAAI,OAAO;EAC1B;AAEJ,MAAM,QAAQ,KAAK,OAAO,QAAQ,CAAC,KACjC,KAAK,gBAAgB,2CAA2C,EAChE,KAAK,UAAU,IAAI,EACnB,KAAK,SACN;;;;AAKD,MAAa,4BAA4B,QAAQ,KAC/C,UACA,EAAE,OAAO,GACR,EAAE,YAAY,QAAQ,MAAM,CAC9B,CAAC,KACA,QAAQ,UAAU,KAAK,EACvB,QAAQ,gBAAgB,yBAAyB,EACjD,QAAQ,aAAa;CACnB;EACE,SAAS;EACT,aAAa;EACd;CACD;EACE,SAAS;EACT,aAAa;EACd;CACD;EACE,SAAS;EACT,aAAa;EACd;CACD;EACE,SAAS;EACT,aAAa;EACd;CACF,CAAC,CACH"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { GetSmartAccountStatusParams } from "../../dto/smart-account.mjs";
|
|
3
|
-
import "../../dto/index.mjs";
|
|
4
|
-
import { getGlobalFlags } from "../../flags/global.mjs";
|
|
5
|
-
import { Web3Service } from "../../layers/web3.mjs";
|
|
6
|
-
import { SmartAccountManager } from "../../layers/smart-account.mjs";
|
|
7
|
-
import { OutputFormatter } from "../../layers/output.mjs";
|
|
8
|
-
import "../../layers/index.mjs";
|
|
9
|
-
import { chainAndRpcUrl } from "../../flags/shared.mjs";
|
|
10
|
-
import { Console, Effect, Schema } from "effect";
|
|
11
|
-
import { Command, Flag } from "effect/unstable/cli";
|
|
12
|
-
//#region src/commands/smart-account/status.ts
|
|
13
|
-
const handler = (flagAlias, flagChain, flagRpcUrl) => Effect.gen(function* () {
|
|
14
|
-
const web3Service = yield* Web3Service;
|
|
15
|
-
const smartAccountManager = yield* SmartAccountManager;
|
|
16
|
-
const outputFormatter = yield* OutputFormatter;
|
|
17
|
-
const globalFlags = yield* getGlobalFlags();
|
|
18
|
-
let params;
|
|
19
|
-
if (globalFlags.params._tag === "Some") params = Schema.decodeUnknownSync(Schema.fromJsonString(GetSmartAccountStatusParams))(globalFlags.params.value);
|
|
20
|
-
else {
|
|
21
|
-
let alias;
|
|
22
|
-
let chain;
|
|
23
|
-
const rpcUrl = flagRpcUrl._tag === "Some" ? flagRpcUrl.value : void 0;
|
|
24
|
-
if (flagAlias._tag === "Some") alias = flagAlias.value;
|
|
25
|
-
else alias = (yield* smartAccountManager.selectSmartAccount({ message: "Select Smart Account:" })).alias;
|
|
26
|
-
if (flagChain._tag === "Some") chain = flagChain.value;
|
|
27
|
-
else chain = yield* web3Service.selectChain({ message: "Select Chain:" });
|
|
28
|
-
params = {
|
|
29
|
-
alias,
|
|
30
|
-
chain,
|
|
31
|
-
rpcUrl
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const data = { deployed: yield* smartAccountManager.getSmartAccountStatus(params) };
|
|
35
|
-
if (globalFlags.quiet) return;
|
|
36
|
-
const output = yield* outputFormatter.format(data, globalFlags.out);
|
|
37
|
-
yield* Console.log(output);
|
|
38
|
-
});
|
|
39
|
-
const alias = Flag.string("alias").pipe(Flag.withDescription("The alias of the smart account"), Flag.withAlias("a"), Flag.optional);
|
|
40
|
-
/**
|
|
41
|
-
* Command that checks deployment status of a smart account on a chain.
|
|
42
|
-
*/
|
|
43
|
-
const getSmartAccountStatus = Command.make("status", {
|
|
44
|
-
alias,
|
|
45
|
-
...chainAndRpcUrl
|
|
46
|
-
}, ({ alias, chain, rpcUrl }) => handler(alias, chain, rpcUrl)).pipe(Command.withDescription("Get Smart Account Deployment Status for a given chain"), Command.withExamples([
|
|
47
|
-
{
|
|
48
|
-
command: "namera smart-account status -a my-smart --chain eth-mainnet",
|
|
49
|
-
description: "Get Smart Account Deployment Status for a given chain"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
command: "namera smart-account status --alias my-smart --chain eth-mainnet --rpc-url https://rpc.ankr.com/eth",
|
|
53
|
-
description: "Get Smart Account Deployment Status for a given chain with custom RPC URL"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
command: `namera smart-account status --params '{"alias":"my-smart","chain":"eth-mainnet"}'`,
|
|
57
|
-
description: "Get Smart Account Deployment Status for a given chain with json params"
|
|
58
|
-
}
|
|
59
|
-
]));
|
|
60
|
-
//#endregion
|
|
61
|
-
export { getSmartAccountStatus };
|
|
62
|
-
|
|
63
|
-
//# sourceMappingURL=status.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status.mjs","names":["Web3Service.Web3Service","SmartAccountManager.SmartAccountManager","OutputFormatter.OutputFormatter"],"sources":["../../../src/commands/smart-account/status.ts"],"sourcesContent":["import { Console, Effect, type Option, Schema } from \"effect\";\nimport { Command, Flag } from \"effect/unstable/cli\";\n\nimport { GetSmartAccountStatusParams } from \"@/dto\";\nimport { getGlobalFlags } from \"@/flags/global\";\nimport { chainAndRpcUrl } from \"@/flags/shared\";\nimport { OutputFormatter, SmartAccountManager, Web3Service } from \"@/layers\";\nimport type { SupportedChain } from \"@/schema/chain\";\n\nconst handler = (\n flagAlias: Option.Option<string>,\n flagChain: Option.Option<SupportedChain>,\n flagRpcUrl: Option.Option<string>,\n) =>\n Effect.gen(function* () {\n const web3Service = yield* Web3Service.Web3Service;\n const smartAccountManager = yield* SmartAccountManager.SmartAccountManager;\n const outputFormatter = yield* OutputFormatter.OutputFormatter;\n const globalFlags = yield* getGlobalFlags();\n\n let params: GetSmartAccountStatusParams;\n\n if (globalFlags.params._tag === \"Some\") {\n params = Schema.decodeUnknownSync(\n Schema.fromJsonString(GetSmartAccountStatusParams),\n )(globalFlags.params.value);\n } else {\n let alias: string;\n let chain: SupportedChain;\n const rpcUrl = flagRpcUrl._tag === \"Some\" ? flagRpcUrl.value : undefined;\n\n if (flagAlias._tag === \"Some\") {\n alias = flagAlias.value;\n } else {\n const res = yield* smartAccountManager.selectSmartAccount({\n message: \"Select Smart Account:\",\n });\n alias = res.alias;\n }\n\n if (flagChain._tag === \"Some\") {\n chain = flagChain.value;\n } else {\n chain = yield* web3Service.selectChain({\n message: \"Select Chain:\",\n });\n }\n\n params = { alias, chain, rpcUrl };\n }\n\n const deployed = yield* smartAccountManager.getSmartAccountStatus(params);\n\n const data = { deployed };\n\n if (globalFlags.quiet) return;\n\n const output = yield* outputFormatter.format(data, globalFlags.out);\n yield* Console.log(output);\n });\n\nconst alias = Flag.string(\"alias\").pipe(\n Flag.withDescription(\"The alias of the smart account\"),\n Flag.withAlias(\"a\"),\n Flag.optional,\n);\n\n/**\n * Command that checks deployment status of a smart account on a chain.\n */\nexport const getSmartAccountStatus = Command.make(\n \"status\",\n {\n alias,\n ...chainAndRpcUrl,\n },\n ({ alias, chain, rpcUrl }) => handler(alias, chain, rpcUrl),\n).pipe(\n Command.withDescription(\n \"Get Smart Account Deployment Status for a given chain\",\n ),\n Command.withExamples([\n {\n command: \"namera smart-account status -a my-smart --chain eth-mainnet\",\n description: \"Get Smart Account Deployment Status for a given chain\",\n },\n {\n command:\n \"namera smart-account status --alias my-smart --chain eth-mainnet --rpc-url https://rpc.ankr.com/eth\",\n description:\n \"Get Smart Account Deployment Status for a given chain with custom RPC URL\",\n },\n {\n command: `namera smart-account status --params '{\"alias\":\"my-smart\",\"chain\":\"eth-mainnet\"}'`,\n description:\n \"Get Smart Account Deployment Status for a given chain with json params\",\n },\n ]),\n);\n"],"mappings":";;;;;;;;;;;;AASA,MAAM,WACJ,WACA,WACA,eAEA,OAAO,IAAI,aAAa;CACtB,MAAM,cAAc,OAAOA;CAC3B,MAAM,sBAAsB,OAAOC;CACnC,MAAM,kBAAkB,OAAOC;CAC/B,MAAM,cAAc,OAAO,gBAAgB;CAE3C,IAAI;AAEJ,KAAI,YAAY,OAAO,SAAS,OAC9B,UAAS,OAAO,kBACd,OAAO,eAAe,4BAA4B,CACnD,CAAC,YAAY,OAAO,MAAM;MACtB;EACL,IAAI;EACJ,IAAI;EACJ,MAAM,SAAS,WAAW,SAAS,SAAS,WAAW,QAAQ;AAE/D,MAAI,UAAU,SAAS,OACrB,SAAQ,UAAU;MAKlB,UAAQ,OAHW,oBAAoB,mBAAmB,EACxD,SAAS,yBACV,CAAC,EACU;AAGd,MAAI,UAAU,SAAS,OACrB,SAAQ,UAAU;MAElB,SAAQ,OAAO,YAAY,YAAY,EACrC,SAAS,iBACV,CAAC;AAGJ,WAAS;GAAE;GAAO;GAAO;GAAQ;;CAKnC,MAAM,OAAO,EAAE,iBAFS,oBAAoB,sBAAsB,OAAO,EAEhD;AAEzB,KAAI,YAAY,MAAO;CAEvB,MAAM,SAAS,OAAO,gBAAgB,OAAO,MAAM,YAAY,IAAI;AACnE,QAAO,QAAQ,IAAI,OAAO;EAC1B;AAEJ,MAAM,QAAQ,KAAK,OAAO,QAAQ,CAAC,KACjC,KAAK,gBAAgB,iCAAiC,EACtD,KAAK,UAAU,IAAI,EACnB,KAAK,SACN;;;;AAKD,MAAa,wBAAwB,QAAQ,KAC3C,UACA;CACE;CACA,GAAG;CACJ,GACA,EAAE,OAAO,OAAO,aAAa,QAAQ,OAAO,OAAO,OAAO,CAC5D,CAAC,KACA,QAAQ,gBACN,wDACD,EACD,QAAQ,aAAa;CACnB;EACE,SAAS;EACT,aAAa;EACd;CACD;EACE,SACE;EACF,aACE;EACH;CACD;EACE,SAAS;EACT,aACE;EACH;CACF,CAAC,CACH"}
|
package/dist/dto/index.mjs
DELETED
package/dist/dto/keystore.mjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
//#region src/dto/keystore.ts
|
|
4
|
-
const Keystore = Schema.Struct({
|
|
5
|
-
version: Schema.Number,
|
|
6
|
-
id: Schema.String,
|
|
7
|
-
address: Schema.String,
|
|
8
|
-
crypto: Schema.Any
|
|
9
|
-
});
|
|
10
|
-
Schema.Struct({
|
|
11
|
-
path: Schema.String,
|
|
12
|
-
alias: Schema.String,
|
|
13
|
-
data: Keystore
|
|
14
|
-
});
|
|
15
|
-
const GetKeystoreParams = Schema.Struct({ alias: Schema.String.annotate({ description: "The alias of the wallet to retrieve" }) });
|
|
16
|
-
const ListKeystoreParams = Schema.Void;
|
|
17
|
-
const CreateKeystoreParams = Schema.Struct({
|
|
18
|
-
alias: Schema.String.annotate({ description: "The alias of the wallet to create" }),
|
|
19
|
-
password: Schema.redact(Schema.String).annotate({ description: "The password to encrypt the keystore with" })
|
|
20
|
-
});
|
|
21
|
-
const DecryptKeystoreParams = Schema.Struct({
|
|
22
|
-
alias: Schema.String.annotate({ description: "The alias of the keystore to decrypt" }),
|
|
23
|
-
password: Schema.redact(Schema.String).annotate({ description: "The password to decrypt the keystore with" })
|
|
24
|
-
});
|
|
25
|
-
Schema.Struct({
|
|
26
|
-
address: Schema.String.annotate({ description: "The address of the keystore" }),
|
|
27
|
-
alias: Schema.String.annotate({ description: "The alias of the keystore" }),
|
|
28
|
-
privateKey: Schema.Redacted(Schema.String).annotate({ description: "The private key of the keystore" }),
|
|
29
|
-
publicKey: Schema.String.annotate({ description: "The public key of the keystore" })
|
|
30
|
-
});
|
|
31
|
-
const ImportKeystoreParams = Schema.Struct({
|
|
32
|
-
alias: Schema.String.annotate({ description: "The alias of the keystore to import" }),
|
|
33
|
-
privateKey: Schema.String.annotate({ description: "The private key of the keystore to import" }),
|
|
34
|
-
password: Schema.redact(Schema.String).annotate({ description: "The password to encrypt the keystore with" })
|
|
35
|
-
});
|
|
36
|
-
const RemoveKeystoreParams = Schema.Struct({ alias: Schema.String.annotate({ description: "The alias of the keystore to remove" }) });
|
|
37
|
-
Schema.Struct({
|
|
38
|
-
alias: Schema.String.annotate({ description: "The alias of the keystore to get the signer for" }),
|
|
39
|
-
password: Schema.redact(Schema.String).annotate({ description: "The password to decrypt the keystore with" })
|
|
40
|
-
});
|
|
41
|
-
//#endregion
|
|
42
|
-
export { CreateKeystoreParams, DecryptKeystoreParams, GetKeystoreParams, ImportKeystoreParams, Keystore, ListKeystoreParams, RemoveKeystoreParams };
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=keystore.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keystore.mjs","names":[],"sources":["../../src/dto/keystore.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nexport const Keystore = Schema.Struct({\n version: Schema.Number,\n id: Schema.String,\n address: Schema.String,\n crypto: Schema.Any,\n});\n\nexport const KeystoreData = Schema.Struct({\n path: Schema.String,\n alias: Schema.String,\n data: Keystore,\n});\n\nexport const GetKeystoreParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the wallet to retrieve\",\n }),\n});\n\nexport const ListKeystoreParams = Schema.Void;\n\nexport const CreateKeystoreParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the wallet to create\",\n }),\n password: Schema.redact(Schema.String).annotate({\n description: \"The password to encrypt the keystore with\",\n }),\n});\n\nexport const DecryptKeystoreParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the keystore to decrypt\",\n }),\n password: Schema.redact(Schema.String).annotate({\n description: \"The password to decrypt the keystore with\",\n }),\n});\n\nexport const DecryptKeystoreResponse = Schema.Struct({\n address: Schema.String.annotate({\n description: \"The address of the keystore\",\n }),\n alias: Schema.String.annotate({\n description: \"The alias of the keystore\",\n }),\n privateKey: Schema.Redacted(Schema.String).annotate({\n description: \"The private key of the keystore\",\n }),\n publicKey: Schema.String.annotate({\n description: \"The public key of the keystore\",\n }),\n});\n\nexport const ImportKeystoreParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the keystore to import\",\n }),\n privateKey: Schema.String.annotate({\n description: \"The private key of the keystore to import\",\n }),\n password: Schema.redact(Schema.String).annotate({\n description: \"The password to encrypt the keystore with\",\n }),\n});\n\nexport const RemoveKeystoreParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the keystore to remove\",\n }),\n});\n\nexport const GetSignerParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the keystore to get the signer for\",\n }),\n password: Schema.redact(Schema.String).annotate({\n description: \"The password to decrypt the keystore with\",\n }),\n});\n\nexport type Keystore = typeof Keystore.Type;\nexport type KeystoreData = typeof KeystoreData.Type;\nexport type GetKeystoreParams = typeof GetKeystoreParams.Type;\nexport type ListKeystoreParams = typeof ListKeystoreParams.Type;\nexport type CreateKeystoreParams = typeof CreateKeystoreParams.Type;\nexport type DecryptKeystoreParams = typeof DecryptKeystoreParams.Type;\nexport type DecryptKeystoreResponse = typeof DecryptKeystoreResponse.Type;\nexport type ImportKeystoreParams = typeof ImportKeystoreParams.Type;\nexport type RemoveKeystoreParams = typeof RemoveKeystoreParams.Type;\nexport type GetSignerParams = typeof GetSignerParams.Type;\n"],"mappings":";;;AAEA,MAAa,WAAW,OAAO,OAAO;CACpC,SAAS,OAAO;CAChB,IAAI,OAAO;CACX,SAAS,OAAO;CAChB,QAAQ,OAAO;CAChB,CAAC;AAE0B,OAAO,OAAO;CACxC,MAAM,OAAO;CACb,OAAO,OAAO;CACd,MAAM;CACP,CAAC;AAEF,MAAa,oBAAoB,OAAO,OAAO,EAC7C,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,uCACd,CAAC,EACH,CAAC;AAEF,MAAa,qBAAqB,OAAO;AAEzC,MAAa,uBAAuB,OAAO,OAAO;CAChD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,qCACd,CAAC;CACF,UAAU,OAAO,OAAO,OAAO,OAAO,CAAC,SAAS,EAC9C,aAAa,6CACd,CAAC;CACH,CAAC;AAEF,MAAa,wBAAwB,OAAO,OAAO;CACjD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,wCACd,CAAC;CACF,UAAU,OAAO,OAAO,OAAO,OAAO,CAAC,SAAS,EAC9C,aAAa,6CACd,CAAC;CACH,CAAC;AAEqC,OAAO,OAAO;CACnD,SAAS,OAAO,OAAO,SAAS,EAC9B,aAAa,+BACd,CAAC;CACF,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,6BACd,CAAC;CACF,YAAY,OAAO,SAAS,OAAO,OAAO,CAAC,SAAS,EAClD,aAAa,mCACd,CAAC;CACF,WAAW,OAAO,OAAO,SAAS,EAChC,aAAa,kCACd,CAAC;CACH,CAAC;AAEF,MAAa,uBAAuB,OAAO,OAAO;CAChD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,uCACd,CAAC;CACF,YAAY,OAAO,OAAO,SAAS,EACjC,aAAa,6CACd,CAAC;CACF,UAAU,OAAO,OAAO,OAAO,OAAO,CAAC,SAAS,EAC9C,aAAa,6CACd,CAAC;CACH,CAAC;AAEF,MAAa,uBAAuB,OAAO,OAAO,EAChD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,uCACd,CAAC,EACH,CAAC;AAE6B,OAAO,OAAO;CAC3C,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,mDACd,CAAC;CACF,UAAU,OAAO,OAAO,OAAO,OAAO,CAAC,SAAS,EAC9C,aAAa,6CACd,CAAC;CACH,CAAC"}
|
package/dist/dto/mcp.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
//#region src/dto/mcp.ts
|
|
4
|
-
const StartMcpServerParams = Schema.Struct({
|
|
5
|
-
smartAccountAlias: Schema.String.annotate({ description: "The alias of the smart account to use for the MCP server" }),
|
|
6
|
-
transport: Schema.Literals(["http", "stdio"]).annotate({ description: "The transport to use for the MCP server" }),
|
|
7
|
-
port: Schema.optional(Schema.Int.check(Schema.makeFilter((v) => v > 0 && v < 65536))).annotate({ description: "The port to use for the MCP server when using http transport" }),
|
|
8
|
-
sessionKeys: Schema.mutableKey(Schema.Record(Schema.String, Schema.String))
|
|
9
|
-
});
|
|
10
|
-
//#endregion
|
|
11
|
-
export { StartMcpServerParams };
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=mcp.mjs.map
|
package/dist/dto/mcp.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.mjs","names":[],"sources":["../../src/dto/mcp.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nexport const StartMcpServerParams = Schema.Struct({\n smartAccountAlias: Schema.String.annotate({\n description: \"The alias of the smart account to use for the MCP server\",\n }),\n transport: Schema.Literals([\"http\", \"stdio\"]).annotate({\n description: \"The transport to use for the MCP server\",\n }),\n port: Schema.optional(\n Schema.Int.check(Schema.makeFilter((v) => v > 0 && v < 65_536)),\n ).annotate({\n description: \"The port to use for the MCP server when using http transport\",\n }),\n sessionKeys: Schema.mutableKey(Schema.Record(Schema.String, Schema.String)),\n});\n\nexport type StartMcpServerParams = typeof StartMcpServerParams.Type;\n"],"mappings":";;;AAEA,MAAa,uBAAuB,OAAO,OAAO;CAChD,mBAAmB,OAAO,OAAO,SAAS,EACxC,aAAa,4DACd,CAAC;CACF,WAAW,OAAO,SAAS,CAAC,QAAQ,QAAQ,CAAC,CAAC,SAAS,EACrD,aAAa,2CACd,CAAC;CACF,MAAM,OAAO,SACX,OAAO,IAAI,MAAM,OAAO,YAAY,MAAM,IAAI,KAAK,IAAI,MAAO,CAAC,CAChE,CAAC,SAAS,EACT,aAAa,gEACd,CAAC;CACF,aAAa,OAAO,WAAW,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO,CAAC;CAC5E,CAAC"}
|
package/dist/dto/session-key.mjs
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Keystore } from "./keystore.mjs";
|
|
3
|
-
import { SupportedChain } from "../schema/chain.mjs";
|
|
4
|
-
import { EthereumAddress } from "../schema/common.mjs";
|
|
5
|
-
import { PolicyParams } from "../schema/policy.mjs";
|
|
6
|
-
import "../schema/index.mjs";
|
|
7
|
-
import { Schema, Struct } from "effect";
|
|
8
|
-
//#region src/dto/session-key.ts
|
|
9
|
-
const BaseSessionKey = Schema.Struct({
|
|
10
|
-
smartAccountAlias: Schema.String,
|
|
11
|
-
serializedAccounts: Schema.Array(Schema.Struct({
|
|
12
|
-
chain: SupportedChain,
|
|
13
|
-
serializedAccount: Schema.String
|
|
14
|
-
}))
|
|
15
|
-
}).mapFields(Struct.assign(Keystore.fields));
|
|
16
|
-
const EcdsaSessionKey = Schema.Struct({
|
|
17
|
-
sessionKeyType: Schema.Literal("ecdsa"),
|
|
18
|
-
sessionKeyAddress: EthereumAddress,
|
|
19
|
-
smartAccountAlias: Schema.String
|
|
20
|
-
}).mapFields(Struct.assign(BaseSessionKey.fields));
|
|
21
|
-
const PasskeySessionKey = Schema.Struct({
|
|
22
|
-
sessionKeyType: Schema.Literal("passkey"),
|
|
23
|
-
passKeyName: Schema.String
|
|
24
|
-
}).mapFields(Struct.assign(BaseSessionKey.fields));
|
|
25
|
-
const SessionKey = Schema.Union([EcdsaSessionKey, PasskeySessionKey]);
|
|
26
|
-
Schema.Struct({
|
|
27
|
-
alias: Schema.String,
|
|
28
|
-
data: SessionKey,
|
|
29
|
-
path: Schema.String
|
|
30
|
-
});
|
|
31
|
-
const CreateSessionKeyParams = Schema.Struct({
|
|
32
|
-
alias: Schema.String.annotate({ description: "The alias of the session key to create" }),
|
|
33
|
-
chains: Schema.mutable(Schema.Array(SupportedChain)).annotate({ description: "The chains to create the session key for" }),
|
|
34
|
-
policyParams: Schema.mutable(Schema.Array(PolicyParams)),
|
|
35
|
-
smartAccountAlias: Schema.String.annotate({ description: "The alias of the smart account to create the session key for" }),
|
|
36
|
-
ownerKeystorePassword: Schema.redact(Schema.String).annotate({ description: "The password to decrypt the owner keystore with" }),
|
|
37
|
-
sessionKeyPassword: Schema.redact(Schema.String).annotate({ description: "The password to encrypt the session key with" })
|
|
38
|
-
});
|
|
39
|
-
Schema.Struct({ alias: Schema.String.annotate({ description: "The alias of the session key to retrieve" }) });
|
|
40
|
-
const ListSessionKeysParams = Schema.Struct({ smartAccount: Schema.optional(Schema.String).annotate({ description: "The alias of the smart account to list session keys for" }) });
|
|
41
|
-
const GetSessionKeyInfoParams = Schema.Struct({ alias: Schema.String.annotate({ description: "The alias of the session key to retrieve" }) });
|
|
42
|
-
const GetSessionKeyStatusParams = Schema.Struct({
|
|
43
|
-
alias: Schema.String.annotate({ description: "The alias of the session key to retrieve" }),
|
|
44
|
-
chain: SupportedChain.annotate({ description: "The chain to retrieve the session key status for" }),
|
|
45
|
-
rpcUrl: Schema.redact(Schema.String.pipe(Schema.optional)).annotate({
|
|
46
|
-
description: "The RPC URL to use for the chain",
|
|
47
|
-
default: "Public RPC URL"
|
|
48
|
-
})
|
|
49
|
-
});
|
|
50
|
-
const RemoveSessionKeyParams = Schema.Struct({ alias: Schema.String.annotate({ description: "The alias of the session key to remove" }) });
|
|
51
|
-
//#endregion
|
|
52
|
-
export { CreateSessionKeyParams, GetSessionKeyInfoParams, GetSessionKeyStatusParams, ListSessionKeysParams, RemoveSessionKeyParams, SessionKey };
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=session-key.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-key.mjs","names":[],"sources":["../../src/dto/session-key.ts"],"sourcesContent":["import { Schema, Struct } from \"effect\";\n\nimport { EthereumAddress, PolicyParams, SupportedChain } from \"@/schema\";\n\nimport { Keystore } from \"./keystore\";\n\nconst BaseSessionKey = Schema.Struct({\n smartAccountAlias: Schema.String,\n serializedAccounts: Schema.Array(\n Schema.Struct({\n chain: SupportedChain,\n serializedAccount: Schema.String,\n }),\n ),\n}).mapFields(Struct.assign(Keystore.fields));\n\nconst EcdsaSessionKey = Schema.Struct({\n sessionKeyType: Schema.Literal(\"ecdsa\"),\n sessionKeyAddress: EthereumAddress,\n smartAccountAlias: Schema.String,\n}).mapFields(Struct.assign(BaseSessionKey.fields));\n\nconst PasskeySessionKey = Schema.Struct({\n sessionKeyType: Schema.Literal(\"passkey\"),\n passKeyName: Schema.String,\n}).mapFields(Struct.assign(BaseSessionKey.fields));\n\nexport const SessionKey = Schema.Union([EcdsaSessionKey, PasskeySessionKey]);\n\nexport const SessionKeyData = Schema.Struct({\n alias: Schema.String,\n data: SessionKey,\n path: Schema.String,\n});\n\nexport const CreateSessionKeyParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the session key to create\",\n }),\n chains: Schema.mutable(Schema.Array(SupportedChain)).annotate({\n description: \"The chains to create the session key for\",\n }),\n policyParams: Schema.mutable(Schema.Array(PolicyParams)),\n smartAccountAlias: Schema.String.annotate({\n description: \"The alias of the smart account to create the session key for\",\n }),\n ownerKeystorePassword: Schema.redact(Schema.String).annotate({\n description: \"The password to decrypt the owner keystore with\",\n }),\n sessionKeyPassword: Schema.redact(Schema.String).annotate({\n description: \"The password to encrypt the session key with\",\n }),\n});\n\nexport const GetSessionKeyParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the session key to retrieve\",\n }),\n});\n\nexport const ListSessionKeysParams = Schema.Struct({\n smartAccount: Schema.optional(Schema.String).annotate({\n description: \"The alias of the smart account to list session keys for\",\n }),\n});\n\nexport const GetSessionKeyInfoParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the session key to retrieve\",\n }),\n});\n\nexport const GetSessionKeyStatusParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the session key to retrieve\",\n }),\n chain: SupportedChain.annotate({\n description: \"The chain to retrieve the session key status for\",\n }),\n rpcUrl: Schema.redact(Schema.String.pipe(Schema.optional)).annotate({\n description: \"The RPC URL to use for the chain\",\n default: \"Public RPC URL\",\n }),\n});\n\nexport const RemoveSessionKeyParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the session key to remove\",\n }),\n});\n\nexport type SessionKey = typeof SessionKey.Type;\nexport type SessionKeyData = typeof SessionKeyData.Type;\nexport type CreateSessionKeyParams = typeof CreateSessionKeyParams.Type;\nexport type GetSessionKeyParams = typeof GetSessionKeyParams.Type;\nexport type ListSessionKeysParams = typeof ListSessionKeysParams.Type;\nexport type GetSessionKeyInfoParams = typeof GetSessionKeyInfoParams.Type;\nexport type GetSessionKeyStatusParams = typeof GetSessionKeyStatusParams.Type;\nexport type RemoveSessionKeyParams = typeof RemoveSessionKeyParams.Type;\n"],"mappings":";;;;;;;;AAMA,MAAM,iBAAiB,OAAO,OAAO;CACnC,mBAAmB,OAAO;CAC1B,oBAAoB,OAAO,MACzB,OAAO,OAAO;EACZ,OAAO;EACP,mBAAmB,OAAO;EAC3B,CAAC,CACH;CACF,CAAC,CAAC,UAAU,OAAO,OAAO,SAAS,OAAO,CAAC;AAE5C,MAAM,kBAAkB,OAAO,OAAO;CACpC,gBAAgB,OAAO,QAAQ,QAAQ;CACvC,mBAAmB;CACnB,mBAAmB,OAAO;CAC3B,CAAC,CAAC,UAAU,OAAO,OAAO,eAAe,OAAO,CAAC;AAElD,MAAM,oBAAoB,OAAO,OAAO;CACtC,gBAAgB,OAAO,QAAQ,UAAU;CACzC,aAAa,OAAO;CACrB,CAAC,CAAC,UAAU,OAAO,OAAO,eAAe,OAAO,CAAC;AAElD,MAAa,aAAa,OAAO,MAAM,CAAC,iBAAiB,kBAAkB,CAAC;AAE9C,OAAO,OAAO;CAC1C,OAAO,OAAO;CACd,MAAM;CACN,MAAM,OAAO;CACd,CAAC;AAEF,MAAa,yBAAyB,OAAO,OAAO;CAClD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,0CACd,CAAC;CACF,QAAQ,OAAO,QAAQ,OAAO,MAAM,eAAe,CAAC,CAAC,SAAS,EAC5D,aAAa,4CACd,CAAC;CACF,cAAc,OAAO,QAAQ,OAAO,MAAM,aAAa,CAAC;CACxD,mBAAmB,OAAO,OAAO,SAAS,EACxC,aAAa,gEACd,CAAC;CACF,uBAAuB,OAAO,OAAO,OAAO,OAAO,CAAC,SAAS,EAC3D,aAAa,mDACd,CAAC;CACF,oBAAoB,OAAO,OAAO,OAAO,OAAO,CAAC,SAAS,EACxD,aAAa,gDACd,CAAC;CACH,CAAC;AAEiC,OAAO,OAAO,EAC/C,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,4CACd,CAAC,EACH,CAAC;AAEF,MAAa,wBAAwB,OAAO,OAAO,EACjD,cAAc,OAAO,SAAS,OAAO,OAAO,CAAC,SAAS,EACpD,aAAa,2DACd,CAAC,EACH,CAAC;AAEF,MAAa,0BAA0B,OAAO,OAAO,EACnD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,4CACd,CAAC,EACH,CAAC;AAEF,MAAa,4BAA4B,OAAO,OAAO;CACrD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,4CACd,CAAC;CACF,OAAO,eAAe,SAAS,EAC7B,aAAa,oDACd,CAAC;CACF,QAAQ,OAAO,OAAO,OAAO,OAAO,KAAK,OAAO,SAAS,CAAC,CAAC,SAAS;EAClE,aAAa;EACb,SAAS;EACV,CAAC;CACH,CAAC;AAEF,MAAa,yBAAyB,OAAO,OAAO,EAClD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,0CACd,CAAC,EACH,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { SupportedChain } from "../schema/chain.mjs";
|
|
3
|
-
import { BigIntFromString, EntrypointVersion, EthereumAddress, KernelVersion, OwnerType } from "../schema/common.mjs";
|
|
4
|
-
import "../schema/index.mjs";
|
|
5
|
-
import { Schema } from "effect";
|
|
6
|
-
//#region src/dto/smart-account.ts
|
|
7
|
-
const LocalSmartAccount = Schema.Struct({
|
|
8
|
-
entryPointVersion: EntrypointVersion,
|
|
9
|
-
index: BigIntFromString,
|
|
10
|
-
kernelVersion: KernelVersion,
|
|
11
|
-
ownerAlias: Schema.String,
|
|
12
|
-
ownerType: OwnerType,
|
|
13
|
-
smartAccountAddress: EthereumAddress
|
|
14
|
-
});
|
|
15
|
-
Schema.Struct({
|
|
16
|
-
data: LocalSmartAccount,
|
|
17
|
-
path: Schema.String,
|
|
18
|
-
alias: Schema.String
|
|
19
|
-
});
|
|
20
|
-
const CreateSmartAccountParams = Schema.Struct({
|
|
21
|
-
alias: Schema.String.annotate({ description: "The alias of the smart account to create" }),
|
|
22
|
-
ownerAlias: Schema.String.annotate({ description: "The alias of the owner keystore" }),
|
|
23
|
-
ownerPassword: Schema.redact(Schema.String).annotate({ description: "The password of the owner keystore" }),
|
|
24
|
-
index: Schema.optional(BigIntFromString.check(Schema.makeFilter((v) => v >= 0n))).annotate({
|
|
25
|
-
description: "The index of the smart account",
|
|
26
|
-
default: 0n
|
|
27
|
-
})
|
|
28
|
-
});
|
|
29
|
-
Schema.Struct({ alias: Schema.String.annotate({ description: "The alias of the smart account to retrieve" }) });
|
|
30
|
-
const ListSmartAccountParams = Schema.Void;
|
|
31
|
-
const GetSmartAccountInfoParams = Schema.Struct({ alias: Schema.String.annotate({ description: "The alias of the smart account to retrieve" }) });
|
|
32
|
-
const RemoveSmartAccountParams = Schema.Struct({ alias: Schema.String.annotate({ description: "The alias of the smart account to remove" }) });
|
|
33
|
-
const GetSmartAccountStatusParams = Schema.Struct({
|
|
34
|
-
alias: Schema.String.annotate({ description: "The alias of the smart account" }),
|
|
35
|
-
chain: SupportedChain.annotate({ description: "The chain to get the status for" }),
|
|
36
|
-
rpcUrl: Schema.redact(Schema.String.pipe(Schema.optional)).annotate({
|
|
37
|
-
description: "The RPC URL to use for the chain",
|
|
38
|
-
default: "Public RPC URL"
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
const ImportSmartAccountParams = LocalSmartAccount.pipe(Schema.fieldsAssign({ alias: Schema.String.annotate({ description: "The alias of the smart account to import" }) }));
|
|
42
|
-
//#endregion
|
|
43
|
-
export { CreateSmartAccountParams, GetSmartAccountInfoParams, GetSmartAccountStatusParams, ImportSmartAccountParams, ListSmartAccountParams, LocalSmartAccount, RemoveSmartAccountParams };
|
|
44
|
-
|
|
45
|
-
//# sourceMappingURL=smart-account.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smart-account.mjs","names":[],"sources":["../../src/dto/smart-account.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport {\n BigIntFromString,\n EntrypointVersion,\n EthereumAddress,\n KernelVersion,\n OwnerType,\n} from \"@/schema\";\nimport { SupportedChain } from \"@/schema/chain\";\n\nexport const LocalSmartAccount = Schema.Struct({\n entryPointVersion: EntrypointVersion,\n index: BigIntFromString,\n kernelVersion: KernelVersion,\n ownerAlias: Schema.String,\n ownerType: OwnerType,\n smartAccountAddress: EthereumAddress,\n});\n\nexport const LocalSmartAccountData = Schema.Struct({\n data: LocalSmartAccount,\n path: Schema.String,\n alias: Schema.String,\n});\n\nexport const CreateSmartAccountParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the smart account to create\",\n }),\n ownerAlias: Schema.String.annotate({\n description: \"The alias of the owner keystore\",\n }),\n ownerPassword: Schema.redact(Schema.String).annotate({\n description: \"The password of the owner keystore\",\n }),\n index: Schema.optional(\n BigIntFromString.check(Schema.makeFilter((v) => v >= 0n)),\n ).annotate({\n description: \"The index of the smart account\",\n default: 0n,\n }),\n});\n\nexport const GetSmartAccountParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the smart account to retrieve\",\n }),\n});\nexport const ListSmartAccountParams = Schema.Void;\n\nexport const GetSmartAccountInfoParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the smart account to retrieve\",\n }),\n});\n\nexport const RemoveSmartAccountParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the smart account to remove\",\n }),\n});\n\nexport const GetSmartAccountStatusParams = Schema.Struct({\n alias: Schema.String.annotate({\n description: \"The alias of the smart account\",\n }),\n chain: SupportedChain.annotate({\n description: \"The chain to get the status for\",\n }),\n rpcUrl: Schema.redact(Schema.String.pipe(Schema.optional)).annotate({\n description: \"The RPC URL to use for the chain\",\n default: \"Public RPC URL\",\n }),\n});\n\nexport const ImportSmartAccountParams = LocalSmartAccount.pipe(\n Schema.fieldsAssign({\n alias: Schema.String.annotate({\n description: \"The alias of the smart account to import\",\n }),\n }),\n);\n\nexport type LocalSmartAccount = typeof LocalSmartAccount.Type;\nexport type LocalSmartAccountData = typeof LocalSmartAccountData.Type;\nexport type CreateSmartAccountParams = typeof CreateSmartAccountParams.Type;\nexport type GetSmartAccountParams = typeof GetSmartAccountParams.Type;\nexport type ListSmartAccountParams = typeof ListSmartAccountParams.Type;\nexport type GetSmartAccountInfoParams = typeof GetSmartAccountInfoParams.Type;\nexport type RemoveSmartAccountParams = typeof RemoveSmartAccountParams.Type;\nexport type GetSmartAccountStatusParams =\n typeof GetSmartAccountStatusParams.Type;\n\nexport type ImportSmartAccountParams = typeof ImportSmartAccountParams.Type;\n"],"mappings":";;;;;;AAWA,MAAa,oBAAoB,OAAO,OAAO;CAC7C,mBAAmB;CACnB,OAAO;CACP,eAAe;CACf,YAAY,OAAO;CACnB,WAAW;CACX,qBAAqB;CACtB,CAAC;AAEmC,OAAO,OAAO;CACjD,MAAM;CACN,MAAM,OAAO;CACb,OAAO,OAAO;CACf,CAAC;AAEF,MAAa,2BAA2B,OAAO,OAAO;CACpD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,4CACd,CAAC;CACF,YAAY,OAAO,OAAO,SAAS,EACjC,aAAa,mCACd,CAAC;CACF,eAAe,OAAO,OAAO,OAAO,OAAO,CAAC,SAAS,EACnD,aAAa,sCACd,CAAC;CACF,OAAO,OAAO,SACZ,iBAAiB,MAAM,OAAO,YAAY,MAAM,KAAK,GAAG,CAAC,CAC1D,CAAC,SAAS;EACT,aAAa;EACb,SAAS;EACV,CAAC;CACH,CAAC;AAEmC,OAAO,OAAO,EACjD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,8CACd,CAAC,EACH,CAAC;AACF,MAAa,yBAAyB,OAAO;AAE7C,MAAa,4BAA4B,OAAO,OAAO,EACrD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,8CACd,CAAC,EACH,CAAC;AAEF,MAAa,2BAA2B,OAAO,OAAO,EACpD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,4CACd,CAAC,EACH,CAAC;AAEF,MAAa,8BAA8B,OAAO,OAAO;CACvD,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,kCACd,CAAC;CACF,OAAO,eAAe,SAAS,EAC7B,aAAa,mCACd,CAAC;CACF,QAAQ,OAAO,OAAO,OAAO,OAAO,KAAK,OAAO,SAAS,CAAC,CAAC,SAAS;EAClE,aAAa;EACb,SAAS;EACV,CAAC;CACH,CAAC;AAEF,MAAa,2BAA2B,kBAAkB,KACxD,OAAO,aAAa,EAClB,OAAO,OAAO,OAAO,SAAS,EAC5B,aAAa,4CACd,CAAC,EACH,CAAC,CACH"}
|
package/dist/flags/global.mjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Effect } from "effect";
|
|
3
|
-
import { Flag, GlobalFlag } from "effect/unstable/cli";
|
|
4
|
-
//#region src/flags/global.ts
|
|
5
|
-
const globalOutput = GlobalFlag.setting("output")({ flag: Flag.choice("output", [
|
|
6
|
-
"pretty",
|
|
7
|
-
"json",
|
|
8
|
-
"ndjson"
|
|
9
|
-
]).pipe(Flag.withAlias("o"), Flag.withDefault("pretty"), Flag.withDescription("Output format (pretty, json, ndjson)")) });
|
|
10
|
-
const globalQuiet = GlobalFlag.setting("quiet")({ flag: Flag.boolean("quiet").pipe(Flag.withAlias("q"), Flag.withDefault(false), Flag.withDescription("Do not print output")) });
|
|
11
|
-
const globalParams = GlobalFlag.setting("params")({ flag: Flag.string("params").pipe(Flag.optional, Flag.withDescription("JSON Parameters to pass to the command")) });
|
|
12
|
-
const getGlobalFlags = () => Effect.gen(function* () {
|
|
13
|
-
const out = yield* globalOutput;
|
|
14
|
-
const quiet = yield* globalQuiet;
|
|
15
|
-
return {
|
|
16
|
-
out,
|
|
17
|
-
params: yield* globalParams,
|
|
18
|
-
quiet
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
const globalFlags = [
|
|
22
|
-
globalOutput,
|
|
23
|
-
globalQuiet,
|
|
24
|
-
globalParams
|
|
25
|
-
];
|
|
26
|
-
//#endregion
|
|
27
|
-
export { getGlobalFlags, globalFlags };
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=global.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global.mjs","names":[],"sources":["../../src/flags/global.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport { Flag, GlobalFlag } from \"effect/unstable/cli\";\n\nexport const globalOutput = GlobalFlag.setting(\"output\")({\n flag: Flag.choice(\"output\", [\"pretty\", \"json\", \"ndjson\"]).pipe(\n Flag.withAlias(\"o\"),\n Flag.withDefault(\"pretty\"),\n Flag.withDescription(\"Output format (pretty, json, ndjson)\"),\n ),\n});\n\nexport const globalQuiet = GlobalFlag.setting(\"quiet\")({\n flag: Flag.boolean(\"quiet\").pipe(\n Flag.withAlias(\"q\"),\n Flag.withDefault(false),\n Flag.withDescription(\"Do not print output\"),\n ),\n});\n\nexport const globalParams = GlobalFlag.setting(\"params\")({\n flag: Flag.string(\"params\").pipe(\n Flag.optional,\n Flag.withDescription(\"JSON Parameters to pass to the command\"),\n ),\n});\n\nexport const getGlobalFlags = () =>\n Effect.gen(function* () {\n const out = yield* globalOutput;\n const quiet = yield* globalQuiet;\n const params = yield* globalParams;\n\n return { out, params, quiet };\n });\n\nexport const globalFlags = [globalOutput, globalQuiet, globalParams];\n"],"mappings":";;;;AAGA,MAAa,eAAe,WAAW,QAAQ,SAAS,CAAC,EACvD,MAAM,KAAK,OAAO,UAAU;CAAC;CAAU;CAAQ;CAAS,CAAC,CAAC,KACxD,KAAK,UAAU,IAAI,EACnB,KAAK,YAAY,SAAS,EAC1B,KAAK,gBAAgB,uCAAuC,CAC7D,EACF,CAAC;AAEF,MAAa,cAAc,WAAW,QAAQ,QAAQ,CAAC,EACrD,MAAM,KAAK,QAAQ,QAAQ,CAAC,KAC1B,KAAK,UAAU,IAAI,EACnB,KAAK,YAAY,MAAM,EACvB,KAAK,gBAAgB,sBAAsB,CAC5C,EACF,CAAC;AAEF,MAAa,eAAe,WAAW,QAAQ,SAAS,CAAC,EACvD,MAAM,KAAK,OAAO,SAAS,CAAC,KAC1B,KAAK,UACL,KAAK,gBAAgB,yCAAyC,CAC/D,EACF,CAAC;AAEF,MAAa,uBACX,OAAO,IAAI,aAAa;CACtB,MAAM,MAAM,OAAO;CACnB,MAAM,QAAQ,OAAO;AAGrB,QAAO;EAAE;EAAK,eAFQ;EAEA;EAAO;EAC7B;AAEJ,MAAa,cAAc;CAAC;CAAc;CAAa;CAAa"}
|