feat(transaction-pay): add ordered strategy fallback orchestration#7868
Open
pedronfigueiredo wants to merge 2 commits intomainfrom
Open
feat(transaction-pay): add ordered strategy fallback orchestration#7868pedronfigueiredo wants to merge 2 commits intomainfrom
pedronfigueiredo wants to merge 2 commits intomainfrom
Conversation
23573ac to
55549a1
Compare
55549a1 to
e2818b3
Compare
packages/transaction-pay-controller/src/helpers/TransactionPayPublishHook.ts
Outdated
Show resolved
Hide resolved
e2818b3 to
5158351
Compare
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
c450bc6 to
782bc16
Compare
matthewwalsh0
requested changes
Feb 11, 2026
packages/transaction-pay-controller/src/helpers/TransactionPayPublishHook.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
9b2de51 to
44ee983
Compare
44ee983 to
eeca0ed
Compare
9cd0f37 to
a6c9af9
Compare
matthewwalsh0
requested changes
Feb 13, 2026
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
a6c9af9 to
df9f104
Compare
packages/transaction-pay-controller/src/TransactionPayController.ts
Outdated
Show resolved
Hide resolved
35e9f3f to
08bac6a
Compare
08bac6a to
26c090a
Compare
matthewwalsh0
requested changes
Feb 16, 2026
| max?: number; | ||
| }; | ||
| relayQuoteUrl?: string; | ||
| strategyOrder?: string[]; |
| ): NamedStrategy[] { | ||
| return strategyNames.flatMap((strategyName) => { | ||
| try { | ||
| return [ |
Member
There was a problem hiding this comment.
Minor, if we're returning a single entry in the array, why do we need flatMap rather than map?
|
|
||
| #getStrategiesWithFallback( | ||
| transaction: TransactionMeta, | ||
| ): [TransactionPayStrategy, ...TransactionPayStrategy[]] { |
Member
There was a problem hiding this comment.
Still confused by this type, wouldn't it just be TransactionPayStrategy[] and we get the first entry for the existing getStrategy messenger action?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
As per preemptive validation on #7806
TransactionPayController:getStrategieswhile preserving existinggetStrategybehavior.supports(...)) during strategy selection.References
Addresses https://github.com/MetaMask/MetaMask-planning/issues/6992
Checklist
Note
Medium Risk
Changes core quote selection/refresh and publish-hook execution paths, so strategy ordering and fallback behavior could alter which provider is used and when quotes clear/update, despite added unit coverage.
Overview
TransactionPayControllernow supports an orderedgetStrategiescallback (with validation) and falls back to a remote feature flagstrategyOrder(defaulting to Relay) when callbacks are missing/invalid.Quote retrieval is refactored to iterate strategies in order via
getStrategiesByName, optionally skip incompatible strategies via newPayStrategy.supports, and automatically fall through to the next strategy when quotes are empty, quote fetching fails, or batch-transaction generation fails.Quote refreshing and the publish hook are updated to carry/consume this strategy orchestration: refresh flows receive the strategy list provider, and
TransactionPayPublishHookexecutes using thestrategyencoded in the first stored quote rather than re-resolving strategy from the transaction. Tests/docs/changelog are updated accordingly.Written by Cursor Bugbot for commit 26c090a. This will update automatically on new commits. Configure here.