Skip to content

fix: show the native asset contract as XLM - #557

Open
Sensei-Victor wants to merge 1 commit into
TricklePay:mainfrom
Sensei-Victor:fix/issue-503
Open

Sensei-Victor wants to merge 1 commit into
TricklePay:mainfrom
Sensei-Victor:fix/issue-503

Conversation

@Sensei-Victor

Copy link
Copy Markdown

Summary

Previously, KNOWN_TOKEN_METADATA mapped the native XLM contract address (CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC on testnet) to USDC. Consequently, any native XLM stream rendered as USDC, and the native token selector was mismatched.

This change:

  • Maps the native contract ID for the configured network to Stellar Lumen / XLM dynamically using nativeAssetContractId(config.networkPassphrase).
  • Removes the hardcoded USDC entry from fallback metadata.
  • Separates the useTokenMetadata and useTokensMetadata React hooks into hooks/use-token-metadata.ts to decouple the React lifecycle from RPC simulation helpers and enable clean test mocking.
  • Updates tests and mock fixtures in format, stream search, and total calculations to use the native asset contract for XLM and realistic mock addresses for other tokens.
  • Cleans up unused imports and hooks effect dependencies to ensure lint and typecheck pass cleanly.

Linked issue

Closes #503

What was tested

  • Ran npm test covering all 103 test suites (955 tests passing), including token-display, token-metadata, format, stream-search, and stream-total.
  • Ran npm run lint and npm run typecheck cleanly with 0 errors and 0 warnings.
  • Ran npm run build validating production compilation and static page generation.

Checklist

  • npm test passes
  • npm run typecheck passes
  • npm run lint passes
  • Tested locally in the browser (where the change touches UI)

- Map the native asset contract ID for the configured network to XLM dynamically via nativeAssetContractId.
- Remove hardcoded USDC metadata fallback mapping to the testnet native asset contract ID.
- Extract token metadata hooks into hooks/use-token-metadata to decouple React hook lifecycle from simulation helpers and resolve module mocking in tests.
- Update fixtures and test suites across format, stream search, and stream totals to reference the native asset and explicit mock token IDs.
- Clean up unused imports, effect dependencies, and lint warnings to ensure all repository checks pass cleanly.

Closes TricklePay#503
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.

Stop labelling the native XLM contract as USDC

1 participant