You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop/toolkit/integrations/transaction-construction.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ description: Understand how to construct, sign, and broadcast transactions in th
9
9
10
10
This page will discuss the transaction format in Polkadot and how to create, sign, and broadcast transactions, as well as highlight some of the commands and tools available for integrators.
11
11
12
-
**Always refer to each tool's documentation when integrating.**
12
+
Always refer to each tool's documentation when integrating.
13
13
14
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.
15
15
@@ -21,7 +21,7 @@ Polkadot has some basic transaction information that is common to all transactio
21
21
-**Block hash**: The hash of the [checkpoint](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank} block.
22
22
-**Block number**: The number of the checkpoint block.
23
23
-**Genesis hash**: The genesis hash of the chain.
24
-
-**Metadata**: The [SCALE-encoded metadata](polkadot-protocol/parachain-basics/data-encoding/){target=\_blank} for the runtime when submitted.
24
+
-**Metadata**: The [SCALE-encoded](/polkadot-protocol/parachain-basics/data-encoding/){target=\_blank} metadata for the runtime when submitted.
25
25
-**Nonce**: The nonce for this transaction.
26
26
-**Spec Version**: The current spec version for the runtime.
27
27
-**Transaction Version**: The current version for transaction format.
@@ -60,7 +60,7 @@ The typical transaction workflow is as follows:
60
60
4. Serialize the signed payload into a transaction.
61
61
5. Submit the serialized transaction.
62
62
63
-
Parity provides several tools to help perform these steps.
63
+
There are several tools to help perform these steps.
Copy file name to clipboardExpand all lines: llms.txt
+17-15Lines changed: 17 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -14077,9 +14077,9 @@ description: Understand how to construct, sign, and broadcast transactions in th
14077
14077
14078
14078
## Introduction
14079
14079
14080
-
This page will discuss the transaction format in Polkadot and how to create, sign, and broadcast transactions as well as highlight some of commands and tools available for integrators.
14080
+
This page will discuss the transaction format in Polkadot and how to create, sign, and broadcast transactions, as well as highlight some of the commands and tools available for integrators.
14081
14081
14082
-
**Always refer to each tool's documentation when integrating.**
14082
+
Always refer to each tool's documentation when integrating.
14083
14083
14084
14084
For further reading, refer to [blocks, transactions, and fees](/polkadot-protocol/parachain-basics/blocks-transactions-fees/){target=\_blank} to learn more about the basics.
14085
14085
@@ -14088,14 +14088,14 @@ For further reading, refer to [blocks, transactions, and fees](/polkadot-protoco
14088
14088
Polkadot has some basic transaction information that is common to all transactions.
14089
14089
14090
14090
- **Address**: The [SS58-encoded address](/polkadot-protocol/glossary/#ss58-address-format){target=\_blank} of the sending account.
14091
-
- **Block Hash**: The hash of the [checkpoint](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank} block.
14092
-
- **Block Number**: The number of the checkpoint block.
14093
-
- **Genesis Hash**: The genesis hash of the chain.
14094
-
- **Metadata**: The [SCALE-encoded metadata](polkadot-protocol/parachain-basics/data-encoding/){target=\_blank} for the runtime when submitted.
14091
+
- **Block hash**: The hash of the [checkpoint](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank} block.
14092
+
- **Block number**: The number of the checkpoint block.
14093
+
- **Genesis hash**: The genesis hash of the chain.
14094
+
- **Metadata**: The [SCALE-encoded](/polkadot-protocol/parachain-basics/data-encoding/){target=\_blank} metadata for the runtime when submitted.
14095
14095
- **Nonce**: The nonce for this transaction.
14096
14096
- **Spec Version**: The current spec version for the runtime.
14097
14097
- **Transaction Version**: The current version for transaction format.
14098
-
- **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.
14098
+
- **Tip**: Optional, the [tip](/polkadot-protocol/parachain-basics/blocks-transactions-fees/fees/#how-fees-are-calculated){target=\_blank} to increase transaction priority.
14099
14099
- **Mode**: The flag indicating whether to verify the metadata hash or not.
14100
14100
- **Era Period**: Optional, the number of blocks after the checkpoint for which a transaction is valid. If zero, the transaction is [immortal](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank}
14101
14101
- **MetadataHash**: Optional, the metadata hash which should match the [`RUNTIME_METADATA_HASH`](https://paritytech.github.io/polkadot-sdk/master/frame_metadata_hash_extension/struct.CheckMetadataHash.html){target=\_blank} environment variable.
@@ -14130,7 +14130,7 @@ The typical transaction workflow is as follows:
14130
14130
4. Serialize the signed payload into a transaction.
14131
14131
5. Submit the serialized transaction.
14132
14132
14133
-
Parity provides several tools to help perform these steps.
14133
+
There are several tools to help perform these steps.
14134
14134
14135
14135
## Polkadot-JS Tools
14136
14136
@@ -14186,7 +14186,7 @@ Let's say you want to send 1 WND from `5F4c8mNz6schf2WMXQZiz1eyR1GGxrMf2coXpAn8m
14186
14186
First fund the sending account. You can use the [Westend Faucet](https://faucet.polkadot.io/westend) for that.
14187
14187
Request some tokens for `5F4c8mNz6schf2WMXQZiz1eyR1GGxrMf2coXpAn8mNjxyzp2`.
14188
14188
14189
-
Next call submit to create the transaction and which will give you the payload to sign.
14189
+
Next, call `submit` to create the transaction, which will give you the payload to sign.
This will output the signature of the transaction.
14208
+
This will output the transaction's signature.
14209
14209
```
14210
14210
Signature: 0xe6facf194a8e...413ce3155c2d1240b
14211
14211
```
14212
14212
14213
-
Paste this signature into the `submit`'s signature field, and send the transaction (or just return the serialized transaction if using `sendOffline`).
14213
+
Paste this signature into the `submit` signature field, and send the transaction (or just return the serialized transaction if using `sendOffline`).
14214
14214
14215
14215
By default, submit will create a mortal extrinsic with a lifetime of 50 blocks.
14216
14216
Assuming a six-second block time, you will have five minutes to go offline, sign the transaction, paste the signature, and submit the signed transaction.
@@ -14400,7 +14400,7 @@ You will get useful output in the terminal with details like the events that wer
14400
14400
14401
14401
## Txwrapper
14402
14402
14403
-
If you do not want to use the CLI for signing operations, Parity provides an SDK called [txwrapper-core](https://github.com/paritytech/txwrapper-core){target=\_blank} to generate and sign transactions offline. For Polkadot, Kusama, and select parachains, use the `txwrapper-polkadot` package. Other Substrate-based chains will have their own `txwrapper-{chain}` implementations. See the [examples](https://github.com/paritytech/txwrapper-core/blob/main/packages/txwrapper-examples/README.md){target=\_blank} for a guide.
14403
+
If you do not want to use the CLI for signing operations, Parity provides an SDK called [txwrapper-core](https://github.com/paritytech/txwrapper-core){target=\_blank} to generate and sign transactions offline. For Polkadot, Kusama, and select parachains, use the `txwrapper-polkadot` package. Other Polkadot SDK-based chains will have their own `txwrapper-{chain}` implementations. See the [examples](https://github.com/paritytech/txwrapper-core/blob/main/packages/txwrapper-examples/README.md){target=\_blank} for a guide.
14404
14404
14405
14405
### Creating a Transaction, Signing, and Submitting
14406
14406
@@ -14410,9 +14410,10 @@ Let's use [chopsticks](/tutorials/polkadot-sdk/testing/fork-live-chains/){target
You should get a Polkadot network running on port 9944.
14414
14415
14415
-
Next we will use the [`txwrapper example script`](https://github.com/paritytech/txwrapper-core/blob/main/packages/txwrapper-examples/polkadot/src/polkadot.ts){target=\_blank} to create and sign transactions.
14416
+
The [txwrapper example script](https://github.com/paritytech/txwrapper-core/blob/main/packages/txwrapper-examples/polkadot/src/polkadot.ts){target=_blank} will then be used to create and sign transactions.
14416
14417
14417
14418
For this you will need the [`txwrapper`](https://github.com/paritytech/txwrapper-core){target=\_blank} library. Let's clone [`txwrapper`](https://github.com/paritytech/txwrapper-core){target=\_blank}:
@@ -14459,7 +14461,7 @@ The [`txwrapper example script`](https://github.com/paritytech/txwrapper-core/bl
14459
14461
14460
14462
## Additional Libraries for Submitting a Transaction
14461
14463
14462
-
Other than Polkadot JS Tools and txwrapper, there are several other libraries that can also be used to submit a signed payload such as the [Sidecar API](/develop/toolkit/api-libraries/sidecar/#sidecar-api){target=\_blank} or using RPC calls with [`author_submitExtrinsic`](https://paritytech.github.io/polkadot-sdk/master/sc_rpc/author/trait.AuthorApiServer.html#tymethod.submit_extrinsic){target=\_blank} or [`author_submitAndWatchExtrinsic`](https://github.com/paritytech/polkadot-sdk/blob/0ae5c5bbd96a600aed81358339be2f16bade4a81/substrate/client/rpc-api/src/author/mod.rs#L69-L78){target=\_blank}, the latter of which will subscribe you to events to be notified as a transaction gets validated and included in the chain. You can see all the available libraries in the [API Libraries](/develop/toolkit/api-libraries/) section of the Polkadot Docs.
14464
+
Other than Polkadot JS Tools and txwrapper, there are several other libraries that can also be used to submit a signed payload such as the [Sidecar API](/develop/toolkit/api-libraries/sidecar/#sidecar-api){target=\_blank} or using RPC calls with [`author_submitExtrinsic`](https://paritytech.github.io/polkadot-sdk/master/sc_rpc/author/trait.AuthorApiServer.html#tymethod.submit_extrinsic){target=\_blank} or [`author_submitAndWatchExtrinsic`](https://github.com/paritytech/polkadot-sdk/blob/0ae5c5bbd96a600aed81358339be2f16bade4a81/substrate/client/rpc-api/src/author/mod.rs#L69-L78){target=\_blank}, the latter of which will subscribe you to events to be notified as a transaction gets validated and included in the chain. You can see all the available libraries in the [API Libraries](/develop/toolkit/api-libraries/){target=\_blank} section of the Polkadot Docs.
0 commit comments