Skip to content

fix: add transaction explorer open action - #546

Open
ghg001 wants to merge 10 commits into
Axionvera:mainfrom
ghg001:feat/issue-97-add-transaction-explorer-open-action
Open

fix: add transaction explorer open action#546
ghg001 wants to merge 10 commits into
Axionvera:mainfrom
ghg001:feat/issue-97-add-transaction-explorer-open-action

Conversation

@ghg001

@ghg001 ghg001 commented Aug 29, 2026

Copy link
Copy Markdown

Overview

This PR adds an Explorer Open Action to the transaction detail screen. Users can now open a transaction hash in a Stellar Testnet explorer directly from the UI via the platform linking API. The action is disabled for invalid or missing hashes, handles linking failures with a clear user-facing message, and the interface makes the Testnet context explicit to avoid confusion with Mainnet.

Related Issue

Closes #

Changes

🔍 Transaction Explorer Action

  • [ADD] src/services/stellar.ts

    • Adds getTestnetTransactionUrl(txHash) helper that returns a Stellar Testnet transaction URL.
    • Uses https://stellar.expert/explorer/testnet/tx/... and avoids Mainnet URLs.
    • Returns null for missing or malformed hashes so callers can disable the action safely.
  • [MODIFY] app/transaction/[id].tsx

    • Adds the explorer action to the transaction detail screen.
    • Calls Linking.openURL with the Testnet URL and handles rejection with a clear alert.
    • Disables the action when the transaction hash is unavailable or invalid.
  • [MODIFY] src/features/transactions/helpers.ts

    • Adds isValidTransactionHash and normalizeTransactionHash utilities used before opening the URL.
  • [MODIFY] src/features/settings/useNetworkEnvironment.ts

    • Exposes the current network environment so the action is used only in Testnet contexts.
  • [MODIFY] src/components/Button.tsx

    • Adds disabled handling and visual styling so the explorer action cannot be pressed when the hash is invalid.

Verification Results

npm test
✅ 12/12 passed

Live acceptance check:
✅ Testnet URL generated with correct stellar.expert testnet path
✅ Invalid or missing hash disables the action
✅ Linking failure shows a clear alert
✅ Testnet label is visible in the transaction detail UI
Acceptance Criteria Status
Transaction detail screen includes an explorer action ✅ Added in app/transaction/[id].tsx
Explorer action opens a Testnet transaction URL ✅ Uses getTestnetTransactionUrl in src/services/stellar.ts
Invalid or missing transaction hash disables the action isValidTransactionHash gate + Button disabled state
Linking failure shows a clear message Alert shown on Linking.openURL rejection
The UI makes the Testnet context clear ✅ Button label and helper copy both mention Testnet

Closes #97

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.

Add transaction explorer open action

1 participant