polkadot-cli 0.6.0 → 0.6.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 +14 -4
- package/dist/cli.mjs +952 -920
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -39,6 +39,8 @@ dot chain remove westend
|
|
|
39
39
|
|
|
40
40
|
Dev accounts (Alice, Bob, Charlie, Dave, Eve, Ferdie) are always available for testnets. Create or import your own accounts for any chain.
|
|
41
41
|
|
|
42
|
+
> **Security warning:** Account secrets (mnemonics and seeds) are currently stored **unencrypted** in `~/.polkadot/accounts.json`. Do not use this for high-value accounts on mainnet. Encrypted storage is planned for a future release.
|
|
43
|
+
|
|
42
44
|
```bash
|
|
43
45
|
# List all accounts (dev + stored)
|
|
44
46
|
dot account list
|
|
@@ -49,13 +51,19 @@ dot account create my-validator
|
|
|
49
51
|
# Import from a BIP39 mnemonic
|
|
50
52
|
dot account import treasury --secret "word1 word2 ... word12"
|
|
51
53
|
|
|
52
|
-
# Import from a hex seed
|
|
53
|
-
dot account import raw-key --secret 0xabcdef...
|
|
54
|
-
|
|
55
54
|
# Remove an account
|
|
56
55
|
dot account remove my-validator
|
|
57
56
|
```
|
|
58
57
|
|
|
58
|
+
**Supported secret formats for import:**
|
|
59
|
+
|
|
60
|
+
| Format | Example | Status |
|
|
61
|
+
|--------|---------|--------|
|
|
62
|
+
| BIP39 mnemonic (12/24 words) | `"abandon abandon ... about"` | Supported |
|
|
63
|
+
| Hex seed (`0x` + 64 hex chars) | `0xabcdef0123...` | Not supported via CLI (see below) |
|
|
64
|
+
|
|
65
|
+
**Known limitation:** Hex seed import (`--secret 0x...`) does not work from the command line. The CLI argument parser (`cac`) interprets `0x`-prefixed values as JavaScript numbers, which loses precision for 32-byte seeds. Use a BIP39 mnemonic instead. If you need to import a raw seed programmatically, write it directly to `~/.polkadot/accounts.json`.
|
|
66
|
+
|
|
59
67
|
### Query storage
|
|
60
68
|
|
|
61
69
|
```bash
|
|
@@ -209,12 +217,14 @@ Config and metadata caches live in `~/.polkadot/`:
|
|
|
209
217
|
```
|
|
210
218
|
~/.polkadot/
|
|
211
219
|
├── config.json # chains and default chain
|
|
212
|
-
├── accounts.json # stored accounts (secrets
|
|
220
|
+
├── accounts.json # stored accounts (⚠️ secrets are NOT encrypted — see below)
|
|
213
221
|
└── chains/
|
|
214
222
|
└── polkadot/
|
|
215
223
|
└── metadata.bin # cached SCALE-encoded metadata
|
|
216
224
|
```
|
|
217
225
|
|
|
226
|
+
> **Warning:** `accounts.json` stores secrets (mnemonics and seeds) in **plain text**. Encrypted-at-rest storage is planned but not yet implemented. Keep appropriate file permissions (`chmod 600 ~/.polkadot/accounts.json`) and do not use this for high-value mainnet accounts.
|
|
227
|
+
|
|
218
228
|
## Development
|
|
219
229
|
|
|
220
230
|
Requires [Bun](https://bun.sh).
|