polkadot-cli 1.5.0 → 1.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 +80 -3
- package/dist/cli.mjs +2697 -2279
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,21 @@ A command-line tool for interacting with Polkadot-ecosystem chains. Manage chain
|
|
|
6
6
|
|
|
7
7
|
Ships with Polkadot and all system parachains preconfigured with multiple fallback RPC endpoints. Add any Substrate-based chain by pointing to its RPC endpoint(s).
|
|
8
8
|
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- ✅ Same syntax as [polkadot-api](https://papi.how) (PAPI)
|
|
12
|
+
- ✅ Chain name prefix — `dot polkadot.query.System.Number`
|
|
13
|
+
- ✅ zsh, bash, and fish autocompletion
|
|
14
|
+
- ✅ Exposes all on-chain metadata documentation
|
|
15
|
+
- ✅ Encode, dry-run, and submit extrinsics
|
|
16
|
+
- ✅ Support for custom signed extensions
|
|
17
|
+
- ✅ Built with agent use in mind — pipe-safe JSON output (`--output json`)
|
|
18
|
+
- ✅ Fuzzy matching with typo suggestions
|
|
19
|
+
- ✅ Account management — BIP39 mnemonics, derivation paths, env-backed secrets, watch-only, dev accounts
|
|
20
|
+
- ✅ Named address resolution across all commands
|
|
21
|
+
- ✅ Runtime API calls — `dot apis.Core.version`
|
|
22
|
+
- ✅ Batteries included — all system parachains and testnets already setup to be used
|
|
23
|
+
|
|
9
24
|
### Preconfigured chains
|
|
10
25
|
|
|
11
26
|
| Network | Chain | Light client |
|
|
@@ -57,6 +72,7 @@ dot chain list
|
|
|
57
72
|
# Re-fetch metadata after a runtime upgrade
|
|
58
73
|
dot chain update # updates default chain
|
|
59
74
|
dot chain update kusama # updates a specific chain
|
|
75
|
+
dot chain update --all # updates all configured chains in parallel
|
|
60
76
|
|
|
61
77
|
# Set default chain
|
|
62
78
|
dot chain default kusama
|
|
@@ -242,6 +258,29 @@ Chain names are case-insensitive — `Polkadot.System.Account`, `POLKADOT.System
|
|
|
242
258
|
|
|
243
259
|
The `--chain` flag and default chain still work as before. If both a chain prefix and `--chain` flag are provided, the CLI errors.
|
|
244
260
|
|
|
261
|
+
### Space-separated syntax
|
|
262
|
+
|
|
263
|
+
Pallet and item segments can also be provided as separate arguments instead of dot notation. These forms are equivalent:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
# Dot notation vs space-separated — these are identical:
|
|
267
|
+
dot query.System # dot notation
|
|
268
|
+
dot query System # space-separated
|
|
269
|
+
|
|
270
|
+
dot events.Balances.Transfer # dot notation
|
|
271
|
+
dot events Balances Transfer # space-separated
|
|
272
|
+
|
|
273
|
+
dot apis.Core # dot notation
|
|
274
|
+
dot apis Core # space-separated
|
|
275
|
+
|
|
276
|
+
# Especially useful with --chain flag:
|
|
277
|
+
dot --chain kusama query System
|
|
278
|
+
dot --chain kusama events Balances Transfer
|
|
279
|
+
dot --chain kusama apis Core
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
This works for all categories (`query`, `tx`, `const`, `events`, `errors`, `apis`). Remaining arguments after the pallet and item are passed as method parameters as usual.
|
|
283
|
+
|
|
245
284
|
### Query storage
|
|
246
285
|
|
|
247
286
|
```bash
|
|
@@ -333,6 +372,37 @@ The pallet listing view shows type information inline so you can understand item
|
|
|
333
372
|
|
|
334
373
|
Documentation from the runtime metadata is shown on an indented line below each item. The detail view (`dot inspect Balances.transfer_allow_death`) shows the full argument signature and complete documentation text. Use call inspection to discover argument names, types, and docs before constructing `dot tx` commands.
|
|
335
374
|
|
|
375
|
+
### Runtime APIs
|
|
376
|
+
|
|
377
|
+
Browse and call Substrate runtime APIs. These are top-level APIs exposed by the runtime (e.g. `Core`, `AccountNonceApi`, `TransactionPaymentApi`), accessed as `dot apis.ApiName.method`.
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
# List all runtime APIs with method counts
|
|
381
|
+
dot apis
|
|
382
|
+
|
|
383
|
+
# List methods in a specific API (with signatures)
|
|
384
|
+
dot apis.Core
|
|
385
|
+
|
|
386
|
+
# Call a runtime API method
|
|
387
|
+
dot apis.Core.version
|
|
388
|
+
|
|
389
|
+
# With chain prefix
|
|
390
|
+
dot polkadot.apis.Core.version
|
|
391
|
+
|
|
392
|
+
# Show method signature and docs
|
|
393
|
+
dot apis.Core.version --help
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
`api` is an alias for `apis`.
|
|
397
|
+
|
|
398
|
+
Runtime API info requires v15 metadata. If `dot apis` shows 0 APIs, update the cached metadata:
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
dot chain update # default chain
|
|
402
|
+
dot chain update people-paseo # specific chain
|
|
403
|
+
dot chain update --all # all configured chains
|
|
404
|
+
```
|
|
405
|
+
|
|
336
406
|
### Focused commands
|
|
337
407
|
|
|
338
408
|
Browse specific metadata categories directly without using `dot inspect`:
|
|
@@ -360,9 +430,13 @@ dot storage System.Account # storage detail
|
|
|
360
430
|
# List pallet constants (dual-purpose — also works as value lookup)
|
|
361
431
|
dot const Balances # list constants
|
|
362
432
|
dot const Balances.ExistentialDeposit # look up value
|
|
433
|
+
|
|
434
|
+
# List runtime APIs
|
|
435
|
+
dot apis # list all APIs
|
|
436
|
+
dot apis.Core # list methods in Core
|
|
363
437
|
```
|
|
364
438
|
|
|
365
|
-
Each command supports `--chain <name>`, `--rpc <url>`, and chain prefix syntax. Singular and plural forms are interchangeable (e.g. `dot call` = `dot calls`, `dot event` = `dot events`).
|
|
439
|
+
Each command supports `--chain <name>`, `--rpc <url>`, and chain prefix syntax. Singular and plural forms are interchangeable (e.g. `dot call` = `dot calls`, `dot event` = `dot events`, `dot api` = `dot apis`).
|
|
366
440
|
|
|
367
441
|
### Submit extrinsics
|
|
368
442
|
|
|
@@ -542,6 +616,7 @@ dot query.System.Account --help # storage type, key/value info, and qu
|
|
|
542
616
|
dot const.Balances.ExistentialDeposit --help # constant type and docs
|
|
543
617
|
dot events.Balances.Transfer --help # event fields and docs
|
|
544
618
|
dot errors.Balances.InsufficientBalance --help # error docs
|
|
619
|
+
dot apis.Core.version --help # runtime API method signature and docs
|
|
545
620
|
```
|
|
546
621
|
|
|
547
622
|
For `tx` commands, omitting both `--from` and `--encode` shows this same help output instead of an error:
|
|
@@ -595,13 +670,15 @@ Once installed, press Tab to complete:
|
|
|
595
670
|
dot qu<Tab> # → query
|
|
596
671
|
dot query.<Tab> # → query.System, query.Balances, ...
|
|
597
672
|
dot query.System.<Tab> # → query.System.Account, query.System.Number, ...
|
|
598
|
-
dot
|
|
673
|
+
dot apis.<Tab> # → apis.Core, apis.Metadata, ...
|
|
674
|
+
dot apis.Core.<Tab> # → apis.Core.version, ...
|
|
675
|
+
dot polkadot.<Tab> # → polkadot.query, polkadot.tx, ..., polkadot.apis
|
|
599
676
|
dot --chain <Tab> # → polkadot, paseo, ...
|
|
600
677
|
dot --from <Tab> # → alice, bob, ..., stored account names
|
|
601
678
|
dot chain <Tab> # → add, remove, update, list, default
|
|
602
679
|
```
|
|
603
680
|
|
|
604
|
-
Completions are context-aware: `query.` shows pallets with storage items, `tx.` shows pallets with calls, `events.` and `errors.` filter accordingly. Chain prefix paths like `polkadot.query.System.` work at any depth.
|
|
681
|
+
Completions are context-aware: `query.` shows pallets with storage items, `tx.` shows pallets with calls, `events.` and `errors.` filter accordingly, `apis.` shows runtime API names. Chain prefix paths like `polkadot.query.System.` work at any depth.
|
|
605
682
|
|
|
606
683
|
## How it compares
|
|
607
684
|
|