Skip to content

Commit 109f36d

Browse files
committed
formatting
1 parent 262d952 commit 109f36d

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

develop/toolkit/integrations/transaction-construction.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: Understand how to construct, sign, and broadcast transactions in th
99

1010
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.
1111

12-
**Always refer to each tool's documentation when integrating.**
12+
Always refer to each tool's documentation when integrating.
1313

1414
For further reading, refer to [blocks, transactions, and fees](/polkadot-protocol/parachain-basics/blocks-transactions-fees/){target=\_blank} to learn more about the basics.
1515

@@ -21,7 +21,7 @@ Polkadot has some basic transaction information that is common to all transactio
2121
- **Block hash**: The hash of the [checkpoint](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank} block.
2222
- **Block number**: The number of the checkpoint block.
2323
- **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.
2525
- **Nonce**: The nonce for this transaction.
2626
- **Spec Version**: The current spec version for the runtime.
2727
- **Transaction Version**: The current version for transaction format.
@@ -60,7 +60,7 @@ The typical transaction workflow is as follows:
6060
4. Serialize the signed payload into a transaction.
6161
5. Submit the serialized transaction.
6262

63-
Parity provides several tools to help perform these steps.
63+
There are several tools to help perform these steps.
6464

6565
## Polkadot-JS Tools
6666

llms.txt

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14077,9 +14077,9 @@ description: Understand how to construct, sign, and broadcast transactions in th
1407714077

1407814078
## Introduction
1407914079

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.
1408114081

14082-
**Always refer to each tool's documentation when integrating.**
14082+
Always refer to each tool's documentation when integrating.
1408314083

1408414084
For further reading, refer to [blocks, transactions, and fees](/polkadot-protocol/parachain-basics/blocks-transactions-fees/){target=\_blank} to learn more about the basics.
1408514085

@@ -14088,14 +14088,14 @@ For further reading, refer to [blocks, transactions, and fees](/polkadot-protoco
1408814088
Polkadot has some basic transaction information that is common to all transactions.
1408914089

1409014090
- **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.
1409514095
- **Nonce**: The nonce for this transaction.
1409614096
- **Spec Version**: The current spec version for the runtime.
1409714097
- **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.
1409914099
- **Mode**: The flag indicating whether to verify the metadata hash or not.
1410014100
- **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}
1410114101
- **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:
1413014130
4. Serialize the signed payload into a transaction.
1413114131
5. Submit the serialized transaction.
1413214132

14133-
Parity provides several tools to help perform these steps.
14133+
There are several tools to help perform these steps.
1413414134

1413514135
## Polkadot-JS Tools
1413614136

@@ -14186,7 +14186,7 @@ Let's say you want to send 1 WND from `5F4c8mNz6schf2WMXQZiz1eyR1GGxrMf2coXpAn8m
1418614186
First fund the sending account. You can use the [Westend Faucet](https://faucet.polkadot.io/westend) for that.
1418714187
Request some tokens for `5F4c8mNz6schf2WMXQZiz1eyR1GGxrMf2coXpAn8mNjxyzp2`.
1418814188

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.
1419014190

1419114191
```bash
1419214192
polkadot-js-signer submit --account 5F4c8mNz6schf2WMXQZiz1eyR1GGxrMf2coXpAn8mNjxyzp2 --ws wss://asset-hub-westend-rpc.n.dwellir.com balances.transferKeepAlive 5FnudgwK8xJvmujsXXP35pF2xwskhHQzBSRM8KZhXjnEz5gD 1000000000000
@@ -14199,18 +14199,18 @@ Payload: 0x040300ff4a83f1...a8239139ff3ff7c3f6
1419914199
Signature>
1420014200
```
1420114201

14202-
Take this payload and use your normal signing environment (e.g. air gapped machine, VM, etc.). In a separate tab in your terminal, sign the payload.
14202+
Take this payload and use your normal signing environment (e.g., air-gapped machine, VM, etc.). In a separate tab of your terminal, sign the payload.
1420314203

1420414204
```bash
1420514205
polkadot-js-signer sign --account 5F4c8mNz6schf2WMXQZiz1eyR1GGxrMf2coXpAn8mNjxyzp2 --seed "south ladder exile ... grape rival settle coil" --type sr25519 0x040300ff4a83f1...a8239139ff3ff7c3f6
1420614206
```
1420714207

14208-
This will output the signature of the transaction.
14208+
This will output the transaction's signature.
1420914209
```
1421014210
Signature: 0xe6facf194a8e...413ce3155c2d1240b
1421114211
```
1421214212

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`).
1421414214

1421514215
By default, submit will create a mortal extrinsic with a lifetime of 50 blocks.
1421614216
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
1440014400

1440114401
## Txwrapper
1440214402

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.
1440414404

1440514405
### Creating a Transaction, Signing, and Submitting
1440614406

@@ -14410,9 +14410,10 @@ Let's use [chopsticks](/tutorials/polkadot-sdk/testing/fork-live-chains/){target
1441014410
```
1441114411
npx @acala-network/chopsticks --config=polkadot -p 9944
1441214412
```
14413+
1441314414
You should get a Polkadot network running on port 9944.
1441414415

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.
1441614417

1441714418
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}:
1441814419

@@ -14430,6 +14431,7 @@ yarn run polkadot
1443014431
```
1443114432

1443214433
You will get output like the following:
14434+
1443314435
```
1443414436
Alice's SS58-Encoded Address: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
1443514437

@@ -14459,7 +14461,7 @@ The [`txwrapper example script`](https://github.com/paritytech/txwrapper-core/bl
1445914461

1446014462
## Additional Libraries for Submitting a Transaction
1446114463

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.
1446314465
--- END CONTENT ---
1446414466

1446514467
Doc-Content: https://docs.polkadot.com/develop/toolkit/integrations/wallets/

0 commit comments

Comments
 (0)