Uniswap / Uniswap/interface

Support numeric chain IDs in URL parameter

Open
#7,992 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Problem

Currently, the chain URL parameter only accepts chain slugs (e.g., ?chain=base, ?chain=ethereum). This requires users and integrators to know the specific slug for each chain, which can vary between applications.

For example, this works:

https://app.uniswap.org/swap?chain=base

But this doesn't:

https://app.uniswap.org/swap?chain=8453

Proposed Solution

Accept numeric chain IDs as an alternative to chain slugs in the chain URL parameter. The parser could check if the value is numeric and resolve it to the appropriate chain, falling back to slug matching for non-numeric values.

This would allow both formats:

  • ?chain=base (existing behavior)
  • ?chain=8453 (proposed addition)

Use Case

  • Deep linking: Other apps and wallets often work with chain IDs natively, making it easier to construct URLs programmatically
  • Consistency: Chain IDs are standardized (EIP-155), while slugs can differ between applications
  • Developer experience: Reduces the need to maintain a mapping table when integrating with Uniswap

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the URL parameter parser and the existing chain-slug resolution entry point described in the issue. Confirm how numeric values can resolve through chain IDs while preserving slug matching; done means both ?chain=base and ?chain=8453 work without changing existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.