Skip to content

Commit 69c6e5b

Browse files
committed
formatting
1 parent a754fb6 commit 69c6e5b

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

develop/toolkit/integrations/transaction-construction.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,50 @@ This page will discuss the transaction format in Polkadot and how to create, sig
1111

1212
**Always refer to each tool's documentation when integrating.**
1313

14-
!!!note "Complementary Reading"
15-
Learn about the basics of [blocks, transactions, and fees](/polkadot-protocol/parachain-basics/blocks-transactions-fees/).
14+
For further reading, refer to [blocks, transactions, and fees](/polkadot-protocol/parachain-basics/blocks-transactions-fees/){target=\_blank} to learn more about the basics.
1615

1716
## Transaction Format
1817

1918
Polkadot has some basic transaction information that is common to all transactions.
2019

21-
- Address: The SS58-encoded address of the sending account.
22-
- Block Hash: The hash of the [checkpoint](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality) block.
20+
- Address: The [SS58-encoded address](/polkadot-protocol/glossary/#ss58-address-format){target=\_blank} of the sending account.
21+
- Block Hash: The hash of the [checkpoint](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank} block.
2322
- Block Number: The number of the checkpoint block.
2423
- Genesis Hash: The genesis hash of the chain.
2524
- Metadata: The SCALE-encoded metadata for the runtime when submitted.
26-
- Nonce: The nonce for this transaction.\*
25+
- Nonce: The nonce for this transaction.
2726
- Spec Version: The current spec version for the runtime.
2827
- Transaction Version: The current version for transaction format.
29-
- Tip: Optional, the [tip](https://docs.polkadot.com/polkadot-protocol/parachain-basics/blocks-transactions-fees/fees/#how-fees-are-calculated) to increase transaction priority.
28+
- Tip: Optional, the [tip](https://docs.polkadot.com/polkadot-protocol/parachain-basics/blocks-transactions-fees/fees/#how-fees-are-calculated){target=\_blank} to increase transaction priority.
3029
- Mode: The flag indicating whether to verify the metadata hash or not.
3130
- Era Period: Optional, the number of blocks after the checkpoint for which a transaction is valid.
32-
If zero, the transaction is [immortal](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality)
31+
If zero, the transaction is [immortal](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank}
3332
- MetadataHash: Optional, the metadata hash which should match the RUNTIME_METADATA_HASH environment
3433
variable.
3534

3635
!!!warning
37-
There are risks to making a transaction immortal. If an account is reaped and a user re-funds the
36+
There are risks to making a transaction immortal. If an account is reaped and a user re-funds the
3837
account, then they could replay an immortal transaction. Always default to using a mortal extrinsic.
39-
40-
The nonce queried from the System module does not account for pending transactions. You must track
38+
39+
The nonce queried from the System module does not account for pending transactions. You must track
4140
and increment the nonce manually if you want to submit multiple valid transactions at the same time.
4241

43-
Each transaction will have its own (or no) parameters to add. For example, the `transferKeepAlive`
42+
Each transaction will have its own (or no) parameters to add. For example, the [`transferKeepAlive`](https://paritytech.github.io/polkadot-sdk/master/pallet_balances/pallet/enum.Call.html#variant.transfer_keep_alive){target=\_blank}
4443
function from the Balances pallet will take:
4544

4645
- `dest`: Destination address
4746
- `#[compact] value`: Number of tokens (compact encoding)
4847

49-
Refer to [the protocol specifications](https://spec.polkadot.network/id-extrinsics), for the
48+
Refer to [the protocol specifications](https://spec.polkadot.network/id-extrinsics){target=\_blank}, for the
5049
concrete specifications and types to build a transaction.
5150

5251
**Mode and MetadataHash**
5352

5453
The mode and metadataHash fields were introduced in transaction construction to support the optional
55-
[`CheckMetadataHash` Signed Extension](https://github.com/polkadot-fellows/RFCs/blob/main/text/0078-merkleized-metadata.md).
54+
[`CheckMetadataHash` Signed Extension](https://github.com/polkadot-fellows/RFCs/blob/main/text/0078-merkleized-metadata.md){target=\_blank}.
5655
This enables trustless metadata verification by allowing the chain to verify the correctness of the
5756
metadata used without the need of a trusted party. This functionality was included in
58-
[v1.2.5](https://github.com/polkadot-fellows/runtimes/releases/tag/v1.2.5) runtime release by the
57+
[v1.2.5](https://github.com/polkadot-fellows/runtimes/releases/tag/v1.2.5){target=\_blank} runtime release by the
5958
Fellowship. A user may opt out of this functionality by setting the mode to `0`. When the mode is 00,
6059
the `metadataHash` field is empty/None.
6160

@@ -66,7 +65,7 @@ SCALE-encoded bytes. The relay chain runtimes are upgradable and therefore any i
6665
subject to change, the metadata allows developers to structure any extrinsics or storage entries
6766
accordingly. The metadata provides you with all of the information required to know how to construct
6867
the serialized call data specific to your transaction. You can read more about the metadata, its
69-
format and how to get it in the [Subxt documentation](/polkadot-protocol/parachain-basics/chain-data/#use-subxt).
68+
format and how to get it in the [Subxt documentation](/polkadot-protocol/parachain-basics/chain-data/#use-subxt){target=\_blank}.
7069

7170
**Transaction Flow**
7271

@@ -82,7 +81,7 @@ Parity provides the following tools to help perform these steps.
8281

8382
## Polkadot-JS Tools
8483

85-
[Polkadot-JS Tools](https://github.com/polkadot-js/tools) contains a set of command line tools for
84+
[Polkadot-JS Tools](https://github.com/polkadot-js/tools){target=\_blank} contains a set of command line tools for
8685
interacting with a Substrate client, including one called "Signer CLI" to create, sign, and
8786
broadcast transactions.
8887

@@ -121,10 +120,10 @@ signature field, and send the transaction (or just return the serialized transac
121120
## TxWrapper
122121

123122
If you do not want to use the CLI for signing operations, Parity provides an SDK called
124-
[TxWrapper Core](https://github.com/paritytech/txwrapper-core) to generate and sign transactions
123+
[TxWrapper Core](https://github.com/paritytech/txwrapper-core){target=\_blank} to generate and sign transactions
125124
offline. For Polkadot, Kusama, and select parachains, use the `txwrapper-polkadot` package. Other
126125
Substrate-based chains will have their own `txwrapper-{chain}` implementations. See the
127-
[examples](https://github.com/paritytech/txwrapper-core/blob/main/packages/txwrapper-examples/README.md)
126+
[examples](https://github.com/paritytech/txwrapper-core/blob/main/packages/txwrapper-examples/README.md){target=\_blank}
128127
for a guide.
129128

130129
**Import a private key**
@@ -225,15 +224,15 @@ const txHash = getTxHash(signedTx);
225224
There are several ways to submit a signed payload:
226225

227226
1. Signer CLI (`yarn run:signer submit --tx <signed-transaction> --ws <endpoint>`)
228-
1. [Substrate API Sidecar](https://docs.polkadot.com/develop/toolkit/api-libraries/sidecar/#sidecar-api)
229-
1. [RPC](https://docs.polkadot.com/develop/toolkit/api-libraries/) with `author_submitExtrinsic` or
227+
1. [Substrate API Sidecar](https://docs.polkadot.com/develop/toolkit/api-libraries/sidecar/#sidecar-api){target=\_blank}
228+
1. [RPC](https://docs.polkadot.com/develop/toolkit/api-libraries/){target=\_blank} with `author_submitExtrinsic` or
230229
`author_submitAndWatchExtrinsic`, the latter of which will subscribe you to events to be notified
231230
as a transaction gets validated and included in the chain.
232231

233232
## Example Addresses
234233

235234
Some addresses to use in the examples. See
236-
[Subkey documentation](https://docs.polkadot.com/polkadot-protocol/basics/accounts/#using-subkey).
235+
[Subkey documentation](https://docs.polkadot.com/polkadot-protocol/basics/accounts/#using-subkey){target=\_blank}.
237236

238237
```bash
239238
$ subkey --network polkadot generate

0 commit comments

Comments
 (0)