chore: add money deposit hook#29487
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #29487 +/- ##
==========================================
+ Coverage 81.86% 81.98% +0.11%
==========================================
Files 5255 5300 +45
Lines 138980 140332 +1352
Branches 31518 31923 +405
==========================================
+ Hits 113774 115045 +1271
Misses 17465 17465
- Partials 7741 7822 +81 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…y account deposits
…metamask-mobile into custom_amt_update_hook
…metamask-mobile into chore--add-money-deposit-hook
…to chore--add-money-deposit-hook
….com/MetaMask/metamask-mobile into chore--add-money-deposit-hook
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|



Description
Changelog
CHANGELOG entry: Updated money account deposit.
Related issues
Depends on: #29561
Depends on: MetaMask/core#8687
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Updates Money Account deposit transaction construction and confirmation re-encoding, which can affect on-chain calldata and Pay gating via
requiredAssets, though it is still using a zero-amount placeholder by default.Overview
Adds a Money Account deposit initiation path that submits an
addTransactionBatchfor approve+deposit with a zero-amount placeholder, navigates to theCustomAmountconfirmation screen, and declares PayrequiredAssetsusing a shared deposit-asset helper.Implements real
updateMoneyAccountDepositTokenAmountre-encoding: converts the user-entered human amount to USDC base units, callspreviewDepositto computeminimumMint(with slippage), and returns updated calldata for the nested approve/deposit calls; it no-ops when vault config/provider is unavailable.Refactors deposit asset handling into
getMoneyAccountDepositAssetAddress(currently hardcoded USDC), skips thepreviewDepositRPC for 0 amounts, updates/extends unit tests and confirmation mocks, and bumps@metamask/transaction-controllerto65.1.0.Reviewed by Cursor Bugbot for commit 5ef8804. Bugbot is set up for automated code reviews on this repo. Configure here.