polkadot-cli 1.14.1 → 1.14.2
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 +175 -169
- package/dist/cli.mjs +36 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Ships with Polkadot and all system parachains preconfigured with multiple fallba
|
|
|
19
19
|
- ✅ Fuzzy matching with typo suggestions
|
|
20
20
|
- ✅ Account management — BIP39 mnemonics, derivation paths, env-backed secrets, watch-only, dev accounts
|
|
21
21
|
- ✅ Named address resolution across all commands
|
|
22
|
-
- ✅ Runtime API calls — `dot apis.Core.version`
|
|
22
|
+
- ✅ Runtime API calls — `dot polkadot.apis.Core.version`
|
|
23
23
|
- ✅ Chain topology — relay/parachain hierarchy with tree display and auto-detection
|
|
24
24
|
- ✅ Batteries included — all system parachains and testnets already setup to be used
|
|
25
25
|
- ✅ File-based commands — run any command from a YAML/JSON file with variable substitution
|
|
@@ -82,11 +82,11 @@ dot chain add my-para --rpc wss://rpc.example.com --relay polkadot --parachain-i
|
|
|
82
82
|
dot chain list
|
|
83
83
|
|
|
84
84
|
# Re-fetch metadata after a runtime upgrade
|
|
85
|
-
dot chain update
|
|
86
|
-
dot chain update --all
|
|
85
|
+
dot chain update polkadot # updates a specific chain
|
|
86
|
+
dot chain update --all # updates all configured chains in parallel
|
|
87
87
|
|
|
88
|
-
# Remove a chain
|
|
89
|
-
dot chain remove
|
|
88
|
+
# Remove a chain (only user-added chains can be removed)
|
|
89
|
+
dot chain remove kusama
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
#### Chain topology
|
|
@@ -129,7 +129,7 @@ dot polkadot.query.System.Number
|
|
|
129
129
|
dot polkadot.query.System.Number --chain polkadot # ✗ errors
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
Chain names are case-insensitive
|
|
132
|
+
Chain names are case-insensitive (`Polkadot.query.System.Number` works the same).
|
|
133
133
|
|
|
134
134
|
#### Export/import chain configuration
|
|
135
135
|
|
|
@@ -200,7 +200,7 @@ dot account import ci-signer --env MY_SECRET
|
|
|
200
200
|
dot account derive treasury treasury-staking --path //staking
|
|
201
201
|
|
|
202
202
|
# Use it — the env var is read at signing time
|
|
203
|
-
MY_SECRET="word1 word2 ..." dot tx
|
|
203
|
+
MY_SECRET="word1 word2 ..." dot tx.System.remark 0xdead --from ci-signer --chain polkadot
|
|
204
204
|
|
|
205
205
|
# Remove one or more accounts
|
|
206
206
|
dot account remove my-validator
|
|
@@ -244,13 +244,13 @@ Named accounts (both watch-only and keyed) resolve automatically everywhere an A
|
|
|
244
244
|
|
|
245
245
|
```bash
|
|
246
246
|
# Use a named account as transfer recipient
|
|
247
|
-
dot tx
|
|
247
|
+
dot tx.Balances.transferKeepAlive treasury 1000000000000 --from alice --chain polkadot
|
|
248
248
|
|
|
249
249
|
# Query by account name
|
|
250
|
-
dot query
|
|
250
|
+
dot polkadot.query.System.Account treasury
|
|
251
251
|
|
|
252
252
|
# Dev accounts also resolve
|
|
253
|
-
dot tx
|
|
253
|
+
dot tx.Balances.transferKeepAlive bob 1000000000000 --from alice --chain polkadot
|
|
254
254
|
```
|
|
255
255
|
|
|
256
256
|
Resolution order: dev account name > stored account name > SS58 address > hex public key. If the input doesn't match any, the CLI shows an error listing all available account names alphabetically, one per line. When the input is close to an existing name, a "Did you mean?" suggestion is included:
|
|
@@ -379,67 +379,59 @@ Security: default export replaces mnemonic/seed with `"<redacted>"`. `--include-
|
|
|
379
379
|
|
|
380
380
|
### Chain prefix
|
|
381
381
|
|
|
382
|
-
Instead of the `--chain` flag, you can prefix
|
|
382
|
+
Instead of the `--chain` flag, you can prefix the dot-path with the chain name. The prefix becomes the first segment of the dot-path:
|
|
383
383
|
|
|
384
384
|
```bash
|
|
385
|
-
dot query
|
|
386
|
-
dot const
|
|
387
|
-
dot tx
|
|
388
|
-
dot inspect
|
|
389
|
-
dot inspect
|
|
385
|
+
dot polkadot.query.System.Account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
|
|
386
|
+
dot polkadot.const.Balances.ExistentialDeposit
|
|
387
|
+
dot polkadot.tx.Balances.transferKeepAlive 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty 1000000000000 --from alice
|
|
388
|
+
dot inspect polkadot.System # for `inspect`, the prefix is the first arg
|
|
389
|
+
dot inspect polkadot.System.Account
|
|
390
390
|
```
|
|
391
391
|
|
|
392
|
-
Chain names are case-insensitive — `Polkadot.System.Account`, `POLKADOT.System.Account`, and `polkadot.System.Account` all resolve the same way. The same applies to `--chain Polkadot`.
|
|
392
|
+
Chain names are case-insensitive — `Polkadot.query.System.Account`, `POLKADOT.query.System.Account`, and `polkadot.query.System.Account` all resolve the same way. The same applies to `--chain Polkadot`.
|
|
393
393
|
|
|
394
394
|
Every invocation must specify a chain explicitly: either via a dotpath prefix (as above) or via `--chain <name>`. If both are provided, the CLI errors.
|
|
395
395
|
|
|
396
396
|
### Space-separated syntax
|
|
397
397
|
|
|
398
|
-
Pallet and
|
|
398
|
+
The `Pallet` and `Item` segments can be passed as separate arguments instead of dot-joined. These pairs are equivalent:
|
|
399
399
|
|
|
400
400
|
```bash
|
|
401
|
-
# Dot notation vs space-separated — these are identical:
|
|
402
|
-
dot query.System
|
|
403
|
-
dot query System
|
|
401
|
+
# Dot notation vs fully space-separated — these are identical:
|
|
402
|
+
dot polkadot.query.System # dot notation
|
|
403
|
+
dot query System --chain polkadot # space-separated
|
|
404
404
|
|
|
405
|
-
dot events.Balances.Transfer
|
|
406
|
-
dot events Balances Transfer
|
|
405
|
+
dot polkadot.events.Balances.Transfer
|
|
406
|
+
dot events Balances Transfer --chain polkadot
|
|
407
407
|
|
|
408
|
-
dot apis.Core
|
|
409
|
-
dot apis Core
|
|
410
|
-
|
|
411
|
-
# Especially useful with --chain flag:
|
|
412
|
-
dot --chain kusama query System
|
|
413
|
-
dot --chain kusama events Balances Transfer
|
|
414
|
-
dot --chain kusama apis Core
|
|
408
|
+
dot polkadot.apis.Core
|
|
409
|
+
dot apis Core --chain polkadot
|
|
415
410
|
```
|
|
416
411
|
|
|
417
|
-
This works for all categories (`query`, `tx`, `const`, `events`, `errors`, `apis`).
|
|
412
|
+
This works for all categories (`query`, `tx`, `const`, `events`, `errors`, `apis`). When passing positional method arguments, keep `Pallet` and `Item` either fully dot-joined (`query.System.Account 5Grw...`) or fully space-separated (`query System Account 5Grw...`) — mixing the two (`query System.Account 5Grw...`) does not work because the second arg gets parsed as a pallet name.
|
|
418
413
|
|
|
419
414
|
### Query storage
|
|
420
415
|
|
|
421
416
|
```bash
|
|
422
417
|
# Plain storage value
|
|
423
|
-
dot query
|
|
418
|
+
dot polkadot.query.System.Number
|
|
424
419
|
|
|
425
420
|
# Map entry by key
|
|
426
|
-
dot query
|
|
421
|
+
dot polkadot.query.System.Account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
|
|
427
422
|
|
|
428
423
|
# Map without key — shows help/usage (use --dump to fetch all entries)
|
|
429
|
-
dot query
|
|
424
|
+
dot polkadot.query.System.Account
|
|
430
425
|
|
|
431
426
|
# Dump all map entries (requires --dump)
|
|
432
|
-
dot query
|
|
433
|
-
|
|
434
|
-
# Enum variant as map key (case-insensitive)
|
|
435
|
-
dot query people-preview.ChunksManager.Chunks R2e9 1
|
|
427
|
+
dot polkadot.query.System.Account --dump
|
|
436
428
|
|
|
437
429
|
# Pipe-safe — stdout is clean data, progress messages go to stderr
|
|
438
|
-
dot query
|
|
439
|
-
dot query
|
|
430
|
+
dot polkadot.query.System.Account --dump | jq '.[0].value.data.free'
|
|
431
|
+
dot polkadot.query.System.Number --json | jq '.+1'
|
|
440
432
|
|
|
441
|
-
#
|
|
442
|
-
dot query
|
|
433
|
+
# --chain flag is equivalent to the dotpath prefix
|
|
434
|
+
dot query.System.Account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY --chain polkadot
|
|
443
435
|
```
|
|
444
436
|
|
|
445
437
|
#### Partial key queries
|
|
@@ -450,13 +442,13 @@ prefix-based iteration and does not require `--dump`.
|
|
|
450
442
|
|
|
451
443
|
```bash
|
|
452
444
|
# Full key — returns a single value
|
|
453
|
-
dot query
|
|
445
|
+
dot polkadot.query.Staking.ErasStakers 100 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
|
|
454
446
|
|
|
455
447
|
# Partial key — returns all entries matching the first key
|
|
456
|
-
dot query
|
|
448
|
+
dot polkadot.query.Staking.ErasStakers 100
|
|
457
449
|
|
|
458
450
|
# No keys — requires --dump (safety net for large maps)
|
|
459
|
-
dot query
|
|
451
|
+
dot polkadot.query.Staking.ErasStakers --dump
|
|
460
452
|
```
|
|
461
453
|
|
|
462
454
|
#### Output formatting
|
|
@@ -469,47 +461,49 @@ Query results automatically convert on-chain types for readability:
|
|
|
469
461
|
|
|
470
462
|
```bash
|
|
471
463
|
# Token metadata — symbol and name display as text, not {}
|
|
472
|
-
dot
|
|
464
|
+
dot paseo-asset-hub.query.Assets.Metadata 50000413
|
|
473
465
|
# { "deposit": "6693666000", "name": "Paseo Token", "symbol": "PAS", ... }
|
|
474
466
|
```
|
|
475
467
|
|
|
476
468
|
### Look up constants
|
|
477
469
|
|
|
478
470
|
```bash
|
|
479
|
-
dot const
|
|
480
|
-
dot const
|
|
481
|
-
|
|
471
|
+
dot polkadot.const.Balances.ExistentialDeposit
|
|
472
|
+
dot polkadot.const.System.SS58Prefix
|
|
473
|
+
|
|
474
|
+
# --chain flag is equivalent
|
|
475
|
+
dot const.Balances.ExistentialDeposit --chain polkadot
|
|
482
476
|
|
|
483
477
|
# Pipe-safe — stdout is clean JSON, progress messages go to stderr
|
|
484
|
-
dot const
|
|
478
|
+
dot polkadot.const.Balances.ExistentialDeposit --json | jq
|
|
485
479
|
```
|
|
486
480
|
|
|
487
481
|
### Inspect metadata
|
|
488
482
|
|
|
489
|
-
Works offline from cached metadata after the first fetch.
|
|
483
|
+
Works offline from cached metadata after the first fetch. The chain is required: pass it with `--chain` or as a prefix on the inspect target (e.g. `dot inspect polkadot.System`).
|
|
490
484
|
|
|
491
485
|
```bash
|
|
492
486
|
# List all pallets (shows storage, constants, calls, events, and errors counts)
|
|
493
|
-
dot inspect
|
|
487
|
+
dot inspect --chain polkadot
|
|
494
488
|
|
|
495
489
|
# List a pallet's storage items, constants, calls, events, and errors
|
|
496
|
-
dot inspect System
|
|
490
|
+
dot inspect System --chain polkadot
|
|
497
491
|
|
|
498
492
|
# Detailed type info for a specific storage item or constant
|
|
499
|
-
dot inspect System.Account
|
|
493
|
+
dot inspect System.Account --chain polkadot
|
|
500
494
|
|
|
501
495
|
# Call detail — shows argument signature and docs
|
|
502
|
-
dot inspect Balances.transfer_allow_death
|
|
496
|
+
dot inspect Balances.transfer_allow_death --chain polkadot
|
|
503
497
|
|
|
504
498
|
# Event detail — shows field signature and docs
|
|
505
|
-
dot inspect Balances.Transfer
|
|
499
|
+
dot inspect Balances.Transfer --chain polkadot
|
|
506
500
|
|
|
507
501
|
# Error detail — shows docs
|
|
508
|
-
dot inspect Balances.InsufficientBalance
|
|
502
|
+
dot inspect Balances.InsufficientBalance --chain polkadot
|
|
509
503
|
|
|
510
|
-
#
|
|
511
|
-
dot inspect
|
|
512
|
-
dot inspect
|
|
504
|
+
# Chain prefix on the inspect target works too (note: `dot polkadot.inspect.X` does NOT — use either form below)
|
|
505
|
+
dot inspect polkadot.System
|
|
506
|
+
dot inspect polkadot.System.Account
|
|
513
507
|
```
|
|
514
508
|
|
|
515
509
|
All listings — pallets, storage items, constants, calls, events, and errors — are sorted alphabetically, making it easy to find a specific item at a glance.
|
|
@@ -526,32 +520,32 @@ Documentation from the runtime metadata is shown on an indented line below each
|
|
|
526
520
|
|
|
527
521
|
### Runtime APIs
|
|
528
522
|
|
|
529
|
-
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`.
|
|
523
|
+
Browse and call Substrate runtime APIs. These are top-level APIs exposed by the runtime (e.g. `Core`, `AccountNonceApi`, `TransactionPaymentApi`), accessed as `dot <chain>.apis.ApiName.method`.
|
|
530
524
|
|
|
531
525
|
```bash
|
|
532
526
|
# List all runtime APIs with method counts
|
|
533
|
-
dot apis
|
|
527
|
+
dot polkadot.apis
|
|
534
528
|
|
|
535
529
|
# List methods in a specific API (with signatures)
|
|
536
|
-
dot apis.Core
|
|
530
|
+
dot polkadot.apis.Core
|
|
537
531
|
|
|
538
532
|
# Call a runtime API method
|
|
539
|
-
dot apis.Core.version
|
|
540
|
-
|
|
541
|
-
# With chain prefix
|
|
542
533
|
dot polkadot.apis.Core.version
|
|
543
534
|
|
|
544
|
-
#
|
|
545
|
-
dot apis.Core.version --
|
|
535
|
+
# --chain flag is equivalent
|
|
536
|
+
dot apis.Core.version --chain polkadot
|
|
537
|
+
|
|
538
|
+
# Show method signature and docs (chain still required to load metadata)
|
|
539
|
+
dot apis.Core.version --chain polkadot --help
|
|
546
540
|
```
|
|
547
541
|
|
|
548
542
|
`api` is an alias for `apis`.
|
|
549
543
|
|
|
550
|
-
Runtime API info requires v15 metadata. If `dot apis` shows 0 APIs, update the cached metadata:
|
|
544
|
+
Runtime API info requires v15 metadata. If `dot <chain>.apis` shows 0 APIs, update the cached metadata:
|
|
551
545
|
|
|
552
546
|
```bash
|
|
553
|
-
dot chain update
|
|
554
|
-
dot chain update --all
|
|
547
|
+
dot chain update polkadot # specific chain
|
|
548
|
+
dot chain update --all # all configured chains
|
|
555
549
|
```
|
|
556
550
|
|
|
557
551
|
#### Argument formats
|
|
@@ -577,7 +571,7 @@ ALICE=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
|
|
|
577
571
|
CONTRACT=0x970951a12f975e6762482aca81e57d5a2a4e73f4 # H160, [u8; 20]
|
|
578
572
|
CALLDATA=$(cast calldata "set(uint256)" 42)
|
|
579
573
|
|
|
580
|
-
dot
|
|
574
|
+
dot paseo-asset-hub.apis.ReviveApi.call \
|
|
581
575
|
"$ALICE" "$CONTRACT" 0 null null "$CALLDATA"
|
|
582
576
|
# ^ origin ^ dest ^ value ^ gas_limit (Option, none) ^ deposit (Option, none) ^ input_data (Vec<u8>)
|
|
583
577
|
```
|
|
@@ -587,9 +581,9 @@ dot --chain paseo-asset-hub apis.ReviveApi.call \
|
|
|
587
581
|
Absent options (`None`) can be written three ways, all equivalent:
|
|
588
582
|
|
|
589
583
|
```bash
|
|
590
|
-
dot apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 null null "$CALLDATA"
|
|
591
|
-
dot apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 none none "$CALLDATA"
|
|
592
|
-
dot apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 undefined undefined "$CALLDATA"
|
|
584
|
+
dot paseo-asset-hub.apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 null null "$CALLDATA"
|
|
585
|
+
dot paseo-asset-hub.apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 none none "$CALLDATA"
|
|
586
|
+
dot paseo-asset-hub.apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 undefined undefined "$CALLDATA"
|
|
593
587
|
```
|
|
594
588
|
|
|
595
589
|
`null` is the **recommended** form — it matches JSON / YAML semantics, so args read identically on the CLI and inside [file-based command](#file-based-commands) YAML/JSON inputs.
|
|
@@ -598,7 +592,7 @@ A present option (`Some(value)`) is just the value itself — no wrapping:
|
|
|
598
592
|
|
|
599
593
|
```bash
|
|
600
594
|
# gas_limit = Some({ ref_time: 1_000_000, proof_size: 100_000 })
|
|
601
|
-
dot apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 \
|
|
595
|
+
dot paseo-asset-hub.apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 \
|
|
602
596
|
'{"ref_time":1000000,"proof_size":100000}' \
|
|
603
597
|
null \
|
|
604
598
|
"$CALLDATA"
|
|
@@ -608,42 +602,44 @@ Notes:
|
|
|
608
602
|
- The `null` / `none` / `undefined` literals are case-sensitive (lowercase only).
|
|
609
603
|
- There is no `Some(value)` prefix — bare values are already treated as `Some`.
|
|
610
604
|
|
|
611
|
-
Use `dot apis.<ApiName>.<method> --help` to see the exact argument signature for any method.
|
|
605
|
+
Use `dot <chain>.apis.<ApiName>.<method> --help` to see the exact argument signature for any method.
|
|
612
606
|
|
|
613
|
-
### Focused
|
|
607
|
+
### Focused metadata listings
|
|
614
608
|
|
|
615
|
-
|
|
609
|
+
Each category supports partial dot-paths for browsing metadata. Category-only invocations list pallets (or APIs); pallet-level invocations list items; item-level invocations show detail. Singular and plural aliases work: `event` = `events`, `error` = `errors`, `api` = `apis`, `consts` = `constants` = `const`.
|
|
616
610
|
|
|
617
611
|
```bash
|
|
618
|
-
# List
|
|
619
|
-
dot pallets
|
|
612
|
+
# List pallets with calls (and the calls themselves)
|
|
613
|
+
dot polkadot.tx # pallets with calls
|
|
614
|
+
dot polkadot.tx.Balances # calls with arg signatures
|
|
615
|
+
dot polkadot.tx.Balances.transfer_allow_death # call detail (or use --help)
|
|
620
616
|
|
|
621
|
-
#
|
|
622
|
-
dot
|
|
623
|
-
dot
|
|
617
|
+
# Events
|
|
618
|
+
dot polkadot.events # pallets with events
|
|
619
|
+
dot polkadot.events.Balances # events with field signatures
|
|
620
|
+
dot polkadot.events.Balances.Transfer # event detail
|
|
624
621
|
|
|
625
|
-
#
|
|
626
|
-
dot
|
|
627
|
-
dot
|
|
622
|
+
# Errors
|
|
623
|
+
dot polkadot.errors # pallets with errors
|
|
624
|
+
dot polkadot.errors.Balances # errors with docs
|
|
625
|
+
dot polkadot.errors.Balances.InsufficientBalance
|
|
628
626
|
|
|
629
|
-
#
|
|
630
|
-
dot
|
|
631
|
-
dot
|
|
627
|
+
# Storage (via the query category)
|
|
628
|
+
dot polkadot.query # pallets with storage items
|
|
629
|
+
dot polkadot.query.System # storage items with types
|
|
630
|
+
dot polkadot.query.System.Account # storage help (use --dump for all entries)
|
|
632
631
|
|
|
633
|
-
#
|
|
634
|
-
dot
|
|
635
|
-
dot
|
|
632
|
+
# Constants
|
|
633
|
+
dot polkadot.const # pallets with constants
|
|
634
|
+
dot polkadot.const.Balances # list constants (offline)
|
|
635
|
+
dot polkadot.const.Balances.ExistentialDeposit # look up value (connects to chain)
|
|
636
636
|
|
|
637
|
-
#
|
|
638
|
-
dot
|
|
639
|
-
dot
|
|
640
|
-
|
|
641
|
-
# List runtime APIs
|
|
642
|
-
dot apis # list all APIs
|
|
643
|
-
dot apis.Core # list methods in Core
|
|
637
|
+
# Runtime APIs
|
|
638
|
+
dot polkadot.apis # all runtime APIs
|
|
639
|
+
dot polkadot.apis.Core # methods in Core
|
|
644
640
|
```
|
|
645
641
|
|
|
646
|
-
|
|
642
|
+
`--chain <name>` works as an alternative to the prefix in every form (e.g. `dot tx.Balances --chain polkadot`). To browse pallets across all categories at once, use `dot inspect` (see [Inspect metadata](#inspect-metadata)).
|
|
647
643
|
|
|
648
644
|
### Submit extrinsics
|
|
649
645
|
|
|
@@ -651,21 +647,28 @@ Build, sign, and submit transactions. Pass a `Pallet.Call` with arguments, or a
|
|
|
651
647
|
|
|
652
648
|
```bash
|
|
653
649
|
# Simple remark
|
|
654
|
-
dot tx
|
|
650
|
+
dot tx.System.remark 0xdeadbeef --from alice --chain polkadot
|
|
655
651
|
|
|
656
652
|
# Transfer (amount in plancks)
|
|
657
|
-
dot tx
|
|
653
|
+
dot tx.Balances.transferKeepAlive 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty 1000000000000 --from alice --chain polkadot
|
|
658
654
|
|
|
659
655
|
# Estimate fees without submitting
|
|
660
|
-
dot tx
|
|
656
|
+
dot tx.Balances.transferKeepAlive 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty 1000000000000 --from alice --chain polkadot --dry-run
|
|
661
657
|
|
|
662
658
|
# Submit a raw SCALE-encoded call (e.g. from a multisig proposal or another tool)
|
|
663
|
-
dot tx 0x0503008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48 --from alice
|
|
659
|
+
dot tx 0x0503008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48 --from alice --chain polkadot
|
|
664
660
|
|
|
665
661
|
# Batch multiple transfers with Utility.batchAll (comma-separated encoded calls)
|
|
666
|
-
A=$(dot tx
|
|
667
|
-
B=$(dot tx
|
|
668
|
-
dot tx
|
|
662
|
+
A=$(dot tx.Balances.transfer_keep_alive 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty 1000000000000 --encode --chain polkadot)
|
|
663
|
+
B=$(dot tx.Balances.transfer_keep_alive 5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y 2000000000000 --encode --chain polkadot)
|
|
664
|
+
dot tx.Utility.batchAll $A,$B --from alice --chain polkadot
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
The dot-prefix form works for `tx` too — these are equivalent:
|
|
668
|
+
|
|
669
|
+
```bash
|
|
670
|
+
dot tx.System.remark 0xdeadbeef --from alice --chain polkadot
|
|
671
|
+
dot polkadot.tx.System.remark 0xdeadbeef --from alice
|
|
669
672
|
```
|
|
670
673
|
|
|
671
674
|
#### Enum shorthand
|
|
@@ -674,17 +677,17 @@ Enum arguments accept a concise `Variant(value)` syntax instead of verbose JSON:
|
|
|
674
677
|
|
|
675
678
|
```bash
|
|
676
679
|
# Instead of: '{"type":"system","value":{"type":"Authorized"}}'
|
|
677
|
-
dot tx
|
|
680
|
+
dot tx.Utility.dispatch_as 'system(Authorized)' $(dot tx.System.remark 0xcafe --encode --chain polkadot) --from alice --chain polkadot
|
|
678
681
|
|
|
679
682
|
# Nested enums work too
|
|
680
|
-
dot tx
|
|
683
|
+
dot tx.Utility.dispatch_as 'system(Signed(5FHneW46...))' <call> --from alice --chain polkadot
|
|
681
684
|
|
|
682
685
|
# Void variants — empty parens or just the name
|
|
683
|
-
dot tx
|
|
684
|
-
dot tx
|
|
686
|
+
dot tx.Pallet.call 'Root()' ... --from alice --chain polkadot
|
|
687
|
+
dot tx.Pallet.call 'Root' ... --from alice --chain polkadot
|
|
685
688
|
|
|
686
689
|
# JSON inside parens for struct values
|
|
687
|
-
dot tx
|
|
690
|
+
dot tx.Pallet.call 'AccountId32({"id":"0xd435..."})' ... --from alice --chain polkadot
|
|
688
691
|
```
|
|
689
692
|
|
|
690
693
|
Variant matching is case-insensitive (`system` resolves to `system`, `authorized` to `Authorized`). All existing formats (JSON objects, hex, SS58 addresses) continue to work unchanged.
|
|
@@ -695,13 +698,13 @@ Encode a call to hex without signing or submitting. Useful for preparing calls t
|
|
|
695
698
|
|
|
696
699
|
```bash
|
|
697
700
|
# Encode a remark call
|
|
698
|
-
dot tx
|
|
701
|
+
dot tx.System.remark 0xdeadbeef --encode --chain polkadot
|
|
699
702
|
|
|
700
703
|
# Encode a transfer (use the hex output in a batch or sudo call)
|
|
701
|
-
dot tx
|
|
704
|
+
dot tx.Balances.transfer_keep_alive 5FHneW46... 1000000000000 --encode --chain polkadot
|
|
702
705
|
|
|
703
706
|
# Use encoded output with Sudo.sudo
|
|
704
|
-
dot tx
|
|
707
|
+
dot tx.Sudo.sudo $(dot tx.System.remark 0xcafe --encode --chain polkadot) --from alice --chain polkadot
|
|
705
708
|
```
|
|
706
709
|
|
|
707
710
|
#### Decode call data to YAML / JSON
|
|
@@ -710,18 +713,18 @@ Decode a hex-encoded call into a YAML or JSON file that is compatible with [file
|
|
|
710
713
|
|
|
711
714
|
```bash
|
|
712
715
|
# Decode a raw hex call to YAML
|
|
713
|
-
dot tx.0x0001076465616462656566 --to-yaml
|
|
716
|
+
dot tx.0x0001076465616462656566 --to-yaml --chain polkadot
|
|
714
717
|
|
|
715
718
|
# Decode a raw hex call to JSON
|
|
716
|
-
dot tx.0x0001076465616462656566 --to-json
|
|
719
|
+
dot tx.0x0001076465616462656566 --to-json --chain polkadot
|
|
717
720
|
|
|
718
721
|
# Encode a named call and output as YAML
|
|
719
|
-
dot tx.System.remark 0xdeadbeef --to-yaml
|
|
722
|
+
dot tx.System.remark 0xdeadbeef --to-yaml --chain polkadot
|
|
720
723
|
|
|
721
724
|
# Round-trip: encode to hex, decode to YAML, re-encode from file
|
|
722
|
-
dot tx.System.remark 0xdeadbeef --encode
|
|
723
|
-
dot tx.0x0001076465616462656566 --to-yaml > remark.yaml
|
|
724
|
-
dot ./remark.yaml --encode
|
|
725
|
+
dot tx.System.remark 0xdeadbeef --encode --chain polkadot # 0x0001076465616462656566
|
|
726
|
+
dot tx.0x0001076465616462656566 --to-yaml --chain polkadot > remark.yaml
|
|
727
|
+
dot ./remark.yaml --encode # chain comes from the file
|
|
725
728
|
```
|
|
726
729
|
|
|
727
730
|
`--to-yaml` / `--to-json` are mutually exclusive with each other and with `--encode` and `--dry-run`.
|
|
@@ -746,7 +749,7 @@ Complex calls (e.g. XCM teleports) that the primary decoder cannot handle are au
|
|
|
746
749
|
The CLI exits with code **1** when a finalized transaction has a dispatch error (e.g. insufficient balance, bad origin). The full transaction output (events, explorer links) is still printed before the error so you can debug the failure. Module errors are formatted as `PalletName.ErrorVariant` (e.g. `Balances.InsufficientBalance`).
|
|
747
750
|
|
|
748
751
|
```bash
|
|
749
|
-
dot tx
|
|
752
|
+
dot tx.Balances.transferKeepAlive 5FHneW46... 999999999999999999 --from alice --chain polkadot
|
|
750
753
|
# ... events and explorer links ...
|
|
751
754
|
# Error: Transaction dispatch error: Balances.InsufficientBalance
|
|
752
755
|
echo $? # 1
|
|
@@ -757,7 +760,7 @@ echo $? # 1
|
|
|
757
760
|
When a call argument is invalid, the CLI shows a contextual error message with the argument name, the expected type, and a hint:
|
|
758
761
|
|
|
759
762
|
```bash
|
|
760
|
-
dot tx
|
|
763
|
+
dot tx.Balances.transferKeepAlive 5GrwvaEF... abc --encode --chain polkadot
|
|
761
764
|
# Error: Invalid value for argument 'value' (expected Compact<u128>): "abc"
|
|
762
765
|
# Hint: Compact<u128>
|
|
763
766
|
```
|
|
@@ -770,15 +773,15 @@ By default, `dot tx` waits for finalization (~30s on Polkadot). Use `--wait` / `
|
|
|
770
773
|
|
|
771
774
|
```bash
|
|
772
775
|
# Return as soon as the tx is broadcast (fastest)
|
|
773
|
-
dot tx
|
|
776
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot --wait broadcast
|
|
774
777
|
|
|
775
778
|
# Return when included in a best block
|
|
776
|
-
dot tx
|
|
777
|
-
dot tx
|
|
779
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot -w best-block
|
|
780
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot -w best # alias
|
|
778
781
|
|
|
779
782
|
# Wait for finalization (default, unchanged)
|
|
780
|
-
dot tx
|
|
781
|
-
dot tx
|
|
783
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot --wait finalized
|
|
784
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot # same
|
|
782
785
|
```
|
|
783
786
|
|
|
784
787
|
| Level | Resolves when | Events shown | Explorer links |
|
|
@@ -791,7 +794,7 @@ The `--wait` flag is silently ignored when combined with `--dry-run` or `--encod
|
|
|
791
794
|
|
|
792
795
|
#### Custom signed extensions
|
|
793
796
|
|
|
794
|
-
Chains with non-standard signed extensions
|
|
797
|
+
Chains with non-standard signed extensions are auto-handled:
|
|
795
798
|
|
|
796
799
|
- `void` → empty bytes
|
|
797
800
|
- `Option<T>` → `None`
|
|
@@ -800,7 +803,7 @@ Chains with non-standard signed extensions (e.g. `people-preview`) are auto-hand
|
|
|
800
803
|
For manual override, use `--ext` with a JSON object:
|
|
801
804
|
|
|
802
805
|
```bash
|
|
803
|
-
dot tx
|
|
806
|
+
dot tx.System.remark 0xdeadbeef --from alice --chain polkadot --ext '{"MyExtension":{"value":"..."}}'
|
|
804
807
|
```
|
|
805
808
|
|
|
806
809
|
#### Transaction options
|
|
@@ -816,23 +819,23 @@ Override low-level transaction parameters. Useful for rapid-fire submission (cus
|
|
|
816
819
|
|
|
817
820
|
```bash
|
|
818
821
|
# Fire-and-forget: submit two txs in rapid succession with manual nonces
|
|
819
|
-
dot tx
|
|
820
|
-
dot tx
|
|
822
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot --nonce 0 --wait broadcast
|
|
823
|
+
dot tx.System.remark 0xbeef --from alice --chain polkadot --nonce 1 --wait broadcast
|
|
821
824
|
|
|
822
825
|
# Add a priority tip (in planck)
|
|
823
|
-
dot tx
|
|
826
|
+
dot tx.Balances.transferKeepAlive 5FHneW46... 1000000000000 --from alice --chain polkadot --tip 1000000
|
|
824
827
|
|
|
825
828
|
# Submit an immortal transaction (no expiry)
|
|
826
|
-
dot tx
|
|
829
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot --mortality immortal
|
|
827
830
|
|
|
828
831
|
# Set a custom mortality period (rounds up to nearest power of two)
|
|
829
|
-
dot tx
|
|
832
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot --mortality 128
|
|
830
833
|
|
|
831
834
|
# Validate against a specific block hash
|
|
832
|
-
dot tx
|
|
835
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot --at 0x1234...abcd
|
|
833
836
|
|
|
834
837
|
# Combine: rapid-fire with tip and broadcast-only
|
|
835
|
-
dot tx
|
|
838
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot --nonce 5 --tip 500000 --wait broadcast
|
|
836
839
|
```
|
|
837
840
|
|
|
838
841
|
When set, nonce / tip / mortality / at are shown in both `--dry-run` and submission output. These flags are silently ignored with `--encode`, `--to-yaml`, and `--to-json` (which return before signing).
|
|
@@ -843,12 +846,12 @@ On asset-hub-style chains (Polkadot Asset Hub, Paseo Asset Hub, etc.) the `Charg
|
|
|
843
846
|
|
|
844
847
|
```bash
|
|
845
848
|
# Pay fees in USDT (asset id 1337, PalletInstance 50) on Polkadot Asset Hub
|
|
846
|
-
dot tx
|
|
849
|
+
dot tx.Balances.transfer_keep_alive 5FHneW46... 1000000000000 \
|
|
847
850
|
--from alice --chain polkadot-asset-hub \
|
|
848
851
|
--asset '{"parents":0,"interior":{"type":"X2","value":[{"type":"PalletInstance","value":50},{"type":"GeneralIndex","value":"1337"}]}}'
|
|
849
852
|
|
|
850
853
|
# Dry-run to see the native-denominated fee estimate
|
|
851
|
-
dot tx
|
|
854
|
+
dot tx.Balances.transfer_keep_alive 5FHneW46... 1000000000000 \
|
|
852
855
|
--from alice --chain polkadot-asset-hub --dry-run \
|
|
853
856
|
--asset '{"parents":0,"interior":{"type":"X2","value":[{"type":"PalletInstance","value":50},{"type":"GeneralIndex","value":"1337"}]}}'
|
|
854
857
|
```
|
|
@@ -868,19 +871,19 @@ Submit transactions without a signer using `--unsigned`. This is for calls autho
|
|
|
868
871
|
|
|
869
872
|
```bash
|
|
870
873
|
# Submit an authorized call on the People chain
|
|
871
|
-
dot tx
|
|
874
|
+
dot tx.People.create_people_collection --unsigned --chain polkadot-people
|
|
872
875
|
|
|
873
876
|
# Dry-run to inspect before submitting
|
|
874
|
-
dot tx
|
|
877
|
+
dot tx.People.create_people_collection --unsigned --chain polkadot-people --dry-run
|
|
875
878
|
|
|
876
879
|
# Encode the full general transaction bytes
|
|
877
|
-
dot tx
|
|
880
|
+
dot tx.People.create_people_collection --unsigned --chain polkadot-people --encode
|
|
878
881
|
|
|
879
882
|
# With raw hex call data
|
|
880
|
-
dot tx 0x3306 --unsigned --chain people
|
|
883
|
+
dot tx 0x3306 --unsigned --chain polkadot-people
|
|
881
884
|
|
|
882
885
|
# JSON output for scripting
|
|
883
|
-
dot tx
|
|
886
|
+
dot tx.People.create_people_collection --unsigned --chain polkadot-people --json
|
|
884
887
|
```
|
|
885
888
|
|
|
886
889
|
The CLI constructs a v5 general transaction with all extension values auto-defaulted (`VerifySignature::Disabled`, `Era::Immortal`, nonce `0`, tip `0`, etc.). Override individual extensions with `--ext` if needed.
|
|
@@ -888,7 +891,7 @@ The CLI constructs a v5 general transaction with all extension values auto-defau
|
|
|
888
891
|
`--unsigned` is mutually exclusive with `--from`, `--nonce`, `--tip`, and `--mortality`. File-based input supports `unsigned: true`:
|
|
889
892
|
|
|
890
893
|
```yaml
|
|
891
|
-
chain: people
|
|
894
|
+
chain: polkadot-people
|
|
892
895
|
unsigned: true
|
|
893
896
|
tx:
|
|
894
897
|
People:
|
|
@@ -1076,7 +1079,7 @@ Hex values passed via `--var` are preserved as-is, including leading zeros. This
|
|
|
1076
1079
|
|
|
1077
1080
|
```bash
|
|
1078
1081
|
# Encode a remark, then embed it in an XCM Transact via --var
|
|
1079
|
-
CALL=$(dot tx.System.remark 0xdead --encode)
|
|
1082
|
+
CALL=$(dot tx.System.remark 0xdead --encode --chain polkadot)
|
|
1080
1083
|
dot ./xcm-transact.yaml --var CALL=$CALL --encode
|
|
1081
1084
|
```
|
|
1082
1085
|
|
|
@@ -1201,21 +1204,24 @@ dot hash --help # same as `dot hash` — shows algorithms and examples
|
|
|
1201
1204
|
|
|
1202
1205
|
#### Item-level help
|
|
1203
1206
|
|
|
1204
|
-
Use `--help` on any fully-qualified dot-path to see metadata detail and category-specific usage hints
|
|
1207
|
+
Use `--help` on any fully-qualified dot-path to see metadata detail and category-specific usage hints. The chain is required (so the CLI knows which metadata to load), but the call itself runs offline from the cache:
|
|
1205
1208
|
|
|
1206
1209
|
```bash
|
|
1207
|
-
dot tx.System.remark --help
|
|
1208
|
-
dot query.System.Account --help
|
|
1209
|
-
dot const.Balances.ExistentialDeposit --help
|
|
1210
|
-
dot events.Balances.Transfer --help
|
|
1211
|
-
dot errors.Balances.InsufficientBalance --help
|
|
1212
|
-
dot apis.Core.version --help
|
|
1210
|
+
dot tx.System.remark --help --chain polkadot # call args, docs, and tx options
|
|
1211
|
+
dot query.System.Account --help --chain polkadot # storage type, key/value info, and query options
|
|
1212
|
+
dot const.Balances.ExistentialDeposit --help --chain polkadot # constant type and docs
|
|
1213
|
+
dot events.Balances.Transfer --help --chain polkadot # event fields and docs
|
|
1214
|
+
dot errors.Balances.InsufficientBalance --help --chain polkadot # error docs
|
|
1215
|
+
dot apis.Core.version --help --chain polkadot # runtime API method signature and docs
|
|
1216
|
+
|
|
1217
|
+
# A chain prefix is equivalent
|
|
1218
|
+
dot polkadot.tx.System.remark --help
|
|
1213
1219
|
```
|
|
1214
1220
|
|
|
1215
1221
|
For `tx` commands, omitting both `--from` and `--encode` shows this same help output instead of an error:
|
|
1216
1222
|
|
|
1217
1223
|
```bash
|
|
1218
|
-
dot tx.System.remark 0xdead
|
|
1224
|
+
dot tx.System.remark 0xdead --chain polkadot # shows call help (no error)
|
|
1219
1225
|
```
|
|
1220
1226
|
|
|
1221
1227
|
### Global options
|
|
@@ -1236,20 +1242,20 @@ dot tx.System.remark 0xdead # shows call help (no error)
|
|
|
1236
1242
|
Every command supports `--json` for machine-readable output. This works on data queries, metadata inspection, account management, chain configuration, and transaction submission:
|
|
1237
1243
|
|
|
1238
1244
|
```bash
|
|
1239
|
-
dot inspect --json
|
|
1240
|
-
dot inspect Balances --json
|
|
1241
|
-
dot chain list --json
|
|
1242
|
-
dot account list --json
|
|
1243
|
-
dot account create my-key --json
|
|
1244
|
-
dot tx.System.remark 0xdead --encode --json
|
|
1245
|
-
dot events.Balances --json
|
|
1246
|
-
dot const.System --json
|
|
1245
|
+
dot inspect --json --chain polkadot # All pallets as JSON
|
|
1246
|
+
dot inspect Balances --json --chain polkadot # Pallet detail with storage, constants, calls, events, errors
|
|
1247
|
+
dot chain list --json # Configured chains
|
|
1248
|
+
dot account list --json # Dev and stored accounts
|
|
1249
|
+
dot account create my-key --json # New account details (mnemonic warning on stderr)
|
|
1250
|
+
dot polkadot.tx.System.remark 0xdead --encode --json # Encoded call hex wrapped in JSON
|
|
1251
|
+
dot polkadot.events.Balances --json # Event listing with field signatures
|
|
1252
|
+
dot polkadot.const.System --json # Constant listing with types
|
|
1247
1253
|
```
|
|
1248
1254
|
|
|
1249
1255
|
For transaction submission, `--json` emits NDJSON (one JSON object per lifecycle event):
|
|
1250
1256
|
|
|
1251
1257
|
```bash
|
|
1252
|
-
dot tx.System.remark 0xdead --from alice --json
|
|
1258
|
+
dot tx.System.remark 0xdead --from alice --chain polkadot --json
|
|
1253
1259
|
# {"event":"signed","txHash":"0x..."}
|
|
1254
1260
|
# {"event":"broadcasted","txHash":"0x..."}
|
|
1255
1261
|
# {"event":"finalized","blockNumber":123,"blockHash":"0x...","ok":true,"events":[...]}
|
|
@@ -1260,11 +1266,11 @@ dot tx.System.remark 0xdead --from alice --json
|
|
|
1260
1266
|
All commands follow Unix conventions: **data goes to stdout, progress goes to stderr**. This means you can safely pipe `--json` into `jq` or other tools without progress messages ("Fetching metadata...", spinner output, "Connecting...") corrupting the data stream:
|
|
1261
1267
|
|
|
1262
1268
|
```bash
|
|
1263
|
-
dot const
|
|
1264
|
-
dot query
|
|
1269
|
+
dot polkadot.const.System.SS58Prefix --json | jq '.+1'
|
|
1270
|
+
dot polkadot.query.System.Number --json | jq
|
|
1265
1271
|
dot chain list --json | jq '.chains[].name'
|
|
1266
1272
|
dot account list --json | jq '.stored[].address'
|
|
1267
|
-
dot inspect --json | jq '.pallets[] | select(.events > 10) | .name'
|
|
1273
|
+
dot inspect --json --chain polkadot | jq '.pallets[] | select(.events > 10) | .name'
|
|
1268
1274
|
```
|
|
1269
1275
|
|
|
1270
1276
|
In an interactive terminal, both streams render together so you see progress and results normally.
|
|
@@ -1308,7 +1314,7 @@ Completions are context-aware: `query.` shows pallets with storage items, `tx.`
|
|
|
1308
1314
|
| **Read constants** | yes | yes | yes | — |
|
|
1309
1315
|
| **Submit extrinsics** | yes, with dry-run | yes (via `--seed`) | — | ink! contract calls only |
|
|
1310
1316
|
| **Inspect metadata** | yes | — | yes (excellent browser) | — |
|
|
1311
|
-
| **Chain presets** | built-in aliases (`--chain
|
|
1317
|
+
| **Chain presets** | built-in aliases (`--chain polkadot`) | — (manual `--ws` every call) | — | parachain templates |
|
|
1312
1318
|
| **Tx tracking + explorer links** | spinner progress, block + explorer link | basic events | — | — |
|
|
1313
1319
|
|
|
1314
1320
|
polkadot-cli aims to be the single tool for day-to-day chain interaction: storage reads, constant lookups, transaction submission, and metadata browsing with a polished terminal UX. @polkadot/api-cli covers similar ground but is in maintenance mode and requires verbose flags. subxt-cli has an excellent metadata explorer but cannot sign or submit transactions. Pop CLI targets a different workflow — scaffolding parachains and deploying ink! contracts rather than end-user chain queries.
|
|
@@ -1364,7 +1370,7 @@ Requires [Bun](https://bun.sh).
|
|
|
1364
1370
|
|
|
1365
1371
|
```bash
|
|
1366
1372
|
bun install
|
|
1367
|
-
bun run dev -- query
|
|
1373
|
+
bun run dev -- polkadot.query.System.Number
|
|
1368
1374
|
bun run build
|
|
1369
1375
|
bun test
|
|
1370
1376
|
```
|
package/dist/cli.mjs
CHANGED
|
@@ -1894,7 +1894,8 @@ async function showItemHelp(category, target, opts) {
|
|
|
1894
1894
|
}
|
|
1895
1895
|
console.log();
|
|
1896
1896
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
1897
|
-
console.log(` dot apis.${api.name}.${method.name}`);
|
|
1897
|
+
console.log(` dot ${chainName}.apis.${api.name}.${method.name}`);
|
|
1898
|
+
console.log(` dot apis.${api.name}.${method.name} --chain ${chainName}`);
|
|
1898
1899
|
console.log();
|
|
1899
1900
|
return;
|
|
1900
1901
|
}
|
|
@@ -1936,8 +1937,9 @@ async function showItemHelp(category, target, opts) {
|
|
|
1936
1937
|
}
|
|
1937
1938
|
console.log();
|
|
1938
1939
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
1939
|
-
console.log(` dot tx.${pallet.name}.${callItem.name} --from <account
|
|
1940
|
-
console.log(` dot tx.${pallet.name}.${callItem.name} --encode`);
|
|
1940
|
+
console.log(` dot tx.${pallet.name}.${callItem.name} --from <account> --chain ${chainName}`);
|
|
1941
|
+
console.log(` dot tx.${pallet.name}.${callItem.name} --encode --chain ${chainName}`);
|
|
1942
|
+
console.log(` dot ${chainName}.tx.${pallet.name}.${callItem.name} --from <account>`);
|
|
1941
1943
|
console.log();
|
|
1942
1944
|
console.log(`${BOLD}Options:${RESET}`);
|
|
1943
1945
|
console.log(` --from <name> Account to sign with`);
|
|
@@ -1966,11 +1968,11 @@ async function showItemHelp(category, target, opts) {
|
|
|
1966
1968
|
console.log();
|
|
1967
1969
|
if (storageItem.keyTypeId != null) {
|
|
1968
1970
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
1969
|
-
console.log(` dot query.${pallet.name}.${storageItem.name} <key>`);
|
|
1970
|
-
console.log(` dot query.${pallet.name}.${storageItem.name} --dump # all entries`);
|
|
1971
|
+
console.log(` dot ${chainName}.query.${pallet.name}.${storageItem.name} <key>`);
|
|
1972
|
+
console.log(` dot ${chainName}.query.${pallet.name}.${storageItem.name} --dump # all entries`);
|
|
1971
1973
|
} else {
|
|
1972
1974
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
1973
|
-
console.log(` dot query.${pallet.name}.${storageItem.name}`);
|
|
1975
|
+
console.log(` dot ${chainName}.query.${pallet.name}.${storageItem.name}`);
|
|
1974
1976
|
}
|
|
1975
1977
|
console.log();
|
|
1976
1978
|
console.log(`${BOLD}Options:${RESET}`);
|
|
@@ -1992,7 +1994,7 @@ async function showItemHelp(category, target, opts) {
|
|
|
1992
1994
|
}
|
|
1993
1995
|
console.log();
|
|
1994
1996
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
1995
|
-
console.log(` dot const.${pallet.name}.${constItem.name}`);
|
|
1997
|
+
console.log(` dot ${chainName}.const.${pallet.name}.${constItem.name}`);
|
|
1996
1998
|
console.log();
|
|
1997
1999
|
return;
|
|
1998
2000
|
}
|
|
@@ -2011,7 +2013,7 @@ async function showItemHelp(category, target, opts) {
|
|
|
2011
2013
|
}
|
|
2012
2014
|
console.log();
|
|
2013
2015
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
2014
|
-
console.log(` dot events.${pallet.name}.${eventItem.name}`);
|
|
2016
|
+
console.log(` dot ${chainName}.events.${pallet.name}.${eventItem.name}`);
|
|
2015
2017
|
console.log();
|
|
2016
2018
|
return;
|
|
2017
2019
|
}
|
|
@@ -2027,7 +2029,7 @@ async function showItemHelp(category, target, opts) {
|
|
|
2027
2029
|
}
|
|
2028
2030
|
console.log();
|
|
2029
2031
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
2030
|
-
console.log(` dot errors.${pallet.name}.${errorItem.name}`);
|
|
2032
|
+
console.log(` dot ${chainName}.errors.${pallet.name}.${errorItem.name}`);
|
|
2031
2033
|
console.log();
|
|
2032
2034
|
return;
|
|
2033
2035
|
}
|
|
@@ -2426,7 +2428,7 @@ var init_complete = __esm(() => {
|
|
|
2426
2428
|
// src/cli.ts
|
|
2427
2429
|
import cac from "cac";
|
|
2428
2430
|
// package.json
|
|
2429
|
-
var version = "1.14.
|
|
2431
|
+
var version = "1.14.2";
|
|
2430
2432
|
|
|
2431
2433
|
// src/commands/account.ts
|
|
2432
2434
|
init_accounts_store();
|
|
@@ -4230,7 +4232,8 @@ async function showItemHelp2(category, target, opts) {
|
|
|
4230
4232
|
}
|
|
4231
4233
|
console.log();
|
|
4232
4234
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
4233
|
-
console.log(` dot apis.${api.name}.${method.name}`);
|
|
4235
|
+
console.log(` dot ${chainName}.apis.${api.name}.${method.name}`);
|
|
4236
|
+
console.log(` dot apis.${api.name}.${method.name} --chain ${chainName}`);
|
|
4234
4237
|
console.log();
|
|
4235
4238
|
return;
|
|
4236
4239
|
}
|
|
@@ -4272,8 +4275,9 @@ async function showItemHelp2(category, target, opts) {
|
|
|
4272
4275
|
}
|
|
4273
4276
|
console.log();
|
|
4274
4277
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
4275
|
-
console.log(` dot tx.${pallet.name}.${callItem.name} --from <account
|
|
4276
|
-
console.log(` dot tx.${pallet.name}.${callItem.name} --encode`);
|
|
4278
|
+
console.log(` dot tx.${pallet.name}.${callItem.name} --from <account> --chain ${chainName}`);
|
|
4279
|
+
console.log(` dot tx.${pallet.name}.${callItem.name} --encode --chain ${chainName}`);
|
|
4280
|
+
console.log(` dot ${chainName}.tx.${pallet.name}.${callItem.name} --from <account>`);
|
|
4277
4281
|
console.log();
|
|
4278
4282
|
console.log(`${BOLD}Options:${RESET}`);
|
|
4279
4283
|
console.log(` --from <name> Account to sign with`);
|
|
@@ -4302,11 +4306,11 @@ async function showItemHelp2(category, target, opts) {
|
|
|
4302
4306
|
console.log();
|
|
4303
4307
|
if (storageItem.keyTypeId != null) {
|
|
4304
4308
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
4305
|
-
console.log(` dot query.${pallet.name}.${storageItem.name} <key>`);
|
|
4306
|
-
console.log(` dot query.${pallet.name}.${storageItem.name} --dump # all entries`);
|
|
4309
|
+
console.log(` dot ${chainName}.query.${pallet.name}.${storageItem.name} <key>`);
|
|
4310
|
+
console.log(` dot ${chainName}.query.${pallet.name}.${storageItem.name} --dump # all entries`);
|
|
4307
4311
|
} else {
|
|
4308
4312
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
4309
|
-
console.log(` dot query.${pallet.name}.${storageItem.name}`);
|
|
4313
|
+
console.log(` dot ${chainName}.query.${pallet.name}.${storageItem.name}`);
|
|
4310
4314
|
}
|
|
4311
4315
|
console.log();
|
|
4312
4316
|
console.log(`${BOLD}Options:${RESET}`);
|
|
@@ -4328,7 +4332,7 @@ async function showItemHelp2(category, target, opts) {
|
|
|
4328
4332
|
}
|
|
4329
4333
|
console.log();
|
|
4330
4334
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
4331
|
-
console.log(` dot const.${pallet.name}.${constItem.name}`);
|
|
4335
|
+
console.log(` dot ${chainName}.const.${pallet.name}.${constItem.name}`);
|
|
4332
4336
|
console.log();
|
|
4333
4337
|
return;
|
|
4334
4338
|
}
|
|
@@ -4347,7 +4351,7 @@ async function showItemHelp2(category, target, opts) {
|
|
|
4347
4351
|
}
|
|
4348
4352
|
console.log();
|
|
4349
4353
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
4350
|
-
console.log(` dot events.${pallet.name}.${eventItem.name}`);
|
|
4354
|
+
console.log(` dot ${chainName}.events.${pallet.name}.${eventItem.name}`);
|
|
4351
4355
|
console.log();
|
|
4352
4356
|
return;
|
|
4353
4357
|
}
|
|
@@ -4363,7 +4367,7 @@ async function showItemHelp2(category, target, opts) {
|
|
|
4363
4367
|
}
|
|
4364
4368
|
console.log();
|
|
4365
4369
|
console.log(`${BOLD}Usage:${RESET}`);
|
|
4366
|
-
console.log(` dot errors.${pallet.name}.${errorItem.name}`);
|
|
4370
|
+
console.log(` dot ${chainName}.errors.${pallet.name}.${errorItem.name}`);
|
|
4367
4371
|
console.log();
|
|
4368
4372
|
return;
|
|
4369
4373
|
}
|
|
@@ -5421,7 +5425,7 @@ async function handleTx(target, args, opts) {
|
|
|
5421
5425
|
if (isRawCall) {
|
|
5422
5426
|
if (args.length > 0) {
|
|
5423
5427
|
throw new Error(`Extra arguments are not allowed when submitting a raw call hex.
|
|
5424
|
-
` + "Usage: dot tx 0x<call_hex> --from <account>");
|
|
5428
|
+
` + "Usage: dot tx 0x<call_hex> --from <account> --chain <chain>");
|
|
5425
5429
|
}
|
|
5426
5430
|
callHex = target;
|
|
5427
5431
|
if (opts.toYaml || opts.toJson) {
|
|
@@ -7106,18 +7110,18 @@ if (process.argv[2] === "__complete") {
|
|
|
7106
7110
|
console.log(" apis Browse and call runtime APIs");
|
|
7107
7111
|
console.log();
|
|
7108
7112
|
console.log("Examples:");
|
|
7109
|
-
console.log(" dot query.System.Account <addr>
|
|
7110
|
-
console.log(" dot query.System
|
|
7111
|
-
console.log(" dot tx.System.remark 0xdead --from alice");
|
|
7112
|
-
console.log(" dot tx.
|
|
7113
|
-
console.log(" dot const.Balances.ExistentialDeposit");
|
|
7114
|
-
console.log(" dot events.Balances
|
|
7115
|
-
console.log(" dot apis.Core.version
|
|
7116
|
-
console.log(" dot
|
|
7117
|
-
console.log(" dot ./transfer.yaml --from alice
|
|
7118
|
-
console.log(" dot tx.0x1f0003... --to-yaml
|
|
7119
|
-
console.log(" dot tx.System.remark 0xdead --to-json
|
|
7120
|
-
console.log(" dot query.System.Number --json
|
|
7113
|
+
console.log(" dot polkadot.query.System.Account <addr> Query a storage item");
|
|
7114
|
+
console.log(" dot polkadot.query.System List storage items in System");
|
|
7115
|
+
console.log(" dot tx.System.remark 0xdead --from alice --chain polkadot");
|
|
7116
|
+
console.log(" dot tx.People.create_people_collection --unsigned --chain polkadot-people");
|
|
7117
|
+
console.log(" dot polkadot.const.Balances.ExistentialDeposit");
|
|
7118
|
+
console.log(" dot polkadot.events.Balances List events in Balances");
|
|
7119
|
+
console.log(" dot polkadot.apis.Core.version Call a runtime API");
|
|
7120
|
+
console.log(" dot query.System.Number --chain polkadot --chain flag form");
|
|
7121
|
+
console.log(" dot ./transfer.yaml --from alice Run from file (chain in YAML)");
|
|
7122
|
+
console.log(" dot tx.0x1f0003... --to-yaml --chain polkadot Decode hex call to YAML");
|
|
7123
|
+
console.log(" dot tx.System.remark 0xdead --to-json --chain polkadot Output as JSON file format");
|
|
7124
|
+
console.log(" dot polkadot.query.System.Number --json JSON output");
|
|
7121
7125
|
console.log();
|
|
7122
7126
|
console.log("Commands:");
|
|
7123
7127
|
console.log(" inspect [target] Inspect chain metadata (alias: explore)");
|