Skip to content

Support numeric chain IDs in URL parameter #7992

@PaulRBerg

Description

@PaulRBerg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions