Skip to content

fix(metadata): implement dynamic network url path routing for token page and social previews - #429

Merged
zachyo merged 1 commit into
soropad:masterfrom
DevRushd:fix/dynamic-token-metadata
Aug 7, 2026
Merged

fix(metadata): implement dynamic network url path routing for token page and social previews#429
zachyo merged 1 commit into
soropad:masterfrom
DevRushd:fix/dynamic-token-metadata

Conversation

@DevRushd

Copy link
Copy Markdown
Contributor

Summary

Replaces hardcoded NETWORKS.testnet references in three server-side entry points with path-based dynamic network routing. The network context is now carried directly in the URL path: /token/[network]/[contractId].

Changes

Directory Restructure

  • Moved frontend/app/token/[contractId]frontend/app/token/[network]/[contractId]
  • Moved frontend/app/api/og/token/[contractId]frontend/app/api/og/token/[network]/[contractId]
  • Moved frontend/app/api/token/[contractId]/metadatafrontend/app/api/token/[network]/[contractId]/metadata

Code Changes

  • types/network.ts: Added getNetworkConfig(network: string) helper that maps "mainnet"NETWORKS.mainnet and falls back to NETWORKS.testnet
  • token/[network]/[contractId]/page.tsx: Reads network from URL params, uses getNetworkConfig for validateTokenContract and fetchTokenInfo calls, updates OG image URLs to include network segment
  • api/og/token/[network]/[contractId]/route.tsx: Reads network from URL params, constructs network config dynamically
  • api/token/[network]/[contractId]/metadata/route.ts: Reads network from URL params, constructs network config dynamically
  • PublicTokenPage.tsx: Accepts network prop, syncs URL network with NetworkProvider context, fixes InvalidTokenContract import path

Closes #401

@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@DevRushd Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@zachyo

zachyo commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Hi @DevRushd , kindly fix conflicts. Thanks

@DevRushd
DevRushd force-pushed the fix/dynamic-token-metadata branch 3 times, most recently from f8ecf2d to 0331745 Compare August 6, 2026 14:55
@DevRushd
DevRushd force-pushed the fix/dynamic-token-metadata branch from 0331745 to 18e859a Compare August 7, 2026 13:40
@DevRushd

DevRushd commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Hi @zachyo, I have fully resolved the conflict

@zachyo
zachyo merged commit 27e7fc7 into soropad:master Aug 7, 2026
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.

Server-rendered token pages and social cards are hardcoded to testnet

2 participants