Skip to content

feat(network-enablement-controller): enable in network enablement [STELLAR]#8832

Merged
jeremytsng merged 19 commits into
mainfrom
feat/stellar-network-enablement-controller
Jun 25, 2026
Merged

feat(network-enablement-controller): enable in network enablement [STELLAR]#8832
jeremytsng merged 19 commits into
mainfrom
feat/stellar-network-enablement-controller

Conversation

@khanti42

@khanti42 khanti42 commented May 15, 2026

Copy link
Copy Markdown
Contributor

Explanation

References

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes default persisted enablement state and popular-network behavior for wallets that load Stellar from multichain config; scope is limited to network-enablement logic and tests.

Overview
Adds Stellar to @metamask/network-enablement-controller using the same pattern as Bitcoin, Solana, and Tron.

Default enabledNetworkMap now includes KnownCaipNamespace.Stellar with pubnet enabled and testnet disabled. enableAllPopularNetworks() turns on Stellar pubnet when that chain exists in MultichainNetworkController. listPopularMultichainNetworks() and listPopularNetworks() treat XlmScope.Pubnet as a popular multichain mainnet when configured.

Messenger action JSDoc and tests are updated for the new namespace and expected counts (e.g. seven popular networks in the default fixture). network-enablement-controller and assets-controllers changelogs document the feature and a @metamask/utils bump respectively.

Reviewed by Cursor Bugbot for commit 8abb845. Bugbot is set up for automated code reviews on this repo. Configure here.

@khanti42 khanti42 mentioned this pull request May 15, 2026
4 tasks
@khanti42 khanti42 marked this pull request as ready for review June 10, 2026 07:25
@khanti42 khanti42 requested review from a team as code owners June 10, 2026 07:25
@khanti42 khanti42 temporarily deployed to default-branch June 10, 2026 07:25 — with GitHub Actions Inactive
@khanti42 khanti42 changed the base branch from main to feat/bump-metamask-utils-11.11.0 June 10, 2026 12:15
Base automatically changed from feat/bump-metamask-utils-11.11.0 to main June 11, 2026 08:26
@khanti42 khanti42 requested review from a team as code owners June 11, 2026 08:26
@jeremytsng jeremytsng added this pull request to the merge queue Jun 24, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 24, 2026
@jeremytsng jeremytsng added this pull request to the merge queue Jun 24, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 24, 2026
@jeremytsng jeremytsng added this pull request to the merge queue Jun 24, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 24, 2026
Comment thread packages/assets-controllers/CHANGELOG.md
@jeremytsng jeremytsng added this pull request to the merge queue Jun 24, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 24, 2026
@jeremytsng jeremytsng enabled auto-merge June 25, 2026 05:50
@jeremytsng jeremytsng added this pull request to the merge queue Jun 25, 2026
Merged via the queue into main with commit d53f8bb Jun 25, 2026
395 of 396 checks passed
@jeremytsng jeremytsng deleted the feat/stellar-network-enablement-controller branch June 25, 2026 05:56
pull Bot pushed a commit to Reality2byte/core that referenced this pull request Jun 25, 2026
## 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-controller`**
- Register Stellar mainnet (`stellar:pubnet`, `XlmScope.Pubnet`) as a
supported chain and include Stellar pubnet/testnet in `isNonEvmChainId`;
add `isStellarChainId` and `ChainId.STELLAR`.
- Add native XLM metadata: `CURRENCY_SYMBOLS.XLM`, the
`XLM_SWAPS_TOKEN_OBJECT` ("Stellar Lumens"), and the `slip44:148` native
asset id.
- Add the `StellarTradeDataSchema` / `StellarTradeData` type and
`isStellarTrade`; extend `extractTradeData` to read a Stellar
transaction envelope (XDR) from either a `{ xdrBase64 }` or `{ xdr }`
object, mirroring how the other non-EVM trade types are handled.
- Align CAIP / decimal formatting with the Bridge API for Stellar in the
CAIP formatters.
- Export `StellarTradeData`, `isStellarChainId`, and `isStellarTrade`
from the package root.

**`@metamask/bridge-status-controller`**
- Thread `StellarTradeData` through the non-EVM submit strategies so
Stellar trades can be submitted alongside Bitcoin/Tron.
- Include the source and destination asset IDs (CAIP-19) in the snap
client transaction request. These are used to populate Stellar trade
metadata for transaction history. Because the request shape is shared
across non-EVM submissions, the asset IDs now also appear for the
existing Solana paths (reflected in the updated submit snapshots) — no
behavioral change beyond the added metadata fields.

### Notes for reviewers
- The `QuoteResponse`/`QuoteResponseV1` union now includes
`StellarTradeData` so Stellar quotes type-check through the existing
quote-response path.
- No public API is removed or renamed by this PR; the new exports are
additive.

## References

Part of the Stellar network enablement across `@metamask/core`:
- Related to MetaMask#8830 (multichain-account-service: `XlmAccountProvider`)
- Related to MetaMask#8831 (multichain-network-controller: Stellar network
scopes)
- Related to MetaMask#8832 (network-enablement-controller: enable Stellar)

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] 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 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-controller` and
`@metamask/bridge-status-controller`.
> 
> In **bridge-controller**, Stellar pubnet is registered as an allowed
bridge chain with native **XLM** metadata (`slip44:148`),
`ChainId.STELLAR`, and `isStellarChainId` / `isNonEvmChainId` updates.
Quote validation and types gain **`StellarTradeData`** (`xdrBase64` or
`xdr`); `extractTradeData` and 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 **`signAndSendTransaction`** snap requests can
include **`sourceAssetId`** / **`destAssetId`** from the quote (for
Stellar history metadata; Solana submit snapshots pick up the same
optional fields). Trade type guards in `trade-utils` switch to
`hasOwnProp` instead of `in` checks.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9a3ffc6. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: jeremytsng <jeremy.tsang-ext@consensys.net>
Co-authored-by: Julink <julien.fontanel@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants