Skip to content

chore: add money deposit hook#29487

Merged
MoMannn merged 49 commits into
mainfrom
chore--add-money-deposit-hook
May 7, 2026
Merged

chore: add money deposit hook#29487
MoMannn merged 49 commits into
mainfrom
chore--add-money-deposit-hook

Conversation

@MoMannn

@MoMannn MoMannn commented Apr 29, 2026

Copy link
Copy Markdown
Member

Description

Changelog

CHANGELOG entry: Updated money account deposit.

Related issues

Depends on: #29561
Depends on: MetaMask/core#8687

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

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 addTransactionBatch for approve+deposit with a zero-amount placeholder, navigates to the CustomAmount confirmation screen, and declares Pay requiredAssets using a shared deposit-asset helper.

Implements real updateMoneyAccountDepositTokenAmount re-encoding: converts the user-entered human amount to USDC base units, calls previewDeposit to compute minimumMint (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 the previewDeposit RPC for 0 amounts, updates/extends unit tests and confirmation mocks, and bumps @metamask/transaction-controller to 65.1.0.

Reviewed by Cursor Bugbot for commit 5ef8804. Bugbot is set up for automated code reviews on this repo. Configure here.

@metamaskbotv2 metamaskbotv2 Bot added the team-delegation MetaMask Delegation Team label Apr 29, 2026
@codecov-commenter

codecov-commenter commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.28571% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.98%. Comparing base (8437791) to head (e7756e8).
⚠️ Report is 109 commits behind head on main.

Files with missing lines Patch % Lines
app/components/UI/Money/hooks/useMoneyAccount.ts 88.23% 1 Missing and 1 partial ⚠️
...ponents/UI/Money/utils/moneyAccountTransactions.ts 90.00% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jpuri jpuri added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label May 5, 2026
jpuri
jpuri previously approved these changes May 6, 2026
@MoMannn MoMannn enabled auto-merge May 6, 2026 07:28
shane-t
shane-t previously approved these changes May 6, 2026
jpuri
jpuri previously approved these changes May 6, 2026
@MoMannn MoMannn added this pull request to the merge queue May 6, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 6, 2026
@MoMannn MoMannn mentioned this pull request May 7, 2026
10 tasks
@MoMannn MoMannn dismissed stale reviews from jpuri and shane-t via d1e2ca4 May 7, 2026 08:08
@socket-security

socket-security Bot commented May 7, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​transaction-controller@​65.0.0 ⏵ 65.1.09510081 +198100

View full report

@socket-security

socket-security Bot commented May 7, 2026

Copy link
Copy Markdown

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Warn Low
Potential code anomaly (AI signal): npm @metamask/transaction-controller is 75.0% likely to have a medium risk anomaly

Notes: The code performs straightforward signature verification using ethers.js, returning true when the recovered signer matches the provided publicKey. While generally safe, the silent catch and potential mismatch between data formatting and signing process should be addressed to avoid silent failures. Overall, a benign utility with moderate input-format sensitivity.

Confidence: 0.75

Severity: 0.50

From: package.jsonnpm/@metamask/transaction-controller@65.1.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/transaction-controller@65.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@MoMannn MoMannn requested review from jpuri and shane-t May 7, 2026 08:10
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/transaction-controller. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/transaction-controller. Running all tests.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

@MoMannn MoMannn enabled auto-merge May 7, 2026 09:28
@MoMannn MoMannn added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 282bcd7 May 7, 2026
114 checks passed
@MoMannn MoMannn deleted the chore--add-money-deposit-hook branch May 7, 2026 10:59
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-M team-delegation MetaMask Delegation Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants