…MetaMask#38961)
## **Description**
### Problem
Money account deposits fail at submit with:
```
KeyringController - The keyring for the current address does not support the method signTransaction.
```
Reported on RC 8.19.0.
### Root cause
1. **Money keyrings cannot sign transactions by design.**
`@metamask/eth-money-keyring` implements `signPersonalMessage`,
`signTypedData` and `signEip7702Authorization` only.
`KeyringController.signTransaction` throws the error above when the
keyring has no `signTransaction`.
2. **The happy path never signs locally.**
`useMoneyAccount.initiateDeposit` creates the batch with
`isGasFeeSponsored: isMonadMainnetChainId(chainId)`.
`TransactionController` then sets `isExternalSign = true`, skips the
keyring (`Skipping sign as signed externally`), and the 7702 relay
publish hook submits it.
3. **`useTransactionConfirm` undid that.** At confirm time it recomputed
both flags from `useIsGaslessSupported`:
```ts
updatedMetadata.isGasFeeSponsored = isGaslessEligible;
const isExternalSignStale =
Boolean(transactionMetadata.isExternalSign) && !isGaslessEligible;
```
When `isGaslessEligible` was false both flags were cleared,
`TransactionController` fell back to `KeyringController:signTransaction`
with the money account as `from`, and that threw.
That revert exists for **hardware wallets**, which genuinely must sign
locally — leaving the flag set there would send an empty `'0x'` to
`eth_sendRawTransaction`. It simply did not exclude money accounts,
which are the opposite case.
**Why `isGaslessSupported` goes false for a deposit:**
`useIsGaslessSupported` resolves asynchronously and checks
`isAtomicBatchSupported` for the **paying** account. For a money deposit
the payer is the funding EOA (via `accountOverride`), not the money
account, so it can legitimately disagree with the 7702 publish hook —
which keys on `txParams.from`. Any transient relay/`isRelaySupported`
failure produces the same outcome.
> Note: this differs from the Extension's trigger in
[MetaMask/metamask-extension#47616](MetaMask/metamask-extension#47616).
Mobile has no per-chain gas sponsorship opt-out preference
(`gasSponsorshipOptOutByChainId` does not exist here), so on Mobile the
`useIsGaslessSupported` disagreement is the cause.
### Solution
- **New selectors `selectMoneyKeyringAddresses` /
`selectIsMoneyKeyringAddress`** in `app/selectors/keyringController`.
They read `keyrings` directly, because money accounts are not internal
accounts, so `metadata.keyring` lookups do not apply.
- **`useTransactionConfirm` now checks whether `txParams.from` belongs
to a money keyring.** For those transactions:
- `isGasFeeSponsored` is kept whenever the controller sponsored the
transaction, regardless of `isGaslessSupported`.
- `isExternalSign` is never cleared.
The check is keyed on the **sending keyring**, not the transaction type,
so deposits, withdrawals, rescue sends and rewards claims are all
covered.
- **Behaviour for all other accounts is unchanged.** The hardware-wallet
revert still applies, and a money transaction the controller did *not*
sponsor is still not force-marked as sponsored.
### Also fixed (found while verifying)
`KEYRING_TYPES_SUPPORTING_7702` in `account-supports-7702.ts` listed
`money` but not `mpcMoney`. Since `accountSupports7702` is the outermost
condition in both the publish hook
(`app/util/transactions/hooks/index.ts`) and
`isEIP7702GasFeeTokensEnabled`, MPC money accounts would have been
blocked from the relay even with the flags preserved.
This is **latent, not user-facing** — MPC keyring registration is fenced
behind `MM_MONEY_MPC_KEYRING_ENABLED`, which ships off. It is fixed here
because the new selector treats both variants as money keyrings, so
leaving the allowlist inconsistent would be a trap for whoever enables
that flag. Both lists now derive from a single `MONEY_KEYRING_TYPES`
constant so they cannot drift again.
## **Changelog**
CHANGELOG entry: Fixed money account deposits failing with a "does not
support the method signTransaction" error
## **Related issues**
Fixes:
[CONF-2227](https://consensyssoftware.atlassian.net/browse/CONF-2227)
Mirrors the Extension fix:
MetaMask/metamask-extension#47616
## **Manual testing steps**
**Setup:** a build with a money account on Monad holding some mUSD.
```gherkin
Feature: Money account deposit
Scenario: user makes a money account deposit
Given the user has a money account on Monad
When the user makes a money account deposit
Then the deposit is submitted through the sponsored 7702 relay
And no "does not support the method signTransaction" error is shown
Scenario: user makes a money account withdrawal
Given the user has a money account on Monad holding mUSD
When the user makes a money account withdrawal
Then the withdrawal is submitted through the sponsored 7702 relay
Scenario: hardware wallet signing is unaffected
Given the user has a hardware wallet account on a sponsored chain
When the user confirms a transaction from that account
Then the transaction is signed on device and submitted normally
```
Because the trigger is a race/transient in `useIsGaslessSupported`, the
most reliable way to reproduce the failure on `main` is to force the
disagreement — e.g. make `useIsGaslessSupported` return `isSupported:
false` (stub `isRelaySupported` to resolve `false`), then attempt a
deposit:
- **Before this PR:** fails with `KeyringController - The keyring for
the current address does not support the method signTransaction.`
- **After this PR:** succeeds via the sponsored relay.
Please also confirm step 3 (hardware wallet) to verify the existing
revert is intact.
## **Screenshots/Recordings**
N/A — no UI change. The fix only affects which flags are sent to
`TransactionController` at confirm time.
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
### Testing notes
- **Regression-proven:** the hook logic was reverted locally to confirm
the two bug-specific tests fail, then restored. They catch the bug
rather than passing vacuously. The two guard tests (non-money sender
still reverted; unsponsored money tx not force-marked) correctly stayed
green throughout.
- 112 tests pass across the 4 affected suites, including the 53
pre-existing `useTransactionConfirm` tests.
- `yarn lint:tsc` exits 0; ESLint reports 0 errors and 0 warnings on the
changed files.
- **Not verified on device** — this is covered by unit tests and code
analysis only. Reviewer device testing on a real money account would be
valuable.
#### Performance checks (if applicable)
- [x] I've tested on Android
- Ideally on a mid-range device; emulator is acceptable
- [x] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [x] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example
For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
## **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.
[CONF-2227]:
https://consensyssoftware.atlassian.net/browse/CONF-2227?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes transaction confirm metadata for sponsored signing paths;
scope is narrow (money signers only) but incorrect logic would break
money flows or regress hardware external-sign reverts.
>
> **Overview**
> Fixes money account deposits and withdrawals failing at confirm when
**`useIsGaslessSupported`** returns false and
**`useTransactionConfirm`** was clearing **`isExternalSign`** /
**`isGasFeeSponsored`**, which forced local **`signTransaction`** on
keyrings that only support message signing.
>
> **`useTransactionConfirm`** now detects Money signers via
**`selectIsMoneyKeyringAddress`** on **`txParams.from`**. For those
accounts it preserves controller-sponsored **`isGasFeeSponsored`**
(using **`isTransactionMarkedAsGasFeeSponsored`**) and never reverts
**`isExternalSign`** when gasless eligibility disagrees; hardware-wallet
and non-money behavior is unchanged.
>
> Adds **`selectMoneyKeyringAddresses`** /
**`selectIsMoneyKeyringAddress`**, a shared **`MONEY_KEYRING_TYPES`**
list (SRP and MPC Money keyrings), and aligns **`accountSupports7702`**
with that list so MPC money accounts are not blocked from the 7702
relay. Regression tests cover deposit, withdraw, unsponsored guard, and
non-money revert paths.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f28bc31. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Description
Problem
Money Account withdrawals (and deposits) on Monad can fail at submit with:
In Mixpanel (project 2212883,
Transaction Finalized, 26 Oct – 1 Nov) this error accounts for 23 failedmoney_account_withdrawevents (21 on 13.54.0, 2 on 13.53.0) and 7 failedmoney_account_depositevents (13.54.0 / 13.55.0). The withdraw failures come from only 2 users, and the failure is sticky per user. For example, one user had 3 successful withdrawals viasentinel_relayand then every Money transaction failed from that point on, across sessions. All failures are on Monad (0x8f), haveaccount_hardware_typeundefined (so hardware wallets are not involved), and have notransaction_submission_method, meaning they never reached the sponsored relay.Root cause
Money keyrings cannot sign transactions by design.
@metamask/eth-money-keyringand@metamask/eth-money-mpc-keyringonly implementsignPersonalMessage,signTypedDataandsignEip7702Authorization.KeyringController.signTransactionthrows the error above when the keyring has nosignTransaction.The happy path never signs locally.
create-withdraw-transaction.ts/create-deposit-transaction.tscreate the batch withisGasFeeSponsored: chainId === CHAIN_IDS.MONAD.TransactionControllerthen setsisExternalSign = true, skips the keyring, and the 7702 relay publish hook submits it.useTransactionConfirmundid that. At confirm time it recomputes both flags fromisSponsorshipOptedOut, the persisted per-chain preferencegasSponsorshipOptOutByChainId[chainId], and fromisGaslessSupported:!isGaslessSupported, but not for the opt-out.When either condition hit,
isGasFeeSponsoredandisExternalSignwere cleared.TransactionControllerthen fell back toKeyringController:signTransactionwith the Money account asfrom, and that threw.How users get into this state: choosing "pay with MON" in the
GasSponsorshipModalon any regular Monad confirmation (swap, bridge, send) persists the opt-out for0x8f. Money confirmations don't render the gas fee row or that modal, so the user cannot see or reverse the preference from the Money flow. Every subsequent Money withdraw/deposit on Monad fails. That matches the sticky per-user pattern in Mixpanel, where the affected users' other Monad transactions stopped going throughsentinel_relayright before their Money transactions started failing.Solution
New selector
isMoneyKeyringAddress(state, address)inui/selectors/money-account.ts. It returnstruewhen the address is held by aMoney KeyringorMPC Money Keyring.metamask.keyringsdirectly, because Money Accounts are not internal accounts, sometadata.keyringlookups don't apply.useTransactionConfirmnow checks whethertxParams.frombelongs to a Money keyring. For those transactions:isGasFeeSponsoredis kept whenever the controller sponsored the transaction, regardless ofisSponsorshipOptedOutorisGaslessSupported.isExternalSignis never cleared.The check is keyed on the sending keyring, not the transaction type, so withdrawals, deposits and any other Money-account-sourced flow are covered. The existing
moneyAccountWithdrawtype-based carve-out is kept as a fallback.Behaviour for all other accounts is unchanged. A user who opted out on Monad still pays native gas for their regular transactions.
Out of scope / follow-ups
TransactionControllercould reject up front, with a clear error, when it is about to sign locally with a keyring that has nosignTransaction.Changelog
CHANGELOG entry: Fixed Money Account withdrawals and deposits on Monad failing with a "does not support the method signTransaction" error after opting out of gas sponsorship on Monad
Related issues
Fixes: CONF-2215
Manual testing steps
Setup: Extension with a Money Account on Monad that holds some mUSD.
KeyringController - The keyring for the current address does not support the method signTransaction.{ '0x8f': false }.Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes transaction confirm flags for Money keyring senders only, but touches gas sponsorship and external signing paths where misclassification could block submits or leave wrong activity labels.
Overview
Fixes Money Account withdraw/deposit failures after a user opts out of Monad gas sponsorship on an unrelated confirmation.
useTransactionConfirmwas clearingisGasFeeSponsoredandisExternalSignbased on opt-out anduseIsGaslessSupported, which forced localsignTransactionon Money keyrings that cannot implement it.Adds
isMoneyKeyringAddress(Money / MPC Money keyrings viametamask.keyrings) and usestxParams.fromat confirm time: when the sender is a Money keyring and the controller already marked the tx sponsored, those flags stay set so the 7702 relay path still runs. Deposits get the same treatment as withdrawals; the withdraw-only type carve-out remains only as a fallback when keyring state is not loaded yet. Non–Money-keyring behavior is unchanged (opt-out still clears sponsorship for regular txs).Tests cover the selector and confirm-hook cases for opt-out, unsupported gasless, and non-money senders.
Reviewed by Cursor Bugbot for commit 325303a. Bugbot is set up for automated code reviews on this repo. Configure here.