fix(money): correct transfer toasts (MUSD-845)#30770
Conversation
Mirrors the deposit-intent pattern (PR #30741) for the withdraw flow so transfer "between accounts" emits its own toast copy per Figma: - In progress: "Transfer in progress" / "This may take a few minutes." - Success: "Transfer complete" / "{{amount}} added to Money account." - Failed: "Transfer failed" / "Unable to transfer funds. Try again." initiateWithdrawal() now pre-generates a client-side batchId and registers a MoneyAccountWithdrawIntent ("betweenAccounts" by default) before the addTransactionBatch await, so useMoneyTransactionStatus can resolve the intent for both deferred in-progress toasts and the synchronous immediate failure path. The intent is cleared on every terminal status (confirmed, failed, dropped, cancelled, rejected) and when initiateWithdrawal throws.
|
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. |
| expect(toast.labelOptions).toHaveLength(3); | ||
| }); | ||
|
|
||
| it('success title/body is "Transfer complete" / "$50.00 added to Money account." for betweenAccounts', () => { |
There was a problem hiding this comment.
This test is asserting against the result.current.MoneyToastOptions.withdraw.success toast but "$50.00 added to Money account." doesn't make sense if we're withdrawing from the Money account to another EVM account in the user's wallet.
We'll want to make sure the copy makes sense for the intent.
Please push back if I'm misunderstanding!
| "withdraw_success_body_between_accounts": "{{amount}} added to Money account.", | ||
| "withdraw_success_body_no_amount_between_accounts": "Added to Money account.", |
There was a problem hiding this comment.
Same point here. We'll want to double-check copy. Right now, I don't think this makes sense.
There was a problem hiding this comment.
good point, I took it from https://www.figma.com/design/XKZ8hRqSn2iTiuzmlQLuYQ/Money-account?node-id=6412-27526&m=dev, but didn't pay too much attention to it
…conditionally (MUSD-845)
All transfers out of the Money account share the same Figma toast copy
("Transfer in progress / complete / failed"), so the intent-aware
plumbing added in the previous commit was over-engineered:
- Drop MoneyAccountWithdrawIntent + the batchId-keyed registry, the
pre-generated batchId in initiateWithdrawal, and the matching
get/clear/InitiateWithdrawalOptions exports.
- Drop WithdrawIntent / WithdrawInProgressParams / WithdrawFailedParams
and the `destination` param on WithdrawSuccessParams.
- Rename locale keys to drop the now-redundant `_between_accounts`
suffix, and remove the unused "moved to {{destination}}" copy.
- useMoneyTransactionStatus.showFor* maps moneyAccountWithdraw
straight to the new copy with no intent lookup.
Deposit-intent infrastructure (Convert crypto vs Add mUSD) is unchanged.
…toast (MUSD-845)
The transfer success body now reads "{{amount}} added to {{destination}}."
where destination is the user's currently selected internal account's
display name, resolved at toast time from selectSelectedInternalAccount.
Falls back to "Money account" only when no account name is available.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #30770 +/- ##
==========================================
- Coverage 82.70% 82.70% -0.01%
==========================================
Files 5545 5550 +5
Lines 142217 142337 +120
Branches 32834 32860 +26
==========================================
+ Hits 117624 117722 +98
- Misses 16746 16754 +8
- Partials 7847 7861 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…nt (MUSD-845)
Previously, the transfer success toast read the destination name from
selectSelectedInternalAccount at toast time. That breaks two ways:
1. If the user switches accounts between submit and confirmation, the
toast names the wrong account.
2. The fallback "Money account" was misleading on a withdraw — funds
don't return to the Money account, they leave it.
The destination is now derived from the actual on-chain transfer: decode
the recipient from the nested tokenMethodTransfer calldata, look it up
via getMemoizedInternalAccountByAddress, and use the account's display
name. Falls back to a shortened recipient address when the recipient is
not one of the user's internal accounts (e.g. external send), and to
"your account" only when the nested transfer tx itself is absent.
Pull request was converted to draft
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 11ee11b. Configure here.
Replace the hardcoded English fallback "your account" with a
strings('money.toasts.withdraw_fallback_destination') lookup so it gets
translated for non-English users.
…D-845) The success toast rendered "added to ." when the recipient account had a blank name: the name fell through the ?? guard because empty strings are not nullish. Trim the name and branch on whether the recipient is an internal account — name when present, "your account" for a nameless own account, shortened address only for true external recipients.
| recipient, | ||
| ); | ||
| if (!account) return renderShortAddress(recipient); | ||
| const accountName = account.metadata?.name?.trim(); |
There was a problem hiding this comment.
There was a problem hiding this comment.
…D-845) The withdraw success toast read the recipient name from internalAccounts[].metadata.name, which stays empty under the multichain-accounts model where the display name lives on the AccountTreeController account group. Renamed accounts therefore fell back to "your account" even though the picker showed the name. Prefer the account-group name via selectAccountToGroupMap (keyed by account.id), falling back to the internal-account name, then the localized default — matching the Bridge useRecipientDisplayData precedent.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The Performance Test Selection: |




Description
Follow-up to PR #30741 (MUSD-849, MUSD-845) which corrected the deposit toasts. The same lifecycle for transfer (Money account → another account) was still showing the generic "Transaction in progress / Transaction complete / {{amount}} moved to Between accounts." copy.
This PR updates the three withdraw lifecycle toasts to match Figma. The new copy is used for every transfer out of the Money account (today: "Transfer → Between accounts"; the upcoming Perps / Predictions / external-send paths will reuse the same lifecycle):
Figma references:
Because all transfers share this copy today, no intent layer is introduced on the withdraw side — the toast subscriber just maps
TransactionType.moneyAccountWithdrawto the new strings unconditionally. (The deposit-intent infrastructure from #30741 stays in place — Convert crypto vs. Add mUSD still have distinct copy.)Changelog
CHANGELOG entry: Updated the in-progress, success, and failed toasts for Money account transfers to "Transfer in progress / Transfer complete / Transfer failed" with the Figma body copy.
Related issues
Fixes: MUSD-845
Manual testing steps
Screenshots/Recordings
Before
In-progress / success toasts used the generic "Transaction in progress" / "Transaction complete" / "{{amount}} moved to Between accounts." copy.
After
Toasts match the Figma per state (see table above).
Pre-merge author checklist
Performance checks (if applicable)
For performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
User-facing toast strings and destination labeling for Money withdraws only; no auth, payments, or persistence changes beyond reading account metadata at confirm time.
Overview
Money account transfer (withdraw) toasts now use Figma-specific copy instead of the generic deposit-style “Transaction in progress / complete” strings and the hardcoded “Between accounts” success destination.
Copy & i18n: Withdraw in-progress, success, and failed titles/bodies are wired to new
money.toasts.withdraw_*keys (e.g. “Transfer in progress”, “Transfer complete”, “{{amount}} added to {{destination}}.”, “Transfer failed”). Success wording shifts from “moved to” to “added to” the destination.Success destination: On confirmed withdraw,
useMoneyTransactionStatusderives the label from the nested ERC20transferrecipient: internal accounts use account group name (preferred), then account name, then shortened address for unknown recipients, with “your account” when metadata or nested transfer is missing.Tests were tightened for exact toast strings and for the destination-resolution fallbacks.
Reviewed by Cursor Bugbot for commit 0af17bb. Bugbot is set up for automated code reviews on this repo. Configure here.