polkadot-cli 1.4.0 → 1.6.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 +85 -3
- package/dist/cli.mjs +2900 -2438
- 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
|
|
@@ -321,6 +337,8 @@ dot inspect kusama.System
|
|
|
321
337
|
dot inspect kusama.System.Account
|
|
322
338
|
```
|
|
323
339
|
|
|
340
|
+
All listings — pallets, storage items, constants, calls, events, and errors — are sorted alphabetically, making it easy to find a specific item at a glance.
|
|
341
|
+
|
|
324
342
|
The pallet listing view shows type information inline so you can understand item shapes at a glance:
|
|
325
343
|
|
|
326
344
|
- **Storage**: key/value types with `[map]` tag for map items (e.g. `Account: AccountId32 → { nonce: u32, ... } [map]`)
|
|
@@ -331,6 +349,37 @@ The pallet listing view shows type information inline so you can understand item
|
|
|
331
349
|
|
|
332
350
|
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.
|
|
333
351
|
|
|
352
|
+
### Runtime APIs
|
|
353
|
+
|
|
354
|
+
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`.
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
# List all runtime APIs with method counts
|
|
358
|
+
dot apis
|
|
359
|
+
|
|
360
|
+
# List methods in a specific API (with signatures)
|
|
361
|
+
dot apis.Core
|
|
362
|
+
|
|
363
|
+
# Call a runtime API method
|
|
364
|
+
dot apis.Core.version
|
|
365
|
+
|
|
366
|
+
# With chain prefix
|
|
367
|
+
dot polkadot.apis.Core.version
|
|
368
|
+
|
|
369
|
+
# Show method signature and docs
|
|
370
|
+
dot apis.Core.version --help
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
`api` is an alias for `apis`.
|
|
374
|
+
|
|
375
|
+
Runtime API info requires v15 metadata. If `dot apis` shows 0 APIs, update the cached metadata:
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
dot chain update # default chain
|
|
379
|
+
dot chain update people-paseo # specific chain
|
|
380
|
+
dot chain update --all # all configured chains
|
|
381
|
+
```
|
|
382
|
+
|
|
334
383
|
### Focused commands
|
|
335
384
|
|
|
336
385
|
Browse specific metadata categories directly without using `dot inspect`:
|
|
@@ -358,9 +407,13 @@ dot storage System.Account # storage detail
|
|
|
358
407
|
# List pallet constants (dual-purpose — also works as value lookup)
|
|
359
408
|
dot const Balances # list constants
|
|
360
409
|
dot const Balances.ExistentialDeposit # look up value
|
|
410
|
+
|
|
411
|
+
# List runtime APIs
|
|
412
|
+
dot apis # list all APIs
|
|
413
|
+
dot apis.Core # list methods in Core
|
|
361
414
|
```
|
|
362
415
|
|
|
363
|
-
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`).
|
|
416
|
+
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`).
|
|
364
417
|
|
|
365
418
|
### Submit extrinsics
|
|
366
419
|
|
|
@@ -457,6 +510,31 @@ dot tx Balances.transferKeepAlive 5GrwvaEF... abc --encode
|
|
|
457
510
|
|
|
458
511
|
For struct-based calls, the error identifies the specific field that failed. For tuple-based calls, it shows the argument index. The original parse error is preserved as the `cause` for programmatic access.
|
|
459
512
|
|
|
513
|
+
#### Wait level
|
|
514
|
+
|
|
515
|
+
By default, `dot tx` waits for finalization (~30s on Polkadot). Use `--wait` / `-w` to return earlier:
|
|
516
|
+
|
|
517
|
+
```bash
|
|
518
|
+
# Return as soon as the tx is broadcast (fastest)
|
|
519
|
+
dot tx System.remark 0xdead --from alice --wait broadcast
|
|
520
|
+
|
|
521
|
+
# Return when included in a best block
|
|
522
|
+
dot tx System.remark 0xdead --from alice -w best-block
|
|
523
|
+
dot tx System.remark 0xdead --from alice -w best # alias
|
|
524
|
+
|
|
525
|
+
# Wait for finalization (default, unchanged)
|
|
526
|
+
dot tx System.remark 0xdead --from alice --wait finalized
|
|
527
|
+
dot tx System.remark 0xdead --from alice # same
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
| Level | Resolves when | Events shown | Explorer links |
|
|
531
|
+
|-------|---------------|:---:|:---:|
|
|
532
|
+
| `broadcast` | Tx is broadcast to the network | — | — |
|
|
533
|
+
| `best-block` / `best` | Tx is included in a best block | yes | yes |
|
|
534
|
+
| `finalized` (default) | Tx is finalized | yes | yes |
|
|
535
|
+
|
|
536
|
+
The `--wait` flag is silently ignored when combined with `--dry-run` or `--encode` (both return before submission).
|
|
537
|
+
|
|
460
538
|
#### Custom signed extensions
|
|
461
539
|
|
|
462
540
|
Chains with non-standard signed extensions (e.g. `people-preview`) are auto-handled:
|
|
@@ -515,6 +593,7 @@ dot query.System.Account --help # storage type, key/value info, and qu
|
|
|
515
593
|
dot const.Balances.ExistentialDeposit --help # constant type and docs
|
|
516
594
|
dot events.Balances.Transfer --help # event fields and docs
|
|
517
595
|
dot errors.Balances.InsufficientBalance --help # error docs
|
|
596
|
+
dot apis.Core.version --help # runtime API method signature and docs
|
|
518
597
|
```
|
|
519
598
|
|
|
520
599
|
For `tx` commands, omitting both `--from` and `--encode` shows this same help output instead of an error:
|
|
@@ -534,6 +613,7 @@ dot tx.System.remark 0xdead # shows call help (no error)
|
|
|
534
613
|
| `--output json` | Raw JSON output (default: pretty) |
|
|
535
614
|
| `--dump` | Dump all entries of a storage map (required for keyless map queries) |
|
|
536
615
|
| `--limit <n>` | Max entries for map queries (0 = unlimited, default: 100) |
|
|
616
|
+
| `-w, --wait <level>` | Tx wait level: `broadcast`, `best-block` / `best`, `finalized` (default) |
|
|
537
617
|
|
|
538
618
|
### Pipe-safe output
|
|
539
619
|
|
|
@@ -567,13 +647,15 @@ Once installed, press Tab to complete:
|
|
|
567
647
|
dot qu<Tab> # → query
|
|
568
648
|
dot query.<Tab> # → query.System, query.Balances, ...
|
|
569
649
|
dot query.System.<Tab> # → query.System.Account, query.System.Number, ...
|
|
570
|
-
dot
|
|
650
|
+
dot apis.<Tab> # → apis.Core, apis.Metadata, ...
|
|
651
|
+
dot apis.Core.<Tab> # → apis.Core.version, ...
|
|
652
|
+
dot polkadot.<Tab> # → polkadot.query, polkadot.tx, ..., polkadot.apis
|
|
571
653
|
dot --chain <Tab> # → polkadot, paseo, ...
|
|
572
654
|
dot --from <Tab> # → alice, bob, ..., stored account names
|
|
573
655
|
dot chain <Tab> # → add, remove, update, list, default
|
|
574
656
|
```
|
|
575
657
|
|
|
576
|
-
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.
|
|
658
|
+
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.
|
|
577
659
|
|
|
578
660
|
## How it compares
|
|
579
661
|
|