@twin.org/crypto-cli 0.0.1-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,53 @@
1
+ # Class: CLI
2
+
3
+ The main entry point for the CLI.
4
+
5
+ ## Extends
6
+
7
+ - `CLIBase`
8
+
9
+ ## Constructors
10
+
11
+ ### new CLI()
12
+
13
+ > **new CLI**(): [`CLI`](CLI.md)
14
+
15
+ #### Returns
16
+
17
+ [`CLI`](CLI.md)
18
+
19
+ #### Inherited from
20
+
21
+ `CLIBase.constructor`
22
+
23
+ ## Methods
24
+
25
+ ### run()
26
+
27
+ > **run**(`argv`, `localesDirectory`?, `options`?): `Promise`\<`number`\>
28
+
29
+ Run the app.
30
+
31
+ #### Parameters
32
+
33
+ • **argv**: `string`[]
34
+
35
+ The process arguments.
36
+
37
+ • **localesDirectory?**: `string`
38
+
39
+ The directory for the locales, default to relative to the script.
40
+
41
+ • **options?**
42
+
43
+ Additional options.
44
+
45
+ • **options.overrideOutputWidth?**: `number`
46
+
47
+ Override the output width.
48
+
49
+ #### Returns
50
+
51
+ `Promise`\<`number`\>
52
+
53
+ The exit code.
@@ -0,0 +1,15 @@
1
+ # Function: actionCommandAddress()
2
+
3
+ > **actionCommandAddress**(`opts`): `Promise`\<`void`\>
4
+
5
+ Action the address command.
6
+
7
+ ## Parameters
8
+
9
+ • **opts**: `object` & `ICliOutputOptionsConsole` & `ICliOutputOptionsEnv` & `ICliOutputOptionsJson`
10
+
11
+ The options for the command.
12
+
13
+ ## Returns
14
+
15
+ `Promise`\<`void`\>
@@ -0,0 +1,15 @@
1
+ # Function: actionCommandMnemonic()
2
+
3
+ > **actionCommandMnemonic**(`opts`): `Promise`\<`void`\>
4
+
5
+ Action the mnemonic command.
6
+
7
+ ## Parameters
8
+
9
+ • **opts**: `object` & `ICliOutputOptionsConsole` & `ICliOutputOptionsEnv` & `ICliOutputOptionsJson`
10
+
11
+ The options for the command.
12
+
13
+ ## Returns
14
+
15
+ `Promise`\<`void`\>
@@ -0,0 +1,11 @@
1
+ # Function: buildCommandAddress()
2
+
3
+ > **buildCommandAddress**(): `Command`
4
+
5
+ Build the address command to be consumed by the CLI.
6
+
7
+ ## Returns
8
+
9
+ `Command`
10
+
11
+ The command.
@@ -0,0 +1,11 @@
1
+ # Function: buildCommandMnemonic()
2
+
3
+ > **buildCommandMnemonic**(): `Command`
4
+
5
+ Build the mnemonic command to be consumed by the CLI.
6
+
7
+ ## Returns
8
+
9
+ `Command`
10
+
11
+ The command.
@@ -0,0 +1,12 @@
1
+ # @twin.org/crypto-cli
2
+
3
+ ## Classes
4
+
5
+ - [CLI](classes/CLI.md)
6
+
7
+ ## Functions
8
+
9
+ - [buildCommandAddress](functions/buildCommandAddress.md)
10
+ - [actionCommandAddress](functions/actionCommandAddress.md)
11
+ - [buildCommandMnemonic](functions/buildCommandMnemonic.md)
12
+ - [actionCommandMnemonic](functions/actionCommandMnemonic.md)
@@ -0,0 +1,107 @@
1
+ {
2
+ "error": {
3
+ "commands": {
4
+ "address": {
5
+ "seedMissingEnv": "The seed does not appear to be hex or base64, assuming it is an environment variable, but there is no environment variable with the name \"{env}\" set.",
6
+ "seedInvalidEnv": "The seed does not appear to be hex or base64, assuming it is an environment variable, but there the environment variable is neither hex or base64. \"{envValue}\"",
7
+ "seedInvalidFormat": "The seed does not appear to be hex, base64 or an environment variable. \"{seed}\""
8
+ }
9
+ }
10
+ },
11
+ "commands": {
12
+ "mnemonic": {
13
+ "summary": "Create a mnemonic.",
14
+ "description": "Create a mnemonic, will also generate the equivalent seed in hex and base64 format.",
15
+ "options": {
16
+ "strength": {
17
+ "param": "--strength '<'number'>'",
18
+ "description": "The number of words in the mnemonic, defaults to 256 which produces 24 words."
19
+ },
20
+ "seed-format": {
21
+ "param": "--seed-format '<'format'>'",
22
+ "description": "The format to output the seed."
23
+ },
24
+ "no-console": {
25
+ "param": "--no-console",
26
+ "description": "Hides the mnemonic and seed in the console."
27
+ },
28
+ "json": {
29
+ "param": "--json '<'filename'>'",
30
+ "description": "Creates a JSON file containing the mnemonic and seed."
31
+ },
32
+ "env": {
33
+ "param": "--env '<'filename'>'",
34
+ "description": "Creates an env file containing the mnemonic and seed."
35
+ },
36
+ "env-prefix": {
37
+ "param": "--env-prefix '<'prefix'>'",
38
+ "description": "Prefixes the env variables with the value."
39
+ }
40
+ },
41
+ "progress": {
42
+ "writingJsonFile": "Writing JSON file",
43
+ "writingEnvFile": "Writing env file"
44
+ },
45
+ "labels": {
46
+ "mnemonic": "Mnemonic",
47
+ "seed": "Seed",
48
+ "envPrefix": "Env Prefix"
49
+ }
50
+ },
51
+ "address": {
52
+ "summary": "Create bech32 addresses and keys from the seed.",
53
+ "description": "Create a number of bech32 addresses and their associated key pairs from the seed.",
54
+ "options": {
55
+ "seed": {
56
+ "param": "--seed '<'seed'>'",
57
+ "description": "The seed to use for generating the addresses, this can be either hex, base64 or an environment variable name. For an environment variable start the value with a !"
58
+ },
59
+ "start": {
60
+ "param": "--start '<'number'>'",
61
+ "description": "The index of the first address to create."
62
+ },
63
+ "count": {
64
+ "param": "--count '<'number'>'",
65
+ "description": "The number of addresses to create, max 100."
66
+ },
67
+ "account": {
68
+ "param": "--account '<'number'>'",
69
+ "description": "The account used to generate the bech32 addresses."
70
+ },
71
+ "hrp": {
72
+ "param": "--hrp '<'hrp'>'",
73
+ "description": "The human readable part of the bech32 addresses."
74
+ },
75
+ "coin": {
76
+ "param": "--coin '<'coin'>'",
77
+ "description": "The coin type used to generate the bech32 addresses."
78
+ },
79
+ "key-type": {
80
+ "param": "--key-type '<'type'>'",
81
+ "description": "The type of key to generate."
82
+ },
83
+ "key-format": {
84
+ "param": "--key-format '<'format'>'",
85
+ "description": "The format to output the keys."
86
+ }
87
+ },
88
+ "progress": {
89
+ "generatingAddresses": "Generating addresses"
90
+ },
91
+ "labels": {
92
+ "seed": "Seed",
93
+ "start": "Start",
94
+ "count": "Count",
95
+ "account": "Account",
96
+ "hrp": "HRP",
97
+ "coin": "Coin",
98
+ "key-type": "Key Type",
99
+ "key-format": "Key Format",
100
+ "index": "Index",
101
+ "address": "Address",
102
+ "public-key": "Public Key",
103
+ "private-key": "Private Key"
104
+ }
105
+ }
106
+ }
107
+ }
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@twin.org/crypto-cli",
3
+ "version": "0.0.1-next.10",
4
+ "description": "A command line interface for interacting with the crypto tools",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/twinfoundation/framework.git",
8
+ "directory": "apps/crypto-cli"
9
+ },
10
+ "author": "martyn.janes@iota.org",
11
+ "license": "Apache-2.0",
12
+ "type": "module",
13
+ "engines": {
14
+ "node": ">=20.0.0"
15
+ },
16
+ "dependencies": {
17
+ "@twin.org/cli-core": "0.0.1-next.10",
18
+ "@twin.org/core": "0.0.1-next.10",
19
+ "@twin.org/crypto": "0.0.1-next.10",
20
+ "@twin.org/nameof": "next",
21
+ "commander": "12.1.0"
22
+ },
23
+ "main": "./dist/cjs/index.cjs",
24
+ "module": "./dist/esm/index.mjs",
25
+ "types": "./dist/types/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "require": "./dist/cjs/index.cjs",
29
+ "import": "./dist/esm/index.mjs",
30
+ "types": "./dist/types/index.d.ts"
31
+ }
32
+ },
33
+ "files": [
34
+ "bin",
35
+ "dist/cjs",
36
+ "dist/esm",
37
+ "dist/locales",
38
+ "dist/types",
39
+ "locales",
40
+ "docs"
41
+ ],
42
+ "bin": {
43
+ "twin-crypto": "bin/index.js"
44
+ }
45
+ }