Skip to content

feat: show estimated tx cost in confirmation step#3907

Open
597226617 wants to merge 1 commit into
livepeer:masterfrom
597226617:feat/tx-cost-confirmation
Open

feat: show estimated tx cost in confirmation step#3907
597226617 wants to merge 1 commit into
livepeer:masterfrom
597226617:feat/tx-cost-confirmation

Conversation

@597226617
Copy link
Copy Markdown

Summary

Implements #1815 - Add estimated transaction cost display and confirmation step before submitting on-chain transactions.

Changes

Server-side

  • New /estimateTxCost endpoint (server/handlers.go): Accepts txType query param, returns estimated gas cost in ETH based on current gas price and typical gas limits per tx type
  • Registered route in server/webserver.go

CLI-side

  • New confirmTx() helper (cmd/livepeer_cli/wizard.go): Queries /estimateTxCost, displays estimated cost, prompts user for y/N confirmation
  • Added confirmation to all transaction wizards:
    • bond, rebond, unbond, withdrawStake, withdrawFees (wizard_bond.go)
    • initializeRound (wizard_rounds.go)
    • activateOrchestrator (wizard_transcoder.go)
    • fundDepositAndReserve, unlock, withdraw (wizard_ticketbroker.go)

ETH Client

  • Added EstimateTransferGas method to eth/client.go interface

User Experience

⚠️  Transaction: Bond 100 tokens to 0x123...
💰 Estimated cost: 0.0015 ETH (gas limit: 150000, gas price: 10000000000 wei)
Do you want to proceed? [y/N]: 

Closes #1815
Relates to #1783

Implements livepeer#1815 - Show estimated tx cost before transaction submission

Changes:
- Add /estimateTxCost server endpoint for gas estimation
- Add confirmTx() helper in CLI wizard
- Add confirmation prompts to all transaction wizards:
  bond, rebond, unbond, withdrawStake, withdrawFees,
  initializeRound, activateOrchestrator,
  fundDepositAndReserve, unlock, withdraw
- Add EstimateTransferGas to eth client interface

Closes livepeer#1815, relates to livepeer#1783
@github-actions github-actions Bot added the go Pull requests that update Go code label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code

Projects

No open projects
Status: Triage

Development

Successfully merging this pull request may close these issues.

livepeer_cli: Show estimated tx cost in a confirmation step

2 participants