feat(bridge-controller): add bridge support [STELLAR]#8829
Merged
Conversation
# Conflicts: # packages/bridge-controller/CHANGELOG.md # packages/bridge-controller/src/types.ts
…us controller (#9170) ## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes the non-EVM snap request payload for all trades that pass asset IDs from quotes; Tron overwrites options so behavior there stays isolated, but Stellar and other non-Tron paths now depend on correct quote asset metadata. > > **Overview** > **Stellar bridge trades** are wired through submit validation and the non-EVM handler by treating `ChainId.STELLAR` like other snap chains (string XDR or `StellarTradeData`). > > **Snap `signAndSendTransaction` requests** now optionally include `sourceAssetId` and `destAssetId` from the quote in `params.options`, passed from `handleNonEvmTx` via an extended `getClientRequest`. That gives the Stellar snap enough context for **transaction history** without changing the core request shape for chains that omit those args. **Tron** still sets `visible` and contract `type` in `options`, which replaces any asset-id options for Tron trades (unchanged Tron-specific behavior). > > Tests cover Stellar asset ID options (full pair and source-only). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit bd8bc27. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
# Conflicts: # packages/bridge-controller/CHANGELOG.md
# Conflicts: # packages/bridge-controller/CHANGELOG.md # packages/bridge-status-controller/CHANGELOG.md
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
infiniteflower
approved these changes
Jun 24, 2026
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 adds Stellar as a supported non-EVM network for the bridge/swap flow, spanning two packages:
@metamask/bridge-controller(quote handling and trade construction) and@metamask/bridge-status-controller(transaction submission and status tracking).Until now the bridge/swap stack recognized EVM chains plus Bitcoin, Solana, and Tron as non-EVM chains. Stellar was not a recognized chain, so quotes, trade-data extraction, and snap-based submission had no path for it. This change introduces the chain, its native asset, and the Stellar-specific trade-data shape so that Stellar quotes can be fetched, parsed, and submitted end to end.
@metamask/bridge-controllerstellar:pubnet,XlmScope.Pubnet) as a supported chain and include Stellar pubnet/testnet inisNonEvmChainId; addisStellarChainIdandChainId.STELLAR.CURRENCY_SYMBOLS.XLM, theXLM_SWAPS_TOKEN_OBJECT("Stellar Lumens"), and theslip44:148native asset id.StellarTradeDataSchema/StellarTradeDatatype andisStellarTrade; extendextractTradeDatato read a Stellar transaction envelope (XDR) from either a{ xdrBase64 }or{ xdr }object, mirroring how the other non-EVM trade types are handled.StellarTradeData,isStellarChainId, andisStellarTradefrom the package root.@metamask/bridge-status-controllerStellarTradeDatathrough the non-EVM submit strategies so Stellar trades can be submitted alongside Bitcoin/Tron.Notes for reviewers
QuoteResponse/QuoteResponseV1union now includesStellarTradeDataso Stellar quotes type-check through the existing quote-response path.References
Part of the Stellar network enablement across
@metamask/core:XlmAccountProvider)Checklist
Note
Medium Risk
Changes the non-EVM transaction submission path and snap request shape for bridge trades; scope is additive but touches fund-movement plumbing.
Overview
Adds Stellar as a supported non-EVM network for unified bridge/swap flows in
@metamask/bridge-controllerand@metamask/bridge-status-controller.In bridge-controller, Stellar pubnet is registered as an allowed bridge chain with native XLM metadata (
slip44:148),ChainId.STELLAR, andisStellarChainId/isNonEvmChainIdupdates. Quote validation and types gainStellarTradeData(xdrBase64orxdr);extractTradeDataand CAIP/decimal formatters map Stellar IDs for Bridge API requests. New helpers are exported from the package entry.In bridge-status-controller, non-EVM submit validation accepts Stellar trades, and
signAndSendTransactionsnap requests can includesourceAssetId/destAssetIdfrom the quote (for Stellar history metadata; Solana submit snapshots pick up the same optional fields). Trade type guards intrade-utilsswitch tohasOwnPropinstead ofinchecks.Reviewed by Cursor Bugbot for commit 9a3ffc6. Bugbot is set up for automated code reviews on this repo. Configure here.