Skip to content

Conversation

@nhussein11
Copy link
Collaborator

πŸ“ Description

Provide a clear and concise description of your changes.

πŸ” Review Preference

Choose one:

  • βœ… I have time to handle formatting/style feedback myself
  • ⚑ Docs team handles formatting (check "Allow edits from maintainers")

πŸ€– AI-Ready Docs

If content changed, regenerate AI files:

  • βœ… I ran python3 scripts/generate_llms.py
  • ⚑ Docs team will regenerate (check "Allow edits from maintainers")

βœ… Checklist

@nhussein11 nhussein11 self-assigned this Nov 26, 2025
@nhussein11 nhussein11 added the B0 - Needs Review Pull request is ready for review label Nov 26, 2025
@nhussein11 nhussein11 requested a review from a team as a code owner November 26, 2025 23:18
@nhussein11 nhussein11 added the C1 - Medium Medium priority task label Nov 26, 2025
Copilot AI review requested due to automatic review settings November 26, 2025 23:18
@nhussein11 nhussein11 added the A0 - New Content Pull request contains new content pages label Nov 26, 2025
Copilot finished reviewing on behalf of nhussein11 November 26, 2025 23:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive documentation and code examples for calculating transaction fees on Polkadot-based chains. It provides practical examples using both Polkadot-API (PAPI) and Polkadot.js API, along with instructions for the Polkadot-JS Apps UI.

Key Changes:

  • Complete tutorial documentation covering fee calculation concepts and prerequisites
  • TypeScript code examples for both PAPI and Polkadot.js API with detailed explanations
  • Expected output samples demonstrating fee estimation results

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.chain-interactions/send-transactions/calculate-transaction-fees.md Main tutorial document explaining transaction fee calculation with three different approaches (PAPI, Polkadot.js API, and UI)
.snippets/code/chain-interactions/send-transactions/calculate-transaction-fees/polkadotjs-fee-calculator.ts Polkadot.js API implementation for fee estimation
.snippets/code/chain-interactions/send-transactions/calculate-transaction-fees/polkadotjs-fee-calculator-output.html Expected terminal output for the Polkadot.js API example
.snippets/code/chain-interactions/send-transactions/calculate-transaction-fees/papi-fee-calculator.ts PAPI implementation for fee estimation
.snippets/code/chain-interactions/send-transactions/calculate-transaction-fees/papi-fee-calculator-output.html Expected terminal output for the PAPI example

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const bobAddress = "INSERT_BOB_ADDRESS";

// Amount to transfer (1 DOT = 10^10 plancks)
const amount = 1_000_000_000_000n; // 1 DOT
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states "1 DOT = 10^10 plancks" and the amount is set to 1_000_000_000_000n (1 trillion), but 10^10 is 10 billion, not 1 trillion. The value should be 10_000_000_000n to represent 1 DOT, or the comment should state "1 DOT = 10^12 plancks" if 1 trillion is correct.

Suggested change
const amount = 1_000_000_000_000n; // 1 DOT
const amount = 10_000_000_000n; // 1 DOT

Copilot uses AI. Check for mistakes.
const bobAddress = "INSERT_BOB_ADDRESS";

// Amount to transfer (1 DOT = 10^10 plancks)
const amount = 1_000_000_000_000n; // 1 DOT
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states "1 DOT = 10^10 plancks" and the amount is set to 1_000_000_000_000n (1 trillion), but 10^10 is 10 billion, not 1 trillion. The value should be 10_000_000_000n to represent 1 DOT, or the comment should state "1 DOT = 10^12 plancks" if 1 trillion is correct.

Suggested change
const amount = 1_000_000_000_000n; // 1 DOT
const amount = 10_000_000_000n; // 1 DOT

Copilot uses AI. Check for mistakes.
To see fees before submitting a transfer:

1. Navigate to **Accounts** > **Accounts** in the top menu
2. Choice an account and click **send**
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "Choice" should be "Choose".

Suggested change
2. Choice an account and click **send**
2. Choose an account and click **send**

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +6
<span data-ty>Transaction amount: 100 DOT</span>
<span data-ty>Total deducted: 100.0014668864 DOT</span>
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output shows "Transaction amount: 100 DOT", but the code sets the amount to 1_000_000_000_000n which, based on the conversion factor used (/ 1e10), would output 100 DOT. However, the comment in the code states this is "1 DOT". Either the comment should say "100 DOT" or the amount should be 10_000_000_000n for 1 DOT (assuming 10^10 plancks per DOT).

Suggested change
<span data-ty>Transaction amount: 100 DOT</span>
<span data-ty>Total deducted: 100.0014668864 DOT</span>
<span data-ty>Transaction amount: 1 DOT</span>
<span data-ty>Total deducted: 1.0014668864 DOT</span>

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +6
<span data-ty>Transaction amount: 100 DOT</span>
<span data-ty>Total deducted: 100.0014668864 DOT</span>
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output shows "Transaction amount: 100 DOT", but the code sets the amount to 1_000_000_000_000n which, based on the conversion factor used (/ 1e10), would output 100 DOT. However, the comment in the code states this is "1 DOT". Either the comment should say "100 DOT" or the amount should be 10_000_000_000n for 1 DOT (assuming 10^10 plancks per DOT).

Suggested change
<span data-ty>Transaction amount: 100 DOT</span>
<span data-ty>Total deducted: 100.0014668864 DOT</span>
<span data-ty>Transaction amount: 1 DOT</span>
<span data-ty>Total deducted: 1.0014668864 DOT</span>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0 - New Content Pull request contains new content pages B0 - Needs Review Pull request is ready for review C1 - Medium Medium priority task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants