feat(transaction-pay): add Across strategy support#7886
Open
pedronfigueiredo wants to merge 2 commits intocor-6992-extract-fallback-mechanismfrom
Open
feat(transaction-pay): add Across strategy support#7886pedronfigueiredo wants to merge 2 commits intocor-6992-extract-fallback-mechanismfrom
pedronfigueiredo wants to merge 2 commits intocor-6992-extract-fallback-mechanismfrom
Conversation
packages/transaction-pay-controller/src/strategy/across/across-submit.ts
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/across/types.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/across/across-submit.ts
Outdated
Show resolved
Hide resolved
665488f to
8be8f8c
Compare
packages/transaction-pay-controller/src/strategy/across/across-quotes.ts
Outdated
Show resolved
Hide resolved
8be8f8c to
3f52702
Compare
packages/transaction-pay-controller/src/strategy/across/across-submit.ts
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/across/across-submit.ts
Show resolved
Hide resolved
3f52702 to
789a704
Compare
packages/transaction-pay-controller/src/strategy/across/across-submit.ts
Outdated
Show resolved
Hide resolved
789a704 to
6953629
Compare
packages/transaction-pay-controller/src/strategy/across/across-quotes.ts
Show resolved
Hide resolved
6953629 to
8c1c7e5
Compare
9cd0f37 to
a6c9af9
Compare
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
This PR extracts the Across strategy work on top of the provider-fallback baseline.
It adds:
acrossstrategy type + registration)transaction-controllerandtransaction-pay-controllerReferences
Addresses: https://github.com/MetaMask/MetaMask-planning/issues/6997
Checklist
Note
Medium Risk
Introduces a new cross-chain quoting/submission path that constructs and submits approval + swap/deposit transactions and relies on remote feature-flag configuration and external API responses, which could affect transaction execution if misconfigured or parsed incorrectly.
Overview
Adds Across as a new
TransactionPayStrategyand wires it into strategy selection/ordering (defaulting toRelaythenAcross), with config driven by remote feature flags.Implements the Across integration end-to-end: fetches/normalizes quotes from the Across API (slippage, fees/impact, gas estimates with buffering/fallback, optional API keys/app fees, and optional embedded “actions” for delegation flows) and submits quotes by creating either a transaction batch (ERC20 approvals + deposit) or a single swap/deposit tx.
Extends types to support quote impact/impactRatio and reusable action payloads, introduces
estimateGasWithBufferOrFallback, and adds newTransactionTypes (perpsAcrossDeposit,predictAcrossDeposit) used when submitting Across deposits for Perps/Predict. Changelogs and tests are updated accordingly.Written by Cursor Bugbot for commit 8c1c7e5. This will update automatically on new commits. Configure here.