Skip to content

fix: show networkFeeError at trade confirm#12192

Merged
kaladinlight merged 2 commits intoreleasefrom
estimate-gas-trade-error
Mar 19, 2026
Merged

fix: show networkFeeError at trade confirm#12192
kaladinlight merged 2 commits intoreleasefrom
estimate-gas-trade-error

Conversation

@kaladinlight
Copy link
Contributor

Description

Trade confirm was silently failing on gas estimation and not disabling the button resulting in failed attempt to trade. Expose the error and disable the button if we can't estimate gas.

Follow up if we wish would be falling back to the quote estimated fees and just fetch up to date gas price on execute.

Issue (if applicable)

https://discordapp.com/channels/554694662431178782/1483584545369620523/1483591857739927552

Risk

High Risk PRs Require 2 approvals

Low

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

Testing

  • ETH -> KNX (0xf19304e6bFE0A18D2a0171758aA433921F192897) swap with butter currently exposes this fail case

Engineering

☝️

Operations

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)

☝️

Screenshots (if applicable)

image

@kaladinlight kaladinlight requested a review from a team as a code owner March 18, 2026 18:51
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 508dd651-1cfb-44ec-a75d-5317261e7bfc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch estimate-gas-trade-error
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Collaborator

@NeOMakinG NeOMakinG left a comment

Choose a reason for hiding this comment

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

QA Review (Code Review)

Changes reviewed:

  1. TradeConfirmFooter.tsx: Extracts error from useTradeNetworkFeeCryptoBaseUnit hook and passes it to TradeFooterButton

  2. TradeFooterButton.tsx:

    • Adds networkFeeError prop with proper typing
    • Creates networkFeeErrorMessage memo that handles both ChainAdapterError (with translation) and generic errors
    • Displays warning alert when network fee estimation fails
    • Disables confirm button when error present
    • Changes button color to red to indicate error state

Assessment:
Clean implementation that properly surfaces gas estimation failures to users. Previously the button would remain enabled even when gas estimation failed, leading to confusing UX and failed transactions. Now users see a clear warning and cannot proceed with a broken trade.

Tested: Code review only (wallet import issues prevented live testing)
LGTM 👍

@kaladinlight kaladinlight merged commit eb864b8 into release Mar 19, 2026
4 checks passed
@kaladinlight kaladinlight deleted the estimate-gas-trade-error branch March 19, 2026 15:45
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.

2 participants