Skip to content

WalletConnect chain is hardcoded to stellar:testnet #501

Description

@therealjhay

ProblemSTELLAR_CHAIN = 'stellar:testnet' is a module constant in walletconnect.ts. The Topbar network toggle lets users switch the walletStore network to 'public', but WalletConnect pairing still uses stellar:testnet regardless, so a mainnet wallet can be offered a testnet session or vice versa.

  1. Chain id is fixed at module load; walletStore.network changes are not reflected.
  2. Session proposals advertise stellar:testnet even when the UI says Mainnet.
  3. Account/network mismatch errors surface only later, after the wallet replies.

Solution

  • Derive the chain id from the active walletStore network at pairing time.
  • Validate the wallet's reported network against the UI network and fail fast with a typed error.
  • Keep the mapping (testnet/public) in one place and document it.

Acceptance Criteria

  • Switching the Topbar network changes the chain id used in the pairing URI.
  • A wallet on the wrong network produces an immediate, clear mismatch error.
  • No stale stellar:testnet constant is used for mainnet sessions.
  • npm run build passes.

Note for Contributors: Write a clear PR description. Show the pairing URI chain id before/after toggling the network.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions