@twin.org/crypto-cli 0.0.1-next.6 → 0.0.1-next.60
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 +18 -10
- package/dist/esm/index.mjs +17 -9
- package/dist/locales/en.json +335 -316
- package/dist/types/commands/address.d.ts +2 -2
- package/docs/changelog.md +179 -1
- package/docs/examples.md +2 -2
- 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 +5 -5
- package/package.json +7 -7
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,19 +96,19 @@ 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();
|
|
95
103
|
}
|
|
96
104
|
}
|
|
97
105
|
if (core.Is.stringValue(opts?.json)) {
|
|
98
|
-
await cliCore.CLIUtils.writeJsonFile(opts.json, addressDictionary, opts.mergeJson);
|
|
106
|
+
await cliCore.CLIUtils.writeJsonFile(opts.json, { addresses: addressDictionary }, opts.mergeJson);
|
|
99
107
|
}
|
|
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
|
}
|
|
@@ -185,11 +193,11 @@ class CLI extends cliCore.CLIBase {
|
|
|
185
193
|
return this.execute({
|
|
186
194
|
title: "TWIN Crypto",
|
|
187
195
|
appName: "twin-crypto",
|
|
188
|
-
version: "0.0.1-next.
|
|
196
|
+
version: "0.0.1-next.60", // x-release-please-version
|
|
189
197
|
icon: "🌍",
|
|
190
198
|
supportsEnvFiles: true,
|
|
191
199
|
overrideOutputWidth: options?.overrideOutputWidth
|
|
192
|
-
}, localesDirectory ?? path.join(path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))), "../locales"), argv);
|
|
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);
|
|
193
201
|
}
|
|
194
202
|
/**
|
|
195
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,19 +93,19 @@ 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();
|
|
92
100
|
}
|
|
93
101
|
}
|
|
94
102
|
if (Is.stringValue(opts?.json)) {
|
|
95
|
-
await CLIUtils.writeJsonFile(opts.json, addressDictionary, opts.mergeJson);
|
|
103
|
+
await CLIUtils.writeJsonFile(opts.json, { addresses: addressDictionary }, opts.mergeJson);
|
|
96
104
|
}
|
|
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
|
}
|
|
@@ -182,7 +190,7 @@ class CLI extends CLIBase {
|
|
|
182
190
|
return this.execute({
|
|
183
191
|
title: "TWIN Crypto",
|
|
184
192
|
appName: "twin-crypto",
|
|
185
|
-
version: "0.0.1-next.
|
|
193
|
+
version: "0.0.1-next.60", // x-release-please-version
|
|
186
194
|
icon: "🌍",
|
|
187
195
|
supportsEnvFiles: true,
|
|
188
196
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/locales/en.json
CHANGED
|
@@ -1,317 +1,336 @@
|
|
|
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
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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
|
+
"arrayStartsWith": "Property \"{property}\" must be an array starting with [{startValues}], it is \"{value}\"",
|
|
85
|
+
"arrayEndsWith": "Property \"{property}\" must be an array ending with [{endValues}], it is \"{value}\"",
|
|
86
|
+
"uint8Array": "Property \"{property}\" must be a Uint8Array, it is \"{value}\"",
|
|
87
|
+
"function": "Property \"{property}\" must be a function, it is \"{value}\"",
|
|
88
|
+
"urn": "Property \"{property}\" must be a Urn formatted string, it is \"{value}\"",
|
|
89
|
+
"url": "Property \"{property}\" must be a Url formatted string, it is \"{value}\"",
|
|
90
|
+
"email": "Property \"{property}\" must be string in e-mail format, it is \"{value}\"",
|
|
91
|
+
"length32Multiple": "Property \"{property}\" should be a multiple of 32, it is {value}",
|
|
92
|
+
"lengthEntropy": "Property \"{property}\" should be a multiple of 4, >=16 and <= 32, it is {value}",
|
|
93
|
+
"length3Multiple": "Property \"{property}\" should be a multiple of 3, it is {value}",
|
|
94
|
+
"greaterThan0": "Property \"{property}\" must be greater than zero, it is {value}"
|
|
95
|
+
},
|
|
96
|
+
"objectHelper": {
|
|
97
|
+
"failedBytesToJSON": "Failed converting bytes to JSON",
|
|
98
|
+
"cannotSetArrayIndex": "Cannot set property \"{property}\" using index \"{index}\" as it is not an array",
|
|
99
|
+
"cannotSetProperty": "Cannot set property \"{property}\" when the target is not an object"
|
|
100
|
+
},
|
|
101
|
+
"common": {
|
|
102
|
+
"notImplementedMethod": "The method \"{method}\" has not been implemented",
|
|
103
|
+
"validation": "Validation failed"
|
|
104
|
+
},
|
|
105
|
+
"factory": {
|
|
106
|
+
"noUnregister": "There is no {typeName} registered with the name \"{name}\"",
|
|
107
|
+
"noGet": "The requested {typeName} \"{name}\" does not exist in the factory"
|
|
108
|
+
},
|
|
109
|
+
"bitString": {
|
|
110
|
+
"outOfRange": "The index should be >= 0 and less than the length of the bit string"
|
|
111
|
+
},
|
|
112
|
+
"base32": {
|
|
113
|
+
"invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
|
|
114
|
+
},
|
|
115
|
+
"base64": {
|
|
116
|
+
"length4Multiple": "Invalid length should be a multiple of 4, it is \"{value}\""
|
|
117
|
+
},
|
|
118
|
+
"base58": {
|
|
119
|
+
"invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
|
|
120
|
+
},
|
|
121
|
+
"jsonHelper": {
|
|
122
|
+
"failedPatch": "Failed to patch the JSON object, patch index \"{index}\" failed"
|
|
123
|
+
},
|
|
124
|
+
"bip39": {
|
|
125
|
+
"missingMnemonicWord": "The mnemonic contains a word not in the wordlist, \"{value}\"",
|
|
126
|
+
"checksumMismatch": "The checksum does not match \"{newChecksum}\" != \"{checksumBits}\""
|
|
127
|
+
},
|
|
128
|
+
"ed25519": {
|
|
129
|
+
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
130
|
+
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
131
|
+
},
|
|
132
|
+
"secp256k1": {
|
|
133
|
+
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
134
|
+
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
135
|
+
},
|
|
136
|
+
"x25519": {
|
|
137
|
+
"invalidPublicKey": "Invalid Ed25519 Public Key"
|
|
138
|
+
},
|
|
139
|
+
"blake2b": {
|
|
140
|
+
"outputLength64": "The output length should be between 1 and 64, it is \"{outputLength}\"",
|
|
141
|
+
"keyLength64": "The key length should be between 1 and 64, it is \"{keyLength}\""
|
|
142
|
+
},
|
|
143
|
+
"sha512": {
|
|
144
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
145
|
+
},
|
|
146
|
+
"sha256": {
|
|
147
|
+
"bitSize": "Only 224 or 256 bits are supported, it is \"{bitSize}\""
|
|
148
|
+
},
|
|
149
|
+
"sha3": {
|
|
150
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
151
|
+
},
|
|
152
|
+
"hmacSha256": {
|
|
153
|
+
"bitSize": "Only 224 or 256 bits are supported, it is \"{bitSize}\""
|
|
154
|
+
},
|
|
155
|
+
"hmacSha512": {
|
|
156
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
157
|
+
},
|
|
158
|
+
"bech32": {
|
|
159
|
+
"decodeFailed": "The address contains decoding failed for address \"{bech32}\"",
|
|
160
|
+
"invalidChecksum": "The address contains an invalid checksum in address, \"{bech32}\"",
|
|
161
|
+
"separatorMisused": "The separator character '1' should only be used between hrp and data, \"{bech32}\"",
|
|
162
|
+
"lowerUpper": "The address my use either lowercase or uppercase, \"{bech32}\"",
|
|
163
|
+
"dataTooShort": "The address does not contain enough data to decode, \"{bech32}\""
|
|
164
|
+
},
|
|
165
|
+
"pbkdf2": {
|
|
166
|
+
"keyTooLong": "The requested key length \"{keyLength}\" is too long, based on the \"{macLength}\""
|
|
167
|
+
},
|
|
168
|
+
"chaCha20Poly1305": {
|
|
169
|
+
"noAadWithData": "You can not set the aad when there is already data",
|
|
170
|
+
"noAuthTag": "Can not finalise when the auth tag is not set",
|
|
171
|
+
"authenticationFailed": "The data could not be authenticated",
|
|
172
|
+
"authTagDecrypting": "Can not get the auth tag when decrypting",
|
|
173
|
+
"authTagEncrypting": "Can not set the auth tag when encrypting",
|
|
174
|
+
"noAuthTagSet": "The auth tag has not been set"
|
|
175
|
+
},
|
|
176
|
+
"bip44": {
|
|
177
|
+
"unsupportedKeyType": "The key type \"{keyType}\" is not supported"
|
|
178
|
+
},
|
|
179
|
+
"slip0010": {
|
|
180
|
+
"invalidSeed": "The seed is invalid \"{seed}\""
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"cli": {
|
|
184
|
+
"progress": {
|
|
185
|
+
"done": "Done.",
|
|
186
|
+
"error": "Error",
|
|
187
|
+
"loadingEnvFiles": "Loading env files",
|
|
188
|
+
"pleaseWait": "Please wait...",
|
|
189
|
+
"writingJsonFile": "Writing JSON file",
|
|
190
|
+
"writingEnvFile": "Writing env file",
|
|
191
|
+
"readingJsonFile": "Reading JSON file",
|
|
192
|
+
"readingEnvFile": "Reading env file"
|
|
193
|
+
},
|
|
194
|
+
"options": {
|
|
195
|
+
"lang": {
|
|
196
|
+
"param": "--lang '<'lang'>'",
|
|
197
|
+
"description": "The language to display the output in."
|
|
198
|
+
},
|
|
199
|
+
"load-env": {
|
|
200
|
+
"param": "--load-env [env...]",
|
|
201
|
+
"description": "Load the env files to initialise any environment variables."
|
|
202
|
+
},
|
|
203
|
+
"no-console": {
|
|
204
|
+
"param": "--no-console",
|
|
205
|
+
"description": "Hides the output in the console."
|
|
206
|
+
},
|
|
207
|
+
"json": {
|
|
208
|
+
"param": "--json '<'filename'>'",
|
|
209
|
+
"description": "Creates a JSON file containing the output."
|
|
210
|
+
},
|
|
211
|
+
"env": {
|
|
212
|
+
"param": "--env '<'filename'>'",
|
|
213
|
+
"description": "Creates an env file containing the output."
|
|
214
|
+
},
|
|
215
|
+
"merge-json": {
|
|
216
|
+
"param": "--merge-json",
|
|
217
|
+
"description": "If the JSON file already exists merge the data instead of overwriting."
|
|
218
|
+
},
|
|
219
|
+
"merge-env": {
|
|
220
|
+
"param": "--merge-env",
|
|
221
|
+
"description": "If the env file already exists merge the data instead of overwriting."
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"errorNames": {
|
|
226
|
+
"error": "Error",
|
|
227
|
+
"generalError": "General",
|
|
228
|
+
"guardError": "Guard",
|
|
229
|
+
"conflictError": "Conflict",
|
|
230
|
+
"notFoundError": "Not Found",
|
|
231
|
+
"notSupportedError": "Not Supported",
|
|
232
|
+
"alreadyExistsError": "Already Exists",
|
|
233
|
+
"notImplementedError": "Not Implemented",
|
|
234
|
+
"validationError": "Validation",
|
|
235
|
+
"unprocessableError": "Unprocessable"
|
|
236
|
+
},
|
|
237
|
+
"validation": {
|
|
238
|
+
"defaultFieldName": "The field"
|
|
239
|
+
},
|
|
240
|
+
"commands": {
|
|
241
|
+
"mnemonic": {
|
|
242
|
+
"summary": "Create a mnemonic.",
|
|
243
|
+
"description": "Create a mnemonic, will also generate the equivalent seed in hex and base64 format.",
|
|
244
|
+
"options": {
|
|
245
|
+
"strength": {
|
|
246
|
+
"param": "--strength '<'number'>'",
|
|
247
|
+
"description": "The number of words in the mnemonic, defaults to 256 which produces 24 words."
|
|
248
|
+
},
|
|
249
|
+
"seed-format": {
|
|
250
|
+
"param": "--seed-format '<'format'>'",
|
|
251
|
+
"description": "The format to output the seed."
|
|
252
|
+
},
|
|
253
|
+
"no-console": {
|
|
254
|
+
"param": "--no-console",
|
|
255
|
+
"description": "Hides the mnemonic and seed in the console."
|
|
256
|
+
},
|
|
257
|
+
"json": {
|
|
258
|
+
"param": "--json '<'filename'>'",
|
|
259
|
+
"description": "Creates a JSON file containing the mnemonic and seed."
|
|
260
|
+
},
|
|
261
|
+
"env": {
|
|
262
|
+
"param": "--env '<'filename'>'",
|
|
263
|
+
"description": "Creates an env file containing the mnemonic and seed."
|
|
264
|
+
},
|
|
265
|
+
"env-prefix": {
|
|
266
|
+
"param": "--env-prefix '<'prefix'>'",
|
|
267
|
+
"description": "Prefixes the env variables with the value."
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"progress": {
|
|
271
|
+
"writingJsonFile": "Writing JSON file",
|
|
272
|
+
"writingEnvFile": "Writing env file"
|
|
273
|
+
},
|
|
274
|
+
"labels": {
|
|
275
|
+
"mnemonic": "Mnemonic",
|
|
276
|
+
"seed": "Seed",
|
|
277
|
+
"envPrefix": "Env Prefix"
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"address": {
|
|
281
|
+
"summary": "Create addresses and keys from the seed.",
|
|
282
|
+
"description": "Create a number of addresses and their associated key pairs from the seed.",
|
|
283
|
+
"options": {
|
|
284
|
+
"seed": {
|
|
285
|
+
"param": "--seed '<'seed'>'",
|
|
286
|
+
"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 !"
|
|
287
|
+
},
|
|
288
|
+
"start": {
|
|
289
|
+
"param": "--start '<'number'>'",
|
|
290
|
+
"description": "The index of the first address to create."
|
|
291
|
+
},
|
|
292
|
+
"count": {
|
|
293
|
+
"param": "--count '<'number'>'",
|
|
294
|
+
"description": "The number of addresses to create, max 100."
|
|
295
|
+
},
|
|
296
|
+
"account": {
|
|
297
|
+
"param": "--account '<'number'>'",
|
|
298
|
+
"description": "The account used to generate the addresses."
|
|
299
|
+
},
|
|
300
|
+
"hrp": {
|
|
301
|
+
"param": "--hrp '<'hrp'>'",
|
|
302
|
+
"description": "The human readable part for the addresses if generating bech32 format."
|
|
303
|
+
},
|
|
304
|
+
"coin": {
|
|
305
|
+
"param": "--coin '<'coin'>'",
|
|
306
|
+
"description": "The coin type used to generate the addresses."
|
|
307
|
+
},
|
|
308
|
+
"key-type": {
|
|
309
|
+
"param": "--key-type '<'type'>'",
|
|
310
|
+
"description": "The type of key to generate."
|
|
311
|
+
},
|
|
312
|
+
"key-format": {
|
|
313
|
+
"param": "--key-format '<'format'>'",
|
|
314
|
+
"description": "The format to output the keys."
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"progress": {
|
|
318
|
+
"generatingAddresses": "Generating addresses"
|
|
319
|
+
},
|
|
320
|
+
"labels": {
|
|
321
|
+
"seed": "Seed",
|
|
322
|
+
"start": "Start",
|
|
323
|
+
"count": "Count",
|
|
324
|
+
"account": "Account",
|
|
325
|
+
"hrp": "HRP",
|
|
326
|
+
"coin": "Coin",
|
|
327
|
+
"key-type": "Key Type",
|
|
328
|
+
"key-format": "Key Format",
|
|
329
|
+
"index": "Index",
|
|
330
|
+
"address": "Address",
|
|
331
|
+
"public-key": "Public Key",
|
|
332
|
+
"private-key": "Private Key"
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
@@ -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
|
@@ -1,5 +1,183 @@
|
|
|
1
1
|
# @twin.org/crypto-cli - Changelog
|
|
2
2
|
|
|
3
|
-
## 0.0.1-next.
|
|
3
|
+
## [0.0.1-next.60](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.59...crypto-cli-v0.0.1-next.60) (2025-06-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* crypto CLI address output to JSON ([0398604](https://github.com/twinfoundation/framework/commit/0398604c5ad7673eddf1ee7bed7fafa94f3526f8))
|
|
9
|
+
* crypto CLI address output to JSON ([3397bfb](https://github.com/twinfoundation/framework/commit/3397bfbdde6be5dcb40b490009891e14338e2af7))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* The following workspace dependencies were updated
|
|
15
|
+
* dependencies
|
|
16
|
+
* @twin.org/cli-core bumped from 0.0.1-next.59 to 0.0.1-next.60
|
|
17
|
+
* @twin.org/core bumped from 0.0.1-next.59 to 0.0.1-next.60
|
|
18
|
+
* @twin.org/crypto bumped from 0.0.1-next.59 to 0.0.1-next.60
|
|
19
|
+
|
|
20
|
+
## [0.0.1-next.59](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.58...crypto-cli-v0.0.1-next.59) (2025-06-17)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Miscellaneous Chores
|
|
24
|
+
|
|
25
|
+
* **crypto-cli:** Synchronize repo versions
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
|
|
30
|
+
* The following workspace dependencies were updated
|
|
31
|
+
* dependencies
|
|
32
|
+
* @twin.org/cli-core bumped from 0.0.1-next.58 to 0.0.1-next.59
|
|
33
|
+
* @twin.org/core bumped from 0.0.1-next.58 to 0.0.1-next.59
|
|
34
|
+
* @twin.org/crypto bumped from 0.0.1-next.58 to 0.0.1-next.59
|
|
35
|
+
|
|
36
|
+
## [0.0.1-next.58](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.57...crypto-cli-v0.0.1-next.58) (2025-06-13)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Miscellaneous Chores
|
|
40
|
+
|
|
41
|
+
* **crypto-cli:** Synchronize repo versions
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Dependencies
|
|
45
|
+
|
|
46
|
+
* The following workspace dependencies were updated
|
|
47
|
+
* dependencies
|
|
48
|
+
* @twin.org/cli-core bumped from 0.0.1-next.57 to 0.0.1-next.58
|
|
49
|
+
* @twin.org/core bumped from 0.0.1-next.57 to 0.0.1-next.58
|
|
50
|
+
* @twin.org/crypto bumped from 0.0.1-next.57 to 0.0.1-next.58
|
|
51
|
+
|
|
52
|
+
## [0.0.1-next.57](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.56...crypto-cli-v0.0.1-next.57) (2025-06-10)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
* add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Dependencies
|
|
61
|
+
|
|
62
|
+
* The following workspace dependencies were updated
|
|
63
|
+
* dependencies
|
|
64
|
+
* @twin.org/cli-core bumped from 0.0.1-next.56 to 0.0.1-next.57
|
|
65
|
+
* @twin.org/core bumped from 0.0.1-next.56 to 0.0.1-next.57
|
|
66
|
+
* @twin.org/crypto bumped from 0.0.1-next.56 to 0.0.1-next.57
|
|
67
|
+
|
|
68
|
+
## [0.0.1-next.56](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.55...crypto-cli-v0.0.1-next.56) (2025-05-08)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Miscellaneous Chores
|
|
72
|
+
|
|
73
|
+
* **crypto-cli:** Synchronize repo versions
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Dependencies
|
|
77
|
+
|
|
78
|
+
* The following workspace dependencies were updated
|
|
79
|
+
* dependencies
|
|
80
|
+
* @twin.org/cli-core bumped from 0.0.1-next.55 to 0.0.1-next.56
|
|
81
|
+
* @twin.org/core bumped from 0.0.1-next.55 to 0.0.1-next.56
|
|
82
|
+
* @twin.org/crypto bumped from 0.0.1-next.55 to 0.0.1-next.56
|
|
83
|
+
|
|
84
|
+
## [0.0.1-next.55](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.54...crypto-cli-v0.0.1-next.55) (2025-05-07)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
### Miscellaneous Chores
|
|
88
|
+
|
|
89
|
+
* **crypto-cli:** Synchronize repo versions
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
### Dependencies
|
|
93
|
+
|
|
94
|
+
* The following workspace dependencies were updated
|
|
95
|
+
* dependencies
|
|
96
|
+
* @twin.org/cli-core bumped from 0.0.1-next.54 to 0.0.1-next.55
|
|
97
|
+
* @twin.org/core bumped from 0.0.1-next.54 to 0.0.1-next.55
|
|
98
|
+
* @twin.org/crypto bumped from 0.0.1-next.54 to 0.0.1-next.55
|
|
99
|
+
|
|
100
|
+
## [0.0.1-next.54](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.53...crypto-cli-v0.0.1-next.54) (2025-05-06)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
### Miscellaneous Chores
|
|
104
|
+
|
|
105
|
+
* **crypto-cli:** Synchronize repo versions
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### Dependencies
|
|
109
|
+
|
|
110
|
+
* The following workspace dependencies were updated
|
|
111
|
+
* dependencies
|
|
112
|
+
* @twin.org/cli-core bumped from 0.0.1-next.53 to 0.0.1-next.54
|
|
113
|
+
* @twin.org/core bumped from 0.0.1-next.53 to 0.0.1-next.54
|
|
114
|
+
* @twin.org/crypto bumped from 0.0.1-next.53 to 0.0.1-next.54
|
|
115
|
+
|
|
116
|
+
## [0.0.1-next.53](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.52...crypto-cli-v0.0.1-next.53) (2025-05-01)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
### Miscellaneous Chores
|
|
120
|
+
|
|
121
|
+
* **crypto-cli:** Synchronize repo versions
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Dependencies
|
|
125
|
+
|
|
126
|
+
* The following workspace dependencies were updated
|
|
127
|
+
* dependencies
|
|
128
|
+
* @twin.org/cli-core bumped from 0.0.1-next.52 to 0.0.1-next.53
|
|
129
|
+
* @twin.org/core bumped from 0.0.1-next.52 to 0.0.1-next.53
|
|
130
|
+
* @twin.org/crypto bumped from 0.0.1-next.52 to 0.0.1-next.53
|
|
131
|
+
|
|
132
|
+
## [0.0.1-next.52](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.51...crypto-cli-v0.0.1-next.52) (2025-04-17)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### Features
|
|
136
|
+
|
|
137
|
+
* use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Dependencies
|
|
141
|
+
|
|
142
|
+
* The following workspace dependencies were updated
|
|
143
|
+
* dependencies
|
|
144
|
+
* @twin.org/cli-core bumped from 0.0.1-next.51 to 0.0.1-next.52
|
|
145
|
+
* @twin.org/core bumped from 0.0.1-next.51 to 0.0.1-next.52
|
|
146
|
+
* @twin.org/crypto bumped from 0.0.1-next.51 to 0.0.1-next.52
|
|
147
|
+
|
|
148
|
+
## [0.0.1-next.51](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.50...crypto-cli-v0.0.1-next.51) (2025-03-27)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
### Miscellaneous Chores
|
|
152
|
+
|
|
153
|
+
* **crypto-cli:** Synchronize repo versions
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
### Dependencies
|
|
157
|
+
|
|
158
|
+
* The following workspace dependencies were updated
|
|
159
|
+
* dependencies
|
|
160
|
+
* @twin.org/cli-core bumped from 0.0.1-next.50 to 0.0.1-next.51
|
|
161
|
+
* @twin.org/core bumped from 0.0.1-next.50 to 0.0.1-next.51
|
|
162
|
+
* @twin.org/crypto bumped from 0.0.1-next.50 to 0.0.1-next.51
|
|
163
|
+
|
|
164
|
+
## [0.0.1-next.50](https://github.com/twinfoundation/framework/compare/crypto-cli-v0.0.1-next.49...crypto-cli-v0.0.1-next.50) (2025-03-26)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
### Features
|
|
168
|
+
|
|
169
|
+
* add version type ([ae50cd9](https://github.com/twinfoundation/framework/commit/ae50cd99d342ed8eeb55290a52e9fed80a2af99e))
|
|
170
|
+
* remove version type ([553aa55](https://github.com/twinfoundation/framework/commit/553aa55bd79b8f930155035e522af2b0f6e3d0c8))
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
### Dependencies
|
|
174
|
+
|
|
175
|
+
* The following workspace dependencies were updated
|
|
176
|
+
* dependencies
|
|
177
|
+
* @twin.org/cli-core bumped from 0.0.1-next.49 to 0.0.1-next.50
|
|
178
|
+
* @twin.org/core bumped from 0.0.1-next.49 to 0.0.1-next.50
|
|
179
|
+
* @twin.org/crypto bumped from 0.0.1-next.49 to 0.0.1-next.50
|
|
180
|
+
|
|
181
|
+
## 0.0.1-next.49
|
|
4
182
|
|
|
5
183
|
- Initial Release
|
package/docs/examples.md
CHANGED
|
@@ -229,10 +229,10 @@ twin-crypto address --load-env my.env --seed !SEED --env address.env --merge-env
|
|
|
229
229
|
The output of this command would produce address.env
|
|
230
230
|
|
|
231
231
|
```shell
|
|
232
|
-
|
|
232
|
+
ADDRESS_0="iota1qqcpqyrnqtzteu7k26dgjvjp3x76tts526prtwrjq99v50pyv6l9xysdcg8"
|
|
233
233
|
ADDRESS_0_PRIVATE_KEY="0x3b2863db878ce156a46d2142c72baa7807a40a990684604ff86456821228d978"
|
|
234
234
|
ADDRESS_0_PUBLIC_KEY="0x6b6eb9e54b44bfbc65c4a02c6489609fbc9588e640ca44bfdfdb1af4e5874905"
|
|
235
|
-
|
|
235
|
+
ADDRESS_1="iota1qrqyyyuhfzgrp7ducjapg8pta3w877nu0u5jpe50cxx39qjs08kczw7uj4v"
|
|
236
236
|
ADDRESS_1_PRIVATE_KEY="0xc5038b4c0b1dc46769687e77555a7be176e22de4262cf5aabf11290ab7c8d856"
|
|
237
237
|
ADDRESS_1_PUBLIC_KEY="0x603d9b2d25341d142524867536e3ee94d3e02a45fe498ec4c3473b0449446d77"
|
|
238
238
|
....
|
|
@@ -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,15 @@
|
|
|
66
66
|
},
|
|
67
67
|
"account": {
|
|
68
68
|
"param": "--account '<'number'>'",
|
|
69
|
-
"description": "The account used to generate the
|
|
69
|
+
"description": "The account used to generate the addresses."
|
|
70
70
|
},
|
|
71
71
|
"hrp": {
|
|
72
72
|
"param": "--hrp '<'hrp'>'",
|
|
73
|
-
"description": "The human readable part
|
|
73
|
+
"description": "The human readable part for the addresses if generating bech32 format."
|
|
74
74
|
},
|
|
75
75
|
"coin": {
|
|
76
76
|
"param": "--coin '<'coin'>'",
|
|
77
|
-
"description": "The coin type used to generate the
|
|
77
|
+
"description": "The coin type used to generate the addresses."
|
|
78
78
|
},
|
|
79
79
|
"key-type": {
|
|
80
80
|
"param": "--key-type '<'type'>'",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/crypto-cli",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.60",
|
|
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.1-next.
|
|
18
|
-
"@twin.org/core": "0.0.1-next.
|
|
19
|
-
"@twin.org/crypto": "0.0.1-next.
|
|
17
|
+
"@twin.org/cli-core": "0.0.1-next.60",
|
|
18
|
+
"@twin.org/core": "0.0.1-next.60",
|
|
19
|
+
"@twin.org/crypto": "0.0.1-next.60",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
|
-
"commander": "
|
|
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": [
|