Repository navigation
fix(confirmations): keep money account transactions externally signed - #38961
Conversation
Money account deposits failed at submit with "KeyringController - The keyring for the current address does not support the method signTransaction." Money keyrings implement message signing only; they have no `signTransaction`, so their transactions must stay externally signed and publish through the EIP-7702 relay. `useTransactionConfirm` cleared both `isGasFeeSponsored` and `isExternalSign` whenever `useIsGaslessSupported` was false, and `TransactionController` then fell back to local signing, which threw. That revert exists for hardware wallets, which genuinely must sign locally, but it did not exclude money accounts. It trips because `useIsGaslessSupported` resolves asynchronously and reads the *paying* account's atomic-batch support — for a deposit that is the funding EOA, not the money account — so it can legitimately disagree with the 7702 publish hook. Keep both flags for transactions sent from a money keyring account. The check is keyed on the sending keyring rather than the transaction type, so deposits, withdrawals, rescue sends and rewards claims are all covered. `isGasFeeSponsored` is only preserved when the controller already sponsored the transaction, so nothing is force-marked. Behaviour for every other account is unchanged. Also add the missing `mpcMoney` keyring type and route both money variants through a shared `MONEY_KEYRING_TYPES` constant. `KEYRING_TYPES_SUPPORTING_7702` listed `money` but not `mpcMoney`, which would have blocked MPC money accounts from the relay in both `isEIP7702GasFeeTokensEnabled` and the publish hook. Sharing one constant keeps the two lists from drifting again. Fixes CONF-2227
|
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. |
Smart E2E Test SelectionSelected E2E tagsSmokeConfirmations AI Confidence: 88 E2E reasoningExpand to readThis PR introduces behavioral changes to the transaction confirmation flow for Money Accounts (both SRP-derived 'Money Keyring' and new MPC 'MPC Money Keyring' variant):
Tags selected:
Changes are purely in unit-tested hooks and selectors (no UI component changes), so browser/network/swap/stake tags are not warranted. The risk is high because the confirmation hook is widely consumed and the flag logic change could break existing transaction flows if the Money Account detection has edge cases. |
|



Description
Problem
Money account deposits fail at submit with:
Reported on RC 8.19.0.
Root cause
Money keyrings cannot sign transactions by design.
@metamask/eth-money-keyringimplementssignPersonalMessage,signTypedDataandsignEip7702Authorizationonly.KeyringController.signTransactionthrows the error above when the keyring has nosignTransaction.The happy path never signs locally.
useMoneyAccount.initiateDepositcreates the batch withisGasFeeSponsored: isMonadMainnetChainId(chainId).TransactionControllerthen setsisExternalSign = true, skips the keyring (Skipping sign as signed externally), and the 7702 relay publish hook submits it.useTransactionConfirmundid that. At confirm time it recomputed both flags fromuseIsGaslessSupported:When
isGaslessEligiblewas false both flags were cleared,TransactionControllerfell back toKeyringController:signTransactionwith the money account asfrom, and that threw.That revert exists for hardware wallets, which genuinely must sign locally — leaving the flag set there would send an empty
'0x'toeth_sendRawTransaction. It simply did not exclude money accounts, which are the opposite case.Why
isGaslessSupportedgoes false for a deposit:useIsGaslessSupportedresolves asynchronously and checksisAtomicBatchSupportedfor the paying account. For a money deposit the payer is the funding EOA (viaaccountOverride), not the money account, so it can legitimately disagree with the 7702 publish hook — which keys ontxParams.from. Any transient relay/isRelaySupportedfailure produces the same outcome.Solution
New selectors
selectMoneyKeyringAddresses/selectIsMoneyKeyringAddressinapp/selectors/keyringController. They readkeyringsdirectly, because money accounts are not internal accounts, sometadata.keyringlookups do not apply.useTransactionConfirmnow checks whethertxParams.frombelongs to a money keyring. For those transactions:isGasFeeSponsoredis kept whenever the controller sponsored the transaction, regardless ofisGaslessSupported.isExternalSignis 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_7702inaccount-supports-7702.tslistedmoneybut notmpcMoney. SinceaccountSupports7702is the outermost condition in both the publish hook (app/util/transactions/hooks/index.ts) andisEIP7702GasFeeTokensEnabled, 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 singleMONEY_KEYRING_TYPESconstant 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
Mirrors the Extension fix: MetaMask/metamask-extension#47616
Manual testing steps
Setup: a build with a money account on Monad holding some mUSD.
Because the trigger is a race/transient in
useIsGaslessSupported, the most reliable way to reproduce the failure onmainis to force the disagreement — e.g. makeuseIsGaslessSupportedreturnisSupported: false(stubisRelaySupportedto resolvefalse), then attempt a deposit:KeyringController - The keyring for the current address does not support the method signTransaction.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
TransactionControllerat confirm time.Before
After
Pre-merge author checklist
Testing notes
useTransactionConfirmtests.yarn lint:tscexits 0; ESLint reports 0 errors and 0 warnings on the changed files.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
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
useIsGaslessSupportedreturns false anduseTransactionConfirmwas clearingisExternalSign/isGasFeeSponsored, which forced localsignTransactionon keyrings that only support message signing.useTransactionConfirmnow detects Money signers viaselectIsMoneyKeyringAddressontxParams.from. For those accounts it preserves controller-sponsoredisGasFeeSponsored(usingisTransactionMarkedAsGasFeeSponsored) and never revertsisExternalSignwhen gasless eligibility disagrees; hardware-wallet and non-money behavior is unchanged.Adds
selectMoneyKeyringAddresses/selectIsMoneyKeyringAddress, a sharedMONEY_KEYRING_TYPESlist (SRP and MPC Money keyrings), and alignsaccountSupports7702with 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.Reviewed by Cursor Bugbot for commit f28bc31. Bugbot is set up for automated code reviews on this repo. Configure here.