Skip to content

feat(stellar): use the shared Asset UI component - #428

Merged
Julink-eth merged 5 commits into
mainfrom
feat/stellar-shared-asset
Oct 9, 2026
Merged

Julink-eth merged 5 commits into
mainfrom
feat/stellar-shared-asset

Conversation

@Julink-eth

Copy link
Copy Markdown
Contributor

Explanation

Stellar integration of the shared Asset component (#418). The confirmation fee row, the readable operation asset rows and the change-trust confirmations now render the shared Asset / AssetIcon, replacing Stellar's local Asset, AssetIcon and AssetText components, which are deleted. Fiat formatting and gating stay at the call sites.
Stellar tests now load SVGs with the shared jest.svg-transformer.js instead of the empty stub, which the shared icon requires.

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

@Julink-eth
Julink-eth requested review from a team as code owners October 8, 2026 13:24
@Julink-eth
Julink-eth deployed to default-branch October 8, 2026 13:24 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The migration preserves existing rendering behavior, removes obsolete code, and adds focused test coverage.

0 open findings

What changed in this PR

Migrates Stellar confirmation asset displays to the shared network utility components while preserving existing fiat behavior.

Changes:

  • Replaces local asset UI components with shared Asset and AssetIcon.
  • Keeps Stellar-specific fiat formatting at call sites and adds coverage.
  • Updates SVG test transformation and removes obsolete assets/dependencies.
File Description
yarn.lock Removes the unused SVG stub dependency.
packages/​stellar-wallet-snap/​src/​ui/​images/​question-mark.svg Deletes the local fallback icon.
packages/​stellar-wallet-snap/​src/​ui/​images/​index.ts Removes the deleted icon export.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​views/​ConfirmSignChangeTrustOptOut/​ConfirmSignChangeTrustOptOut.tsx Uses shared asset components.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​views/​ConfirmSignChangeTrustOptIn/​ConfirmSignChangeTrustOptIn.tsx Uses shared asset components.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​views/​ConfirmSignChangeTrustOptIn/​ConfirmSignChangeTrust.test.tsx Tests both change-trust views.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​components/​ReadableParamsList.tsx Migrates readable asset rows.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​components/​ReadableParamsList.test.tsx Covers asset-row rendering states.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​components/​index.ts Removes obsolete exports.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​components/​Fee.tsx Migrates fee asset rendering.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​components/​Fee.test.tsx Covers fee and fiat rendering.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​components/​AssetText.tsx Deletes the local text component.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​components/​AssetIcon.tsx Deletes the local icon component.
packages/​stellar-wallet-snap/​src/​ui/​confirmation/​components/​Asset.tsx Deletes the local asset component.
packages/​stellar-wallet-snap/​snap.manifest.json Updates the built bundle checksum.
packages/​stellar-wallet-snap/​package.json Removes the unused Jest transformer.
packages/​stellar-wallet-snap/​jest.config.js Uses the shared SVG transformer.
packages/​stellar-wallet-snap/​CHANGELOG.md Documents the component migration.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@Julink-eth

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/bitcoin-wallet-snap@3.1.0-preview-032cb0b
@metamask-previews/snap-networks-utils@1.0.0-preview-032cb0b
@metamask-previews/solana-wallet-snap@7.0.0-preview-032cb0b
@metamask-previews/stellar-wallet-snap@1.1.1-preview-032cb0b
@metamask-previews/tron-wallet-snap@4.0.0-preview-032cb0b

@stanleyyconsensys stanleyyconsensys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor nit comment

preferences={preferences}
priceLoading={priceLoading}
fiat={
price

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we place them before the render (after line 28)

price={price ?? null}
priceLoading={priceLoading}
fiat={
preferences && price && amount !== undefined

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks likes it is keep repeat, please add a utils to handle

import { FetchStatus } from '../../api';
import {
Asset,
AssetIcon,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question:
if no price, Asset doesnt need to pass any extra attribute , is that correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct

Comment on lines +65 to +72
preferences
? tokenPriceToFiat(
amount,
price,
preferences.currency,
preferences.locale,
)
: null

@stanleyyconsensys stanleyyconsensys Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

not a blocker, but we can do the same as Fee.tsx?

including the loading

@Julink-eth
Julink-eth added this pull request to the merge queue Oct 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

Merged via the queue into main with commit 51ff1aa Oct 9, 2026
56 checks passed
@Julink-eth
Julink-eth deleted the feat/stellar-shared-asset branch October 9, 2026 09:58
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.

3 participants