Skip to content

feat: add WalletConnect connector support (#298) - #378

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
waterWang:feat/walletconnect-connector
Jul 29, 2026
Merged

feat: add WalletConnect connector support (#298)#378
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
waterWang:feat/walletconnect-connector

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Adds WalletConnect v2 connector support to the wagmi wallet configuration, allowing mobile wallet users and hardware wallet users to connect via WalletConnect QR code.

Changes

Validation layer

  • lib/wallet/validation.js: Added 'walletConnect' to SUPPORTED_CONNECTOR_NAMES
  • lib/wallet/validation.d.ts: Updated type declaration to include 'walletConnect' in the readonly tuple

Connector layer

  • lib/wallet/connectors.ts: Removed corrupted local declaration that conflicted with re-export from validation.js. The file now cleanly re-exports from validation.js with TypeScript type resolution via validation.d.ts
  • lib/wallet/config.ts:
    • Added missing splitCsv import (pre-existing bug that caused ReferenceError at runtime)
    • Replaced fail() call with throw new ConfigError() in the walletConnect case (the fail helper was not imported in this module's scope)

Tests

  • test/wallet-connectors.test.ts: Added tests for walletConnect parsing (standalone and combined with injected)
  • test/wallet-config.test.ts: Added tests for WalletConnect config building (with project ID, combined connectors, and missing project ID error path). Added NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID to the env cleanup list to prevent cross-test leakage

Acceptance Criteria ✓

  • NEXT_PUBLIC_WALLET_CONNECTORS=walletConnect (alone or combined with injected) produces a working connector without throwing
  • Omitting NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID while walletConnect is enabled throws a clear ConfigError at startup
  • .env.example and README document the new connector and variable (already documented)
  • Tests cover the new connector
  • All existing tests pass (40/40 tests passing)

Closes #298

- Add 'walletConnect' to SUPPORTED_CONNECTOR_NAMES in validation.js
- Update validation.d.ts type to include 'walletConnect'
- Fix connectors.ts: remove corrupted local declaration, re-export from validation.js
- Fix config.ts: add missing splitCsv import, replace fail() with throw ConfigError
- Add WalletConnect parsing and config tests

Closes Adamantine-guild#298
@Lakes41
Lakes41 merged commit 91a4c46 into Adamantine-guild:main Jul 29, 2026
1 check passed
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.

Add WalletConnect connector support

2 participants