Repository navigation
feat(money): show bank microdeposits in activity - #38408
Conversation
Adds a microdeposit row to Money activity, fed by NeoBankService.getMicrodeposits() through neobank-proxy and gated by the moneyMicrodepositsEnabled flag. - New `microdeposit` MoneyActivityItem kind, merged into All and Deposits and exempt from the Accounts-API watermark (the list is fetched whole) - useMoneyMicrodeposits polls every 10s (60s on LOW hardware + slow cellular), pauses off-focus/background/offline, and swallows fetch failures so they cannot hide the rest of the feed. 404 already resolves to [] in the controller. - Rows use a synthetic id from created_at/amount/currency/counterparty, since MoonPay's payload has no id and is cumulative across rounds. - Dedicated flag selector next to the VBA activity flags.
NeoBankService.getMicrodeposits resolves the MoonPay customer id through WalletRegistrationService.getMoonpayCustomerId(), which reads the canonical profile id with AuthenticationController:getSessionProfile. The service messenger only delegated getBearerToken, so every call threw "A handler for AuthenticationController:getSessionProfile has not been delegated to NeoBankService" before any request left the app.
|
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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
Adds moneyMicrodepositsEnabled to the flag name enum, the default values and the feature flag registry so the flag is part of the app's flag inventory and QA coverage report. Production default stays off; the remote flag is created in the flag service separately.
Row title is "Test Deposit"; the subtitle is the counterparty bank when the API reports one, otherwise "From your bank".
The fetch now runs whenever a primary Money Account exists and the device is online. The flag, its selector, tests, enum entry and registry entry come out together; the follow-up re-adds them once the flag service has the flag.
Microdeposits can only arrive after the account is verified and a bank is linked, so the extra fetch is skipped unless the profile has an approved KYC decision or the Money wallet already has a provider registration or autoramp. Both signals come from Redux (KycController state and RampsController state), so the gate costs no network request. The registration/autoramp fallback keeps the rows visible for users whose persisted KYC session did not survive a reinstall or predates the KycController.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6fda0f9. Configure here.
Skip the query while the wallet is locked and disable focus/reconnect refetches, matching the auth-gated query pattern used elsewhere. Pull-to-refresh now re-checks the same gate because query.refetch() ignores enabled. A failed poll now rejects instead of resolving to an empty list, so React Query keeps the last good rows instead of hiding them until the next success.
useMoneyActivityItems already resolves the primary Money account through useMoneyAccountTransactions, so the microdeposit hook now takes that address instead of reading selectPrimaryMoneyAccount again. That keeps one source of truth for the address and stops the hook from throwing when a screen renders Money with a minimal background state. Read the KeyringController lock state defensively for the same reason.
The activity hook now polls microdeposits through useQuery, which needs a QueryClientProvider this view test does not render. Mock the hook like the other data hooks in the file.
28.1.0 carries NeoBankService.getMicrodeposits. The 28.0.0 breaking change (RampsController must delegate NeoBankService:listAutorampTransactions) is already covered because the mobile messenger spreads RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS.
The pinned controller now ships NeoBankMicrodeposit and getMicrodeposits, so the structural copy and the runtime narrowing in asMicrodepositService are no longer needed. The hook calls the service directly.
The activity view now reaches useMoneyMicrodeposits through the real bucketing hook, and that useQuery needs a QueryClientProvider this view test does not render. Mock the leaf data hook like the other activity sources.
ramps-controller 28 adds the persisted autorampTransactionRecords key, so the Engine fixture must carry it.
# Conflicts: # package.json # yarn.lock
Extract the nested conditional so the refetchInterval expression reads as one ternary, clearing typescript:S3358.
|
Fixed the |
Smart E2E Test SelectionSelected E2E tags: ALL AI Confidence: 100 E2E reasoningExpand to readHard rule seed mandates ALL due to locale changes in locales/languages/en.json (3 new microdeposit strings: 'microdeposit', 'microdeposit_from', 'microdeposit_from_bank'). These copy strings feed UI label selectors used in E2E tests and are not cosmetic. Additionally, the changes have broad functional impact:
The locale change hard rule alone justifies ALL. The Engine messenger change and broad Money/Card feature additions reinforce this conservative selection. |
lint-staged's markdown Prettier pass reflowed the table while the merge staged every file from main. Restore main's blob so the PR carries no unrelated Predict changes.
- Drop the duplicate `autorampTransactionRecords` key the merge left in the initial-background-state fixture. - Share the VBA wallet-evidence predicate between the microdeposit gate and `getVbaHomeCard`, trimming both sides like RampsController does. - Move the Money poll intervals into `constants/polling.ts`; poll microdeposits once a minute instead of every 10s, since they appear at most a few times during onboarding. - Share the signed-amount formatter between neobank and microdeposit display info. - Stop exporting the hook-local query key.
Resolve the yarn.lock conflict by taking main's lockfile: main already resolves `@metamask/ramps-controller@^28.0.0` to 28.1.0, so the branch's redundant `^28.1.0` bump (and its lock entry) is dropped. The PR no longer touches package.json or yarn.lock.
The merge's lint-staged prettier pass rewrapped a markdown table in a file this PR does not need to touch, which pulled in Predict codeowner review. Restore main's version so the PR's CODEOWNERS surface is only the Money/Ramp/Engine files it actually changes.
…olling ReactQueryService already maps AppState onto TanStack's focus manager, and the query does not set refetchIntervalInBackground, so the interval pauses in the background on its own. useIsFocused plus the offline gate are all the hook needs.
|




Description
Money accounts are US virtual bank accounts. When a user links their bank, the bank sends small test credits (microdeposits) that appear on the user's bank statement with no explanation. This adds those credits to Money activity so the user can recognise them.
The rows are read from neobank-proxy
GET /neobank/customers/{id}/microdepositsthrough a newNeoBankService.getMicrodeposits()and polled once a minute while the Money screen is focused and the app is foregrounded, paused when offline. The fetch is skipped unless the profile has an approved KYC decision or the Money wallet already has a VBA registration or autoramp, so pre-onboarding users never pay for it. A 404 (no MoonPay customer yet) resolves to an empty list; other failures are logged and do not hide the rest of the feed.Rows are display-only: MoonPay exposes no confirm endpoint and reports no further state. The list is cumulative across deposit rounds, and the payload has no id, so rows use a synthetic key built from timestamp, amount, currency and counterparty.
The mobile messenger also had to start delegating
AuthenticationController:getSessionProfile, whichgetMoonpayCustomerId()needs to resolve the customer before the list request.Backend: va-mmcx-onramp-api#1377 (the route this client reads).
Changelog
CHANGELOG entry: Added bank test deposits to Money activity, so users can recognise the small credits their bank sends when linking an account
Related issues
Fixes: TRAM-4327
Manual testing steps
MoonPay's sandbox cannot create microdeposits, so this was verified on the iOS simulator against a stubbed neobank-proxy serving the route's real schema. With the route deployed, the app needs no other change.
Screenshots/Recordings
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
Touches Money activity merge/settling behavior and adds authenticated neobank polling with new messenger delegation; scope is localized but feed correctness and unnecessary API calls depend on the fetch gates.
Overview
Adds bank test deposit (microdeposit) rows to Money activity so users can match small verification credits on their bank statement. Data comes from a new
useMoneyMicrodepositshook that callsNeoBankService.getMicrodeposits()on a slow poll while Money is focused; fetches are gated on approved KYC or existing VBA registration/autoramp, plus unlocked wallet and connectivity.Microdeposits are merged into All and Deposits via
useMoneyActivityItems, sorted by time with synthetic ids, and exempt from the Accounts-API watermark so they are not hidden while other pages load.MicrodepositActivityItemrenders display-only rows (no detail navigation). Pull-to-refresh refetches microdeposits with the rest of the feed.Supporting changes: shared
hasVbaWalletEvidencehelper (replacing duplicated logic in VBA home card),moneyFormatIncomingAmountfor neobank and microdeposit amounts, sharedMONEY_POLL_INTERVAL_MS/MONEY_SLOW_POLL_INTERVAL_MS, andAuthenticationController:getSessionProfiledelegation on the NeoBank service messenger for customer id resolution.Reviewed by Cursor Bugbot for commit 08e52f2. Bugbot is set up for automated code reviews on this repo. Configure here.