-
Notifications
You must be signed in to change notification settings - Fork 2
feat(typink): add support for the WalletConnect protocol
#301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
2a51bfb to
d17d83b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Add support for WalletConnect to Typink, integrating a new WalletConnect wallet, chain ID utilities, and wiring it into providers and example app.
- Introduces WalletConnect class with session management, signer, and injected provider API.
- Adds CAIP-2 chain ID utilities and genesisHash to network definitions.
- Integrates WalletConnect into WalletSetupProvider and the demo app; adds tests and dependencies.
Reviewed Changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/typink/src/wallets/WalletConnect.ts | New WalletConnect implementation with connect/disconnect, signer, and session event handling. |
| packages/typink/src/wallets/tests/WalletConnect.test.ts | Comprehensive test suite for WalletConnect behavior and signer. |
| packages/typink/src/utils/chains.ts | Utilities to convert genesis hash and networks to CAIP-2 IDs. |
| packages/typink/src/utils/tests/chains.test.ts | Tests for chain ID utilities. |
| packages/typink/src/wallets/index.ts | Exposes WalletConnect and exports a preconfigured walletConnect instance. |
| packages/typink/src/wallets/Wallet.ts | Types injectedProvider getter for stronger typing. |
| packages/typink/src/utils/index.ts | Re-exports chains utilities. |
| packages/typink/src/types.ts | Adds optional genesisHash to NetworkInfo. |
| packages/typink/src/providers/WalletSetupProvider.tsx | Passes supported networks to WalletConnect on init. |
| packages/typink/src/providers/tests/WalletSetupProvider.test.tsx | Updates Jotai mock to include atom for tests. |
| packages/typink/src/networks/mainnet.ts | Adds genesisHash to mainnet networks. |
| packages/typink/src/networks/testnet.ts | Adds genesisHash to testnet networks. |
| packages/typink/src/atoms/walletActions.ts | Ensures WalletConnect sessions are properly disconnected. |
| packages/typink/package.json | Adds WalletConnect-related dependencies. |
| examples/demo-inkv5/src/main.tsx | Demonstrates WalletConnect usage with alephZero network. |
| examples/demo-inkv5/.eslintrc.cjs | Minor lint rule updates. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
WalletConnect protocolWalletConnect protocol
This PR adds support for the WalletConnect protocol.
Details:
WalletConnectby passing aWalletConnectinstance to thewalletsprop in TypinkProvider.