Skip to content

feat(confirmations): block money account withdrawals above withdrawable balance as user types - #45564

Draft
jpuri wants to merge 1 commit into
fix/confirmations-money-account-withdraw-submitfrom
feat/confirmations-money-account-withdraw-balance-alert
Draft

feat(confirmations): block money account withdrawals above withdrawable balance as user types#45564
jpuri wants to merge 1 commit into
fix/confirmations-money-account-withdraw-submitfrom
feat/confirmations-money-account-withdraw-balance-alert

Conversation

@jpuri

@jpuri jpuri commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Description

The insufficient-money-account-balance alert compared the withdrawable vmUSD against the amount parsed from committed calldata, which lags the input by the debounced encode. Prefer the synchronously recorded last withdraw amount so the blocking alert reacts on every keystroke — Send disables and shows "Insufficient funds" immediately, and clears immediately when the amount is reduced. Mirrors mobile, which evaluates the pending typed amount.

Changelog

CHANGELOG entry: Fixed money account withdrawal insufficient funds alert lagging behind the typed amount

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1814

Manual testing steps

  1. Open a confirmation for a money account withdrawal (mUSD on Monad)
  2. Type an amount above the withdrawable balance
  3. Verify Send disables and the "Insufficient funds" alert shows immediately on the keystroke, without waiting for the debounced encode
  4. Reduce the amount below the withdrawable balance and verify the alert clears immediately

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

🤖 Generated with Claude Code

@jpuri
jpuri deployed to pr-comment August 17, 2026 04:33 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

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.

@metamask-ci metamask-ci Bot added the team-confirmations Push issues to confirmations team label Aug 17, 2026
@metamask-ci

metamask-ci Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (2 files, +52 -2)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 hooks/
          • 📁 alerts/
            • 📁 transactions/
              • 📄 useInsufficientMoneyAccountBalanceAlert.test.ts +38 -0
              • 📄 useInsufficientMoneyAccountBalanceAlert.ts +14 -2

@jpuri
jpuri force-pushed the fix/confirmations-money-account-withdraw-submit branch from eb55e66 to 9a9a1c7 Compare August 17, 2026 10:13
…le balance as user types

The insufficient-money-account-balance alert compared the withdrawable vmUSD
against the amount parsed from committed calldata, which lags the input by
the debounced encode. Prefer the synchronously recorded last withdraw amount
so the blocking alert reacts on every keystroke — Send disables and shows
"Insufficient funds" immediately, and clears immediately when the amount is
reduced. Mirrors mobile, which evaluates the pending typed amount.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jpuri
jpuri force-pushed the feat/confirmations-money-account-withdraw-balance-alert branch from 602c006 to 3ae3ee1 Compare August 17, 2026 10:15
@jpuri
jpuri deployed to pr-comment August 17, 2026 10:15 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-S team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant