Repository navigation
feat(asset-detail): copy the token's contract address - #3061
Conversation
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
|
PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-f8af1c51c028a34925f1 |
There was a problem hiding this comment.
🟢 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
What
"Copy address" on the asset detail page now copies the token's contract address (C...) for every token.
CODE:ISSUER)Functional changes:
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.
Checklist
Tests:
AssetDetail.test.tsxchecks 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