@sm-lab/keys 0.2.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 +60 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +718 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.mts +61 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/io-BtF203qz.mjs +275 -0
- package/dist/io-BtF203qz.mjs.map +1 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @sm-lab/keys
|
|
2
|
+
|
|
3
|
+
Real BLS12-381 validator **deposit-data** generator for Lido SM (mainnet / hoodi).
|
|
4
|
+
Pure TypeScript — no chain, no Foundry, no external binary. Replaces `eth-staking-smith`
|
|
5
|
+
for sm-lab / consumer test suites.
|
|
6
|
+
|
|
7
|
+
Keys are EIP-2333/2334 derived from a BIP-39 mnemonic and signed against the deposit
|
|
8
|
+
domain, so they pass the CSM SDK's on-upload BLS validation.
|
|
9
|
+
|
|
10
|
+
## CLI
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
sm-keys 5 # count is positional: `5` == `--count 5`
|
|
14
|
+
sm-keys --count 5 # hoodi, 0x01 (all defaults) → JSON to stdout
|
|
15
|
+
sm-keys --chain mainnet --count 1
|
|
16
|
+
sm-keys --count 1 --type 0x02 # compounding (CM)
|
|
17
|
+
sm-keys --count 3 --mnemonic "..." # reproducible
|
|
18
|
+
sm-keys --count 2 --wc 0xCustomAddress # withdrawal address override
|
|
19
|
+
sm-keys --count 5 -o deposit_data.json # write file (mnemonic → stderr)
|
|
20
|
+
sm-keys --count 2 --json # structured JSON result to stdout (mnemonic + keys)
|
|
21
|
+
sm-keys help # mirrors --help
|
|
22
|
+
sm-keys completion fish | source # shell completion (bash | zsh | fish)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`count` is also a positional argument, so `sm-keys 2` == `sm-keys --count 2` (the positional
|
|
26
|
+
wins if both are given). `sm-keys help` mirrors `sm-keys --help`.
|
|
27
|
+
|
|
28
|
+
### FLAGS
|
|
29
|
+
|
|
30
|
+
| flag | default | notes |
|
|
31
|
+
| -------------------------- | ---------- | ---------------------------------------------------------- |
|
|
32
|
+
| `--chain <mainnet\|hoodi>` | `hoodi` | |
|
|
33
|
+
| `--count <n>` | `1` | |
|
|
34
|
+
| `--type <0x01\|0x02>` | `0x01` | `0x02` = compounding |
|
|
35
|
+
| `--mnemonic <phrase>` | random | BIP-39 (128-bit when omitted) |
|
|
36
|
+
| `--wc <address>` | Lido vault | eth1 address override |
|
|
37
|
+
| `--start-index <n>` | `0` | first validator index |
|
|
38
|
+
| `-o, --out <path>` | — | write `deposit_data.json`; else stdout |
|
|
39
|
+
| `--json` | — | emit `{ mnemonic, keys[] }` as JSON to stdout; exit 0 or 1 |
|
|
40
|
+
|
|
41
|
+
With `--json` the output is a single JSON value (`JSON.stringify`, 2-space indent) on stdout.
|
|
42
|
+
`keys` fields keep their `0x`-prefixed hex form. Errors go to stderr; exit code 1.
|
|
43
|
+
|
|
44
|
+
## TS API
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { makeDepositKeys, writeDepositDataFile } from '@sm-lab/keys';
|
|
48
|
+
|
|
49
|
+
const { mnemonic, keys } = await makeDepositKeys({ chain: 'hoodi', count: 5 });
|
|
50
|
+
writeDepositDataFile('deposit_data.json', keys);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Options
|
|
54
|
+
|
|
55
|
+
- `chain` — `'mainnet'` or `'hoodi'` (default: `'hoodi'`)
|
|
56
|
+
- `count` — number of validator keys (required)
|
|
57
|
+
- `mnemonic?` — BIP-39 seed phrase (random 128-bit if omitted)
|
|
58
|
+
- `type?` — withdrawal type: `'0x01'` (eth1, default) or `'0x02'` (compounding)
|
|
59
|
+
- `withdrawalAddress?` — override Lido vault withdrawal address
|
|
60
|
+
- `startIndex?` — first validator index (default: 0)
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|