Skip to content

Add gas estimation guide#86

Open
nwakaku wants to merge 1 commit intocedra-labs:mainfrom
nwakaku:How-to
Open

Add gas estimation guide#86
nwakaku wants to merge 1 commit intocedra-labs:mainfrom
nwakaku:How-to

Conversation

@nwakaku
Copy link
Copy Markdown

@nwakaku nwakaku commented Dec 29, 2025

Cedra Builders Forge - Submission

Season 1

📋 Task Information

Task Title: Create Any Technical Guide for Cedra

Issue Link: #62

Telegram: @Wizzy2304


✅ Checklist

  • Commented "I'm taking this task" on the issue before starting
  • This PR contains ONE task only
  • All work is original (no copy-paste)
  • Code compiles without errors and all tests pass
  • Includes README, tests, and documentation
  • Will share PR in Cedra Builders Telegram

📝 What Was Built

Added a guide: "How to Estimate Gas Before Transactions" in guides/How to estimate gas before transactions.md. The guide covers:

  • Gas basics: gas units, gas price, and total cost calculation
  • Basic gas estimation using transaction.simulate.simple() with TypeScript examples
  • Common pitfalls (4):
    1. Not checking the success flag
    2. Not accounting for transaction amount
    3. Using stale estimates
    4. Not handling simulation errors
  • Best practices: 5 recommendations for reliable gas estimation

The guide is concise (~487 words) and focuses on essential information for developers.

Task Issue

[Link to task issue]

Testing Instructions

  1. Review the guide:

    cat guides/"How to estimate gas before transactions.md"
  2. Verify code examples:

    • Ensure TypeScript examples use correct SDK imports
    • Check that function signatures match the Cedra TypeScript SDK API
    • Verify gas estimation logic is accurate
  3. Test with a real transaction (optional):

    # Navigate to any example project
    cd first-tx
    
    # Run the example and verify gas estimation works
    npm install
    npm run start
  4. Validate markdown formatting:

    • Check that code blocks render correctly
    • Verify links to external resources work
    • Ensure the guide is readable and well-structured

Dependencies or Setup Required

  • None. The guide is documentation only and requires no additional setup.
  • For testing code examples:
    • Node.js and npm
    • @cedra-labs/ts-sdk package
    • Access to Cedra testnet or mainnet
    • A funded Cedra account for testing transactions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant