polkadot-cli 1.16.0 → 1.17.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.
Files changed (3) hide show
  1. package/README.md +498 -150
  2. package/dist/cli.mjs +712 -224
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -102,6 +102,12 @@ dot chain add my-para --rpc wss://rpc.example.com --relay polkadot --parachain-i
102
102
 
103
103
  # List configured chains (shows relay/parachain hierarchy)
104
104
  dot chain list
105
+ dot chains # shorthand
106
+ dot chains -v # include RPC endpoints in the list
107
+
108
+ # Inspect a single chain (rpc, parachains, metadata cache status)
109
+ dot chain info polkadot
110
+ dot chain polkadot # bare-noun shortcut, same as `chain info polkadot`
105
111
 
106
112
  # Re-fetch metadata after a runtime upgrade
107
113
  dot chain update polkadot # updates a specific chain
@@ -115,37 +121,74 @@ dot chain remove kusama
115
121
 
116
122
  `dot chain list` displays chains as a tree, grouping parachains under their parent relay:
117
123
 
124
+ ```
125
+ Configured Chains
126
+
127
+ polkadot
128
+ ├─ polkadot-asset-hub [1000]
129
+ ├─ polkadot-bridge-hub [1002]
130
+ ├─ polkadot-collectives [1001]
131
+ ├─ polkadot-coretime [1005]
132
+ └─ polkadot-people [1004]
133
+
134
+ paseo
135
+ ├─ paseo-asset-hub [1000]
136
+ └─ paseo-people [1004]
137
+
138
+ my-solo-chain
139
+ ```
140
+
141
+ The default list is intentionally compact — names + relay tree + parachain IDs. Pass `-v` / `--verbose` to also print every RPC endpoint inline (à la `git remote -v`):
142
+
118
143
  ```
119
144
  Configured Chains
120
145
 
121
146
  polkadot wss://polkadot.ibp.network
122
- ├─ polkadot-asset-hub [1000] wss://...
123
- ├─ polkadot-bridge-hub [1002] wss://...
124
- ├─ polkadot-collectives [1001] wss://...
125
- ├─ polkadot-coretime [1005] wss://...
126
- └─ polkadot-people [1004] wss://...
147
+ wss://polkadot-rpc.n.dwellir.com
148
+ wss://rpc.polkadot.io
149
+ ├─ polkadot-asset-hub [1000] wss://polkadot-asset-hub-rpc.polkadot.io
150
+ ...
151
+ ```
127
152
 
128
- paseo wss://paseo.ibp.network
129
- ├─ paseo-asset-hub [1000] wss://...
130
- └─ paseo-people [1004] wss://...
153
+ For the full set of fields for one chain (RPCs, parent relay, child parachains, metadata cache status), use `dot chain info <name>`:
154
+
155
+ ```
156
+ dot chain info polkadot
131
157
 
132
- my-solo-chain wss://...
158
+ # polkadot
159
+ #
160
+ # rpc:
161
+ # wss://polkadot.ibp.network
162
+ # wss://rpc.polkadot.io
163
+ # ...
164
+ # parachains:
165
+ # polkadot-asset-hub [1000]
166
+ # polkadot-bridge-hub [1002]
167
+ # ...
168
+ # metadata:
169
+ # not cached — run `dot chain update polkadot`
133
170
  ```
134
171
 
172
+ After a successful `dot chain update <name>`, the `metadata:` row shows the cached `specName`, `specVersion`, and `fetchedAt` timestamp instead of the `not cached` hint. `dot chain info <name> --json` emits the same data as a structured object (with `metadata: null` when no fingerprint is cached). Names resolve case-insensitively. The bare-noun form `dot chain <name>` is a shortcut for `dot chain info <name>` — known action verbs (`add`, `remove`, `update`, `list`, `export`, `import`, `info`) take precedence over chain names if there's ever a clash.
173
+
135
174
  All built-in system parachains are preconfigured with their relay chain and parachain ID. When adding a custom parachain with `--relay`, the CLI auto-detects the parachain ID from on-chain `ParachainInfo` storage. Use `--parachain-id` to set it explicitly if auto-detection is not available.
136
175
 
137
176
  Removing a relay chain that has parachains prints a warning listing the orphaned chains. The parachains remain in the config and can be re-associated later.
138
177
 
139
178
  #### Selecting a chain
140
179
 
141
- Every chain-consuming command must specify a chain explicitly either with the global `--chain <name>` flag or with a dotpath chain prefix. There is no hidden default; running a command without a chain errors out with a message listing the configured chains.
180
+ Every chain-consuming command must specify a chain explicitly. Prefer the dotpath chain prefix; the `--chain <name>` flag is equivalent. There is no hidden default; running a command without a chain errors out with a message listing the configured chains.
142
181
 
143
182
  ```bash
144
- # Via --chain flag
145
- dot query.System.Number --chain polkadot
146
-
147
- # Via dotpath chain prefix
183
+ # Recommended — dotpath chain prefix
148
184
  dot polkadot.query.System.Number
185
+ # Output:
186
+ # 31014744
187
+
188
+ # Equivalent — --chain flag
189
+ dot query.System.Number --chain polkadot
190
+ # Output:
191
+ # 31014744
149
192
 
150
193
  # Both at once errors
151
194
  dot polkadot.query.System.Number --chain polkadot # ✗ errors
@@ -246,7 +289,7 @@ dot account add ci-signer --env MY_SECRET
246
289
  dot account derive treasury treasury-staking --path //staking
247
290
 
248
291
  # Use it — the env var is read at signing time
249
- MY_SECRET="word1 word2 ..." dot tx.System.remark 0xdead --from ci-signer --chain polkadot
292
+ MY_SECRET="word1 word2 ..." dot polkadot.tx.System.remark 0xdead --from ci-signer
250
293
 
251
294
  # Remove one or more accounts
252
295
  dot account remove my-validator
@@ -290,13 +333,13 @@ Named accounts (both watch-only and keyed) resolve automatically everywhere an A
290
333
 
291
334
  ```bash
292
335
  # Use a named account as transfer recipient
293
- dot tx.Balances.transferKeepAlive treasury 1000000000000 --from alice --chain polkadot
336
+ dot polkadot.tx.Balances.transfer_keep_alive treasury 1000000000000 --from alice
294
337
 
295
338
  # Query by account name
296
339
  dot polkadot.query.System.Account treasury
297
340
 
298
341
  # Dev accounts also resolve
299
- dot tx.Balances.transferKeepAlive bob 1000000000000 --from alice --chain polkadot
342
+ dot polkadot.tx.Balances.transfer_keep_alive bob 1000000000000 --from alice
300
343
  ```
301
344
 
302
345
  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:
@@ -340,7 +383,26 @@ JSON output:
340
383
 
341
384
  ```bash
342
385
  dot account inspect alice --json
343
- # {"publicKey":"0xd435...a27d","ss58":"5Grw...utQY","prefix":42,"name":"Alice"}
386
+ # Output:
387
+ # {
388
+ # "publicKey": "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
389
+ # "ss58": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
390
+ # "prefix": 42,
391
+ # "name": "Alice"
392
+ # }
393
+ ```
394
+
395
+ Plain text output:
396
+
397
+ ```bash
398
+ dot account inspect alice
399
+ # Output:
400
+ # Account Info
401
+ #
402
+ # Name: Alice
403
+ # Public Key: 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
404
+ # SS58: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
405
+ # Prefix: 42
344
406
  ```
345
407
 
346
408
  #### Reveal the sr25519 private key
@@ -445,7 +507,7 @@ Instead of the `--chain` flag, you can prefix the dot-path with the chain name.
445
507
  ```bash
446
508
  dot polkadot.query.System.Account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
447
509
  dot polkadot.const.Balances.ExistentialDeposit
448
- dot polkadot.tx.Balances.transferKeepAlive 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty 1000000000000 --from alice
510
+ dot polkadot.tx.Balances.transfer_keep_alive bob 1000000000 --from alice --dry-run
449
511
  dot inspect polkadot.System # for `inspect`, the prefix is the first arg
450
512
  dot inspect polkadot.System.Account
451
513
  ```
@@ -477,9 +539,24 @@ This works for all categories (`query`, `tx`, `const`, `events`, `errors`, `apis
477
539
  ```bash
478
540
  # Plain storage value
479
541
  dot polkadot.query.System.Number
542
+ # Output:
543
+ # 31014744
480
544
 
481
- # Map entry by key
545
+ # Map entry by key — Alice's account on Polkadot (free balance is u128 as a quoted string)
482
546
  dot polkadot.query.System.Account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
547
+ # Output:
548
+ # {
549
+ # "nonce": 0,
550
+ # "consumers": 0,
551
+ # "providers": 0,
552
+ # "sufficients": 0,
553
+ # "data": {
554
+ # "free": "0",
555
+ # "reserved": "0",
556
+ # "frozen": "0",
557
+ # "flags": "170141183460469231731687303715884105728"
558
+ # }
559
+ # }
483
560
 
484
561
  # Map without key — shows help/usage (use --dump to fetch all entries)
485
562
  dot polkadot.query.System.Account
@@ -522,15 +599,27 @@ Query results automatically convert on-chain types for readability:
522
599
 
523
600
  ```bash
524
601
  # Token metadata — symbol and name display as text, not {}
525
- dot paseo-asset-hub.query.Assets.Metadata 50000413
526
- # { "deposit": "6693666000", "name": "Paseo Token", "symbol": "PAS", ... }
602
+ dot polkadot-asset-hub.query.Assets.Metadata 1984
603
+ # Output:
604
+ # {
605
+ # "deposit": "2008200000",
606
+ # "name": "Tether USD",
607
+ # "symbol": "USDt",
608
+ # "decimals": 6,
609
+ # "is_frozen": false
610
+ # }
527
611
  ```
528
612
 
529
613
  ### Look up constants
530
614
 
531
615
  ```bash
532
616
  dot polkadot.const.Balances.ExistentialDeposit
617
+ # Output:
618
+ # "10000000000"
619
+
533
620
  dot polkadot.const.System.SS58Prefix
621
+ # Output:
622
+ # 0
534
623
 
535
624
  # --chain flag is equivalent
536
625
  dot const.Balances.ExistentialDeposit --chain polkadot
@@ -541,42 +630,94 @@ dot polkadot.const.Balances.ExistentialDeposit --json | jq
541
630
 
542
631
  ### Inspect metadata
543
632
 
544
- 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`).
633
+ Works offline from cached metadata after the first fetch. The chain is required. Prefer the chain-prefix-on-target form (`dot inspect polkadot.System`); `--chain` is equivalent. Note that `dot polkadot.inspect.X` does **not** parse — `inspect` is a top-level command, not a dotpath category.
545
634
 
546
- ```bash
547
- # List all pallets (shows storage, constants, calls, events, and errors counts)
548
- dot inspect --chain polkadot
549
-
550
- # List a pallet's storage items, constants, calls, events, and errors
551
- dot inspect System --chain polkadot
635
+ Output is **width-aware**: short type signatures stay on a single line, longer ones expand across multiple lines with field names aligned. Composite struct fields, enum variants, and call arguments are color-coded (cyan field names, yellow primitives, magenta container keywords like `Vec`/`Option`, green enum variants) when stdout is a TTY; piped output stays plain.
552
636
 
553
- # Detailed type info for a specific storage item or constant
554
- dot inspect System.Account --chain polkadot
555
-
556
- # Call detail — shows argument signature and docs
557
- dot inspect Balances.transfer_allow_death --chain polkadot
637
+ ```bash
638
+ # Pallet detail list storage, constants, calls, events, and errors
639
+ dot inspect polkadot.System
640
+ # Output:
641
+ # System Pallet
642
+ #
643
+ # Storage Items:
644
+ # Account [map]
645
+ # Key: AccountId32
646
+ # Value: {
647
+ # nonce : u32,
648
+ # consumers : u32,
649
+ # providers : u32,
650
+ # sufficients: u32,
651
+ # data : { free: u128, reserved: u128, frozen: u128, flags: u128 },
652
+ # }
653
+ # The full account information for a particular account ID.
654
+ # ...
655
+
656
+ # Storage item detail — full type and docs (each part on its own line)
657
+ dot inspect polkadot.System.Account
658
+ # Output:
659
+ # System.Account (Storage)
660
+ #
661
+ # Type: map
662
+ # Key: AccountId32
663
+ # Value: {
664
+ # nonce : u32,
665
+ # consumers : u32,
666
+ # providers : u32,
667
+ # sufficients: u32,
668
+ # data : { free: u128, reserved: u128, frozen: u128, flags: u128 },
669
+ # }
670
+ #
671
+ # The full account information for a particular account ID.
558
672
 
559
673
  # Event detail — shows field signature and docs
560
- dot inspect Balances.Transfer --chain polkadot
674
+ dot inspect polkadot.Balances.Transfer
675
+ # Output:
676
+ # Balances.Transfer (Event)
677
+ #
678
+ # Fields: (from: AccountId32, to: AccountId32, amount: u128)
679
+ #
680
+ # Transfer succeeded.
561
681
 
562
682
  # Error detail — shows docs
563
- dot inspect Balances.InsufficientBalance --chain polkadot
683
+ dot inspect polkadot.Balances.InsufficientBalance
684
+ # Output:
685
+ # Balances.InsufficientBalance (Error)
686
+ #
687
+ # Balance too low to send value.
564
688
 
565
- # Chain prefix on the inspect target works too (note: `dot polkadot.inspect.X` does NOT use either form below)
566
- dot inspect polkadot.System
567
- dot inspect polkadot.System.Account
689
+ # List all pallets single positional is read as a pallet name, so use --chain here
690
+ dot inspect --chain polkadot
568
691
  ```
569
692
 
570
693
  All listings — pallets, storage items, constants, calls, events, and errors — are sorted alphabetically, making it easy to find a specific item at a glance.
571
694
 
572
695
  The pallet listing view shows type information inline so you can understand item shapes at a glance:
573
696
 
574
- - **Storage**: key/value types with `[map]` tag for map items (e.g. `Account: AccountId32 { nonce: u32, ... } [map]`)
697
+ - **Storage**: name with optional `[map]` tag, followed by indented `Key:` / `Value:` lines (composite values expand to one field per line when wide)
575
698
  - **Constants**: the constant's type (e.g. `ExistentialDeposit: u128`)
576
- - **Calls**: full argument signature (e.g. `transfer_allow_death(dest: enum(5 variants), value: Compact<u128>)`)
577
- - **Events**: field signature (e.g. `Transfer(from: AccountId32, to: AccountId32, amount: u128)`)
699
+ - **Calls**: argument signature inline if it fits, otherwise one argument per line with names aligned by colon
700
+ - **Events**: field signature inline if it fits, otherwise one field per line
578
701
  - **Errors**: name and documentation (e.g. `InsufficientBalance`)
579
702
 
703
+ Long call signatures expand automatically:
704
+
705
+ ```bash
706
+ dot inspect polkadot.Referenda
707
+ # Output (excerpt):
708
+ # cancel(index: u32)
709
+ # Cancel an ongoing referendum.
710
+ # ...
711
+ # submit(
712
+ # proposal_origin : system | Origins | ParachainsOrigin | XcmPallet,
713
+ # proposal : Legacy | Inline | Lookup,
714
+ # enactment_moment: At | After,
715
+ # )
716
+ # Propose a referendum on a privileged action.
717
+ ```
718
+
719
+ Enums up to 24 variants now render as `A | B | C | …` (previously variants were collapsed to `enum(N variants)` for >4); only enums with more than 24 variants are still summarized for readability. So a transaction extension's value type like `Option<AsPersonalAliasWithAccount | AsPersonalAliasWithProof | …>` now spells out the variants you actually need to construct.
720
+
580
721
  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.
581
722
 
582
723
  ### Dump full metadata
@@ -584,7 +725,7 @@ Documentation from the runtime metadata is shown on an indented line below each
584
725
  `dot metadata <chain>` fetches the chain's runtime metadata and prints **everything** as one JSON blob — pallets (with calls, events, errors, storage, constants), runtime APIs, and transaction extensions, headed by a runtime fingerprint (`specVersion`, `transactionVersion`, `codeHash`, etc.). Useful for feeding LLM agents or pipelines that want a single source of truth instead of walking `dot inspect` piecemeal.
585
726
 
586
727
  ```bash
587
- # Decoded JSON — fetches fresh from the chain
728
+ # Decoded JSON — fetches fresh from the chain (top-level command; no chain prefix)
588
729
  dot metadata polkadot
589
730
 
590
731
  # SCALE-encoded metadata bytes as a single 0x… hex line (for tools that re-parse)
@@ -596,11 +737,33 @@ dot metadata polkadot --cached
596
737
  # Override the RPC endpoint
597
738
  dot metadata polkadot --rpc wss://rpc.example.com
598
739
 
599
- # Slice with jq — list call names in a pallet
600
- dot metadata polkadot | jq '.pallets[] | select(.name=="Balances") | .calls[].name'
740
+ # Slice with jq — list call names in Balances
741
+ dot metadata polkadot | jq -r '.pallets[] | select(.name=="Balances") | .calls[].name'
742
+ # Output:
743
+ # burn
744
+ # force_adjust_total_issuance
745
+ # force_set_balance
746
+ # force_transfer
747
+ # force_unreserve
748
+ # transfer_all
749
+ # transfer_allow_death
750
+ # transfer_keep_alive
751
+ # upgrade_accounts
601
752
 
602
753
  # All transaction extension identifiers
603
- dot metadata polkadot | jq '.transactionExtensions[].identifier'
754
+ dot metadata polkadot | jq -r '.transactionExtensions[].identifier'
755
+ # Output:
756
+ # AuthorizeCall
757
+ # CheckNonZeroSender
758
+ # CheckSpecVersion
759
+ # CheckTxVersion
760
+ # CheckGenesis
761
+ # CheckMortality
762
+ # CheckNonce
763
+ # CheckWeight
764
+ # ChargeTransactionPayment
765
+ # PrevalidateAttests
766
+ # CheckMetadataHash
604
767
  ```
605
768
 
606
769
  The decoded JSON is structured-only (no colorization), so it's safe to redirect to a file or pipe into other tools. The default fetches fresh from the RPC and atomically updates the local metadata cache and runtime-fingerprint sidecar — so subsequent commands benefit from the freshest possible metadata.
@@ -612,18 +775,43 @@ Browse and call Substrate runtime APIs. These are top-level APIs exposed by the
612
775
  ```bash
613
776
  # List all runtime APIs with method counts
614
777
  dot polkadot.apis
778
+ # Output:
779
+ # Runtime APIs on polkadot (24)
780
+ #
781
+ # AccountNonceApi 1 methods
782
+ # AssetHubMigrationApi 2 methods
783
+ # AuthorityDiscoveryApi 1 methods
784
+ # BabeApi 6 methods
785
+ # ...
615
786
 
616
787
  # List methods in a specific API (with signatures)
617
788
  dot polkadot.apis.Core
789
+ # Output:
790
+ # Core Methods
791
+ #
792
+ # execute_block(block: { header: { ... }, extrinsics: Vec<Vec<u8>> }) → unknown
793
+ # Execute the given block.
794
+ # initialize_block(header: { ... }) → AllExtrinsics | OnlyInherents
795
+ # Initialize a block with the given header and return the runtime executive mode.
796
+ # version() → { spec_name: str, impl_name: str, ... }
797
+ # Returns the version of the runtime.
618
798
 
619
799
  # Call a runtime API method
620
- dot polkadot.apis.Core.version
800
+ dot polkadot.apis.Core.version --json
801
+ # Output:
802
+ # {
803
+ # "spec_name": "polkadot",
804
+ # "impl_name": "parity-polkadot",
805
+ # "spec_version": 2002001,
806
+ # "transaction_version": 26,
807
+ # ...
808
+ # }
621
809
 
622
810
  # --chain flag is equivalent
623
811
  dot apis.Core.version --chain polkadot
624
812
 
625
813
  # Show method signature and docs (chain still required to load metadata)
626
- dot apis.Core.version --chain polkadot --help
814
+ dot polkadot.apis.Core.version --help
627
815
  ```
628
816
 
629
817
  `api` is an alias for `apis`.
@@ -651,16 +839,16 @@ Runtime API arguments accept the same shorthand as `dot tx` arguments:
651
839
  | `Vec<T>` (non-byte) | JSON array or comma-separated | `[1,2,3]`, `1,2,3` |
652
840
  | Structs / nested enums | JSON | `{"type":"X1","value":{…}}` |
653
841
 
654
- For sized byte arrays (`[u8; N]`) — common for Ethereum-style addresses (`H160`, `[u8; 20]`), 32-byte hashes (`H256`), and raw `AccountId32` bytes — pass a `0x`-prefixed hex string. Example: a contract call against the `pallet-revive` runtime API:
842
+ For sized byte arrays (`[u8; N]`) — common for Ethereum-style addresses (`H160`, `[u8; 20]`), 32-byte hashes (`H256`), and raw `AccountId32` bytes — pass a `0x`-prefixed hex string. Example: a contract call against the `pallet-revive` runtime API. Use `dot <chain>.apis.<ApiName>.<method> --help` to see the exact argument signature for any method.
655
843
 
656
844
  ```bash
657
- ALICE=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
845
+ ORIGIN=alice
658
846
  CONTRACT=0x970951a12f975e6762482aca81e57d5a2a4e73f4 # H160, [u8; 20]
659
847
  CALLDATA=$(cast calldata "set(uint256)" 42)
660
848
 
849
+ # Args: origin, dest, value, gas_limit (Option), storage_deposit (Option), input_data
661
850
  dot paseo-asset-hub.apis.ReviveApi.call \
662
- "$ALICE" "$CONTRACT" 0 null null "$CALLDATA"
663
- # ^ origin ^ dest ^ value ^ gas_limit (Option, none) ^ deposit (Option, none) ^ input_data (Vec<u8>)
851
+ "$ORIGIN" "$CONTRACT" 0 null null "$CALLDATA"
664
852
  ```
665
853
 
666
854
  ##### Passing `Option<T>`
@@ -668,9 +856,10 @@ dot paseo-asset-hub.apis.ReviveApi.call \
668
856
  Absent options (`None`) can be written three ways, all equivalent:
669
857
 
670
858
  ```bash
671
- dot paseo-asset-hub.apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 null null "$CALLDATA"
672
- dot paseo-asset-hub.apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 none none "$CALLDATA"
673
- dot paseo-asset-hub.apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 undefined undefined "$CALLDATA"
859
+ # null (recommended), none, and undefined all mean None
860
+ dot paseo-asset-hub.apis.ReviveApi.call "$ORIGIN" "$CONTRACT" 0 null null "$CALLDATA"
861
+ dot paseo-asset-hub.apis.ReviveApi.call "$ORIGIN" "$CONTRACT" 0 none none "$CALLDATA"
862
+ dot paseo-asset-hub.apis.ReviveApi.call "$ORIGIN" "$CONTRACT" 0 undefined undefined "$CALLDATA"
674
863
  ```
675
864
 
676
865
  `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.
@@ -679,7 +868,7 @@ A present option (`Some(value)`) is just the value itself — no wrapping:
679
868
 
680
869
  ```bash
681
870
  # gas_limit = Some({ ref_time: 1_000_000, proof_size: 100_000 })
682
- dot paseo-asset-hub.apis.ReviveApi.call "$ALICE" "$CONTRACT" 0 \
871
+ dot paseo-asset-hub.apis.ReviveApi.call "$ORIGIN" "$CONTRACT" 0 \
683
872
  '{"ref_time":1000000,"proof_size":100000}' \
684
873
  null \
685
874
  "$CALLDATA"
@@ -689,8 +878,6 @@ Notes:
689
878
  - The `null` / `none` / `undefined` literals are case-sensitive (lowercase only).
690
879
  - There is no `Some(value)` prefix — bare values are already treated as `Some`.
691
880
 
692
- Use `dot <chain>.apis.<ApiName>.<method> --help` to see the exact argument signature for any method.
693
-
694
881
  ### Focused metadata listings
695
882
 
696
883
  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`.
@@ -739,15 +926,29 @@ List the transaction extensions (also known as signed extensions) a chain declar
739
926
  ```bash
740
927
  # List all transaction extensions on a chain
741
928
  dot polkadot.extensions
929
+ # Output:
930
+ # Transaction extensions on polkadot (11)
931
+ #
932
+ # AuthorizeCall unknown [custom]
933
+ # ChargeTransactionPayment Compact<u128> [builtin]
934
+ # CheckGenesis unknown [builtin]
935
+ # CheckMetadataHash Disabled | Enabled [builtin]
936
+ # CheckMortality enum(256 variants) [builtin]
937
+ # CheckNonce Compact<u64> [builtin]
938
+ # CheckNonZeroSender unknown [builtin]
939
+ # CheckSpecVersion unknown [builtin]
940
+ # CheckTxVersion unknown [builtin]
941
+ # CheckWeight unknown [builtin]
942
+ # PrevalidateAttests unknown [builtin]
742
943
 
743
944
  # Detail view for a single extension
744
945
  dot polkadot.extensions.CheckMortality
745
-
746
- # --chain flag form is equivalent
747
- dot extensions.ChargeTransactionPayment --chain polkadot
748
-
749
- # Space-separated syntax also works
750
- dot extensions CheckMortality --chain polkadot
946
+ # Output:
947
+ # CheckMortality (Transaction Extension)
948
+ #
949
+ # Value type: enum(256 variants)
950
+ # AdditionalSigned: [u8; 32]
951
+ # Handled by: polkadot-api (builtin)
751
952
 
752
953
  # Structured output for scripts
753
954
  dot polkadot.extensions --json
@@ -767,29 +968,58 @@ The detail view shows the extension's value type, its `additionalSigned` type, a
767
968
  Build, sign, and submit transactions. Pass a `Pallet.Call` with arguments, or a raw SCALE-encoded call hex (e.g. from a multisig proposal or governance). Both forms display a decoded human-readable representation of the call.
768
969
 
769
970
  ```bash
770
- # Simple remark
771
- dot tx.System.remark 0xdeadbeef --from alice --chain polkadot
772
-
773
- # Transfer (amount in plancks)
774
- dot tx.Balances.transferKeepAlive 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty 1000000000000 --from alice --chain polkadot
775
-
776
- # Estimate fees without submitting
777
- dot tx.Balances.transferKeepAlive 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty 1000000000000 --from alice --chain polkadot --dry-run
971
+ # Estimate fees without submitting (no broadcast). The Decode block shows
972
+ # the call name on the header line and indented JSON below it.
973
+ dot polkadot.tx.System.remark 0xdeadbeef --from alice --dry-run
974
+ # Output:
975
+ # Chain: polkadot
976
+ # From: alice (5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY)
977
+ # Call: 0x000010deadbeef
978
+ # Decode: System.remark
979
+ # {
980
+ # "remark": "0xdeadbeef"
981
+ # }
982
+ # Estimated fees: 125598975
983
+
984
+ # Transfer (amount in plancks). Method names are snake_case.
985
+ dot polkadot.tx.Balances.transfer_keep_alive bob 1000000000000 --from alice --dry-run
986
+
987
+ # Submit (omit --dry-run)
988
+ dot polkadot.tx.System.remark 0xdeadbeef --from alice
778
989
 
779
990
  # Submit a raw SCALE-encoded call (e.g. from a multisig proposal or another tool)
780
- dot tx 0x0503008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48 --from alice --chain polkadot
781
-
782
- # Batch multiple transfers with Utility.batchAll (comma-separated encoded calls)
783
- A=$(dot tx.Balances.transfer_keep_alive 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty 1000000000000 --encode --chain polkadot)
784
- B=$(dot tx.Balances.transfer_keep_alive 5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y 2000000000000 --encode --chain polkadot)
785
- dot tx.Utility.batchAll $A,$B --from alice --chain polkadot
786
- ```
787
-
788
- The dot-prefix form works for `tx` too — these are equivalent:
991
+ dot polkadot.tx 0x000010deadbeef --from alice --dry-run
992
+
993
+ # Batch multiple remarks with Utility.batch_all (comma-separated encoded calls).
994
+ # Complex decoded calls remain readable because each level is indented.
995
+ A=$(dot polkadot.tx.System.remark 0xdeadbeef --encode)
996
+ B=$(dot polkadot.tx.System.remark 0xcafe --encode)
997
+ dot polkadot.tx.Utility.batch_all "$A,$B" --from alice --dry-run
998
+ # Output (excerpt — nested calls each get their own enum {type, value} envelope):
999
+ # Chain: polkadot
1000
+ # From: alice (5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY)
1001
+ # Call: 0x1a0208000010deadbeef000008cafe
1002
+ # Decode: Utility.batch_all
1003
+ # {
1004
+ # "calls": [
1005
+ # {
1006
+ # "type": "System",
1007
+ # "value": {
1008
+ # "type": "remark",
1009
+ # "value": { "remark": "0xdeadbeef" }
1010
+ # }
1011
+ # },
1012
+ # ...
1013
+ # ]
1014
+ # }
1015
+ # Estimated fees: 133994995
1016
+ ```
1017
+
1018
+ The `--chain` flag is equivalent to the chain prefix:
789
1019
 
790
1020
  ```bash
791
- dot tx.System.remark 0xdeadbeef --from alice --chain polkadot
792
1021
  dot polkadot.tx.System.remark 0xdeadbeef --from alice
1022
+ dot tx.System.remark 0xdeadbeef --from alice --chain polkadot
793
1023
  ```
794
1024
 
795
1025
  #### Enum shorthand
@@ -798,17 +1028,27 @@ Enum arguments accept a concise `Variant(value)` syntax instead of verbose JSON:
798
1028
 
799
1029
  ```bash
800
1030
  # Instead of: '{"type":"system","value":{"type":"Authorized"}}'
801
- dot tx.Utility.dispatch_as 'system(Authorized)' $(dot tx.System.remark 0xcafe --encode --chain polkadot) --from alice --chain polkadot
802
-
803
- # Nested enums work too
804
- dot tx.Utility.dispatch_as 'system(Signed(5FHneW46...))' <call> --from alice --chain polkadot
1031
+ dot polkadot.tx.Utility.dispatch_as 'system(Authorized)' $(dot polkadot.tx.System.remark 0xcafe --encode) --from alice --dry-run
1032
+ # Output:
1033
+ # Chain: polkadot
1034
+ # From: alice (5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY)
1035
+ # Call: 0x1a030003000008cafe
1036
+ # Decode: Utility.dispatch_as
1037
+ # {
1038
+ # "as_origin": { "type": "system", "value": { "type": "Authorized" } },
1039
+ # "call": { "type": "System", "value": { "type": "remark", "value": { "remark": "0xcafe" } } }
1040
+ # }
1041
+ # Estimated fees: 127644270
1042
+
1043
+ # Nested enums work too — Signed origin with an account
1044
+ dot polkadot.tx.Utility.dispatch_as 'system(Signed(bob))' "$INNER_CALL" --from alice --dry-run
805
1045
 
806
1046
  # Void variants — empty parens or just the name
807
- dot tx.Pallet.call 'Root()' ... --from alice --chain polkadot
808
- dot tx.Pallet.call 'Root' ... --from alice --chain polkadot
1047
+ dot polkadot.tx.Pallet.call 'Root()' ... --from alice
1048
+ dot polkadot.tx.Pallet.call 'Root' ... --from alice
809
1049
 
810
1050
  # JSON inside parens for struct values
811
- dot tx.Pallet.call 'AccountId32({"id":"0xd435..."})' ... --from alice --chain polkadot
1051
+ dot polkadot.tx.Pallet.call 'AccountId32({"id":"0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"})' ... --from alice
812
1052
  ```
813
1053
 
814
1054
  Variant matching is case-insensitive (`system` resolves to `system`, `authorized` to `Authorized`). All existing formats (JSON objects, hex, SS58 addresses) continue to work unchanged.
@@ -819,13 +1059,26 @@ Encode a call to hex without signing or submitting. Useful for preparing calls t
819
1059
 
820
1060
  ```bash
821
1061
  # Encode a remark call
822
- dot tx.System.remark 0xdeadbeef --encode --chain polkadot
1062
+ dot polkadot.tx.System.remark 0xdeadbeef --encode
1063
+ # Output:
1064
+ # 0x000010deadbeef
823
1065
 
824
1066
  # Encode a transfer (use the hex output in a batch or sudo call)
825
- dot tx.Balances.transfer_keep_alive 5FHneW46... 1000000000000 --encode --chain polkadot
826
-
827
- # Use encoded output with Sudo.sudo
828
- dot tx.Sudo.sudo $(dot tx.System.remark 0xcafe --encode --chain polkadot) --from alice --chain polkadot
1067
+ dot polkadot.tx.Balances.transfer_keep_alive bob 1000000000 --encode
1068
+ # Output:
1069
+ # 0x050300...02286bee
1070
+
1071
+ # Use encoded output with Sudo.sudo (Sudo only exists on testnets like Paseo)
1072
+ dot paseo-asset-hub.tx.Sudo.sudo $(dot paseo-asset-hub.tx.System.remark 0xcafe --encode) --from alice --dry-run
1073
+ # Output:
1074
+ # Chain: paseo-asset-hub
1075
+ # From: alice (5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY)
1076
+ # Call: 0xfb00000008cafe
1077
+ # Decode: Sudo.sudo
1078
+ # {
1079
+ # "call": { "type": "System", "value": { "type": "remark", "value": { "remark": "0xcafe" } } }
1080
+ # }
1081
+ # Estimated fees: ...
829
1082
  ```
830
1083
 
831
1084
  #### Decode call data to YAML / JSON
@@ -834,43 +1087,59 @@ Decode a hex-encoded call into a YAML or JSON file that is compatible with [file
834
1087
 
835
1088
  ```bash
836
1089
  # Decode a raw hex call to YAML
837
- dot tx.0x0001076465616462656566 --to-yaml --chain polkadot
1090
+ dot polkadot.tx.0x000010deadbeef --to-yaml
1091
+ # Output:
1092
+ # chain: polkadot
1093
+ # tx:
1094
+ # System:
1095
+ # remark:
1096
+ # remark: "0xdeadbeef"
838
1097
 
839
1098
  # Decode a raw hex call to JSON
840
- dot tx.0x0001076465616462656566 --to-json --chain polkadot
1099
+ dot polkadot.tx.0x000010deadbeef --to-json
1100
+ # Output:
1101
+ # {
1102
+ # "chain": "polkadot",
1103
+ # "tx": {
1104
+ # "System": {
1105
+ # "remark": {
1106
+ # "remark": "0xdeadbeef"
1107
+ # }
1108
+ # }
1109
+ # }
1110
+ # }
841
1111
 
842
1112
  # Encode a named call and output as YAML
843
- dot tx.System.remark 0xdeadbeef --to-yaml --chain polkadot
1113
+ dot polkadot.tx.System.remark 0xdeadbeef --to-yaml
844
1114
 
845
1115
  # Round-trip: encode to hex, decode to YAML, re-encode from file
846
- dot tx.System.remark 0xdeadbeef --encode --chain polkadot # 0x0001076465616462656566
847
- dot tx.0x0001076465616462656566 --to-yaml --chain polkadot > remark.yaml
848
- dot ./remark.yaml --encode # chain comes from the file
1116
+ dot polkadot.tx.System.remark 0xdeadbeef --encode # 0x000010deadbeef
1117
+ dot polkadot.tx.0x000010deadbeef --to-yaml > remark.yaml
1118
+ dot ./remark.yaml --encode # chain comes from the file
849
1119
  ```
850
1120
 
851
1121
  `--to-yaml` / `--to-json` are mutually exclusive with each other and with `--encode` and `--dry-run`.
852
1122
 
853
- Both dry-run and submission display the encoded call hex and a decoded human-readable form:
1123
+ Both dry-run and submission display the encoded call hex and a decoded human-readable form. The decoded call is rendered as JSON with two-space indentation under the `Decode:` header so even deeply nested calls (XCM, sudo, batch, dispatch_as) remain easy to scan:
854
1124
 
855
1125
  ```
856
- Call: 0x0001076465616462656566
857
- Decode: System.remark(remark: 0xdeadbeef)
1126
+ Call: 0x000010deadbeef
1127
+ Decode: System.remark
1128
+ {
1129
+ "remark": "0xdeadbeef"
1130
+ }
858
1131
  Tx: 0xabc123...
859
1132
  Status: ok
860
1133
  ```
861
1134
 
862
- Complex calls (e.g. XCM teleports) that the primary decoder cannot handle are automatically decoded via a fallback path:
863
-
864
- ```
865
- Decode: PolkadotXcm.limited_teleport_assets { dest: V3 { parents: 1, interior: X1(Parachain(5140)) }, beneficiary: V3 { ... }, assets: V3 [...], fee_asset_item: 0, weight_limit: Unlimited }
866
- ```
1135
+ Complex calls (XCM teleports, batched governance proposals) keep the same shape every nested enum becomes a `{ "type": ..., "value": ... }` block, indented one level deeper, so you can read the structure top-down without it ever wrapping past the terminal width.
867
1136
 
868
1137
  #### Exit codes
869
1138
 
870
1139
  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`).
871
1140
 
872
1141
  ```bash
873
- dot tx.Balances.transferKeepAlive 5FHneW46... 999999999999999999 --from alice --chain polkadot
1142
+ dot polkadot.tx.Balances.transfer_keep_alive bob 999999999999999999 --from alice
874
1143
  # ... events and explorer links ...
875
1144
  # Error: Transaction dispatch error: Balances.InsufficientBalance
876
1145
  echo $? # 1
@@ -897,7 +1166,7 @@ The check only fires on suspected-stale errors, so the happy path pays no extra
897
1166
  When a call argument is invalid, the CLI shows a contextual error message with the argument name, the expected type, and a hint:
898
1167
 
899
1168
  ```bash
900
- dot tx.Balances.transferKeepAlive 5GrwvaEF... abc --encode --chain polkadot
1169
+ dot polkadot.tx.Balances.transfer_keep_alive bob abc --encode
901
1170
  # Error: Invalid value for argument 'value' (expected Compact<u128>): "abc"
902
1171
  # Hint: Compact<u128>
903
1172
  ```
@@ -910,15 +1179,15 @@ By default, `dot tx` waits for finalization (~30s on Polkadot). Use `--wait` / `
910
1179
 
911
1180
  ```bash
912
1181
  # Return as soon as the tx is broadcast (fastest)
913
- dot tx.System.remark 0xdead --from alice --chain polkadot --wait broadcast
1182
+ dot polkadot.tx.System.remark 0xdead --from alice --wait broadcast
914
1183
 
915
1184
  # Return when included in a best block
916
- dot tx.System.remark 0xdead --from alice --chain polkadot -w best-block
917
- dot tx.System.remark 0xdead --from alice --chain polkadot -w best # alias
1185
+ dot polkadot.tx.System.remark 0xdead --from alice -w best-block
1186
+ dot polkadot.tx.System.remark 0xdead --from alice -w best # alias
918
1187
 
919
1188
  # Wait for finalization (default, unchanged)
920
- dot tx.System.remark 0xdead --from alice --chain polkadot --wait finalized
921
- dot tx.System.remark 0xdead --from alice --chain polkadot # same
1189
+ dot polkadot.tx.System.remark 0xdead --from alice --wait finalized
1190
+ dot polkadot.tx.System.remark 0xdead --from alice # same
922
1191
  ```
923
1192
 
924
1193
  | Level | Resolves when | Events shown | Explorer links |
@@ -940,7 +1209,7 @@ Chains with non-standard signed extensions are auto-handled:
940
1209
  For manual override, use `--ext` with a JSON object:
941
1210
 
942
1211
  ```bash
943
- dot tx.System.remark 0xdeadbeef --from alice --chain polkadot --ext '{"MyExtension":{"value":"..."}}'
1212
+ dot polkadot.tx.System.remark 0xdeadbeef --from alice --ext '{"MyExtension":{"value":"..."}}'
944
1213
  ```
945
1214
 
946
1215
  Not sure which extensions a chain exposes? Run `dot <chain>.extensions` (see [Transaction extensions](#transaction-extensions)) to list them all with value types and a `[builtin]` / `[custom]` marker.
@@ -958,23 +1227,23 @@ Override low-level transaction parameters. Useful for rapid-fire submission (cus
958
1227
 
959
1228
  ```bash
960
1229
  # Fire-and-forget: submit two txs in rapid succession with manual nonces
961
- dot tx.System.remark 0xdead --from alice --chain polkadot --nonce 0 --wait broadcast
962
- dot tx.System.remark 0xbeef --from alice --chain polkadot --nonce 1 --wait broadcast
1230
+ dot polkadot.tx.System.remark 0xdead --from alice --nonce 0 --wait broadcast
1231
+ dot polkadot.tx.System.remark 0xbeef --from alice --nonce 1 --wait broadcast
963
1232
 
964
1233
  # Add a priority tip (in planck)
965
- dot tx.Balances.transferKeepAlive 5FHneW46... 1000000000000 --from alice --chain polkadot --tip 1000000
1234
+ dot polkadot.tx.Balances.transfer_keep_alive bob 1000000000 --from alice --tip 1000000
966
1235
 
967
1236
  # Submit an immortal transaction (no expiry)
968
- dot tx.System.remark 0xdead --from alice --chain polkadot --mortality immortal
1237
+ dot polkadot.tx.System.remark 0xdead --from alice --mortality immortal
969
1238
 
970
1239
  # Set a custom mortality period (rounds up to nearest power of two)
971
- dot tx.System.remark 0xdead --from alice --chain polkadot --mortality 128
1240
+ dot polkadot.tx.System.remark 0xdead --from alice --mortality 128
972
1241
 
973
1242
  # Validate against a specific block hash
974
- dot tx.System.remark 0xdead --from alice --chain polkadot --at 0x1234...abcd
1243
+ dot polkadot.tx.System.remark 0xdead --from alice --at 0x1234...abcd
975
1244
 
976
1245
  # Combine: rapid-fire with tip and broadcast-only
977
- dot tx.System.remark 0xdead --from alice --chain polkadot --nonce 5 --tip 500000 --wait broadcast
1246
+ dot polkadot.tx.System.remark 0xdead --from alice --nonce 5 --tip 500000 --wait broadcast
978
1247
  ```
979
1248
 
980
1249
  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).
@@ -984,15 +1253,23 @@ When set, nonce / tip / mortality / at are shown in both `--dry-run` and submiss
984
1253
  On asset-hub-style chains (Polkadot Asset Hub, Paseo Asset Hub, etc.) the `ChargeAssetTxPayment` signed extension lets a transaction pay its fees in a non-native asset. Use `--asset <json>` to select the asset — the value is an XCM location (JSON) identifying the asset, which the runtime's asset-conversion pool swaps for native tokens at dispatch time.
985
1254
 
986
1255
  ```bash
987
- # Pay fees in USDT (asset id 1337, PalletInstance 50) on Polkadot Asset Hub
988
- dot tx.Balances.transfer_keep_alive 5FHneW46... 1000000000000 \
989
- --from alice --chain polkadot-asset-hub \
990
- --asset '{"parents":0,"interior":{"type":"X2","value":[{"type":"PalletInstance","value":50},{"type":"GeneralIndex","value":"1337"}]}}'
1256
+ # Define the USDT location once (asset id 1337, PalletInstance 50)
1257
+ USDT='{"parents":0,"interior":{"type":"X2","value":[{"type":"PalletInstance","value":50},{"type":"GeneralIndex","value":"1337"}]}}'
991
1258
 
992
1259
  # Dry-run to see the native-denominated fee estimate
993
- dot tx.Balances.transfer_keep_alive 5FHneW46... 1000000000000 \
994
- --from alice --chain polkadot-asset-hub --dry-run \
995
- --asset '{"parents":0,"interior":{"type":"X2","value":[{"type":"PalletInstance","value":50},{"type":"GeneralIndex","value":"1337"}]}}'
1260
+ dot polkadot-asset-hub.tx.Balances.transfer_keep_alive bob 1000000000 \
1261
+ --from alice --dry-run --asset "$USDT"
1262
+ # Output:
1263
+ # Chain: polkadot-asset-hub
1264
+ # From: alice (5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY)
1265
+ # Call: 0x0a0300d435...02286bee
1266
+ # Decode: Balances.transfer_keep_alive { dest: Id(...), value: 1000000000 }
1267
+ # Asset: {"parents":0,"interior":{"type":"X2","value":[{"type":"PalletInstance","value":50},{"type":"GeneralIndex","value":"1337"}]}}
1268
+ # Estimated fees: 9249754
1269
+
1270
+ # Submit (omit --dry-run)
1271
+ dot polkadot-asset-hub.tx.Balances.transfer_keep_alive bob 1000000000 \
1272
+ --from alice --asset "$USDT"
996
1273
  ```
997
1274
 
998
1275
  The `--asset` echo is included in dry-run and submission output (and `--json`). A few things to know:
@@ -1010,19 +1287,19 @@ Submit transactions without a signer using `--unsigned`. This is for calls autho
1010
1287
 
1011
1288
  ```bash
1012
1289
  # Submit an authorized call on the People chain
1013
- dot tx.People.create_people_collection --unsigned --chain polkadot-people
1290
+ dot polkadot-people.tx.People.create_people_collection --unsigned
1014
1291
 
1015
1292
  # Dry-run to inspect before submitting
1016
- dot tx.People.create_people_collection --unsigned --chain polkadot-people --dry-run
1293
+ dot polkadot-people.tx.People.create_people_collection --unsigned --dry-run
1017
1294
 
1018
1295
  # Encode the full general transaction bytes
1019
- dot tx.People.create_people_collection --unsigned --chain polkadot-people --encode
1296
+ dot polkadot-people.tx.People.create_people_collection --unsigned --encode
1020
1297
 
1021
1298
  # With raw hex call data
1022
- dot tx 0x3306 --unsigned --chain polkadot-people
1299
+ dot polkadot-people.tx 0x3306 --unsigned
1023
1300
 
1024
1301
  # JSON output for scripting
1025
- dot tx.People.create_people_collection --unsigned --chain polkadot-people --json
1302
+ dot polkadot-people.tx.People.create_people_collection --unsigned --json
1026
1303
  ```
1027
1304
 
1028
1305
  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.
@@ -1164,8 +1441,14 @@ The same teleport in JSON:
1164
1441
  ```
1165
1442
 
1166
1443
  ```bash
1167
- # Run from file
1444
+ # Run from file (the `chain:` field comes from the YAML)
1168
1445
  dot ./teleport-dot.xcm.yaml --from alice --dry-run
1446
+ # Output:
1447
+ # Chain: polkadot-asset-hub
1448
+ # From: alice (5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY)
1449
+ # Call: 0x1f0904...
1450
+ # Decode: PolkadotXcm.limited_teleport_assets { dest: V4 { parents: 1, interior: Here }, ... }
1451
+ # Estimated fees: ...
1169
1452
 
1170
1453
  # Encode only
1171
1454
  dot ./reserve-transfer-usdc.xcm.yaml --encode
@@ -1218,7 +1501,7 @@ Hex values passed via `--var` are preserved as-is, including leading zeros. This
1218
1501
 
1219
1502
  ```bash
1220
1503
  # Encode a remark, then embed it in an XCM Transact via --var
1221
- CALL=$(dot tx.System.remark 0xdead --encode --chain polkadot)
1504
+ CALL=$(dot polkadot.tx.System.remark 0xdead --encode)
1222
1505
  dot ./xcm-transact.yaml --var CALL=$CALL --encode
1223
1506
  ```
1224
1507
 
@@ -1231,18 +1514,30 @@ Compute cryptographic hashes commonly used in Substrate. Supports BLAKE2b-256, B
1231
1514
  ```bash
1232
1515
  # Hash hex-encoded data
1233
1516
  dot hash blake2b256 0xdeadbeef
1517
+ # Output:
1518
+ # 0xf3e925002fed7cc0ded46842569eb5c90c910c091d8d04a1bdf96e0db719fd91
1234
1519
 
1235
1520
  # Hash plain text (UTF-8 encoded)
1236
1521
  dot hash sha256 hello
1522
+ # Output:
1523
+ # 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
1237
1524
 
1238
1525
  # Hash file contents
1239
1526
  dot hash keccak256 --file ./data.bin
1240
1527
 
1241
1528
  # Read from stdin
1242
1529
  echo -n "hello" | dot hash sha256 --stdin
1530
+ # Output:
1531
+ # 0x2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
1243
1532
 
1244
1533
  # JSON output
1245
1534
  dot hash blake2b256 0xdeadbeef --json
1535
+ # Output:
1536
+ # {
1537
+ # "algorithm": "blake2b256",
1538
+ # "input": "0xdeadbeef",
1539
+ # "hash": "0xf3e925002fed7cc0ded46842569eb5c90c910c091d8d04a1bdf96e0db719fd91"
1540
+ # }
1246
1541
  ```
1247
1542
 
1248
1543
  Run `dot hash` with no arguments to see all available algorithms.
@@ -1254,6 +1549,11 @@ Sign arbitrary messages with an account keypair. Output is a `Sr25519(0x...)` va
1254
1549
  ```bash
1255
1550
  # Sign a text message
1256
1551
  dot sign "hello world" --from alice
1552
+ # Output:
1553
+ # Type: Sr25519
1554
+ # Message: 0x68656c6c6f20776f726c64
1555
+ # Signature: 0x4283a3bbae463c39264ca193b1bcce61702794e54e482bc2e46202c85ef6a5446750e81db57cd28af4ffd5c69aadcf5b2b3068972e0cdcb68e51db0ff600d786
1556
+ # Enum: Sr25519(0x4283a3bbae463c39264ca193b1bcce61702794e54e482bc2e46202c85ef6a5446750e81db57cd28af4ffd5c69aadcf5b2b3068972e0cdcb68e51db0ff600d786)
1257
1557
 
1258
1558
  # Sign hex-encoded bytes
1259
1559
  dot sign 0xdeadbeef --from alice
@@ -1266,6 +1566,13 @@ echo -n "hello" | dot sign --stdin --from alice
1266
1566
 
1267
1567
  # JSON output (for scripting)
1268
1568
  dot sign "hello" --from alice --json
1569
+ # Output:
1570
+ # {
1571
+ # "type": "Sr25519",
1572
+ # "message": "0x68656c6c6f",
1573
+ # "signature": "0x5a058160b62eeb6c1194116d4613489e9c310075478c544761b9c8198d3fdb38...",
1574
+ # "enum": "Sr25519(0x5a058160b62eeb6c1194116d4613489e9c310075478c544761b9c8198d3fdb38...)"
1575
+ # }
1269
1576
  ```
1270
1577
 
1271
1578
  Output shows the crypto type, message bytes in hex, raw signature, and an `Enum` value directly pasteable into tx arguments (e.g. `Sr25519(0x...)`).
@@ -1282,6 +1589,18 @@ Derive the sovereign account addresses for a parachain. These are deterministic
1282
1589
  ```bash
1283
1590
  # Show both child and sibling accounts
1284
1591
  dot parachain 1000
1592
+ # Output:
1593
+ # Parachain 1000 — Sovereign Accounts
1594
+ #
1595
+ # Child:
1596
+ # Public Key: 0x70617261e8030000000000000000000000000000000000000000000000000000
1597
+ # SS58: 5Ec4AhPZk8STuex8Wsi9TwDtJQxKqzPJRCH7348Xtcs9vZLJ
1598
+ # Prefix: 42
1599
+ #
1600
+ # Sibling:
1601
+ # Public Key: 0x7369626ce8030000000000000000000000000000000000000000000000000000
1602
+ # SS58: 5Eg2fntNprdN3FgH4sfEaaZhYtddZQSQUqvYJ1f2mLtinVhV
1603
+ # Prefix: 42
1285
1604
 
1286
1605
  # Show only the child (relay chain) account
1287
1606
  dot parachain 2004 --type child
@@ -1294,6 +1613,13 @@ dot parachain 1000 --prefix 0
1294
1613
 
1295
1614
  # JSON output
1296
1615
  dot parachain 1000 --json
1616
+ # Output:
1617
+ # {
1618
+ # "paraId": 1000,
1619
+ # "prefix": 42,
1620
+ # "child": { "publicKey": "0x70617261...", "ss58": "5Ec4AhPZ..." },
1621
+ # "sibling": { "publicKey": "0x7369626c...", "ss58": "5Eg2fntN..." }
1622
+ # }
1297
1623
  ```
1298
1624
 
1299
1625
  Run `dot parachain` with no arguments to see usage and examples.
@@ -1305,9 +1631,20 @@ Derive Bandersnatch member keys from account mnemonics for on-chain member set r
1305
1631
  ```bash
1306
1632
  # Derive unkeyed member key (lite person)
1307
1633
  dot verifiable alice
1634
+ # Output:
1635
+ # Bandersnatch Member Key
1636
+ #
1637
+ # Account: alice
1638
+ # Member Key: 0x66813b70ba616b374c90ac92edff6e3be95e12adbc93ea7a6c37cbf334ab87e2
1308
1639
 
1309
1640
  # Derive keyed member key (full person — "candidate" context)
1310
1641
  dot verifiable alice --context candidate
1642
+ # Output:
1643
+ # Bandersnatch Member Key
1644
+ #
1645
+ # Account: alice
1646
+ # Context: candidate
1647
+ # Member Key: 0x2fd5b74033d904cf5575b932507939c5d43811e488223229eaf5596565f15ae6
1311
1648
 
1312
1649
  # Arbitrary context string
1313
1650
  dot verifiable alice --context pps
@@ -1346,21 +1683,21 @@ dot hash --help # same as `dot hash` — shows algorithms and examples
1346
1683
  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:
1347
1684
 
1348
1685
  ```bash
1349
- dot tx.System.remark --help --chain polkadot # call args, docs, and tx options
1350
- dot query.System.Account --help --chain polkadot # storage type, key/value info, and query options
1351
- dot const.Balances.ExistentialDeposit --help --chain polkadot # constant type and docs
1352
- dot events.Balances.Transfer --help --chain polkadot # event fields and docs
1353
- dot errors.Balances.InsufficientBalance --help --chain polkadot # error docs
1354
- dot apis.Core.version --help --chain polkadot # runtime API method signature and docs
1686
+ dot polkadot.tx.System.remark --help # call args, docs, and tx options
1687
+ dot polkadot.query.System.Account --help # storage type, key/value info, and query options
1688
+ dot polkadot.const.Balances.ExistentialDeposit --help # constant type and docs
1689
+ dot polkadot.events.Balances.Transfer --help # event fields and docs
1690
+ dot polkadot.errors.Balances.InsufficientBalance --help # error docs
1691
+ dot polkadot.apis.Core.version --help # runtime API method signature and docs
1355
1692
 
1356
- # A chain prefix is equivalent
1357
- dot polkadot.tx.System.remark --help
1693
+ # The --chain flag is equivalent to the chain prefix
1694
+ dot tx.System.remark --help --chain polkadot
1358
1695
  ```
1359
1696
 
1360
1697
  For `tx` commands, omitting both `--from` and `--encode` shows this same help output instead of an error:
1361
1698
 
1362
1699
  ```bash
1363
- dot tx.System.remark 0xdead --chain polkadot # shows call help (no error)
1700
+ dot polkadot.tx.System.remark 0xdead # shows call help (no error)
1364
1701
  ```
1365
1702
 
1366
1703
  ### Global options
@@ -1381,9 +1718,10 @@ dot tx.System.remark 0xdead --chain polkadot # shows call help (no error)
1381
1718
  Every command supports `--json` for machine-readable output. This works on data queries, metadata inspection, account management, chain configuration, and transaction submission:
1382
1719
 
1383
1720
  ```bash
1384
- dot inspect --json --chain polkadot # All pallets as JSON
1385
- dot inspect Balances --json --chain polkadot # Pallet detail with storage, constants, calls, events, errors
1721
+ dot inspect polkadot --json # All pallets as JSON
1722
+ dot inspect polkadot.Balances --json # Pallet detail with storage, constants, calls, events, errors
1386
1723
  dot chain list --json # Configured chains
1724
+ dot chain info polkadot --json # Full detail for one chain (rpc, parachains, metadata status)
1387
1725
  dot account list --json # Dev and stored accounts
1388
1726
  dot account create my-key --json # New account details (mnemonic warning on stderr)
1389
1727
  dot polkadot.tx.System.remark 0xdead --encode --json # Encoded call hex wrapped in JSON
@@ -1391,10 +1729,20 @@ dot polkadot.events.Balances --json # Event listing with field
1391
1729
  dot polkadot.const.System --json # Constant listing with types
1392
1730
  ```
1393
1731
 
1732
+ For `--encode` with `--json`, the call hex is wrapped in an object:
1733
+
1734
+ ```bash
1735
+ dot polkadot.tx.System.remark 0xdead --encode --json
1736
+ # Output:
1737
+ # {
1738
+ # "callHex": "0x000008dead"
1739
+ # }
1740
+ ```
1741
+
1394
1742
  For transaction submission, `--json` emits NDJSON (one JSON object per lifecycle event):
1395
1743
 
1396
1744
  ```bash
1397
- dot tx.System.remark 0xdead --from alice --chain polkadot --json
1745
+ dot polkadot.tx.System.remark 0xdead --from alice --json
1398
1746
  # {"event":"signed","txHash":"0x..."}
1399
1747
  # {"event":"broadcasted","txHash":"0x..."}
1400
1748
  # {"event":"finalized","blockNumber":123,"blockHash":"0x...","ok":true,"events":[...]}
@@ -1409,7 +1757,7 @@ dot polkadot.const.System.SS58Prefix --json | jq '.+1'
1409
1757
  dot polkadot.query.System.Number --json | jq
1410
1758
  dot chain list --json | jq '.chains[].name'
1411
1759
  dot account list --json | jq '.stored[].address'
1412
- dot inspect --json --chain polkadot | jq '.pallets[] | select(.events > 10) | .name'
1760
+ dot inspect polkadot --json | jq '.pallets[] | select(.events > 10) | .name'
1413
1761
  ```
1414
1762
 
1415
1763
  In an interactive terminal, both streams render together so you see progress and results normally.