feat: add accountOverride to override default recipient or delegator for MM Pay transactions#8454
feat: add accountOverride to override default recipient or delegator for MM Pay transactions#8454
Conversation
…for MM Pay transactions
There was a problem hiding this comment.
For the fully gasless flow, do we need to update submitViaRelayExecute in relay-submit to use the accountOverride also since it would be providing the funds?
There was a problem hiding this comment.
This should also already work as from is now updated in quote.
There was a problem hiding this comment.
This flow just uses the transaction and not from so I think we need to fix this manually.
There was a problem hiding this comment.
PR is updated to address this
There was a problem hiding this comment.
Can do in a separate PR if easier, but for the withdraw flows, if we have a accountOverride, then we want that to sign the withdraw transaction rather than the original from.
So do we need to convert the withdraw transaction data to delegations on line 353 of relay-submit.ts?
There was a problem hiding this comment.
This should also already work since from is quote is updated.
There was a problem hiding this comment.
This is also a special case as while the data is currently using the original from via transaction which is what we want, we now need to convert it to delegations with getDelegationTransaction so our accountOverride can submit it.
There was a problem hiding this comment.
PR is updated to address this
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 1b7f538. Configure here.
… into acc_override_support
… into acc_override_support
| /** | ||
| * Optional address to override the default account used by the transaction. | ||
| * When `isPostQuote` is true, used as the recipient of the MM Pay transfer. | ||
| * When `isPostQuote` is false, used as the delegator for the transaction, it provides the funds and pays for gas. |
There was a problem hiding this comment.
Slightly ambigious as the delegation is still done on behalf of the original from and not accountOverride. Plus this also still applies when isPostQuote is true.
There was a problem hiding this comment.
Valid point, I updated the PR
There was a problem hiding this comment.
This flow just uses the transaction and not from so I think we need to fix this manually.
There was a problem hiding this comment.
This is also a special case as while the data is currently using the original from via transaction which is what we want, we now need to convert it to delegations with getDelegationTransaction so our accountOverride can submit it.
@matthewwalsh0 : PR is updated to address this. |
… into acc_override_support
|
@metamaskbot publish-preview |

Explanation
Add accountOverride in transaction config to override default recipient or delegator for MM Pay transactions
References
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1188
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1204
Checklist
Note
Medium Risk
Changes which account is used for balance checks and transaction/delegation signing, so incorrect wiring could cause quotes to be computed for the wrong account or submissions to be signed with an unexpected
from.Overview
Adds a new per-transaction
accountOverrideconfig/state field that overrides the defaultfromaddress used across MM Pay flows.When
accountOverridechanges, the controller now re-runs source amount/quote updates and clears any selectedpaymentToken; quote building, payment-token balance lookups, Relay execute delegation (txParams.from), and HyperLiquid withdraw signing now all use the overridden address. Tests and changelog are updated accordingly.Reviewed by Cursor Bugbot for commit 2383954. Bugbot is set up for automated code reviews on this repo. Configure here.