@agrozyme/eckey 0.0.6 → 1.0.1

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.6 win32-x64 node-v24.14.1
16
+ @agrozyme/eckey/1.0.1 win32-x64 node-v26.0.0
17
17
  $ eckey --help [COMMAND]
18
18
  USAGE
19
19
  $ eckey COMMAND
@@ -36,18 +36,19 @@ convert string to other format
36
36
  ```
37
37
  USAGE
38
38
  $ eckey convert --data <value> [--from
39
- base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr|base58xrp|base64|base64url|base64urlnopad|hex|
40
- utf8|base58check] [--to base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr|base58xrp|base64|base6
41
- 4url|base64urlnopad|hex|utf8|base58check]
39
+ base16|base32|base32nopad|base32hex|base32hexnopad|base32crockford|base64|base64nopad|base64url|base64urlnopad|base5
40
+ 8|base58flickr|base58xrp|base58xmr|base58check|utf8|hex] [--to
41
+ base16|base32|base32nopad|base32hex|base32hexnopad|base32crockford|base64|base64nopad|base64url|base64urlnopad|base5
42
+ 8|base58flickr|base58xrp|base58xmr|base58check|utf8|hex]
42
43
 
43
44
  FLAGS
44
45
  --data=<value> (required)
45
46
  --from=<option> [default: hex]
46
- <options: base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr|base58xrp|base64|base
47
- 64url|base64urlnopad|hex|utf8|base58check>
47
+ <options: base16|base32|base32nopad|base32hex|base32hexnopad|base32crockford|base64|base64nopad|base6
48
+ 4url|base64urlnopad|base58|base58flickr|base58xrp|base58xmr|base58check|utf8|hex>
48
49
  --to=<option> [default: hex]
49
- <options: base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr|base58xrp|base64|base
50
- 64url|base64urlnopad|hex|utf8|base58check>
50
+ <options: base16|base32|base32nopad|base32hex|base32hexnopad|base32crockford|base64|base64nopad|base6
51
+ 4url|base64urlnopad|base58|base58flickr|base58xrp|base58xmr|base58check|utf8|hex>
51
52
 
52
53
  DESCRIPTION
53
54
  convert string to other format
@@ -56,7 +57,7 @@ EXAMPLES
56
57
  $ eckey convert
57
58
  ```
58
59
 
59
- _See code: [src/commands/convert.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v0.0.6/src/commands/convert.ts)_
60
+ _See code: [src/commands/convert.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v1.0.1/src/commands/convert.ts)_
60
61
 
61
62
  ## `eckey help [COMMAND]`
62
63
 
@@ -76,7 +77,7 @@ DESCRIPTION
76
77
  Display help for eckey.
77
78
  ```
78
79
 
79
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.43/src/commands/help.ts)_
80
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.46/src/commands/help.ts)_
80
81
 
81
82
  ## `eckey make`
82
83
 
@@ -85,18 +86,20 @@ make elliptic curve key pair
85
86
  ```
86
87
  USAGE
87
88
  $ eckey make --curve
88
- bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|babyjubjub|p256|secp256r1|p384|secp384r1|p521|secp
89
- 521r1|pallas|vesta|schnorr|secp256k1 [--format base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr
90
- |base58xrp|base64|base64url|base64urlnopad|hex|utf8|base58check] [--count <value>]
89
+ bls12_381|bls12_381_Short|bls12_381_Long|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|babyjubjub|brainpoo
90
+ lP256r1|brainpoolP384r1|brainpoolP512r1|p256|secp256r1|p384|secp384r1|p521|secp521r1|schnorr|secp256k1 [--format
91
+ base16|base32|base32nopad|base32hex|base32hexnopad|base32crockford|base64|base64nopad|base64url|base64urlnopad|base5
92
+ 8|base58flickr|base58xrp|base58xmr|base58check|utf8|hex] [--count <value>]
91
93
 
92
94
  FLAGS
93
95
  --count=<value> [default: 1]
94
96
  --curve=<option> (required)
95
- <options: bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|babyjubjub|p256|secp256
96
- r1|p384|secp384r1|p521|secp521r1|pallas|vesta|schnorr|secp256k1>
97
+ <options: bls12_381|bls12_381_Short|bls12_381_Long|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph
98
+ |jubjub|babyjubjub|brainpoolP256r1|brainpoolP384r1|brainpoolP512r1|p256|secp256r1|p384|secp384r1|p5
99
+ 21|secp521r1|schnorr|secp256k1>
97
100
  --format=<option> [default: hex]
98
- <options: base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr|base58xrp|base64|ba
99
- se64url|base64urlnopad|hex|utf8|base58check>
101
+ <options: base16|base32|base32nopad|base32hex|base32hexnopad|base32crockford|base64|base64nopad|bas
102
+ e64url|base64urlnopad|base58|base58flickr|base58xrp|base58xmr|base58check|utf8|hex>
100
103
 
101
104
  DESCRIPTION
102
105
  make elliptic curve key pair
@@ -105,7 +108,7 @@ EXAMPLES
105
108
  $ eckey make
106
109
  ```
107
110
 
108
- _See code: [src/commands/make.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v0.0.6/src/commands/make.ts)_
111
+ _See code: [src/commands/make.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v1.0.1/src/commands/make.ts)_
109
112
 
110
113
  ## `eckey pair`
111
114
 
@@ -114,18 +117,20 @@ convert key pair to other format
114
117
  ```
115
118
  USAGE
116
119
  $ eckey pair --data <value> --curve
117
- bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|babyjubjub|p256|secp256r1|p384|secp384r1|p521|secp
118
- 521r1|pallas|vesta|schnorr|secp256k1 [--format base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr
119
- |base58xrp|base64|base64url|base64urlnopad|hex|utf8|base58check]
120
+ bls12_381|bls12_381_Short|bls12_381_Long|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|babyjubjub|brainpoo
121
+ lP256r1|brainpoolP384r1|brainpoolP512r1|p256|secp256r1|p384|secp384r1|p521|secp521r1|schnorr|secp256k1 [--format
122
+ base16|base32|base32nopad|base32hex|base32hexnopad|base32crockford|base64|base64nopad|base64url|base64urlnopad|base5
123
+ 8|base58flickr|base58xrp|base58xmr|base58check|utf8|hex]
120
124
 
121
125
  FLAGS
122
126
  --curve=<option> (required)
123
- <options: bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|babyjubjub|p256|secp256
124
- r1|p384|secp384r1|p521|secp521r1|pallas|vesta|schnorr|secp256k1>
127
+ <options: bls12_381|bls12_381_Short|bls12_381_Long|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph
128
+ |jubjub|babyjubjub|brainpoolP256r1|brainpoolP384r1|brainpoolP512r1|p256|secp256r1|p384|secp384r1|p5
129
+ 21|secp521r1|schnorr|secp256k1>
125
130
  --data=<value> (required)
126
131
  --format=<option> [default: hex]
127
- <options: base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr|base58xrp|base64|ba
128
- se64url|base64urlnopad|hex|utf8|base58check>
132
+ <options: base16|base32|base32nopad|base32hex|base32hexnopad|base32crockford|base64|base64nopad|bas
133
+ e64url|base64urlnopad|base58|base58flickr|base58xrp|base58xmr|base58check|utf8|hex>
129
134
 
130
135
  DESCRIPTION
131
136
  convert key pair to other format
@@ -134,5 +139,5 @@ EXAMPLES
134
139
  $ eckey pair
135
140
  ```
136
141
 
137
- _See code: [src/commands/pair.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v0.0.6/src/commands/pair.ts)_
142
+ _See code: [src/commands/pair.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v1.0.1/src/commands/pair.ts)_
138
143
  <!-- commandsstop -->
package/bin/dev.cmd CHANGED
@@ -1,3 +1,2 @@
1
1
  @echo off
2
-
3
- node "%~dp0\dev" %*
2
+ node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %*
package/bin/dev.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env -S node --loader ts-node/esm --disable-warning=ExperimentalWarning
2
+
3
+ import { execute } from "@oclif/core";
4
+
5
+ await execute({ development: true, dir: import.meta.url });
package/bin/run.cmd CHANGED
@@ -1,3 +1,2 @@
1
1
  @echo off
2
-
3
2
  node "%~dp0\run" %*
package/bin/run.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execute } from "@oclif/core";
4
+
5
+ await execute({ dir: import.meta.url });
@@ -1,12 +1,17 @@
1
- import { Command } from '@oclif/core';
2
- export default class Convert 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
- from: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
- to: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
- };
10
- static args: {};
11
- run(): Promise<void>;
1
+ import { Command } from "@oclif/core";
2
+ import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
3
+
4
+ //#region src/commands/convert.d.ts
5
+ declare class Convert extends Command {
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ data: _$_oclif_core_interfaces0.OptionFlag<string, _$_oclif_core_interfaces0.CustomOptions>;
10
+ from: _$_oclif_core_interfaces0.OptionFlag<string, _$_oclif_core_interfaces0.CustomOptions>;
11
+ to: _$_oclif_core_interfaces0.OptionFlag<string, _$_oclif_core_interfaces0.CustomOptions>;
12
+ };
13
+ static args: {};
14
+ run(): Promise<void>;
12
15
  }
16
+ //#endregion
17
+ export { Convert as default };
@@ -1,26 +1,34 @@
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 Convert extends core_1.Command {
7
- static description = 'convert string to other format';
8
- static examples = ['<%= config.bin %> <%= command.id %>'];
9
- static flags = {
10
- data: core_1.Flags.string({ required: true }),
11
- from: core_1.Flags.string({ options: types_1.bytesCoderKeys, default: 'hex' }),
12
- to: core_1.Flags.string({ options: types_1.bytesCoderKeys, default: 'hex' }),
13
- };
14
- static args = {};
15
- async run() {
16
- const { args, flags } = await this.parse(Convert);
17
- const { data, from, to } = flags;
18
- const fromConveter = crypto_1.bytesCoderMap[from];
19
- const toConveter = crypto_1.bytesCoderMap[to];
20
- const items = fromConveter.decode(data);
21
- const result = toConveter.encode(items);
22
- console.info(`Convert data form ${from} to ${to}:`);
23
- console.dir({ data, result });
24
- }
25
- }
26
- exports.default = Convert;
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { bytesCoderMap, bytesCoderTypes } from "@agrozyme/crypto/base/map";
3
+ //#region src/commands/convert.ts
4
+ var Convert = class Convert extends Command {
5
+ static description = "convert string to other format";
6
+ static examples = ["<%= config.bin %> <%= command.id %>"];
7
+ static flags = {
8
+ data: Flags.string({ required: true }),
9
+ from: Flags.string({
10
+ options: bytesCoderTypes,
11
+ default: "hex"
12
+ }),
13
+ to: Flags.string({
14
+ options: bytesCoderTypes,
15
+ default: "hex"
16
+ })
17
+ };
18
+ static args = {};
19
+ async run() {
20
+ const { args, flags } = await this.parse(Convert);
21
+ const { data, from, to } = flags;
22
+ const fromConveter = bytesCoderMap[from];
23
+ const toConveter = bytesCoderMap[to];
24
+ const items = fromConveter.decode(data);
25
+ const result = toConveter.encode(items);
26
+ console.info(`Convert data form ${from} to ${to}:`);
27
+ console.dir({
28
+ data,
29
+ result
30
+ });
31
+ }
32
+ };
33
+ //#endregion
34
+ export { Convert as default };
@@ -1,12 +1,17 @@
1
- import { Command } from '@oclif/core';
2
- export default class Make extends Command {
3
- static description: string;
4
- static examples: string[];
5
- static flags: {
6
- curve: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
- format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
- count: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
9
- };
10
- static args: {};
11
- run(): Promise<void>;
1
+ import { Command } from "@oclif/core";
2
+ import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
3
+
4
+ //#region src/commands/make.d.ts
5
+ declare class Make extends Command {
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ curve: _$_oclif_core_interfaces0.OptionFlag<string, _$_oclif_core_interfaces0.CustomOptions>;
10
+ format: _$_oclif_core_interfaces0.OptionFlag<string, _$_oclif_core_interfaces0.CustomOptions>;
11
+ count: _$_oclif_core_interfaces0.OptionFlag<number, _$_oclif_core_interfaces0.CustomOptions>;
12
+ };
13
+ static args: {};
14
+ run(): Promise<void>;
12
15
  }
16
+ //#endregion
17
+ export { Make as default };
@@ -1,30 +1,42 @@
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 Make extends core_1.Command {
7
- static description = 'make elliptic curve key pair';
8
- static examples = ['<%= config.bin %> <%= command.id %>'];
9
- static flags = {
10
- curve: core_1.Flags.string({ required: true, options: types_1.curveKeys }),
11
- format: core_1.Flags.string({ options: types_1.bytesCoderKeys, default: 'hex' }),
12
- count: core_1.Flags.integer({ min: 1, default: 1 }),
13
- };
14
- static args = {};
15
- async run() {
16
- const { args, flags } = await this.parse(Make);
17
- const curve = crypto_1.curveMap[flags.curve];
18
- const keyConveter = crypto_1.bytesCoderMap[flags.format];
19
- const items = [];
20
- for (let index = 0; index < flags.count; index++) {
21
- const privateKey = curve.randomPrivateKey();
22
- const publicKey = curve.getPublicKey(privateKey, true);
23
- const item = { privateKey: keyConveter.encode(privateKey), publicKey: keyConveter.encode(publicKey) };
24
- items.push(item);
25
- }
26
- console.log(`make ${flags.curve} curve ${flags.count} keypair(s) with ${flags.format} format:`);
27
- console.dir(items);
28
- }
29
- }
30
- exports.default = Make;
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { bytesCoderMap, bytesCoderTypes } from "@agrozyme/crypto/base/map";
3
+ import { curveMap, curveTypes } from "@agrozyme/crypto/curves/map";
4
+ //#region src/commands/make.ts
5
+ var Make = class Make extends Command {
6
+ static description = "make elliptic curve key pair";
7
+ static examples = ["<%= config.bin %> <%= command.id %>"];
8
+ static flags = {
9
+ curve: Flags.string({
10
+ required: true,
11
+ options: curveTypes
12
+ }),
13
+ format: Flags.string({
14
+ options: bytesCoderTypes,
15
+ default: "hex"
16
+ }),
17
+ count: Flags.integer({
18
+ min: 1,
19
+ default: 1
20
+ })
21
+ };
22
+ static args = {};
23
+ async run() {
24
+ const { args, flags } = await this.parse(Make);
25
+ const curve = curveMap[flags.curve];
26
+ const keyConveter = bytesCoderMap[flags.format];
27
+ const items = [];
28
+ for (let index = 0; index < flags.count; index++) {
29
+ const privateKey = curve.randomPrivateKey();
30
+ const publicKey = curve.getPublicKey(privateKey, true);
31
+ const item = {
32
+ privateKey: keyConveter.encode(privateKey),
33
+ publicKey: keyConveter.encode(publicKey)
34
+ };
35
+ items.push(item);
36
+ }
37
+ console.log(`make ${flags.curve} curve ${flags.count} keypair(s) with ${flags.format} format:`);
38
+ console.dir(items);
39
+ }
40
+ };
41
+ //#endregion
42
+ export { Make as default };
@@ -1,12 +1,17 @@
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>;
1
+ import { Command } from "@oclif/core";
2
+ import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
3
+
4
+ //#region src/commands/pair.d.ts
5
+ declare class Pair extends Command {
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ data: _$_oclif_core_interfaces0.OptionFlag<string, _$_oclif_core_interfaces0.CustomOptions>;
10
+ curve: _$_oclif_core_interfaces0.OptionFlag<string, _$_oclif_core_interfaces0.CustomOptions>;
11
+ format: _$_oclif_core_interfaces0.OptionFlag<string, _$_oclif_core_interfaces0.CustomOptions>;
12
+ };
13
+ static args: {};
14
+ run(): Promise<void>;
12
15
  }
16
+ //#endregion
17
+ export { Pair as default };
@@ -1,26 +1,35 @@
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;
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { bytesCoderMap, bytesCoderTypes } from "@agrozyme/crypto/base/map";
3
+ import { curveMap, curveTypes } from "@agrozyme/crypto/curves/map";
4
+ //#region src/commands/pair.ts
5
+ var Pair = class Pair extends Command {
6
+ static description = "convert key pair to other format";
7
+ static examples = ["<%= config.bin %> <%= command.id %>"];
8
+ static flags = {
9
+ data: Flags.string({ required: true }),
10
+ curve: Flags.string({
11
+ required: true,
12
+ options: curveTypes
13
+ }),
14
+ format: Flags.string({
15
+ options: bytesCoderTypes,
16
+ default: "hex"
17
+ })
18
+ };
19
+ static args = {};
20
+ async run() {
21
+ const { args, flags } = await this.parse(Pair);
22
+ const { data, format } = flags;
23
+ const curve = curveMap[flags.curve];
24
+ const keyConveter = bytesCoderMap[format];
25
+ const privateKey = keyConveter.decode(data);
26
+ const publicKey = curve.getPublicKey(privateKey, true);
27
+ const item = {
28
+ privateKey: keyConveter.encode(privateKey),
29
+ publicKey: keyConveter.encode(publicKey)
30
+ };
31
+ console.dir(item);
32
+ }
33
+ };
34
+ //#endregion
35
+ export { Pair as default };
@@ -1,9 +1,13 @@
1
- import { Command } from '@oclif/core';
2
- export default class Test extends Command {
3
- static hidden: boolean;
4
- static description: string;
5
- static examples: string[];
6
- static flags: {};
7
- static args: {};
8
- run(): Promise<void>;
1
+ import { Command } from "@oclif/core";
2
+
3
+ //#region src/commands/test.d.ts
4
+ declare class Test extends Command {
5
+ static hidden: boolean;
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {};
9
+ static args: {};
10
+ run(): Promise<void>;
9
11
  }
12
+ //#endregion
13
+ export { Test as default };
@@ -1,26 +1,19 @@
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
- class Test extends core_1.Command {
6
- static hidden = true;
7
- static description = 'test the command here';
8
- static examples = ['<%= config.bin %> <%= command.id %>'];
9
- static flags = {};
10
- static args = {};
11
- async run() {
12
- const { args, flags } = await this.parse(Test);
13
- const curve = crypto_1.curveMap['ed25519'];
14
- const privateKey = curve.randomPrivateKey();
15
- const publicKey = curve.getPublicKey(privateKey, false);
16
- console.dir(publicKey.length);
17
- // const data: Record<string, number> = {};
18
- // Object.keys(curveMap).forEach((name) => {
19
- // const curve = curveMap[name];
20
- // data[name] = curve.randomPrivateKey().length;
21
- // });
22
- //
23
- // console.dir(data, { depth: 0 });
24
- }
25
- }
26
- exports.default = Test;
1
+ import { Command } from "@oclif/core";
2
+ import { curveMap } from "@agrozyme/crypto/curves/map";
3
+ //#region src/commands/test.ts
4
+ var Test = class Test extends Command {
5
+ static hidden = true;
6
+ static description = "test the command here";
7
+ static examples = ["<%= config.bin %> <%= command.id %>"];
8
+ static flags = {};
9
+ static args = {};
10
+ async run() {
11
+ const { args, flags } = await this.parse(Test);
12
+ const curve = curveMap["ed25519"];
13
+ const privateKey = curve.randomPrivateKey();
14
+ const publicKey = curve.getPublicKey(privateKey, false);
15
+ console.dir(publicKey.length);
16
+ }
17
+ };
18
+ //#endregion
19
+ export { Test as default };
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export { run } from '@oclif/core';
1
+ import { run } from "@oclif/core";
2
+ export { run };
package/dist/index.js CHANGED
@@ -1,5 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.run = void 0;
4
- var core_1 = require("@oclif/core");
5
- Object.defineProperty(exports, "run", { enumerable: true, get: function () { return core_1.run; } });
1
+ import { run } from "@oclif/core";
2
+ export { run };
@@ -23,18 +23,21 @@
23
23
  "options": [
24
24
  "base16",
25
25
  "base32",
26
- "base32crockford",
26
+ "base32nopad",
27
27
  "base32hex",
28
- "base58",
29
- "base58flickr",
30
- "base58xmr",
31
- "base58xrp",
28
+ "base32hexnopad",
29
+ "base32crockford",
32
30
  "base64",
31
+ "base64nopad",
33
32
  "base64url",
34
33
  "base64urlnopad",
35
- "hex",
34
+ "base58",
35
+ "base58flickr",
36
+ "base58xrp",
37
+ "base58xmr",
38
+ "base58check",
36
39
  "utf8",
37
- "base58check"
40
+ "hex"
38
41
  ],
39
42
  "type": "option"
40
43
  },
@@ -46,18 +49,21 @@
46
49
  "options": [
47
50
  "base16",
48
51
  "base32",
49
- "base32crockford",
52
+ "base32nopad",
50
53
  "base32hex",
51
- "base58",
52
- "base58flickr",
53
- "base58xmr",
54
- "base58xrp",
54
+ "base32hexnopad",
55
+ "base32crockford",
55
56
  "base64",
57
+ "base64nopad",
56
58
  "base64url",
57
59
  "base64urlnopad",
58
- "hex",
60
+ "base58",
61
+ "base58flickr",
62
+ "base58xrp",
63
+ "base58xmr",
64
+ "base58check",
59
65
  "utf8",
60
- "base58check"
66
+ "hex"
61
67
  ],
62
68
  "type": "option"
63
69
  }
@@ -70,7 +76,7 @@
70
76
  "pluginType": "core",
71
77
  "strict": true,
72
78
  "enableJsonFlag": false,
73
- "isESM": false,
79
+ "isESM": true,
74
80
  "relativePath": [
75
81
  "dist",
76
82
  "commands",
@@ -92,6 +98,8 @@
92
98
  "multiple": false,
93
99
  "options": [
94
100
  "bls12_381",
101
+ "bls12_381_Short",
102
+ "bls12_381_Long",
95
103
  "bn254",
96
104
  "ed448",
97
105
  "ed448ph",
@@ -100,14 +108,15 @@
100
108
  "ed25519ph",
101
109
  "jubjub",
102
110
  "babyjubjub",
111
+ "brainpoolP256r1",
112
+ "brainpoolP384r1",
113
+ "brainpoolP512r1",
103
114
  "p256",
104
115
  "secp256r1",
105
116
  "p384",
106
117
  "secp384r1",
107
118
  "p521",
108
119
  "secp521r1",
109
- "pallas",
110
- "vesta",
111
120
  "schnorr",
112
121
  "secp256k1"
113
122
  ],
@@ -121,18 +130,21 @@
121
130
  "options": [
122
131
  "base16",
123
132
  "base32",
124
- "base32crockford",
133
+ "base32nopad",
125
134
  "base32hex",
126
- "base58",
127
- "base58flickr",
128
- "base58xmr",
129
- "base58xrp",
135
+ "base32hexnopad",
136
+ "base32crockford",
130
137
  "base64",
138
+ "base64nopad",
131
139
  "base64url",
132
140
  "base64urlnopad",
133
- "hex",
141
+ "base58",
142
+ "base58flickr",
143
+ "base58xrp",
144
+ "base58xmr",
145
+ "base58check",
134
146
  "utf8",
135
- "base58check"
147
+ "hex"
136
148
  ],
137
149
  "type": "option"
138
150
  },
@@ -152,7 +164,7 @@
152
164
  "pluginType": "core",
153
165
  "strict": true,
154
166
  "enableJsonFlag": false,
155
- "isESM": false,
167
+ "isESM": true,
156
168
  "relativePath": [
157
169
  "dist",
158
170
  "commands",
@@ -181,6 +193,8 @@
181
193
  "multiple": false,
182
194
  "options": [
183
195
  "bls12_381",
196
+ "bls12_381_Short",
197
+ "bls12_381_Long",
184
198
  "bn254",
185
199
  "ed448",
186
200
  "ed448ph",
@@ -189,14 +203,15 @@
189
203
  "ed25519ph",
190
204
  "jubjub",
191
205
  "babyjubjub",
206
+ "brainpoolP256r1",
207
+ "brainpoolP384r1",
208
+ "brainpoolP512r1",
192
209
  "p256",
193
210
  "secp256r1",
194
211
  "p384",
195
212
  "secp384r1",
196
213
  "p521",
197
214
  "secp521r1",
198
- "pallas",
199
- "vesta",
200
215
  "schnorr",
201
216
  "secp256k1"
202
217
  ],
@@ -210,18 +225,21 @@
210
225
  "options": [
211
226
  "base16",
212
227
  "base32",
213
- "base32crockford",
228
+ "base32nopad",
214
229
  "base32hex",
215
- "base58",
216
- "base58flickr",
217
- "base58xmr",
218
- "base58xrp",
230
+ "base32hexnopad",
231
+ "base32crockford",
219
232
  "base64",
233
+ "base64nopad",
220
234
  "base64url",
221
235
  "base64urlnopad",
222
- "hex",
236
+ "base58",
237
+ "base58flickr",
238
+ "base58xrp",
239
+ "base58xmr",
240
+ "base58check",
223
241
  "utf8",
224
- "base58check"
242
+ "hex"
225
243
  ],
226
244
  "type": "option"
227
245
  }
@@ -234,7 +252,7 @@
234
252
  "pluginType": "core",
235
253
  "strict": true,
236
254
  "enableJsonFlag": false,
237
- "isESM": false,
255
+ "isESM": true,
238
256
  "relativePath": [
239
257
  "dist",
240
258
  "commands",
@@ -258,7 +276,7 @@
258
276
  "pluginType": "core",
259
277
  "strict": true,
260
278
  "enableJsonFlag": false,
261
- "isESM": false,
279
+ "isESM": true,
262
280
  "relativePath": [
263
281
  "dist",
264
282
  "commands",
@@ -266,5 +284,5 @@
266
284
  ]
267
285
  }
268
286
  },
269
- "version": "0.0.6"
287
+ "version": "1.0.1"
270
288
  }
package/package.json CHANGED
@@ -1,79 +1,76 @@
1
1
  {
2
2
  "name": "@agrozyme/eckey",
3
- "version": "0.0.6",
3
+ "version": "1.0.1",
4
4
  "description": "Elliptic Curve Key CLI",
5
- "author": "",
6
- "bin": {
7
- "eckey": "./bin/run"
8
- },
9
- "repository": "https://gitlab.com/agrozyme-package/TypeScript/eckey.git",
5
+ "keywords": [
6
+ "oclif"
7
+ ],
10
8
  "homepage": "https://gitlab.com/agrozyme-package/TypeScript/eckey",
9
+ "repository": "https://gitlab.com/agrozyme-package/TypeScript/eckey.git",
11
10
  "license": "MIT",
11
+ "author": "",
12
+ "type": "module",
12
13
  "main": "dist/index.js",
14
+ "types": "dist/index.d.ts",
15
+ "bin": {
16
+ "eckey": "./bin/run.js"
17
+ },
13
18
  "files": [
14
- "/bin",
15
- "/dist",
16
- "/npm-shrinkwrap.json",
17
- "/oclif.manifest.json"
19
+ "./bin",
20
+ "./dist",
21
+ "./oclif.manifest.json"
18
22
  ],
23
+ "oclif": {
24
+ "bin": "eckey",
25
+ "commands": "./dist/commands",
26
+ "dirname": "eckey",
27
+ "plugins": [
28
+ "@oclif/plugin-help"
29
+ ],
30
+ "topicSeparator": ":"
31
+ },
19
32
  "dependencies": {
20
- "@agrozyme/crypto": "^1.0.13",
21
- "@oclif/core": "^4.10.5",
22
- "@oclif/plugin-help": "^6.2.43",
23
- "@oclif/plugin-plugins": "^5.4.59",
24
- "rambdax": "^11.3.1"
33
+ "@agrozyme/crypto": "^2.0.5",
34
+ "@oclif/core": "^4.11.0",
35
+ "@oclif/plugin-help": "^6.2.46",
36
+ "@oclif/plugin-plugins": "^5.4.63",
37
+ "tslib": "^2.8.1"
25
38
  },
26
39
  "devDependencies": {
40
+ "@arethetypeswrong/core": "^0.18.2",
27
41
  "@oclif/test": "^4.1.18",
28
- "@rstest/core": "^0.9.6",
29
42
  "@types/chai": "^5.2.3",
30
- "@types/node": "^18.19.130",
43
+ "@types/node": "^22.19.17",
44
+ "@yao-pkg/pkg": "^6.19.0",
31
45
  "chai": "^6.2.2",
32
46
  "oclif": "^4.23.0",
33
- "pkg": "^5.8.1",
47
+ "publint": "^0.3.19",
34
48
  "shx": "^0.4.0",
35
49
  "ts-node": "^10.9.2",
36
- "tslib": "^2.8.1",
37
- "typescript": "^6.0.2",
50
+ "tsdown": "^0.21.10",
51
+ "typescript": "^6.0.3",
52
+ "vitest": "^4.1.5",
38
53
  "yarpm": "^1.2.0"
39
54
  },
40
- "oclif": {
41
- "bin": "eckey",
42
- "dirname": "eckey",
43
- "commands": "./dist/commands",
44
- "plugins": [
45
- "@oclif/plugin-help"
46
- ],
47
- "topicSeparator": ":"
55
+ "engines": {
56
+ "node": ">=22"
48
57
  },
49
58
  "pkg": {
50
59
  "scripts": "dist/**/*.js",
51
60
  "assets": "assets/**/*",
52
61
  "outputPath": "package",
53
62
  "targets": [
54
- "node18-win",
55
- "node18-linux",
56
- "node18-macos"
63
+ "node22-win",
64
+ "node22-macos",
65
+ "node22-linux"
57
66
  ]
58
67
  },
59
- "engines": {
60
- "node": ">=18"
61
- },
62
- "keywords": [
63
- "oclif"
64
- ],
65
- "types": "dist/index.d.ts",
66
68
  "scripts": {
67
- "clean": "shx rm -rf dist/ tmp/ package/ && shx rm -f *-debug.log *-error.log .*-debug.log .*-error.log *.tsbuildinfo *.manifest.json",
68
- "clean:pack": "shx rm -f *.tgz npm-shrinkwrap.json",
69
- "clean:lock": "shx rm -f package-lock.json yarn.lock pnpm-lock.yaml",
70
- "clean:all": "yarpm run clean && yarpm run clean:pack && yarpm run clean:lock",
71
- "build": "yarpm run clean && tsc --build --force && shx cp -R ./src/assets ./dist",
72
- "test": "rstest",
73
- "oclif:readme": "yarpm run build && oclif readme",
74
- "oclif:pack": "yarn generate-lock-entry > yarn.lock && oclif pack",
75
- "package": "yarpm run build && pkg --no-bytecode --public --public-packages=* --compress=GZip .",
69
+ "build": "yarpm run clean && tsdown && shx cp -R ./src/assets ./dist && oclif readme",
70
+ "clean": "shx rm -rf dist/ tmp/ package/ && shx rm -f *-debug.log *.log *.tsbuildinfo *.manifest.json",
76
71
  "dev": "node ./bin/dev",
77
- "start": "node ./bin/run"
72
+ "package": "yarpm run build && pkg --no-bytecode --public --public-packages=* --compress=Zstd .",
73
+ "start": "node ./bin/run",
74
+ "test": "vitest run"
78
75
  }
79
76
  }
package/bin/dev DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const oclif = require('@oclif/core')
4
-
5
- const path = require('path')
6
- const project = path.join(__dirname, '..', 'tsconfig.json')
7
-
8
- // In dev mode -> use ts-node and dev plugins
9
- process.env.NODE_ENV = 'development'
10
-
11
- require('ts-node').register({project})
12
-
13
- // In dev mode, always show stack traces
14
- oclif.settings.debug = true;
15
-
16
- // Start the CLI
17
- oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
package/bin/run DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const oclif = require('@oclif/core')
4
-
5
- oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))
package/dist/types.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const bytesCoderKeys: ("base16" | "base32" | "base32crockford" | "base32hex" | "base58" | "base58flickr" | "base58xmr" | "base58xrp" | "base64" | "base64url" | "base64urlnopad" | "hex" | "utf8" | "base58check")[];
2
- export declare const curveKeys: ("bls12_381" | "bn254" | "ed448" | "ed448ph" | "ed25519" | "ed25519ctx" | "ed25519ph" | "jubjub" | "babyjubjub" | "p256" | "secp256r1" | "p384" | "secp384r1" | "p521" | "secp521r1" | "pallas" | "vesta" | "schnorr" | "secp256k1")[];
package/dist/types.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.curveKeys = exports.bytesCoderKeys = void 0;
4
- const crypto_1 = require("@agrozyme/crypto");
5
- const rambdax_1 = require("rambdax");
6
- exports.bytesCoderKeys = (0, rambdax_1.keys)(crypto_1.bytesCoderMap);
7
- exports.curveKeys = (0, rambdax_1.keys)(crypto_1.curveMap);