@agrozyme/eckey 0.0.5 → 1.0.0
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 +27 -27
- package/bin/dev.cmd +1 -2
- package/bin/dev.js +5 -0
- package/bin/run.cmd +0 -1
- package/bin/run.js +5 -0
- package/dist/commands/convert.d.ts +16 -11
- package/dist/commands/convert.js +34 -26
- package/dist/commands/make.d.ts +16 -11
- package/dist/commands/make.js +42 -30
- package/dist/commands/pair.d.ts +16 -11
- package/dist/commands/pair.js +35 -26
- package/dist/commands/test.d.ts +12 -8
- package/dist/commands/test.js +19 -26
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -5
- package/oclif.manifest.json +25 -23
- package/package.json +48 -52
- package/bin/dev +0 -17
- package/bin/run +0 -5
- package/dist/types.d.ts +0 -2
- package/dist/types.js +0 -7
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
|
|
16
|
+
@agrozyme/eckey/1.0.0 win32-x64 node-v25.9.0
|
|
17
17
|
$ eckey --help [COMMAND]
|
|
18
18
|
USAGE
|
|
19
19
|
$ eckey COMMAND
|
|
@@ -36,18 +36,18 @@ convert string to other format
|
|
|
36
36
|
```
|
|
37
37
|
USAGE
|
|
38
38
|
$ eckey convert --data <value> [--from
|
|
39
|
-
base16|base32|base32crockford|base32hex|base58|
|
|
40
|
-
|
|
41
|
-
|
|
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]
|
|
42
42
|
|
|
43
43
|
FLAGS
|
|
44
44
|
--data=<value> (required)
|
|
45
45
|
--from=<option> [default: hex]
|
|
46
|
-
<options: base16|base32|base32crockford|base32hex|base58|
|
|
47
|
-
|
|
|
46
|
+
<options: base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr|base58xrp|base64|base
|
|
47
|
+
64url|base64urlnopad|hex|utf8|base58check>
|
|
48
48
|
--to=<option> [default: hex]
|
|
49
|
-
<options: base16|base32|base32crockford|base32hex|base58|
|
|
50
|
-
|
|
|
49
|
+
<options: base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr|base58xrp|base64|base
|
|
50
|
+
64url|base64urlnopad|hex|utf8|base58check>
|
|
51
51
|
|
|
52
52
|
DESCRIPTION
|
|
53
53
|
convert string to other format
|
|
@@ -56,7 +56,7 @@ EXAMPLES
|
|
|
56
56
|
$ eckey convert
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
_See code: [src/commands/convert.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/
|
|
59
|
+
_See code: [src/commands/convert.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v1.0.0/src/commands/convert.ts)_
|
|
60
60
|
|
|
61
61
|
## `eckey help [COMMAND]`
|
|
62
62
|
|
|
@@ -67,7 +67,7 @@ USAGE
|
|
|
67
67
|
$ eckey help [COMMAND...] [-n]
|
|
68
68
|
|
|
69
69
|
ARGUMENTS
|
|
70
|
-
COMMAND... Command to show help for.
|
|
70
|
+
[COMMAND...] Command to show help for.
|
|
71
71
|
|
|
72
72
|
FLAGS
|
|
73
73
|
-n, --nested-commands Include all nested commands in the output.
|
|
@@ -76,7 +76,7 @@ DESCRIPTION
|
|
|
76
76
|
Display help for eckey.
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/
|
|
79
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.44/src/commands/help.ts)_
|
|
80
80
|
|
|
81
81
|
## `eckey make`
|
|
82
82
|
|
|
@@ -85,18 +85,18 @@ make elliptic curve key pair
|
|
|
85
85
|
```
|
|
86
86
|
USAGE
|
|
87
87
|
$ eckey make --curve
|
|
88
|
-
bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|p256|p384|p521|
|
|
89
|
-
|
|
90
|
-
|
|
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>]
|
|
91
91
|
|
|
92
92
|
FLAGS
|
|
93
93
|
--count=<value> [default: 1]
|
|
94
94
|
--curve=<option> (required)
|
|
95
|
-
<options: bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|p256|
|
|
96
|
-
|
|
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
97
|
--format=<option> [default: hex]
|
|
98
|
-
<options: base16|base32|base32crockford|base32hex|base58|
|
|
99
|
-
|
|
98
|
+
<options: base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr|base58xrp|base64|ba
|
|
99
|
+
se64url|base64urlnopad|hex|utf8|base58check>
|
|
100
100
|
|
|
101
101
|
DESCRIPTION
|
|
102
102
|
make elliptic curve key pair
|
|
@@ -105,7 +105,7 @@ EXAMPLES
|
|
|
105
105
|
$ eckey make
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
_See code: [src/commands/make.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/
|
|
108
|
+
_See code: [src/commands/make.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v1.0.0/src/commands/make.ts)_
|
|
109
109
|
|
|
110
110
|
## `eckey pair`
|
|
111
111
|
|
|
@@ -114,18 +114,18 @@ convert key pair to other format
|
|
|
114
114
|
```
|
|
115
115
|
USAGE
|
|
116
116
|
$ eckey pair --data <value> --curve
|
|
117
|
-
bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|p256|p384|p521|
|
|
118
|
-
|
|
119
|
-
|
|
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
120
|
|
|
121
121
|
FLAGS
|
|
122
122
|
--curve=<option> (required)
|
|
123
|
-
<options: bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|p256|
|
|
124
|
-
|
|
123
|
+
<options: bls12_381|bn254|ed448|ed448ph|ed25519|ed25519ctx|ed25519ph|jubjub|babyjubjub|p256|secp256
|
|
124
|
+
r1|p384|secp384r1|p521|secp521r1|pallas|vesta|schnorr|secp256k1>
|
|
125
125
|
--data=<value> (required)
|
|
126
126
|
--format=<option> [default: hex]
|
|
127
|
-
<options: base16|base32|base32crockford|base32hex|base58|
|
|
128
|
-
|
|
127
|
+
<options: base16|base32|base32crockford|base32hex|base58|base58flickr|base58xmr|base58xrp|base64|ba
|
|
128
|
+
se64url|base64urlnopad|hex|utf8|base58check>
|
|
129
129
|
|
|
130
130
|
DESCRIPTION
|
|
131
131
|
convert key pair to other format
|
|
@@ -134,5 +134,5 @@ EXAMPLES
|
|
|
134
134
|
$ eckey pair
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
_See code: [src/commands/pair.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/
|
|
137
|
+
_See code: [src/commands/pair.ts](https://gitlab.com/agrozyme-package/TypeScript/eckey/blob/v1.0.0/src/commands/pair.ts)_
|
|
138
138
|
<!-- commandsstop -->
|
package/bin/dev.cmd
CHANGED
package/bin/dev.js
ADDED
package/bin/run.cmd
CHANGED
package/bin/run.js
ADDED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { Command } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 };
|
package/dist/commands/convert.js
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
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
|
-
|
|
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 };
|
package/dist/commands/make.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { Command } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 };
|
package/dist/commands/make.js
CHANGED
|
@@ -1,30 +1,42 @@
|
|
|
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
|
-
|
|
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 };
|
package/dist/commands/pair.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { Command } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 };
|
package/dist/commands/pair.js
CHANGED
|
@@ -1,26 +1,35 @@
|
|
|
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
|
-
|
|
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 };
|
package/dist/commands/test.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { Command } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 };
|
package/dist/commands/test.js
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
1
|
+
import { run } from "@oclif/core";
|
|
2
|
+
export { run };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 };
|
package/oclif.manifest.json
CHANGED
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"base32crockford",
|
|
27
27
|
"base32hex",
|
|
28
28
|
"base58",
|
|
29
|
-
"base58check",
|
|
30
29
|
"base58flickr",
|
|
31
30
|
"base58xmr",
|
|
32
31
|
"base58xrp",
|
|
@@ -34,7 +33,8 @@
|
|
|
34
33
|
"base64url",
|
|
35
34
|
"base64urlnopad",
|
|
36
35
|
"hex",
|
|
37
|
-
"utf8"
|
|
36
|
+
"utf8",
|
|
37
|
+
"base58check"
|
|
38
38
|
],
|
|
39
39
|
"type": "option"
|
|
40
40
|
},
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"base32crockford",
|
|
50
50
|
"base32hex",
|
|
51
51
|
"base58",
|
|
52
|
-
"base58check",
|
|
53
52
|
"base58flickr",
|
|
54
53
|
"base58xmr",
|
|
55
54
|
"base58xrp",
|
|
@@ -57,7 +56,8 @@
|
|
|
57
56
|
"base64url",
|
|
58
57
|
"base64urlnopad",
|
|
59
58
|
"hex",
|
|
60
|
-
"utf8"
|
|
59
|
+
"utf8",
|
|
60
|
+
"base58check"
|
|
61
61
|
],
|
|
62
62
|
"type": "option"
|
|
63
63
|
}
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"pluginType": "core",
|
|
71
71
|
"strict": true,
|
|
72
72
|
"enableJsonFlag": false,
|
|
73
|
-
"isESM":
|
|
73
|
+
"isESM": true,
|
|
74
74
|
"relativePath": [
|
|
75
75
|
"dist",
|
|
76
76
|
"commands",
|
|
@@ -99,16 +99,17 @@
|
|
|
99
99
|
"ed25519ctx",
|
|
100
100
|
"ed25519ph",
|
|
101
101
|
"jubjub",
|
|
102
|
+
"babyjubjub",
|
|
102
103
|
"p256",
|
|
104
|
+
"secp256r1",
|
|
103
105
|
"p384",
|
|
106
|
+
"secp384r1",
|
|
104
107
|
"p521",
|
|
108
|
+
"secp521r1",
|
|
105
109
|
"pallas",
|
|
110
|
+
"vesta",
|
|
106
111
|
"schnorr",
|
|
107
|
-
"secp256k1"
|
|
108
|
-
"secp256r1",
|
|
109
|
-
"secp384r1",
|
|
110
|
-
"secp521r1",
|
|
111
|
-
"vesta"
|
|
112
|
+
"secp256k1"
|
|
112
113
|
],
|
|
113
114
|
"type": "option"
|
|
114
115
|
},
|
|
@@ -123,7 +124,6 @@
|
|
|
123
124
|
"base32crockford",
|
|
124
125
|
"base32hex",
|
|
125
126
|
"base58",
|
|
126
|
-
"base58check",
|
|
127
127
|
"base58flickr",
|
|
128
128
|
"base58xmr",
|
|
129
129
|
"base58xrp",
|
|
@@ -131,7 +131,8 @@
|
|
|
131
131
|
"base64url",
|
|
132
132
|
"base64urlnopad",
|
|
133
133
|
"hex",
|
|
134
|
-
"utf8"
|
|
134
|
+
"utf8",
|
|
135
|
+
"base58check"
|
|
135
136
|
],
|
|
136
137
|
"type": "option"
|
|
137
138
|
},
|
|
@@ -151,7 +152,7 @@
|
|
|
151
152
|
"pluginType": "core",
|
|
152
153
|
"strict": true,
|
|
153
154
|
"enableJsonFlag": false,
|
|
154
|
-
"isESM":
|
|
155
|
+
"isESM": true,
|
|
155
156
|
"relativePath": [
|
|
156
157
|
"dist",
|
|
157
158
|
"commands",
|
|
@@ -187,16 +188,17 @@
|
|
|
187
188
|
"ed25519ctx",
|
|
188
189
|
"ed25519ph",
|
|
189
190
|
"jubjub",
|
|
191
|
+
"babyjubjub",
|
|
190
192
|
"p256",
|
|
193
|
+
"secp256r1",
|
|
191
194
|
"p384",
|
|
195
|
+
"secp384r1",
|
|
192
196
|
"p521",
|
|
197
|
+
"secp521r1",
|
|
193
198
|
"pallas",
|
|
199
|
+
"vesta",
|
|
194
200
|
"schnorr",
|
|
195
|
-
"secp256k1"
|
|
196
|
-
"secp256r1",
|
|
197
|
-
"secp384r1",
|
|
198
|
-
"secp521r1",
|
|
199
|
-
"vesta"
|
|
201
|
+
"secp256k1"
|
|
200
202
|
],
|
|
201
203
|
"type": "option"
|
|
202
204
|
},
|
|
@@ -211,7 +213,6 @@
|
|
|
211
213
|
"base32crockford",
|
|
212
214
|
"base32hex",
|
|
213
215
|
"base58",
|
|
214
|
-
"base58check",
|
|
215
216
|
"base58flickr",
|
|
216
217
|
"base58xmr",
|
|
217
218
|
"base58xrp",
|
|
@@ -219,7 +220,8 @@
|
|
|
219
220
|
"base64url",
|
|
220
221
|
"base64urlnopad",
|
|
221
222
|
"hex",
|
|
222
|
-
"utf8"
|
|
223
|
+
"utf8",
|
|
224
|
+
"base58check"
|
|
223
225
|
],
|
|
224
226
|
"type": "option"
|
|
225
227
|
}
|
|
@@ -232,7 +234,7 @@
|
|
|
232
234
|
"pluginType": "core",
|
|
233
235
|
"strict": true,
|
|
234
236
|
"enableJsonFlag": false,
|
|
235
|
-
"isESM":
|
|
237
|
+
"isESM": true,
|
|
236
238
|
"relativePath": [
|
|
237
239
|
"dist",
|
|
238
240
|
"commands",
|
|
@@ -256,7 +258,7 @@
|
|
|
256
258
|
"pluginType": "core",
|
|
257
259
|
"strict": true,
|
|
258
260
|
"enableJsonFlag": false,
|
|
259
|
-
"isESM":
|
|
261
|
+
"isESM": true,
|
|
260
262
|
"relativePath": [
|
|
261
263
|
"dist",
|
|
262
264
|
"commands",
|
|
@@ -264,5 +266,5 @@
|
|
|
264
266
|
]
|
|
265
267
|
}
|
|
266
268
|
},
|
|
267
|
-
"version": "0.0
|
|
269
|
+
"version": "1.0.0"
|
|
268
270
|
}
|
package/package.json
CHANGED
|
@@ -1,79 +1,75 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agrozyme/eckey",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Elliptic Curve Key CLI",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"/oclif.manifest.json"
|
|
19
|
+
"./bin",
|
|
20
|
+
"./dist",
|
|
21
|
+
"./oclif.manifest.json"
|
|
18
22
|
],
|
|
19
|
-
"dependencies": {
|
|
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
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
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
|
-
"pkg": "^5.8.1",
|
|
35
|
-
"shx": "^0.4.0",
|
|
36
|
-
"ts-node": "^10.9.2",
|
|
37
|
-
"tslib": "^2.8.1",
|
|
38
|
-
"typescript": "^5.8.3",
|
|
39
|
-
"yarpm": "^1.2.0"
|
|
40
|
-
},
|
|
41
23
|
"oclif": {
|
|
42
24
|
"bin": "eckey",
|
|
43
|
-
"dirname": "eckey",
|
|
44
25
|
"commands": "./dist/commands",
|
|
26
|
+
"dirname": "eckey",
|
|
45
27
|
"plugins": [
|
|
46
28
|
"@oclif/plugin-help"
|
|
47
29
|
],
|
|
48
30
|
"topicSeparator": ":"
|
|
49
31
|
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@agrozyme/crypto": "^1.0.16",
|
|
34
|
+
"@oclif/core": "^4.10.5",
|
|
35
|
+
"@oclif/plugin-help": "^6.2.44",
|
|
36
|
+
"@oclif/plugin-plugins": "^5.4.61",
|
|
37
|
+
"tslib": "^2.8.1"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@arethetypeswrong/core": "^0.18.2",
|
|
41
|
+
"@oclif/test": "^4.1.18",
|
|
42
|
+
"@types/chai": "^5.2.3",
|
|
43
|
+
"@types/node": "^18.19.130",
|
|
44
|
+
"@yao-pkg/pkg": "^6.18.1",
|
|
45
|
+
"chai": "^6.2.2",
|
|
46
|
+
"oclif": "^4.23.0",
|
|
47
|
+
"publint": "^0.3.18",
|
|
48
|
+
"shx": "^0.4.0",
|
|
49
|
+
"ts-node": "^10.9.2",
|
|
50
|
+
"tsdown": "^0.21.9",
|
|
51
|
+
"typescript": "^6.0.3",
|
|
52
|
+
"vitest": "^4.1.5",
|
|
53
|
+
"yarpm": "^1.2.0"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=18"
|
|
57
|
+
},
|
|
50
58
|
"pkg": {
|
|
51
59
|
"scripts": "dist/**/*.js",
|
|
52
60
|
"assets": "assets/**/*",
|
|
53
61
|
"outputPath": "package",
|
|
54
62
|
"targets": [
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
63
|
+
"node22-win",
|
|
64
|
+
"node22-macos",
|
|
65
|
+
"node22-linux"
|
|
58
66
|
]
|
|
59
67
|
},
|
|
60
|
-
"engines": {
|
|
61
|
-
"node": ">=18"
|
|
62
|
-
},
|
|
63
|
-
"keywords": [
|
|
64
|
-
"oclif"
|
|
65
|
-
],
|
|
66
|
-
"types": "dist/index.d.ts",
|
|
67
68
|
"scripts": {
|
|
68
|
-
"clean": "shx rm -rf dist/ tmp/ package/ && shx rm -f *-debug.log
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"build": "yarpm run clean && tsc --build --force && shx cp -R ./src/assets ./dist",
|
|
73
|
-
"test": "jasmine --require=ts-node/register test/**/*.ts",
|
|
74
|
-
"oclif:readme": "yarpm run build && oclif readme",
|
|
75
|
-
"oclif:pack": "yarn generate-lock-entry > yarn.lock && oclif pack",
|
|
76
|
-
"package": "yarpm run build && pkg --no-bytecode --public --public-packages=* --compress=GZip .",
|
|
69
|
+
"clean": "shx rm -rf dist/ tmp/ package/ && shx rm -f *-debug.log *.log *.tsbuildinfo *.manifest.json",
|
|
70
|
+
"build": "yarpm run clean && tsdown && shx cp -R ./src/assets ./dist && oclif readme",
|
|
71
|
+
"package": "yarpm run build && pkg --no-bytecode --public --public-packages=* --compress=Zstd .",
|
|
72
|
+
"test": "vitest run",
|
|
77
73
|
"dev": "node ./bin/dev",
|
|
78
74
|
"start": "node ./bin/run"
|
|
79
75
|
}
|
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
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" | "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);
|