@twin.org/crypto-cli 0.0.1-next.9 → 0.0.2-next.3
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/dist/cjs/index.cjs +6 -10
- package/dist/esm/index.mjs +6 -10
- package/dist/locales/en.json +334 -322
- package/dist/types/commands/address.d.ts +0 -2
- package/docs/changelog.md +506 -1
- package/docs/examples.md +34 -37
- package/docs/reference/classes/CLI.md +14 -8
- package/docs/reference/functions/actionCommandAddress.md +3 -1
- package/docs/reference/functions/actionCommandMnemonic.md +3 -1
- package/locales/en.json +4 -9
- package/package.json +8 -8
package/docs/examples.md
CHANGED
|
@@ -29,7 +29,7 @@ Options:
|
|
|
29
29
|
|
|
30
30
|
Commands:
|
|
31
31
|
mnemonic [options] Create a mnemonic.
|
|
32
|
-
address [options] Create
|
|
32
|
+
address [options] Create addresses and keys from the seed.
|
|
33
33
|
help [command] display help for command
|
|
34
34
|
```
|
|
35
35
|
|
|
@@ -119,7 +119,6 @@ Seed: 0x01fb73209537a33a2f03e419caed0eba48005b093b9a8ce35a93f5e3a1ad66ceaccb1afd
|
|
|
119
119
|
Start: 0
|
|
120
120
|
Count: 10
|
|
121
121
|
Account: 0
|
|
122
|
-
HRP: iota
|
|
123
122
|
Coin: 4218
|
|
124
123
|
Key Type: Ed25519
|
|
125
124
|
Key Format: hex
|
|
@@ -127,52 +126,52 @@ Key Format: hex
|
|
|
127
126
|
Generating addresses
|
|
128
127
|
|
|
129
128
|
Index: 0
|
|
130
|
-
Address:
|
|
129
|
+
Address: 0xbfa0b1bd6f6e8cf8840349698f8be3a72ea66b6cbf34b0b564dbcc941c0d8655
|
|
131
130
|
Private Key: 0xa72161f8b9714c8382bcb7f72a5ea178880495fa85b1376a138249aaf1b2e837
|
|
132
131
|
Public Key: 0xe6994b391c937a604315a9936393f0ef1ad2d49bf5f21573316dc024c1dcb3ae
|
|
133
132
|
|
|
134
133
|
Index: 1
|
|
135
|
-
Address:
|
|
134
|
+
Address: 0x1f7e7afaea38cebc4f17fa4e59b208226a36cc22ea8151066f96ce133e7c1006
|
|
136
135
|
Private Key: 0xcc57b040833465b530cd87e0c427162a7313f41e15484ef74f641cbb4739d376
|
|
137
136
|
Public Key: 0xcfee67931921b9cf86dbb7f91807b27a275f57364e71d849b86bfc8f671d0f32
|
|
138
137
|
|
|
139
138
|
Index: 2
|
|
140
|
-
Address:
|
|
139
|
+
Address: 0x419014c398bcef3b334f556e3d41f47a57e022d5fdf08c55a1c8d3497023de58
|
|
141
140
|
Private Key: 0x254c4ac4ec71e69bfb244052f8e96435aeefe9da0b0cb432f490fadd51576c49
|
|
142
141
|
Public Key: 0x9fc74352fd77f3c49d714eb67339195a291f6e56bdfca9224962815fac3edc62
|
|
143
142
|
|
|
144
143
|
Index: 3
|
|
145
|
-
Address:
|
|
144
|
+
Address: 0xa54c5e5250f59817747c20452badfdbb3b09584d518bf910f6b73057eac55b8b
|
|
146
145
|
Private Key: 0x9a58e95dc70b77afa5ac93c5b4af890159c0ca8a69a1971181ba1f4a021edd57
|
|
147
146
|
Public Key: 0x42f8ab19112418266e7b84edaa63e12e4ef08106d8ccceb930f0956203532363
|
|
148
147
|
|
|
149
148
|
Index: 4
|
|
150
|
-
Address:
|
|
149
|
+
Address: 0x884009b80f1230a1573cebf96c48162097b304deb1e1b0ff79e1e1f132928361
|
|
151
150
|
Private Key: 0xff4ed1b01af12a6b87e9b95a7cdecab4be3ba920e8090457189e0f7b9cff2704
|
|
152
151
|
Public Key: 0x19ebdb080b0b8b485249c18ebc841d574429c994830cda139d84b14bf5f92025
|
|
153
152
|
|
|
154
153
|
Index: 5
|
|
155
|
-
Address:
|
|
154
|
+
Address: 0x780a9ec0b5a8757eb857de831583db669be8a318d466f213faa975b89a956159
|
|
156
155
|
Private Key: 0x3445b21235ec0d35c7b9030262ad361101c08d57cda5d6c8a9a427a8b7c7fa17
|
|
157
156
|
Public Key: 0xb01632576d4f8fbddebc3bc624e2d5beb41f0352a22a7b8aa7895e4e746e4979
|
|
158
157
|
|
|
159
158
|
Index: 6
|
|
160
|
-
Address:
|
|
159
|
+
Address: 0x5938b9044eeabf1fad2802dce62d76f100d2f4b1f1a877936fd274bf34e84978
|
|
161
160
|
Private Key: 0x35e609b27328f02cbf944e256d26b50259af571614f491b5823ac794ec23dd40
|
|
162
161
|
Public Key: 0x6156dbd30118e3e9b65dfdbfcdd8d33a5397e1e83eb5ca9271088189eae725d6
|
|
163
162
|
|
|
164
163
|
Index: 7
|
|
165
|
-
Address:
|
|
164
|
+
Address: 0xd8638e2bc5eb3e264370db985068fd7b6380d5ad291509e3d92631564a4f5f4e
|
|
166
165
|
Private Key: 0x512f34563657f31f93f6ff675a5cc2bdecb60c04f70c1e6989600bec709bfe81
|
|
167
166
|
Public Key: 0xeaecd2c8c1b0a5e76e740b65189ae69acdcbe2555343b3bfbd5230873d7d367e
|
|
168
167
|
|
|
169
168
|
Index: 8
|
|
170
|
-
Address:
|
|
169
|
+
Address: 0x324cc1e9a4c01cd167d43f60dd53e264acd4bace4c449b38883dfe568cc918bc
|
|
171
170
|
Private Key: 0xf2249753e80bb53776dccae45195bd36079f17ecd758eb71c0ce3d30d39248e9
|
|
172
171
|
Public Key: 0xd744fe270e65f348fda0761f05df3c597afd85dfa3a2d57ba468a62dae89d658
|
|
173
172
|
|
|
174
173
|
Index: 9
|
|
175
|
-
Address:
|
|
174
|
+
Address: 0xda66b1fc0049a0bbe809e547361891cf21b8c2e5c99d094b158600d3faa5aca8
|
|
176
175
|
Private Key: 0x3bfb352e637ef067866e66974647d3758d80629dd1108f77956487da9ace80d9
|
|
177
176
|
Public Key: 0x9d10790d366deb6a73ea7666318cf46c8f5493346fc32865edbc3beda15872c6
|
|
178
177
|
|
|
@@ -190,24 +189,22 @@ Output
|
|
|
190
189
|
```shell
|
|
191
190
|
🌍 TWIN Crypto v1.0.0
|
|
192
191
|
|
|
193
|
-
|
|
192
|
+
Usage: twin-crypto address [options]
|
|
194
193
|
|
|
195
|
-
Create a number of
|
|
194
|
+
Create a number of addresses and their associated key pairs from the seed.
|
|
196
195
|
|
|
197
196
|
Options:
|
|
198
197
|
--seed <seed> 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 !
|
|
199
|
-
--load-env <env> Load the env file to initialise any environment variables.
|
|
200
198
|
--start <number> The index of the first address to create. (default: "0")
|
|
201
199
|
--count <number> The number of addresses to create, max 100. (default: "10")
|
|
202
|
-
--account <number> The account used to generate the
|
|
203
|
-
--
|
|
204
|
-
--coin <coin> The coin type used to generate the bech32 addresses. (default: "4218")
|
|
200
|
+
--account <number> The account used to generate the addresses. (default: "0")
|
|
201
|
+
--coin <coin> The coin type used to generate the addresses. (default: "4218")
|
|
205
202
|
--key-type <type> The type of key to generate. (choices: "Ed25519", "Secp256k1", default: "Ed25519")
|
|
206
203
|
--key-format <format> The format to output the keys. (choices: "hex", "base64", default: "hex")
|
|
207
|
-
--no-console Hides the
|
|
208
|
-
--json <filename> Creates a JSON file containing the
|
|
204
|
+
--no-console Hides the output in the console.
|
|
205
|
+
--json <filename> Creates a JSON file containing the output.
|
|
209
206
|
--merge-json If the JSON file already exists merge the data instead of overwriting.
|
|
210
|
-
--env <filename> Creates an env file containing the
|
|
207
|
+
--env <filename> Creates an env file containing the output.
|
|
211
208
|
--merge-env If the env file already exists merge the data instead of overwriting.
|
|
212
209
|
-h, --help display help for command
|
|
213
210
|
```
|
|
@@ -229,12 +226,12 @@ twin-crypto address --load-env my.env --seed !SEED --env address.env --merge-env
|
|
|
229
226
|
The output of this command would produce address.env
|
|
230
227
|
|
|
231
228
|
```shell
|
|
232
|
-
|
|
233
|
-
ADDRESS_0_PRIVATE_KEY="
|
|
234
|
-
ADDRESS_0_PUBLIC_KEY="
|
|
235
|
-
|
|
236
|
-
ADDRESS_1_PRIVATE_KEY="
|
|
237
|
-
ADDRESS_1_PUBLIC_KEY="
|
|
229
|
+
ADDRESS_0="0xbfa0b1bd6f6e8cf8840349698f8be3a72ea66b6cbf34b0b564dbcc941c0d8655"
|
|
230
|
+
ADDRESS_0_PRIVATE_KEY="0xa72161f8b9714c8382bcb7f72a5ea178880495fa85b1376a138249aaf1b2e837"
|
|
231
|
+
ADDRESS_0_PUBLIC_KEY="0xe6994b391c937a604315a9936393f0ef1ad2d49bf5f21573316dc024c1dcb3ae"
|
|
232
|
+
ADDRESS_1="0x1f7e7afaea38cebc4f17fa4e59b208226a36cc22ea8151066f96ce133e7c1006"
|
|
233
|
+
ADDRESS_1_PRIVATE_KEY="0xcc57b040833465b530cd87e0c427162a7313f41e15484ef74f641cbb4739d376"
|
|
234
|
+
ADDRESS_1_PUBLIC_KEY="0xcfee67931921b9cf86dbb7f91807b27a275f57364e71d849b86bfc8f671d0f32"
|
|
238
235
|
....
|
|
239
236
|
```
|
|
240
237
|
|
|
@@ -242,16 +239,16 @@ and address.json
|
|
|
242
239
|
|
|
243
240
|
```json
|
|
244
241
|
{
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
242
|
+
"0": {
|
|
243
|
+
"address": "0xbfa0b1bd6f6e8cf8840349698f8be3a72ea66b6cbf34b0b564dbcc941c0d8655",
|
|
244
|
+
"privateKey": "0xa72161f8b9714c8382bcb7f72a5ea178880495fa85b1376a138249aaf1b2e837",
|
|
245
|
+
"publicKey": "0xe6994b391c937a604315a9936393f0ef1ad2d49bf5f21573316dc024c1dcb3ae"
|
|
246
|
+
},
|
|
247
|
+
"1": {
|
|
248
|
+
"address": "0x1f7e7afaea38cebc4f17fa4e59b208226a36cc22ea8151066f96ce133e7c1006",
|
|
249
|
+
"privateKey": "0xcc57b040833465b530cd87e0c427162a7313f41e15484ef74f641cbb4739d376",
|
|
250
|
+
"publicKey": "0xcfee67931921b9cf86dbb7f91807b27a275f57364e71d849b86bfc8f671d0f32"
|
|
251
|
+
},
|
|
255
252
|
...
|
|
256
253
|
}
|
|
257
254
|
```
|
|
@@ -8,13 +8,13 @@ The main entry point for the CLI.
|
|
|
8
8
|
|
|
9
9
|
## Constructors
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new CLI**():
|
|
13
|
+
> **new CLI**(): `CLI`
|
|
14
14
|
|
|
15
15
|
#### Returns
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
`CLI`
|
|
18
18
|
|
|
19
19
|
#### Inherited from
|
|
20
20
|
|
|
@@ -24,25 +24,31 @@ The main entry point for the CLI.
|
|
|
24
24
|
|
|
25
25
|
### run()
|
|
26
26
|
|
|
27
|
-
> **run**(`argv`, `localesDirectory
|
|
27
|
+
> **run**(`argv`, `localesDirectory?`, `options?`): `Promise`\<`number`\>
|
|
28
28
|
|
|
29
29
|
Run the app.
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
##### argv
|
|
34
|
+
|
|
35
|
+
`string`[]
|
|
34
36
|
|
|
35
37
|
The process arguments.
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
##### localesDirectory?
|
|
40
|
+
|
|
41
|
+
`string`
|
|
38
42
|
|
|
39
43
|
The directory for the locales, default to relative to the script.
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
##### options?
|
|
42
46
|
|
|
43
47
|
Additional options.
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
###### overrideOutputWidth?
|
|
50
|
+
|
|
51
|
+
`number`
|
|
46
52
|
|
|
47
53
|
Override the output width.
|
|
48
54
|
|
|
@@ -6,7 +6,9 @@ Action the address command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### opts
|
|
10
|
+
|
|
11
|
+
`object` & `ICliOutputOptionsConsole` & `ICliOutputOptionsEnv` & `ICliOutputOptionsJson`
|
|
10
12
|
|
|
11
13
|
The options for the command.
|
|
12
14
|
|
|
@@ -6,7 +6,9 @@ Action the mnemonic command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### opts
|
|
10
|
+
|
|
11
|
+
`object` & `ICliOutputOptionsConsole` & `ICliOutputOptionsEnv` & `ICliOutputOptionsJson`
|
|
10
12
|
|
|
11
13
|
The options for the command.
|
|
12
14
|
|
package/locales/en.json
CHANGED
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"address": {
|
|
52
|
-
"summary": "Create
|
|
53
|
-
"description": "Create a number of
|
|
52
|
+
"summary": "Create addresses and keys from the seed.",
|
|
53
|
+
"description": "Create a number of addresses and their associated key pairs from the seed.",
|
|
54
54
|
"options": {
|
|
55
55
|
"seed": {
|
|
56
56
|
"param": "--seed '<'seed'>'",
|
|
@@ -66,15 +66,11 @@
|
|
|
66
66
|
},
|
|
67
67
|
"account": {
|
|
68
68
|
"param": "--account '<'number'>'",
|
|
69
|
-
"description": "The account used to generate the
|
|
70
|
-
},
|
|
71
|
-
"hrp": {
|
|
72
|
-
"param": "--hrp '<'hrp'>'",
|
|
73
|
-
"description": "The human readable part of the bech32 addresses."
|
|
69
|
+
"description": "The account used to generate the addresses."
|
|
74
70
|
},
|
|
75
71
|
"coin": {
|
|
76
72
|
"param": "--coin '<'coin'>'",
|
|
77
|
-
"description": "The coin type used to generate the
|
|
73
|
+
"description": "The coin type used to generate the addresses."
|
|
78
74
|
},
|
|
79
75
|
"key-type": {
|
|
80
76
|
"param": "--key-type '<'type'>'",
|
|
@@ -93,7 +89,6 @@
|
|
|
93
89
|
"start": "Start",
|
|
94
90
|
"count": "Count",
|
|
95
91
|
"account": "Account",
|
|
96
|
-
"hrp": "HRP",
|
|
97
92
|
"coin": "Coin",
|
|
98
93
|
"key-type": "Key Type",
|
|
99
94
|
"key-format": "Key Format",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/crypto-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-next.3",
|
|
4
4
|
"description": "A command line interface for interacting with the crypto tools",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/cli-core": "0.0.
|
|
18
|
-
"@twin.org/core": "0.0.
|
|
19
|
-
"@twin.org/crypto": "0.0.
|
|
20
|
-
"@twin.org/nameof": "next",
|
|
21
|
-
"commander": "
|
|
17
|
+
"@twin.org/cli-core": "0.0.2-next.3",
|
|
18
|
+
"@twin.org/core": "0.0.2-next.3",
|
|
19
|
+
"@twin.org/crypto": "0.0.2-next.3",
|
|
20
|
+
"@twin.org/nameof": "0.0.2-next.3",
|
|
21
|
+
"commander": "14.0.0"
|
|
22
22
|
},
|
|
23
23
|
"main": "./dist/cjs/index.cjs",
|
|
24
24
|
"module": "./dist/esm/index.mjs",
|
|
25
25
|
"types": "./dist/types/index.d.ts",
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
+
"types": "./dist/types/index.d.ts",
|
|
28
29
|
"require": "./dist/cjs/index.cjs",
|
|
29
|
-
"import": "./dist/esm/index.mjs"
|
|
30
|
-
"types": "./dist/types/index.d.ts"
|
|
30
|
+
"import": "./dist/esm/index.mjs"
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"files": [
|