@twin.org/crypto-cli 0.0.1-next.3 → 0.0.1-next.31
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 +29 -13
- package/dist/esm/index.mjs +28 -12
- package/dist/locales/en.json +330 -311
- package/dist/types/cli.d.ts +5 -1
- package/dist/types/commands/address.d.ts +2 -2
- package/dist/types/commands/mnemonic.d.ts +1 -0
- package/docs/changelog.md +1 -1
- package/docs/examples.md +9 -10
- package/docs/reference/classes/CLI.md +13 -53
- package/docs/reference/functions/actionCommandAddress.md +3 -1
- package/docs/reference/functions/actionCommandMnemonic.md +3 -1
- package/locales/en.json +11 -6
- package/package.json +8 -37
package/dist/cjs/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ function buildCommandAddress() {
|
|
|
24
24
|
.option(core.I18n.formatMessage("commands.address.options.start.param"), core.I18n.formatMessage("commands.address.options.start.description"), "0")
|
|
25
25
|
.option(core.I18n.formatMessage("commands.address.options.count.param"), core.I18n.formatMessage("commands.address.options.count.description"), "10")
|
|
26
26
|
.option(core.I18n.formatMessage("commands.address.options.account.param"), core.I18n.formatMessage("commands.address.options.account.description"), "0")
|
|
27
|
-
.option(core.I18n.formatMessage("commands.address.options.hrp.param"), core.I18n.formatMessage("commands.address.options.hrp.description")
|
|
27
|
+
.option(core.I18n.formatMessage("commands.address.options.hrp.param"), core.I18n.formatMessage("commands.address.options.hrp.description"))
|
|
28
28
|
.option(core.I18n.formatMessage("commands.address.options.coin.param"), core.I18n.formatMessage("commands.address.options.coin.description"), "4218")
|
|
29
29
|
.addOption(new commander.Option(core.I18n.formatMessage("commands.address.options.key-type.param"), core.I18n.formatMessage("commands.address.options.key-type.description"))
|
|
30
30
|
.choices(["Ed25519", "Secp256k1"])
|
|
@@ -49,7 +49,7 @@ function buildCommandAddress() {
|
|
|
49
49
|
* @param opts.start The start index for the address generation.
|
|
50
50
|
* @param opts.count The number of addresses to generate.
|
|
51
51
|
* @param opts.account The account index for the address generation.
|
|
52
|
-
* @param opts.hrp The human readable part for the
|
|
52
|
+
* @param opts.hrp The human readable part for the addresses if generating bech32 format.
|
|
53
53
|
* @param opts.coin The coin type for the address.
|
|
54
54
|
* @param opts.keyType The key type for the address.
|
|
55
55
|
* @param opts.keyFormat The output format of the key.
|
|
@@ -67,7 +67,9 @@ async function actionCommandAddress(opts) {
|
|
|
67
67
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.start"), start);
|
|
68
68
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.count"), count);
|
|
69
69
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.account"), account);
|
|
70
|
-
|
|
70
|
+
if (core.Is.stringValue(hrp)) {
|
|
71
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.hrp"), hrp);
|
|
72
|
+
}
|
|
71
73
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.coin"), coin);
|
|
72
74
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.key-type"), keyType);
|
|
73
75
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.key-format"), keyFormat);
|
|
@@ -76,9 +78,15 @@ async function actionCommandAddress(opts) {
|
|
|
76
78
|
cliCore.CLIDisplay.break();
|
|
77
79
|
const addressDictionary = {};
|
|
78
80
|
for (let i = start; i < start + count; i++) {
|
|
79
|
-
|
|
81
|
+
let addressKeyPair;
|
|
82
|
+
if (core.Is.stringValue(hrp)) {
|
|
83
|
+
addressKeyPair = crypto.Bip44.addressBech32(seed, keyType === "Ed25519" ? crypto.KeyType.Ed25519 : crypto.KeyType.Secp256k1, hrp, coin, account, false, i);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
addressKeyPair = crypto.Bip44.address(seed, keyType === "Ed25519" ? crypto.KeyType.Ed25519 : crypto.KeyType.Secp256k1, coin, account, false, i);
|
|
87
|
+
}
|
|
80
88
|
addressDictionary[i] = {
|
|
81
|
-
|
|
89
|
+
address: addressKeyPair.address,
|
|
82
90
|
privateKey: keyFormat === "hex"
|
|
83
91
|
? core.Converter.bytesToHex(addressKeyPair.privateKey, true)
|
|
84
92
|
: core.Converter.bytesToBase64(addressKeyPair.privateKey),
|
|
@@ -88,7 +96,7 @@ async function actionCommandAddress(opts) {
|
|
|
88
96
|
};
|
|
89
97
|
if (opts.console) {
|
|
90
98
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.index"), i);
|
|
91
|
-
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.address"), addressDictionary[i].
|
|
99
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.address"), addressDictionary[i].address);
|
|
92
100
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.private-key"), addressDictionary[i].privateKey);
|
|
93
101
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.address.labels.public-key"), addressDictionary[i].publicKey);
|
|
94
102
|
cliCore.CLIDisplay.break();
|
|
@@ -100,7 +108,7 @@ async function actionCommandAddress(opts) {
|
|
|
100
108
|
if (core.Is.stringValue(opts?.env)) {
|
|
101
109
|
const output = [];
|
|
102
110
|
for (const addressIndex in addressDictionary) {
|
|
103
|
-
output.push(`ADDRESS_${addressIndex}
|
|
111
|
+
output.push(`ADDRESS_${addressIndex}="${addressDictionary[addressIndex].address}"`);
|
|
104
112
|
output.push(`ADDRESS_${addressIndex}_PRIVATE_KEY="${addressDictionary[addressIndex].privateKey}"`);
|
|
105
113
|
output.push(`ADDRESS_${addressIndex}_PUBLIC_KEY="${addressDictionary[addressIndex].publicKey}"`);
|
|
106
114
|
}
|
|
@@ -126,7 +134,8 @@ function buildCommandMnemonic() {
|
|
|
126
134
|
.default("256"))
|
|
127
135
|
.addOption(new commander.Option(core.I18n.formatMessage("commands.mnemonic.options.seed-format.param"), core.I18n.formatMessage("commands.mnemonic.options.seed-format.description"))
|
|
128
136
|
.choices(["hex", "base64"])
|
|
129
|
-
.default("hex"))
|
|
137
|
+
.default("hex"))
|
|
138
|
+
.addOption(new commander.Option(core.I18n.formatMessage("commands.mnemonic.options.env-prefix.param"), core.I18n.formatMessage("commands.mnemonic.options.env-prefix.description")));
|
|
130
139
|
cliCore.CLIOptions.output(command, {
|
|
131
140
|
noConsole: true,
|
|
132
141
|
json: true,
|
|
@@ -147,17 +156,21 @@ async function actionCommandMnemonic(opts) {
|
|
|
147
156
|
const strength = cliCore.CLIParam.integer("strength", opts.strength, false, 128, 256);
|
|
148
157
|
const mnemonic = crypto.Bip39.randomMnemonic(strength);
|
|
149
158
|
const seed = crypto.Bip39.mnemonicToSeed(mnemonic);
|
|
159
|
+
const envPrefix = core.Is.stringValue(opts.envPrefix) ? opts.envPrefix : "";
|
|
150
160
|
const seedFormatted = opts.seedFormat === "hex" ? core.Converter.bytesToHex(seed, true) : core.Converter.bytesToBase64(seed);
|
|
151
161
|
if (opts.console) {
|
|
152
162
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.mnemonic.labels.mnemonic"), mnemonic);
|
|
153
163
|
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.mnemonic.labels.seed"), seedFormatted);
|
|
164
|
+
if (core.Is.stringValue(opts.envPrefix)) {
|
|
165
|
+
cliCore.CLIDisplay.value(core.I18n.formatMessage("commands.mnemonic.labels.envPrefix"), envPrefix);
|
|
166
|
+
}
|
|
154
167
|
cliCore.CLIDisplay.break();
|
|
155
168
|
}
|
|
156
169
|
if (core.Is.stringValue(opts?.json)) {
|
|
157
170
|
await cliCore.CLIUtils.writeJsonFile(opts.json, { mnemonic, seed: seedFormatted }, opts.mergeJson);
|
|
158
171
|
}
|
|
159
172
|
if (core.Is.stringValue(opts?.env)) {
|
|
160
|
-
await cliCore.CLIUtils.writeEnvFile(opts.env, [
|
|
173
|
+
await cliCore.CLIUtils.writeEnvFile(opts.env, [`${envPrefix}MNEMONIC="${mnemonic}"`, `${envPrefix}SEED="${seedFormatted}"`], opts.mergeEnv);
|
|
161
174
|
}
|
|
162
175
|
cliCore.CLIDisplay.done();
|
|
163
176
|
}
|
|
@@ -172,16 +185,19 @@ class CLI extends cliCore.CLIBase {
|
|
|
172
185
|
* Run the app.
|
|
173
186
|
* @param argv The process arguments.
|
|
174
187
|
* @param localesDirectory The directory for the locales, default to relative to the script.
|
|
188
|
+
* @param options Additional options.
|
|
189
|
+
* @param options.overrideOutputWidth Override the output width.
|
|
175
190
|
* @returns The exit code.
|
|
176
191
|
*/
|
|
177
|
-
async run(argv, localesDirectory) {
|
|
192
|
+
async run(argv, localesDirectory, options) {
|
|
178
193
|
return this.execute({
|
|
179
194
|
title: "TWIN Crypto",
|
|
180
195
|
appName: "twin-crypto",
|
|
181
|
-
version: "0.0.1-next.
|
|
196
|
+
version: "0.0.1-next.31",
|
|
182
197
|
icon: "🌍",
|
|
183
|
-
supportsEnvFiles: true
|
|
184
|
-
|
|
198
|
+
supportsEnvFiles: true,
|
|
199
|
+
overrideOutputWidth: options?.overrideOutputWidth
|
|
200
|
+
}, localesDirectory ?? path.join(path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))), "../locales"), argv);
|
|
185
201
|
}
|
|
186
202
|
/**
|
|
187
203
|
* Get the commands for the CLI.
|
package/dist/esm/index.mjs
CHANGED
|
@@ -21,7 +21,7 @@ function buildCommandAddress() {
|
|
|
21
21
|
.option(I18n.formatMessage("commands.address.options.start.param"), I18n.formatMessage("commands.address.options.start.description"), "0")
|
|
22
22
|
.option(I18n.formatMessage("commands.address.options.count.param"), I18n.formatMessage("commands.address.options.count.description"), "10")
|
|
23
23
|
.option(I18n.formatMessage("commands.address.options.account.param"), I18n.formatMessage("commands.address.options.account.description"), "0")
|
|
24
|
-
.option(I18n.formatMessage("commands.address.options.hrp.param"), I18n.formatMessage("commands.address.options.hrp.description")
|
|
24
|
+
.option(I18n.formatMessage("commands.address.options.hrp.param"), I18n.formatMessage("commands.address.options.hrp.description"))
|
|
25
25
|
.option(I18n.formatMessage("commands.address.options.coin.param"), I18n.formatMessage("commands.address.options.coin.description"), "4218")
|
|
26
26
|
.addOption(new Option(I18n.formatMessage("commands.address.options.key-type.param"), I18n.formatMessage("commands.address.options.key-type.description"))
|
|
27
27
|
.choices(["Ed25519", "Secp256k1"])
|
|
@@ -46,7 +46,7 @@ function buildCommandAddress() {
|
|
|
46
46
|
* @param opts.start The start index for the address generation.
|
|
47
47
|
* @param opts.count The number of addresses to generate.
|
|
48
48
|
* @param opts.account The account index for the address generation.
|
|
49
|
-
* @param opts.hrp The human readable part for the
|
|
49
|
+
* @param opts.hrp The human readable part for the addresses if generating bech32 format.
|
|
50
50
|
* @param opts.coin The coin type for the address.
|
|
51
51
|
* @param opts.keyType The key type for the address.
|
|
52
52
|
* @param opts.keyFormat The output format of the key.
|
|
@@ -64,7 +64,9 @@ async function actionCommandAddress(opts) {
|
|
|
64
64
|
CLIDisplay.value(I18n.formatMessage("commands.address.labels.start"), start);
|
|
65
65
|
CLIDisplay.value(I18n.formatMessage("commands.address.labels.count"), count);
|
|
66
66
|
CLIDisplay.value(I18n.formatMessage("commands.address.labels.account"), account);
|
|
67
|
-
|
|
67
|
+
if (Is.stringValue(hrp)) {
|
|
68
|
+
CLIDisplay.value(I18n.formatMessage("commands.address.labels.hrp"), hrp);
|
|
69
|
+
}
|
|
68
70
|
CLIDisplay.value(I18n.formatMessage("commands.address.labels.coin"), coin);
|
|
69
71
|
CLIDisplay.value(I18n.formatMessage("commands.address.labels.key-type"), keyType);
|
|
70
72
|
CLIDisplay.value(I18n.formatMessage("commands.address.labels.key-format"), keyFormat);
|
|
@@ -73,9 +75,15 @@ async function actionCommandAddress(opts) {
|
|
|
73
75
|
CLIDisplay.break();
|
|
74
76
|
const addressDictionary = {};
|
|
75
77
|
for (let i = start; i < start + count; i++) {
|
|
76
|
-
|
|
78
|
+
let addressKeyPair;
|
|
79
|
+
if (Is.stringValue(hrp)) {
|
|
80
|
+
addressKeyPair = Bip44.addressBech32(seed, keyType === "Ed25519" ? KeyType.Ed25519 : KeyType.Secp256k1, hrp, coin, account, false, i);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
addressKeyPair = Bip44.address(seed, keyType === "Ed25519" ? KeyType.Ed25519 : KeyType.Secp256k1, coin, account, false, i);
|
|
84
|
+
}
|
|
77
85
|
addressDictionary[i] = {
|
|
78
|
-
|
|
86
|
+
address: addressKeyPair.address,
|
|
79
87
|
privateKey: keyFormat === "hex"
|
|
80
88
|
? Converter.bytesToHex(addressKeyPair.privateKey, true)
|
|
81
89
|
: Converter.bytesToBase64(addressKeyPair.privateKey),
|
|
@@ -85,7 +93,7 @@ async function actionCommandAddress(opts) {
|
|
|
85
93
|
};
|
|
86
94
|
if (opts.console) {
|
|
87
95
|
CLIDisplay.value(I18n.formatMessage("commands.address.labels.index"), i);
|
|
88
|
-
CLIDisplay.value(I18n.formatMessage("commands.address.labels.address"), addressDictionary[i].
|
|
96
|
+
CLIDisplay.value(I18n.formatMessage("commands.address.labels.address"), addressDictionary[i].address);
|
|
89
97
|
CLIDisplay.value(I18n.formatMessage("commands.address.labels.private-key"), addressDictionary[i].privateKey);
|
|
90
98
|
CLIDisplay.value(I18n.formatMessage("commands.address.labels.public-key"), addressDictionary[i].publicKey);
|
|
91
99
|
CLIDisplay.break();
|
|
@@ -97,7 +105,7 @@ async function actionCommandAddress(opts) {
|
|
|
97
105
|
if (Is.stringValue(opts?.env)) {
|
|
98
106
|
const output = [];
|
|
99
107
|
for (const addressIndex in addressDictionary) {
|
|
100
|
-
output.push(`ADDRESS_${addressIndex}
|
|
108
|
+
output.push(`ADDRESS_${addressIndex}="${addressDictionary[addressIndex].address}"`);
|
|
101
109
|
output.push(`ADDRESS_${addressIndex}_PRIVATE_KEY="${addressDictionary[addressIndex].privateKey}"`);
|
|
102
110
|
output.push(`ADDRESS_${addressIndex}_PUBLIC_KEY="${addressDictionary[addressIndex].publicKey}"`);
|
|
103
111
|
}
|
|
@@ -123,7 +131,8 @@ function buildCommandMnemonic() {
|
|
|
123
131
|
.default("256"))
|
|
124
132
|
.addOption(new Option(I18n.formatMessage("commands.mnemonic.options.seed-format.param"), I18n.formatMessage("commands.mnemonic.options.seed-format.description"))
|
|
125
133
|
.choices(["hex", "base64"])
|
|
126
|
-
.default("hex"))
|
|
134
|
+
.default("hex"))
|
|
135
|
+
.addOption(new Option(I18n.formatMessage("commands.mnemonic.options.env-prefix.param"), I18n.formatMessage("commands.mnemonic.options.env-prefix.description")));
|
|
127
136
|
CLIOptions.output(command, {
|
|
128
137
|
noConsole: true,
|
|
129
138
|
json: true,
|
|
@@ -144,17 +153,21 @@ async function actionCommandMnemonic(opts) {
|
|
|
144
153
|
const strength = CLIParam.integer("strength", opts.strength, false, 128, 256);
|
|
145
154
|
const mnemonic = Bip39.randomMnemonic(strength);
|
|
146
155
|
const seed = Bip39.mnemonicToSeed(mnemonic);
|
|
156
|
+
const envPrefix = Is.stringValue(opts.envPrefix) ? opts.envPrefix : "";
|
|
147
157
|
const seedFormatted = opts.seedFormat === "hex" ? Converter.bytesToHex(seed, true) : Converter.bytesToBase64(seed);
|
|
148
158
|
if (opts.console) {
|
|
149
159
|
CLIDisplay.value(I18n.formatMessage("commands.mnemonic.labels.mnemonic"), mnemonic);
|
|
150
160
|
CLIDisplay.value(I18n.formatMessage("commands.mnemonic.labels.seed"), seedFormatted);
|
|
161
|
+
if (Is.stringValue(opts.envPrefix)) {
|
|
162
|
+
CLIDisplay.value(I18n.formatMessage("commands.mnemonic.labels.envPrefix"), envPrefix);
|
|
163
|
+
}
|
|
151
164
|
CLIDisplay.break();
|
|
152
165
|
}
|
|
153
166
|
if (Is.stringValue(opts?.json)) {
|
|
154
167
|
await CLIUtils.writeJsonFile(opts.json, { mnemonic, seed: seedFormatted }, opts.mergeJson);
|
|
155
168
|
}
|
|
156
169
|
if (Is.stringValue(opts?.env)) {
|
|
157
|
-
await CLIUtils.writeEnvFile(opts.env, [
|
|
170
|
+
await CLIUtils.writeEnvFile(opts.env, [`${envPrefix}MNEMONIC="${mnemonic}"`, `${envPrefix}SEED="${seedFormatted}"`], opts.mergeEnv);
|
|
158
171
|
}
|
|
159
172
|
CLIDisplay.done();
|
|
160
173
|
}
|
|
@@ -169,15 +182,18 @@ class CLI extends CLIBase {
|
|
|
169
182
|
* Run the app.
|
|
170
183
|
* @param argv The process arguments.
|
|
171
184
|
* @param localesDirectory The directory for the locales, default to relative to the script.
|
|
185
|
+
* @param options Additional options.
|
|
186
|
+
* @param options.overrideOutputWidth Override the output width.
|
|
172
187
|
* @returns The exit code.
|
|
173
188
|
*/
|
|
174
|
-
async run(argv, localesDirectory) {
|
|
189
|
+
async run(argv, localesDirectory, options) {
|
|
175
190
|
return this.execute({
|
|
176
191
|
title: "TWIN Crypto",
|
|
177
192
|
appName: "twin-crypto",
|
|
178
|
-
version: "0.0.1-next.
|
|
193
|
+
version: "0.0.1-next.31",
|
|
179
194
|
icon: "🌍",
|
|
180
|
-
supportsEnvFiles: true
|
|
195
|
+
supportsEnvFiles: true,
|
|
196
|
+
overrideOutputWidth: options?.overrideOutputWidth
|
|
181
197
|
}, localesDirectory ?? path.join(path.dirname(fileURLToPath(import.meta.url)), "../locales"), argv);
|
|
182
198
|
}
|
|
183
199
|
/**
|
package/dist/locales/en.json
CHANGED
|
@@ -1,312 +1,331 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
2
|
+
"error": {
|
|
3
|
+
"commands": {
|
|
4
|
+
"common": {
|
|
5
|
+
"missingEnv": "The \"{option}\" option is configured as an environment variable, but there is no environment variable with the name \"{value}\" set.",
|
|
6
|
+
"optionInvalidHex": "The \"{option}\" does not appear to be hex. \"{value}\"",
|
|
7
|
+
"optionInvalidBase64": "The \"{option}\" does not appear to be base64. \"{value}\"",
|
|
8
|
+
"optionInvalidHexBase64": "The \"{option}\" does not appear to be hex or base64. \"{value}\"",
|
|
9
|
+
"optionInvalidBech32": "The \"{option}\" does not appear to be bech32. \"{value}\"",
|
|
10
|
+
"optionMinValue": "The \"{option}\" option must be greater than or equal to {minValue}, it is {value}.",
|
|
11
|
+
"optionMaxValue": "The \"{option}\" option must be less than or equal to {maxValue}, it is {value}."
|
|
12
|
+
},
|
|
13
|
+
"address": {
|
|
14
|
+
"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.",
|
|
15
|
+
"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}\"",
|
|
16
|
+
"seedInvalidFormat": "The seed does not appear to be hex, base64 or an environment variable. \"{seed}\""
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"validation": {
|
|
20
|
+
"beEmpty": "{fieldName} must be empty",
|
|
21
|
+
"beNotEmpty": "{fieldName} must not be empty",
|
|
22
|
+
"beText": "{fieldName} must be text",
|
|
23
|
+
"beTextValue": "{fieldName} must contain some text",
|
|
24
|
+
"beTextMinMax": "{fieldName} must be longer than {minLength} and shorter than {maxLength} characters",
|
|
25
|
+
"beTextMin": "{fieldName} must be longer than {minLength} characters",
|
|
26
|
+
"beTextMax": "{fieldName} must be shorter than {maxLength} characters",
|
|
27
|
+
"beTextBase58": "{fieldName} must be text formatted using Base58 characters",
|
|
28
|
+
"beTextBase64": "{fieldName} must be text formatted using Base64 characters",
|
|
29
|
+
"beTextHex": "{fieldName} must be text formatted using Hex characters",
|
|
30
|
+
"beTextRegExp": "{fieldName} must be text formatted using the matching pattern {format}",
|
|
31
|
+
"beNumber": "{fieldName} must be a number",
|
|
32
|
+
"beNumberMinMax": "{fieldName} must be >= {minValue} and <= {maxValue}",
|
|
33
|
+
"beNumberMin": "{fieldName} must be >= {minValue}",
|
|
34
|
+
"beNumberMax": "{fieldName} must be <= {maxValue}",
|
|
35
|
+
"beWholeNumber": "{fieldName} must be a whole number",
|
|
36
|
+
"beWholeNumberMinMax": "{fieldName} must be a whole number >= {minValue} and <= {maxValue}",
|
|
37
|
+
"beWholeNumberMin": "{fieldName} must be a whole number >= {minValue}",
|
|
38
|
+
"beWholeNumberMax": "{fieldName} must be a whole number <= {maxValue}",
|
|
39
|
+
"beBigInteger": "{fieldName} must be a bigint",
|
|
40
|
+
"beBigIntegerMinMax": "{fieldName} must be a bigint >= {minValue} and <= {maxValue}",
|
|
41
|
+
"beBigIntegerMin": "{fieldName} must be a bigint >= {minValue}",
|
|
42
|
+
"beBigIntegerMax": "{fieldName} must be a bigint <= {maxValue}",
|
|
43
|
+
"beBoolean": "{fieldName} must be true or false",
|
|
44
|
+
"beDate": "{fieldName} must be a date",
|
|
45
|
+
"beDateTime": "{fieldName} must be a date/time",
|
|
46
|
+
"beTime": "{fieldName} must be a time",
|
|
47
|
+
"beTimestampMilliseconds": "{fieldName} must be a timestamp in milliseconds",
|
|
48
|
+
"beTimestampSeconds": "{fieldName} must be a timestamp in seconds",
|
|
49
|
+
"beObject": "{fieldName} must be an object",
|
|
50
|
+
"beArray": "{fieldName} must be an array",
|
|
51
|
+
"beArrayValue": "{fieldName} must be an array with at least one item",
|
|
52
|
+
"beIncluded": "{fieldName} is unrecognised",
|
|
53
|
+
"beByteArray": "{fieldName} must be a byte array",
|
|
54
|
+
"beUrn": "{fieldName} must be a correctly formatted urn",
|
|
55
|
+
"beUrl": "{fieldName} must be a correctly formatted url",
|
|
56
|
+
"beJSON": "{fieldName} must be correctly formatted JSON",
|
|
57
|
+
"beEmail": "{fieldName} must be a correctly formatted e-mail address",
|
|
58
|
+
"failed": "Validation failed",
|
|
59
|
+
"failedObject": "Validation of \"{objectName}\" failed"
|
|
60
|
+
},
|
|
61
|
+
"guard": {
|
|
62
|
+
"undefined": "Property \"{property}\" must be defined, it is \"{value}\"",
|
|
63
|
+
"string": "Property \"{property}\" must be a string, it is \"{value}\"",
|
|
64
|
+
"stringEmpty": "Property \"{property}\" must have a value, it is empty",
|
|
65
|
+
"stringBase64": "Property \"{property}\" must be a base64 encoded string, it is \"{value}\"",
|
|
66
|
+
"stringBase64Url": "Property \"{property}\" must be a base64 url encoded string, it is \"{value}\"",
|
|
67
|
+
"stringBase58": "Property \"{property}\" must be a base58 encoded string, it is \"{value}\"",
|
|
68
|
+
"stringHex": "Property \"{property}\" must be a hex string, it is \"{value}\"",
|
|
69
|
+
"stringHexLength": "Property \"{property}\" must be a hex string of length \"{options}\", it is \"{value}\"",
|
|
70
|
+
"stringJson": "Property \"{property}\" must be a JSON string",
|
|
71
|
+
"number": "Property \"{property}\" must be a number, it is \"{value}\"",
|
|
72
|
+
"integer": "Property \"{property}\" must be an integer, it is \"{value}\"",
|
|
73
|
+
"bigint": "Property \"{property}\" must be a bigint, it is \"{value}\"",
|
|
74
|
+
"boolean": "Property \"{property}\" must be a boolean, it is \"{value}\"",
|
|
75
|
+
"date": "Property \"{property}\" must be a date, it is \"{value}\"",
|
|
76
|
+
"timestampMilliseconds": "Property \"{property}\" must be a timestamp in milliseconds, it is \"{value}\"",
|
|
77
|
+
"timestampSeconds": "Property \"{property}\" must be a timestamp in seconds, it is \"{value}\"",
|
|
78
|
+
"objectUndefined": "Property \"{property}\" must be an object, it is \"undefined\"",
|
|
79
|
+
"object": "Property \"{property}\" must be an object, it is \"{value}\"",
|
|
80
|
+
"objectValue": "Property \"{property}\" must be an object, with at least one property, it is \"{value}\"",
|
|
81
|
+
"array": "Property \"{property}\" must be an array, it is \"{value}\"",
|
|
82
|
+
"arrayValue": "Property \"{property}\" must be an array with at least one item",
|
|
83
|
+
"arrayOneOf": "Property \"{property}\" must be one of [{options}], it is \"{value}\"",
|
|
84
|
+
"uint8Array": "Property \"{property}\" must be a Uint8Array, it is \"{value}\"",
|
|
85
|
+
"function": "Property \"{property}\" must be a function, it is \"{value}\"",
|
|
86
|
+
"urn": "Property \"{property}\" must be a Urn formatted string, it is \"{value}\"",
|
|
87
|
+
"url": "Property \"{property}\" must be a Url formatted string, it is \"{value}\"",
|
|
88
|
+
"email": "Property \"{property}\" must be string in e-mail format, it is \"{value}\"",
|
|
89
|
+
"length32Multiple": "Property \"{property}\" should be a multiple of 32, it is {value}",
|
|
90
|
+
"lengthEntropy": "Property \"{property}\" should be a multiple of 4, >=16 and <= 32, it is {value}",
|
|
91
|
+
"length3Multiple": "Property \"{property}\" should be a multiple of 3, it is {value}",
|
|
92
|
+
"greaterThan0": "Property \"{property}\" must be greater than zero, it is {value}"
|
|
93
|
+
},
|
|
94
|
+
"objectHelper": {
|
|
95
|
+
"failedBytesToJSON": "Failed converting bytes to JSON",
|
|
96
|
+
"cannotSetArrayIndex": "Cannot set property \"{property}\" using index \"{index}\" as it is not an array",
|
|
97
|
+
"cannotSetProperty": "Cannot set property \"{property}\" when the target is not an object"
|
|
98
|
+
},
|
|
99
|
+
"common": {
|
|
100
|
+
"notImplementedMethod": "The method \"{method}\" has not been implemented",
|
|
101
|
+
"validation": "Validation failed"
|
|
102
|
+
},
|
|
103
|
+
"factory": {
|
|
104
|
+
"noUnregister": "There is no {typeName} registered with the name \"{name}\"",
|
|
105
|
+
"noGet": "The requested {typeName} \"{name}\" does not exist in the factory"
|
|
106
|
+
},
|
|
107
|
+
"bitString": {
|
|
108
|
+
"outOfRange": "The index should be >= 0 and less than the length of the bit string"
|
|
109
|
+
},
|
|
110
|
+
"base32": {
|
|
111
|
+
"invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
|
|
112
|
+
},
|
|
113
|
+
"base64": {
|
|
114
|
+
"length4Multiple": "Invalid length should be a multiple of 4, it is \"{value}\""
|
|
115
|
+
},
|
|
116
|
+
"base58": {
|
|
117
|
+
"invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
|
|
118
|
+
},
|
|
119
|
+
"bip39": {
|
|
120
|
+
"missingMnemonicWord": "The mnemonic contains a word not in the wordlist, \"{value}\"",
|
|
121
|
+
"checksumMismatch": "The checksum does not match \"{newChecksum}\" != \"{checksumBits}\""
|
|
122
|
+
},
|
|
123
|
+
"ed25519": {
|
|
124
|
+
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
125
|
+
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
126
|
+
},
|
|
127
|
+
"secp256k1": {
|
|
128
|
+
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
129
|
+
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
130
|
+
},
|
|
131
|
+
"x25519": {
|
|
132
|
+
"invalidPublicKey": "Invalid Ed25519 Public Key"
|
|
133
|
+
},
|
|
134
|
+
"blake2b": {
|
|
135
|
+
"outputLength64": "The output length should be between 1 and 64, it is \"{outputLength}\"",
|
|
136
|
+
"keyLength64": "The key length should be between 1 and 64, it is \"{keyLength}\""
|
|
137
|
+
},
|
|
138
|
+
"sha512": {
|
|
139
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
140
|
+
},
|
|
141
|
+
"sha256": {
|
|
142
|
+
"bitSize": "Only 224 or 256 bits are supported, it is \"{bitSize}\""
|
|
143
|
+
},
|
|
144
|
+
"sha3": {
|
|
145
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
146
|
+
},
|
|
147
|
+
"hmacSha256": {
|
|
148
|
+
"bitSize": "Only 224 or 256 bits are supported, it is \"{bitSize}\""
|
|
149
|
+
},
|
|
150
|
+
"hmacSha512": {
|
|
151
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
152
|
+
},
|
|
153
|
+
"bech32": {
|
|
154
|
+
"decodeFailed": "The address contains decoding failed for address \"{bech32}\"",
|
|
155
|
+
"invalidChecksum": "The address contains an invalid checksum in address, \"{bech32}\"",
|
|
156
|
+
"separatorMisused": "The separator character '1' should only be used between hrp and data, \"{bech32}\"",
|
|
157
|
+
"lowerUpper": "The address my use either lowercase or uppercase, \"{bech32}\"",
|
|
158
|
+
"dataTooShort": "The address does not contain enough data to decode, \"{bech32}\""
|
|
159
|
+
},
|
|
160
|
+
"pbkdf2": {
|
|
161
|
+
"keyTooLong": "The requested key length \"{keyLength}\" is too long, based on the \"{macLength}\""
|
|
162
|
+
},
|
|
163
|
+
"chaCha20Poly1305": {
|
|
164
|
+
"noAadWithData": "You can not set the aad when there is already data",
|
|
165
|
+
"noAuthTag": "Can not finalise when the auth tag is not set",
|
|
166
|
+
"authenticationFailed": "The data could not be authenticated",
|
|
167
|
+
"authTagDecrypting": "Can not get the auth tag when decrypting",
|
|
168
|
+
"authTagEncrypting": "Can not set the auth tag when encrypting",
|
|
169
|
+
"noAuthTagSet": "The auth tag has not been set"
|
|
170
|
+
},
|
|
171
|
+
"bip44": {
|
|
172
|
+
"unsupportedKeyType": "The key type \"{keyType}\" is not supported"
|
|
173
|
+
},
|
|
174
|
+
"slip0010": {
|
|
175
|
+
"invalidSeed": "The seed is invalid \"{seed}\""
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"cli": {
|
|
179
|
+
"progress": {
|
|
180
|
+
"done": "Done.",
|
|
181
|
+
"error": "Error",
|
|
182
|
+
"loadingEnvFiles": "Loading env files",
|
|
183
|
+
"pleaseWait": "Please wait...",
|
|
184
|
+
"writingJsonFile": "Writing JSON file",
|
|
185
|
+
"writingEnvFile": "Writing env file",
|
|
186
|
+
"readingJsonFile": "Reading JSON file",
|
|
187
|
+
"readingEnvFile": "Reading env file"
|
|
188
|
+
},
|
|
189
|
+
"options": {
|
|
190
|
+
"lang": {
|
|
191
|
+
"param": "--lang '<'lang'>'",
|
|
192
|
+
"description": "The language to display the output in."
|
|
193
|
+
},
|
|
194
|
+
"load-env": {
|
|
195
|
+
"param": "--load-env [env...]",
|
|
196
|
+
"description": "Load the env files to initialise any environment variables."
|
|
197
|
+
},
|
|
198
|
+
"no-console": {
|
|
199
|
+
"param": "--no-console",
|
|
200
|
+
"description": "Hides the output in the console."
|
|
201
|
+
},
|
|
202
|
+
"json": {
|
|
203
|
+
"param": "--json '<'filename'>'",
|
|
204
|
+
"description": "Creates a JSON file containing the output."
|
|
205
|
+
},
|
|
206
|
+
"env": {
|
|
207
|
+
"param": "--env '<'filename'>'",
|
|
208
|
+
"description": "Creates an env file containing the output."
|
|
209
|
+
},
|
|
210
|
+
"merge-json": {
|
|
211
|
+
"param": "--merge-json",
|
|
212
|
+
"description": "If the JSON file already exists merge the data instead of overwriting."
|
|
213
|
+
},
|
|
214
|
+
"merge-env": {
|
|
215
|
+
"param": "--merge-env",
|
|
216
|
+
"description": "If the env file already exists merge the data instead of overwriting."
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"errorNames": {
|
|
221
|
+
"error": "Error",
|
|
222
|
+
"generalError": "General",
|
|
223
|
+
"guardError": "Guard",
|
|
224
|
+
"conflictError": "Conflict",
|
|
225
|
+
"notFoundError": "Not Found",
|
|
226
|
+
"notSupportedError": "Not Supported",
|
|
227
|
+
"alreadyExistsError": "Already Exists",
|
|
228
|
+
"notImplementedError": "Not Implemented",
|
|
229
|
+
"validationError": "Validation",
|
|
230
|
+
"unprocessableError": "Unprocessable"
|
|
231
|
+
},
|
|
232
|
+
"validation": {
|
|
233
|
+
"defaultFieldName": "The field"
|
|
234
|
+
},
|
|
235
|
+
"commands": {
|
|
236
|
+
"mnemonic": {
|
|
237
|
+
"summary": "Create a mnemonic.",
|
|
238
|
+
"description": "Create a mnemonic, will also generate the equivalent seed in hex and base64 format.",
|
|
239
|
+
"options": {
|
|
240
|
+
"strength": {
|
|
241
|
+
"param": "--strength '<'number'>'",
|
|
242
|
+
"description": "The number of words in the mnemonic, defaults to 256 which produces 24 words."
|
|
243
|
+
},
|
|
244
|
+
"seed-format": {
|
|
245
|
+
"param": "--seed-format '<'format'>'",
|
|
246
|
+
"description": "The format to output the seed."
|
|
247
|
+
},
|
|
248
|
+
"no-console": {
|
|
249
|
+
"param": "--no-console",
|
|
250
|
+
"description": "Hides the mnemonic and seed in the console."
|
|
251
|
+
},
|
|
252
|
+
"json": {
|
|
253
|
+
"param": "--json '<'filename'>'",
|
|
254
|
+
"description": "Creates a JSON file containing the mnemonic and seed."
|
|
255
|
+
},
|
|
256
|
+
"env": {
|
|
257
|
+
"param": "--env '<'filename'>'",
|
|
258
|
+
"description": "Creates an env file containing the mnemonic and seed."
|
|
259
|
+
},
|
|
260
|
+
"env-prefix": {
|
|
261
|
+
"param": "--env-prefix '<'prefix'>'",
|
|
262
|
+
"description": "Prefixes the env variables with the value."
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"progress": {
|
|
266
|
+
"writingJsonFile": "Writing JSON file",
|
|
267
|
+
"writingEnvFile": "Writing env file"
|
|
268
|
+
},
|
|
269
|
+
"labels": {
|
|
270
|
+
"mnemonic": "Mnemonic",
|
|
271
|
+
"seed": "Seed",
|
|
272
|
+
"envPrefix": "Env Prefix"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"address": {
|
|
276
|
+
"summary": "Create addresses and keys from the seed.",
|
|
277
|
+
"description": "Create a number of addresses and their associated key pairs from the seed.",
|
|
278
|
+
"options": {
|
|
279
|
+
"seed": {
|
|
280
|
+
"param": "--seed '<'seed'>'",
|
|
281
|
+
"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 !"
|
|
282
|
+
},
|
|
283
|
+
"start": {
|
|
284
|
+
"param": "--start '<'number'>'",
|
|
285
|
+
"description": "The index of the first address to create."
|
|
286
|
+
},
|
|
287
|
+
"count": {
|
|
288
|
+
"param": "--count '<'number'>'",
|
|
289
|
+
"description": "The number of addresses to create, max 100."
|
|
290
|
+
},
|
|
291
|
+
"account": {
|
|
292
|
+
"param": "--account '<'number'>'",
|
|
293
|
+
"description": "The account used to generate the addresses."
|
|
294
|
+
},
|
|
295
|
+
"hrp": {
|
|
296
|
+
"param": "--hrp '<'hrp'>'",
|
|
297
|
+
"description": "The human readable part for the addresses if generating bech32 format."
|
|
298
|
+
},
|
|
299
|
+
"coin": {
|
|
300
|
+
"param": "--coin '<'coin'>'",
|
|
301
|
+
"description": "The coin type used to generate the addresses."
|
|
302
|
+
},
|
|
303
|
+
"key-type": {
|
|
304
|
+
"param": "--key-type '<'type'>'",
|
|
305
|
+
"description": "The type of key to generate."
|
|
306
|
+
},
|
|
307
|
+
"key-format": {
|
|
308
|
+
"param": "--key-format '<'format'>'",
|
|
309
|
+
"description": "The format to output the keys."
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"progress": {
|
|
313
|
+
"generatingAddresses": "Generating addresses"
|
|
314
|
+
},
|
|
315
|
+
"labels": {
|
|
316
|
+
"seed": "Seed",
|
|
317
|
+
"start": "Start",
|
|
318
|
+
"count": "Count",
|
|
319
|
+
"account": "Account",
|
|
320
|
+
"hrp": "HRP",
|
|
321
|
+
"coin": "Coin",
|
|
322
|
+
"key-type": "Key Type",
|
|
323
|
+
"key-format": "Key Format",
|
|
324
|
+
"index": "Index",
|
|
325
|
+
"address": "Address",
|
|
326
|
+
"public-key": "Public Key",
|
|
327
|
+
"private-key": "Private Key"
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
package/dist/types/cli.d.ts
CHANGED
|
@@ -7,7 +7,11 @@ export declare class CLI extends CLIBase {
|
|
|
7
7
|
* Run the app.
|
|
8
8
|
* @param argv The process arguments.
|
|
9
9
|
* @param localesDirectory The directory for the locales, default to relative to the script.
|
|
10
|
+
* @param options Additional options.
|
|
11
|
+
* @param options.overrideOutputWidth Override the output width.
|
|
10
12
|
* @returns The exit code.
|
|
11
13
|
*/
|
|
12
|
-
run(argv: string[], localesDirectory?: string
|
|
14
|
+
run(argv: string[], localesDirectory?: string, options?: {
|
|
15
|
+
overrideOutputWidth?: number;
|
|
16
|
+
}): Promise<number>;
|
|
13
17
|
}
|
|
@@ -12,7 +12,7 @@ export declare function buildCommandAddress(): Command;
|
|
|
12
12
|
* @param opts.start The start index for the address generation.
|
|
13
13
|
* @param opts.count The number of addresses to generate.
|
|
14
14
|
* @param opts.account The account index for the address generation.
|
|
15
|
-
* @param opts.hrp The human readable part for the
|
|
15
|
+
* @param opts.hrp The human readable part for the addresses if generating bech32 format.
|
|
16
16
|
* @param opts.coin The coin type for the address.
|
|
17
17
|
* @param opts.keyType The key type for the address.
|
|
18
18
|
* @param opts.keyFormat The output format of the key.
|
|
@@ -22,7 +22,7 @@ export declare function actionCommandAddress(opts: {
|
|
|
22
22
|
start: string;
|
|
23
23
|
count: string;
|
|
24
24
|
account: string;
|
|
25
|
-
hrp
|
|
25
|
+
hrp?: string;
|
|
26
26
|
coin: string;
|
|
27
27
|
keyType: "Ed25519" | "Secp256k1";
|
|
28
28
|
keyFormat: "hex" | "base64";
|
package/docs/changelog.md
CHANGED
package/docs/examples.md
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
# @twin.org/crypto-cli - Examples
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Running
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
To install and run the CLI locally use the following commands:
|
|
6
6
|
|
|
7
7
|
```shell
|
|
8
|
-
npm install @twin.org/crypto-cli
|
|
8
|
+
npm install @twin.org/crypto-cli -g
|
|
9
|
+
twin-crypto
|
|
9
10
|
```
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
If you run the tool with no command line options:
|
|
12
|
+
or run directly using NPX:
|
|
14
13
|
|
|
15
14
|
```shell
|
|
16
|
-
twin-
|
|
15
|
+
npx "@twin.org/crypto-cli"
|
|
17
16
|
```
|
|
18
17
|
|
|
19
|
-
You should see output similar to the following
|
|
18
|
+
You should see output similar to the following:
|
|
20
19
|
|
|
21
20
|
```shell
|
|
22
21
|
🌍 TWIN Crypto v1.0.0
|
|
@@ -230,10 +229,10 @@ twin-crypto address --load-env my.env --seed !SEED --env address.env --merge-env
|
|
|
230
229
|
The output of this command would produce address.env
|
|
231
230
|
|
|
232
231
|
```shell
|
|
233
|
-
|
|
232
|
+
ADDRESS_0="iota1qqcpqyrnqtzteu7k26dgjvjp3x76tts526prtwrjq99v50pyv6l9xysdcg8"
|
|
234
233
|
ADDRESS_0_PRIVATE_KEY="0x3b2863db878ce156a46d2142c72baa7807a40a990684604ff86456821228d978"
|
|
235
234
|
ADDRESS_0_PUBLIC_KEY="0x6b6eb9e54b44bfbc65c4a02c6489609fbc9588e640ca44bfdfdb1af4e5874905"
|
|
236
|
-
|
|
235
|
+
ADDRESS_1="iota1qrqyyyuhfzgrp7ducjapg8pta3w877nu0u5jpe50cxx39qjs08kczw7uj4v"
|
|
237
236
|
ADDRESS_1_PRIVATE_KEY="0xc5038b4c0b1dc46769687e77555a7be176e22de4262cf5aabf11290ab7c8d856"
|
|
238
237
|
ADDRESS_1_PUBLIC_KEY="0x603d9b2d25341d142524867536e3ee94d3e02a45fe498ec4c3473b0449446d77"
|
|
239
238
|
....
|
|
@@ -22,75 +22,35 @@ The main entry point for the CLI.
|
|
|
22
22
|
|
|
23
23
|
## Methods
|
|
24
24
|
|
|
25
|
-
###
|
|
25
|
+
### run()
|
|
26
26
|
|
|
27
|
-
> **
|
|
27
|
+
> **run**(`argv`, `localesDirectory`?, `options`?): `Promise`\<`number`\>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Run the app.
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
The options for the CLI.
|
|
36
|
-
|
|
37
|
-
• **localesDirectory**: `string`
|
|
38
|
-
|
|
39
|
-
The path to load the locales from.
|
|
33
|
+
##### argv
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
`string`[]
|
|
42
36
|
|
|
43
37
|
The process arguments.
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
`Promise`\<`number`\>
|
|
48
|
-
|
|
49
|
-
The exit code.
|
|
50
|
-
|
|
51
|
-
#### Inherited from
|
|
52
|
-
|
|
53
|
-
`CLIBase.execute`
|
|
54
|
-
|
|
55
|
-
***
|
|
39
|
+
##### localesDirectory?
|
|
56
40
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
> `protected` **configureRoot**(`program`): `void`
|
|
60
|
-
|
|
61
|
-
Configure any options or actions at the root program level.
|
|
62
|
-
|
|
63
|
-
#### Parameters
|
|
41
|
+
`string`
|
|
64
42
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
The root program command.
|
|
68
|
-
|
|
69
|
-
#### Returns
|
|
70
|
-
|
|
71
|
-
`void`
|
|
72
|
-
|
|
73
|
-
#### Inherited from
|
|
74
|
-
|
|
75
|
-
`CLIBase.configureRoot`
|
|
76
|
-
|
|
77
|
-
***
|
|
78
|
-
|
|
79
|
-
### run()
|
|
80
|
-
|
|
81
|
-
> **run**(`argv`, `localesDirectory`?): `Promise`\<`number`\>
|
|
82
|
-
|
|
83
|
-
Run the app.
|
|
43
|
+
The directory for the locales, default to relative to the script.
|
|
84
44
|
|
|
85
|
-
|
|
45
|
+
##### options?
|
|
86
46
|
|
|
87
|
-
|
|
47
|
+
Additional options.
|
|
88
48
|
|
|
89
|
-
|
|
49
|
+
###### overrideOutputWidth
|
|
90
50
|
|
|
91
|
-
|
|
51
|
+
`number`
|
|
92
52
|
|
|
93
|
-
|
|
53
|
+
Override the output width.
|
|
94
54
|
|
|
95
55
|
#### Returns
|
|
96
56
|
|
|
@@ -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
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
"env": {
|
|
33
33
|
"param": "--env '<'filename'>'",
|
|
34
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."
|
|
35
39
|
}
|
|
36
40
|
},
|
|
37
41
|
"progress": {
|
|
@@ -40,12 +44,13 @@
|
|
|
40
44
|
},
|
|
41
45
|
"labels": {
|
|
42
46
|
"mnemonic": "Mnemonic",
|
|
43
|
-
"seed": "Seed"
|
|
47
|
+
"seed": "Seed",
|
|
48
|
+
"envPrefix": "Env Prefix"
|
|
44
49
|
}
|
|
45
50
|
},
|
|
46
51
|
"address": {
|
|
47
|
-
"summary": "Create
|
|
48
|
-
"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.",
|
|
49
54
|
"options": {
|
|
50
55
|
"seed": {
|
|
51
56
|
"param": "--seed '<'seed'>'",
|
|
@@ -61,15 +66,15 @@
|
|
|
61
66
|
},
|
|
62
67
|
"account": {
|
|
63
68
|
"param": "--account '<'number'>'",
|
|
64
|
-
"description": "The account used to generate the
|
|
69
|
+
"description": "The account used to generate the addresses."
|
|
65
70
|
},
|
|
66
71
|
"hrp": {
|
|
67
72
|
"param": "--hrp '<'hrp'>'",
|
|
68
|
-
"description": "The human readable part
|
|
73
|
+
"description": "The human readable part for the addresses if generating bech32 format."
|
|
69
74
|
},
|
|
70
75
|
"coin": {
|
|
71
76
|
"param": "--coin '<'coin'>'",
|
|
72
|
-
"description": "The coin type used to generate the
|
|
77
|
+
"description": "The coin type used to generate the addresses."
|
|
73
78
|
},
|
|
74
79
|
"key-type": {
|
|
75
80
|
"param": "--key-type '<'type'>'",
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/crypto-cli",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.31",
|
|
4
4
|
"description": "A command line interface for interacting with the crypto tools",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/twinfoundation/framework.git",
|
|
8
|
-
"directory": "
|
|
8
|
+
"directory": "apps/crypto-cli"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
11
11
|
"license": "Apache-2.0",
|
|
@@ -13,50 +13,21 @@
|
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"clean": "rimraf dist coverage",
|
|
18
|
-
"build": "tspc",
|
|
19
|
-
"merge-locales": "merge-locales",
|
|
20
|
-
"test": "vitest --run --config ./vitest.config.ts --no-cache",
|
|
21
|
-
"coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
|
|
22
|
-
"bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
|
|
23
|
-
"bundle:cjs": "rollup --config rollup.config.mjs --environment MODULE:cjs",
|
|
24
|
-
"bundle": "npm run bundle:esm && npm run bundle:cjs",
|
|
25
|
-
"docs:clean": "rimraf docs/reference",
|
|
26
|
-
"docs:generate": "typedoc",
|
|
27
|
-
"docs": "npm run docs:clean && npm run docs:generate",
|
|
28
|
-
"dist": "npm run clean && npm run build && npm run merge-locales && npm run test && npm run bundle && npm run docs"
|
|
29
|
-
},
|
|
30
16
|
"dependencies": {
|
|
31
|
-
"@twin.org/cli-core": "0.0.1-next.
|
|
32
|
-
"@twin.org/core": "0.0.1-next.
|
|
33
|
-
"@twin.org/crypto": "0.0.1-next.
|
|
17
|
+
"@twin.org/cli-core": "0.0.1-next.31",
|
|
18
|
+
"@twin.org/core": "0.0.1-next.31",
|
|
19
|
+
"@twin.org/crypto": "0.0.1-next.31",
|
|
34
20
|
"@twin.org/nameof": "next",
|
|
35
|
-
"commander": "
|
|
36
|
-
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@twin.org/merge-locales": "next",
|
|
39
|
-
"@twin.org/nameof-transformer": "next",
|
|
40
|
-
"@types/node": "22.5.5",
|
|
41
|
-
"@vitest/coverage-v8": "2.1.1",
|
|
42
|
-
"copyfiles": "2.4.1",
|
|
43
|
-
"rimraf": "6.0.1",
|
|
44
|
-
"rollup": "4.21.3",
|
|
45
|
-
"rollup-plugin-typescript2": "0.36.0",
|
|
46
|
-
"ts-patch": "3.2.1",
|
|
47
|
-
"typedoc": "0.26.7",
|
|
48
|
-
"typedoc-plugin-markdown": "4.2.7",
|
|
49
|
-
"typescript": "5.6.2",
|
|
50
|
-
"vitest": "2.1.1"
|
|
21
|
+
"commander": "13.1.0"
|
|
51
22
|
},
|
|
52
23
|
"main": "./dist/cjs/index.cjs",
|
|
53
24
|
"module": "./dist/esm/index.mjs",
|
|
54
25
|
"types": "./dist/types/index.d.ts",
|
|
55
26
|
"exports": {
|
|
56
27
|
".": {
|
|
28
|
+
"types": "./dist/types/index.d.ts",
|
|
57
29
|
"require": "./dist/cjs/index.cjs",
|
|
58
|
-
"import": "./dist/esm/index.mjs"
|
|
59
|
-
"types": "./dist/types/index.d.ts"
|
|
30
|
+
"import": "./dist/esm/index.mjs"
|
|
60
31
|
}
|
|
61
32
|
},
|
|
62
33
|
"files": [
|