fix: hide big transaction fee on Perps withdraw when no quotes available cp-7.74.0#29313
Conversation
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Direct impact:
Dependent tags per tag descriptions:
No performance impact: This is a pure logic fix in a React hook with no rendering, data loading, or state management performance implications. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |



Description
When no viable quote existed for a Perps withdraw (e.g. $0.1 → ETH on Ethereum), the confirmation still showed a big transaction fee and an enabled Withdraw button, letting the user submit into a failing transaction.
useNoPayTokenQuotesAlert'sisOptionalOnlycheck was matching the post-quotesourceAmount.targetTokenAddress(the destination token, e.g. native ETH0x0…0) against askipIfBalancerequired token on a different chain (Arbitrum native gas, also0x0…0). That false match suppressed theNoPayTokenQuotesalert.isOptionalOnlyis only meaningful for non-post-quote flows, so this PR bypasses it for post-quote. The existingCustomAmountInfologic then hides the fee rows and shows the disabled "No quotes" button as designed.Changelog
CHANGELOG entry: Fixed Perps withdraw showing a transaction fee and enabled button when no route was available; the rows now hide and the button shows "No quotes".
Related issues
Fixes: #29297
Manual testing steps
Screenshots/Recordings
Before
After
$0.1

$0.5

Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes blocking alert logic in transaction confirmations for post-quote flows, which can affect whether users can proceed with withdrawals; risk is moderated by targeted condition and added tests.
Overview
Fixes a false-negative in the
NoPayTokenQuotesblocking alert for post-quote flows by bypassing theisOptionalOnly(skip-if-balance) suppression whenuseTransactionPayIsPostQuoteis true, preventing cross-chain native-token address collisions (e.g.,0x0…0) from hiding the no-quotes state.Adds/updates unit tests to cover the non-post-quote optional-token case and a regression scenario where a post-quote destination token address would previously suppress the alert.
Reviewed by Cursor Bugbot for commit f3b1072. Bugbot is set up for automated code reviews on this repo. Configure here.