Skip to content

Commit ad00220

Browse files
nhussein11brunopgalvaoCopilot
authored
Apply suggestions from code review
Co-authored-by: Bruno Galvao <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent d4ceb56 commit ad00220

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Create a new project directory and initialize it:
3232
```bash
3333
mkdir fee-calculator
3434
cd fee-calculator
35-
npm init -y
35+
npm init -y && npm pkg set type=module
3636
```
3737

3838
Install the required packages:
@@ -120,7 +120,7 @@ Navigate to the [Polkadot-JS Apps interface](https://polkadot.js.org/apps){targe
120120
To see fees before submitting a transfer:
121121

122122
1. Navigate to **Accounts** > **Accounts** in the top menu
123-
2. Choice an account and click **send**
123+
2. Choose an account and click **send**
124124
3. Fill in the transfer details:
125125
- **Send to address**: Enter Bob's address
126126
- **Amount**: Enter the amount you wish to transfer (e.g., 1 DOT)

.snippets/code/chain-interactions/send-transactions/calculate-transaction-fees/papi-fee-calculator-output.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<span data-ty="input"><span class="file-path"></span>npx tsx papi-fee-calculator.ts</span>
33
<span data-ty="progress"></span>
44
<span data-ty>Estimated fee: 0.0014668864 DOT</span>
5-
<span data-ty>Transaction amount: 100 DOT</span>
6-
<span data-ty>Total deducted: 100.0014668864 DOT</span>
5+
<span data-ty>Transaction amount: 1 DOT</span>
6+
<span data-ty>Total deducted: 1.0014668864 DOT</span>
77
</div>

.snippets/code/chain-interactions/send-transactions/calculate-transaction-fees/papi-fee-calculator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function calculateFees() {
1717
const bobAddress = "INSERT_BOB_ADDRESS";
1818

1919
// Amount to transfer (1 DOT = 10^10 plancks)
20-
const amount = 1_000_000_000_000n; // 1 DOT
20+
const amount = 10_000_000_000n; // 1 DOT
2121

2222
try {
2323
// Create the transaction

.snippets/code/chain-interactions/send-transactions/calculate-transaction-fees/polkadotjs-fee-calculator-output.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<span data-ty="input"><span class="file-path"></span>npx tsx polkadotjs-fee-calculator.ts</span>
33
<span data-ty="progress"></span>
44
<span data-ty>Estimated fee: 0.0014668864 DOT</span>
5-
<span data-ty>Transaction amount: 100 DOT</span>
6-
<span data-ty>Total deducted: 100.0014668864 DOT</span>
5+
<span data-ty>Transaction amount: 1 DOT</span>
6+
<span data-ty>Total deducted: 1.0014668864 DOT</span>
77
</div>

.snippets/code/chain-interactions/send-transactions/calculate-transaction-fees/polkadotjs-fee-calculator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async function calculateFees() {
1313
const bobAddress = "INSERT_BOB_ADDRESS";
1414

1515
// Amount to transfer (1 DOT = 10^10 plancks)
16-
const amount = 1_000_000_000_000n; // 1 DOT
16+
const amount = 10_000_000_000n; // 1 DOT
1717

1818
try {
1919
// Create the transaction

0 commit comments

Comments
 (0)