Skip to content

fix(confirmations): submit money account deposits without false insufficient funds - #45555

Draft
jpuri wants to merge 1 commit into
feat/confirmations-money-account-amount-uifrom
fix/confirmations-money-account-deposit-submit
Draft

fix(confirmations): submit money account deposits without false insufficient funds#45555
jpuri wants to merge 1 commit into
feat/confirmations-money-account-amount-uifrom
fix/confirmations-money-account-deposit-submit

Conversation

@jpuri

@jpuri jpuri commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

Money Account deposits could not submit: Max was the only amount that cleared the footer, other amounts showed insufficient funds, a $0 pay token left the amount on a skeleton, and switching tokens crashed on a high-precision BigNumber rate.

This aligns deposit encode and Max with mobile (ROUND_DOWN, non-atomic Max), compares the live funding-account balance instead of the money-account snapshot, converts deposit USD with the mUSD rate (not Monad/vault), and shows 0.0 when the selected token has no balance.

Stacked on #45543.

Changelog

CHANGELOG entry: Fixed Money Account deposits failing to submit or showing insufficient funds for amounts other than Max

Related issues

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

Manual testing steps

  1. Build and load this branch (yarn start) with the Money Account feature flag enabled and a wallet that has a Money Account plus a small funding balance (for example ETH or a stablecoin).
  2. Start Add funds from the Money Account.
  3. Confirm Pay with is a token that has a balance, not destination mUSD at $0.00.
  4. Tap Max and confirm the footer allows Add funds.
  5. Tap 10%, 25%, and 50%, and type an amount below the Pay-with balance. Confirm the footer still allows Add funds.
  6. Type an amount above the Pay-with balance. Confirm the footer blocks with insufficient funds.
  7. Open Pay with, select a different token, and confirm the confirmation does not crash.
  8. If Pay with is a $0 token, confirm the amount shows 0.0 instead of a skeleton.
  9. Submit a Max deposit and a non-Max deposit and confirm both complete.

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.

@jpuri jpuri added the team-confirmations Push issues to confirmations team label Aug 14, 2026
@jpuri
jpuri deployed to pr-comment August 14, 2026 17:37 — 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 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (27 files, +1958 -156)
  • 📁 app/
    • 📁 scripts/
      • 📁 lib/
        • 📁 transaction/
          • 📄 delegation.test.ts +292 -0
          • 📄 delegation.ts +277 -5
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 rows/
            • 📁 pay-with-row/
              • 📄 pay-with-row.test.tsx +40 -16
              • 📄 pay-with-row.tsx +5 -5
        • 📁 hooks/
          • 📁 alerts/
            • 📁 transactions/
              • 📄 useAccountNoFundsAlert.test.tsx +22 -0
              • 📄 useAccountNoFundsAlert.ts +6 -1
              • 📄 useInsufficientBalanceAlerts.test.ts +15 -0
              • 📄 useInsufficientBalanceAlerts.ts +13 -2
              • 📄 useInsufficientPayTokenBalanceAlert.test.ts +166 -7
              • 📄 useInsufficientPayTokenBalanceAlert.ts +96 -5
          • 📁 pay/
            • 📄 useAutomaticTransactionPayToken.test.tsx +46 -15
            • 📄 useAutomaticTransactionPayToken.ts +33 -13
            • 📄 useIsPaidByMetaMask.test.ts +47 -3
            • 📄 useIsPaidByMetaMask.ts +22 -5
            • 📄 usePayTokenAccountBalance.test.ts +242 -0
            • 📄 usePayTokenAccountBalance.ts +122 -0
            • 📄 usePayWithNoFeeToken.test.tsx +23 -0
            • 📄 usePayWithNoFeeToken.tsx +21 -5
            • 📄 usePayWithToken.test.tsx +28 -0
            • 📄 usePayWithToken.tsx +9 -0
            • 📄 useTransactionPayAvailableTokens.test.tsx +8 -0
            • 📄 useTransactionPayAvailableTokens.ts +4 -1
          • 📁 transactions/
            • 📄 useDepositPrefillAmount.test.ts +34 -6
            • 📄 useDepositPrefillAmount.ts +16 -8
            • 📄 useTransactionCustomAmount.test.ts +269 -4
            • 📄 useTransactionCustomAmount.ts +99 -53
        • 📁 selectors/
          • 📄 feature-flags.ts +3 -2

@jpuri
jpuri force-pushed the feat/confirmations-money-account-amount-ui branch from d144d9f to 385fd56 Compare August 17, 2026 04:28
@jpuri
jpuri force-pushed the fix/confirmations-money-account-deposit-submit branch from 4707159 to f7594c7 Compare August 17, 2026 04:29
@jpuri
jpuri deployed to pr-comment August 17, 2026 04:29 — with GitHub Actions Active
@jpuri
jpuri force-pushed the feat/confirmations-money-account-amount-ui branch from 385fd56 to af818b9 Compare August 17, 2026 09:58
…ficient funds

Align deposit encode and Max with mobile, compare the live
funding-account balance, and convert deposit USD with the mUSD rate so
non-Max amounts can submit.

Also match mobile pay-token selection (no defaulting to under-min
tokens, empty Pay with row when none exist, no quotes for a 0 transfer
amount) and leave the Relay order-id placeholder unsigned on subsidized
execute: subsidized quotes inject the real request id after signing, and
exact-execution caveats made Delegation Manager reject the redeem with
InvalidERC1271Signature.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jpuri
jpuri force-pushed the fix/confirmations-money-account-deposit-submit branch from f7594c7 to 4d93f51 Compare August 17, 2026 10:05
@jpuri
jpuri deployed to pr-comment August 17, 2026 10:05 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-XL team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant