11---
22title : 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.
44categories : Basics, Transactions, Developer Tools
55---
66
@@ -60,10 +60,10 @@ Ensure to replace `INSERT_WS_ENDPOINT` with your WebSocket endpoint, `INSERT_ALI
6060
6161Key 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
6868Execute the script using ` tsx ` :
6969
@@ -95,9 +95,9 @@ Ensure to replace `INSERT_WS_ENDPOINT` with your WebSocket endpoint, `INSERT_ALI
9595
9696Key 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
102102Execute the script using ` tsx ` :
103103
@@ -119,13 +119,13 @@ Navigate to the [Polkadot-JS Apps interface](https://polkadot.js.org/apps){targe
119119
120120To 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** .
1241243 . 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