@agrozyme/eckey 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,7 +13,7 @@ $ npm install -g @agrozyme/eckey
13
13
  $ eckey COMMAND
14
14
  running command...
15
15
  $ eckey (--version)
16
- @agrozyme/eckey/0.0.3 win32-x64 node-v20.14.0
16
+ @agrozyme/eckey/0.0.5 win32-x64 node-v22.14.0
17
17
  $ eckey --help [COMMAND]
18
18
  USAGE
19
19
  $ eckey COMMAND
@@ -27,6 +27,7 @@ USAGE
27
27
  * [`eckey convert`](#eckey-convert)
28
28
  * [`eckey help [COMMAND]`](#eckey-help-command)
29
29
  * [`eckey make`](#eckey-make)
30
+ * [`eckey pair`](#eckey-pair)
30
31
 
31
32
  ## `eckey convert`
32
33
 
@@ -55,7 +56,7 @@ EXAMPLES
55
56
  $ eckey convert
56
57
  ```
57
58
 
58
- _See code: [src/commands/convert.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v0.0.3/src/commands/convert.ts)_
59
+ _See code: [src/commands/convert.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v0.0.5/src/commands/convert.ts)_
59
60
 
60
61
  ## `eckey help [COMMAND]`
61
62
 
@@ -75,7 +76,7 @@ DESCRIPTION
75
76
  Display help for eckey.
76
77
  ```
77
78
 
78
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.3/src/commands/help.ts)_
79
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.27/src/commands/help.ts)_
79
80
 
80
81
  ## `eckey make`
81
82
 
@@ -104,5 +105,34 @@ EXAMPLES
104
105
  $ eckey make
105
106
  ```
106
107
 
107
- _See code: [src/commands/make.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v0.0.3/src/commands/make.ts)_
108
+ _See code: [src/commands/make.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v0.0.5/src/commands/make.ts)_
109
+
110
+ ## `eckey pair`
111
+
112
+ convert key pair to other format
113
+
114
+ ```
115
+ USAGE
116
+ $ eckey pair --data <value> --curve
117
+ bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|p256|p384|p521|pallas|schnorr|secp256k1|secp256r1|
118
+ secp384r1|secp521r1|vesta [--format base16|base32|base32crockford|base32hex|base58|base58check|base58flickr|base58xm
119
+ r|base58xrp|base64|base64url|base64urlnopad|hex|utf8]
120
+
121
+ FLAGS
122
+ --curve=<option> (required)
123
+ <options: bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|p256|p384|p521|pallas|s
124
+ chnorr|secp256k1|secp256r1|secp384r1|secp521r1|vesta>
125
+ --data=<value> (required)
126
+ --format=<option> [default: hex]
127
+ <options: base16|base32|base32crockford|base32hex|base58|base58check|base58flickr|base58xmr|base58x
128
+ rp|base64|base64url|base64urlnopad|hex|utf8>
129
+
130
+ DESCRIPTION
131
+ convert key pair to other format
132
+
133
+ EXAMPLES
134
+ $ eckey pair
135
+ ```
136
+
137
+ _See code: [src/commands/pair.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v0.0.5/src/commands/pair.ts)_
108
138
  <!-- commandsstop -->
@@ -0,0 +1,12 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Pair extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ data: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ curve: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
10
+ static args: {};
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const crypto_1 = require("@agrozyme/crypto");
4
+ const core_1 = require("@oclif/core");
5
+ const types_1 = require("../types");
6
+ class Pair extends core_1.Command {
7
+ static description = 'convert key pair to other format';
8
+ static examples = ['<%= config.bin %> <%= command.id %>'];
9
+ static flags = {
10
+ data: core_1.Flags.string({ required: true }),
11
+ curve: core_1.Flags.string({ required: true, options: types_1.curveKeys }),
12
+ format: core_1.Flags.string({ options: types_1.bytesCoderKeys, default: 'hex' }),
13
+ };
14
+ static args = {};
15
+ async run() {
16
+ const { args, flags } = await this.parse(Pair);
17
+ const { data, format } = flags;
18
+ const curve = crypto_1.curveMap[flags.curve];
19
+ const keyConveter = crypto_1.bytesCoderMap[format];
20
+ const privateKey = keyConveter.decode(data);
21
+ const publicKey = curve.getPublicKey(privateKey, true);
22
+ const item = { privateKey: keyConveter.encode(privateKey), publicKey: keyConveter.encode(publicKey) };
23
+ console.dir(item);
24
+ }
25
+ }
26
+ exports.default = Pair;
@@ -158,6 +158,87 @@
158
158
  "make.js"
159
159
  ]
160
160
  },
161
+ "pair": {
162
+ "aliases": [],
163
+ "args": {},
164
+ "description": "convert key pair to other format",
165
+ "examples": [
166
+ "<%= config.bin %> <%= command.id %>"
167
+ ],
168
+ "flags": {
169
+ "data": {
170
+ "name": "data",
171
+ "required": true,
172
+ "hasDynamicHelp": false,
173
+ "multiple": false,
174
+ "type": "option"
175
+ },
176
+ "curve": {
177
+ "name": "curve",
178
+ "required": true,
179
+ "hasDynamicHelp": false,
180
+ "multiple": false,
181
+ "options": [
182
+ "bls12_381",
183
+ "bn254",
184
+ "ed448",
185
+ "ed448ph",
186
+ "ed25519",
187
+ "ed25519ctx",
188
+ "ed25519ph",
189
+ "jubjub",
190
+ "p256",
191
+ "p384",
192
+ "p521",
193
+ "pallas",
194
+ "schnorr",
195
+ "secp256k1",
196
+ "secp256r1",
197
+ "secp384r1",
198
+ "secp521r1",
199
+ "vesta"
200
+ ],
201
+ "type": "option"
202
+ },
203
+ "format": {
204
+ "name": "format",
205
+ "default": "hex",
206
+ "hasDynamicHelp": false,
207
+ "multiple": false,
208
+ "options": [
209
+ "base16",
210
+ "base32",
211
+ "base32crockford",
212
+ "base32hex",
213
+ "base58",
214
+ "base58check",
215
+ "base58flickr",
216
+ "base58xmr",
217
+ "base58xrp",
218
+ "base64",
219
+ "base64url",
220
+ "base64urlnopad",
221
+ "hex",
222
+ "utf8"
223
+ ],
224
+ "type": "option"
225
+ }
226
+ },
227
+ "hasDynamicHelp": false,
228
+ "hiddenAliases": [],
229
+ "id": "pair",
230
+ "pluginAlias": "@agrozyme/eckey",
231
+ "pluginName": "@agrozyme/eckey",
232
+ "pluginType": "core",
233
+ "strict": true,
234
+ "enableJsonFlag": false,
235
+ "isESM": false,
236
+ "relativePath": [
237
+ "dist",
238
+ "commands",
239
+ "pair.js"
240
+ ]
241
+ },
161
242
  "test": {
162
243
  "aliases": [],
163
244
  "args": {},
@@ -183,5 +264,5 @@
183
264
  ]
184
265
  }
185
266
  },
186
- "version": "0.0.3"
267
+ "version": "0.0.5"
187
268
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agrozyme/eckey",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Elliptic Curve Key CLI",
5
5
  "author": "",
6
6
  "bin": {
@@ -17,25 +17,25 @@
17
17
  "/oclif.manifest.json"
18
18
  ],
19
19
  "dependencies": {
20
- "@agrozyme/crypto": "^1.0.9",
21
- "@oclif/core": "^4.0.6",
22
- "@oclif/plugin-help": "^6.2.3",
23
- "@oclif/plugin-plugins": "^5.3.2",
24
- "rambdax": "^11.1.1"
20
+ "@agrozyme/crypto": "^1.0.10",
21
+ "@oclif/core": "^4.2.10",
22
+ "@oclif/plugin-help": "^6.2.27",
23
+ "@oclif/plugin-plugins": "^5.4.36",
24
+ "rambdax": "^11.3.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@oclif/test": "^4.0.4",
28
- "@types/chai": "^4.3.16",
29
- "@types/jasmine": "^5.1.4",
30
- "@types/node": "^18.19.36",
31
- "chai": "^5.1.1",
32
- "jasmine": "^5.1.0",
33
- "oclif": "^4.13.8",
27
+ "@oclif/test": "^4.1.12",
28
+ "@types/chai": "^5.2.1",
29
+ "@types/jasmine": "^5.1.7",
30
+ "@types/node": "^18.19.86",
31
+ "chai": "^5.2.0",
32
+ "jasmine": "^5.6.0",
33
+ "oclif": "^4.17.43",
34
34
  "pkg": "^5.8.1",
35
- "shx": "^0.3.4",
35
+ "shx": "^0.4.0",
36
36
  "ts-node": "^10.9.2",
37
- "tslib": "^2.6.3",
38
- "typescript": "^5.4.5",
37
+ "tslib": "^2.8.1",
38
+ "typescript": "^5.8.3",
39
39
  "yarpm": "^1.2.0"
40
40
  },
41
41
  "oclif": {