Skip to content

feat(asset-detail): copy the token's contract address - #3061

Merged
JakeUrban merged 2 commits into
masterfrom
feat/copy-token-contract
Nov 5, 2026
Merged

JakeUrban merged 2 commits into
masterfrom
feat/copy-token-contract

Conversation

@JakeUrban

@JakeUrban JakeUrban commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What

"Copy address" on the asset detail page now copies the token's contract address (C...) for every token.

Token Before After
XLM No "Copy address" action. Copies the native Stellar Asset Contract (SAC) address for the active network.
Classic asset (CODE:ISSUER) Copies the issuer account (G...). Copies the asset's SAC address for the active network.
Contract token Copies the contract address. No change.
LP share No "Copy address" action. No change. An LP share has no contract.

Functional changes:

  • The options menu always shows for XLM. Before, the menu did not show for XLM on a network without stellar.expert, such as Futurenet.
  • The app calculates the SAC address from the asset code, the issuer, and the network passphrase. It does not send a network request.
  • The app can copy a SAC address that is not deployed on the network yet.

Why

A user reported that "Copy address" on the XLM details page copied "XLM". This report is correct for mobile. The extension did not copy "XLM". It did not show the action for XLM.

The product requirement is that "Copy address" copies a contract address for every token. This change makes the extension the same as mobile: stellar/freighter-mobile#1041.

Screenshots / video

N/A. The menu items do not change, except that XLM now has "Copy address". The clipboard value is the only other change.

Before After
N/A N/A

Checklist

  • I have read CONTRIBUTING.md and this PR meets its requirements.
  • This PR has narrow scope and does not mix refactoring with feature changes.
  • This PR adds tests for the new functionality or fixes.
  • These changes have been tested in both Chrome and Firefox.
  • This PR includes relevant before and after screenshots for UI changes.
  • I took the time to review my own PR.

Tests: AssetDetail.test.tsx checks the copied value for XLM (Testnet, Futurenet), for a classic asset (Testnet, Mainnet), and for a contract token. The tests for XLM and the classic asset fail on the old code. Most of the diff is re-indentation, because the menu no longer has a condition that hides it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R8cp3zDDtL6tyACP1BnjPA

The asset detail menu offered no "Copy address" for XLM. Native XLM
has no issuer, so the menu hid the action.

Show "Copy address" for XLM. It copies the native Stellar Asset
Contract id for the active network. This is the same as mobile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R8cp3zDDtL6tyACP1BnjPA
"Copy address" copied the issuer account (G...) for a classic asset.
Copy the asset's Stellar Asset Contract id for the active network.
Now "Copy address" copies a contract id for every token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R8cp3zDDtL6tyACP1BnjPA
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-f8af1c51c028a34925f1
Backend: V1 prod + V2 beta (no sandbox configured for @JakeUrban). SDF collaborators only — install instructions in the release description.

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 change correctly handles network-specific SAC addresses, preserves contract-token behavior, omits liquidity-pool shares, and includes coverage for native, classic, and contract tokens across supported networks.

No open issues 🎉

What changed in this PR

Updates the asset detail page so Copy address returns the appropriate contract address for each supported token type, including network-specific Stellar Asset Contract (SAC) addresses for XLM and classic assets.

Changes:

  • Derives XLM and classic-asset SAC addresses from the active network passphrase.
  • Preserves existing contract-token address copying.
  • Omits the action for liquidity-pool shares.
  • Adds coverage across Testnet, Futurenet, and Mainnet scenarios.
File Description
extension/​src/​popup/​components/​account/​AssetDetail/​index.tsx Computes and displays the appropriate contract address in the asset options menu.
extension/​src/​popup/​components/​__tests__/​AssetDetail.test.tsx Tests copied addresses for native, classic, and contract tokens across supported networks.

Review effort: Lite

@JakeUrban
JakeUrban marked this pull request as ready for review November 4, 2026 22:41
@JakeUrban
JakeUrban requested a review from a team November 4, 2026 22:41
@JakeUrban
JakeUrban merged commit e3f6524 into master Nov 5, 2026
12 checks passed
@JakeUrban
JakeUrban deleted the feat/copy-token-contract branch November 5, 2026 03:43
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