Skip to content

Commit f3d0d27

Browse files
eshaben0xlukem
andauthored
Apply suggestions from code review
Co-authored-by: Lucas Malizia <[email protected]>
1 parent 77e7d7f commit f3d0d27

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

.chain-interactions/send-transactions/calculate-transaction-fees.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Calculate Transaction Fees
3-
description: Learn how to calculate transaction fees for transfers between accounts using Polkadot-API, Polkadot.js API, and Polkadot-JS Apps UI.
3+
description: Learn how to calculate transaction fees for transfers between accounts using Polkadot-API, Polkadot.js API, and the Polkadot.js Apps UI.
44
categories: Basics, Transactions, Developer Tools
55
---
66

@@ -60,10 +60,10 @@ Ensure to replace `INSERT_WS_ENDPOINT` with your WebSocket endpoint, `INSERT_ALI
6060

6161
Key aspects of the code:
6262

63-
- **Transaction creation**: The `api.tx.Balances.transfer_keep_alive()` method constructs a balance transfer transaction
64-
- **`dest` parameter**: Specifies the recipient using a `MultiAddress` type with `Id` variant
65-
- **`getEstimatedFees()`**: Returns the estimated fee in plancks (the smallest unit, where 1 DOT = 10^10 plancks)
66-
- The method applies a dummy signature internally to simulate the transaction
63+
- **Transaction creation**: The `api.tx.Balances.transfer_keep_alive()` method constructs a balance transfer transaction.
64+
- **`dest` parameter**: Specifies the recipient using a `MultiAddress` type with `Id` variant.
65+
- **`getEstimatedFees()`**: Returns the estimated fee in plancks (the smallest unit, where 1 DOT = 10^10 plancks).
66+
- The method applies a dummy signature internally to simulate the transaction.
6767

6868
Execute the script using `tsx`:
6969

@@ -95,9 +95,9 @@ Ensure to replace `INSERT_WS_ENDPOINT` with your WebSocket endpoint, `INSERT_ALI
9595

9696
Key aspects of the code:
9797

98-
- **Transaction creation**: The `api.tx.balances.transferKeepAlive()` method constructs a balance transfer transaction
98+
- **Transaction creation**: The `api.tx.balances.transferKeepAlive()` method constructs a balance transfer transaction.
9999
- **`paymentInfo()`**: Applies a dummy signature and queries the RPC endpoint for fee estimation
100-
- **Return values**: The `partialFee` property contains the estimated fee in the smallest unit (plancks)
100+
- **Return values**: The `partialFee` property contains the estimated fee in the smallest unit (plancks).
101101

102102
Execute the script using `tsx`:
103103

@@ -119,13 +119,13 @@ Navigate to the [Polkadot-JS Apps interface](https://polkadot.js.org/apps){targe
119119

120120
To see fees before submitting a transfer:
121121

122-
1. Navigate to **Accounts** > **Accounts** in the top menu
123-
2. Choose an account and click **send**
122+
1. Navigate to **Accounts** > **Accounts** in the top menu.
123+
2. Choose an account and click **send**.
124124
3. Fill in the transfer details:
125-
- **Send to address**: Enter Bob's address
126-
- **Amount**: Enter the amount you wish to transfer (e.g., 1 DOT)
127-
4. Click **Sign and Submit**
128-
5. The transaction fee will be displayed in the confirmation dialog before you sign
125+
- **Send to address**: Enter Bob's address.
126+
- **Amount**: Enter the amount you wish to transfer (e.g., 1 DOT).
127+
4. Click **Sign and Submit**.
128+
5. The transaction fee will be displayed in the confirmation dialog before you sign.
129129

130130
![](/images/chain-interactions/send-transactions/calculate-transaction-fees/calculate-transaction-fees.gif)
131131

0 commit comments

Comments
 (0)