-
-
Notifications
You must be signed in to change notification settings - Fork 44
feat(wallets): add WalletConnect skins for branded wallets #412
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
Conversation
Enable multiple WalletConnect-based wallets to coexist with distinct branding using a composite key architecture. Wallets can now specify a `skin` option that provides custom name/icon metadata and derives a unique `walletKey` (e.g., `walletconnect:biatec`), allowing separate state isolation. Core changes: - Add WalletConnectSkin type and skin registry with built-in Biatec skin - Add `walletKey` property to BaseWallet for state isolation - Update store to use `walletKey` instead of `id` for wallet state keys - Update WalletManager to derive composite keys and prevent duplicates - Deprecate WalletId.BIATEC in favor of WalletConnect with `skin: 'biatec'` Framework adapter updates: - use-wallet-react: Add walletKey to Wallet interface, use for state lookups - use-wallet-vue: Add walletKey to Wallet interface, use for state lookups - use-wallet-solid: Update state lookups to use walletKey - use-wallet-svelte: Add walletKey to Wallet interface, use for state lookups
Add documentation for the WalletConnect skins feature including: - `skin` option in WalletConnect configuration - Built-in skin usage example - Custom skin definition at runtime - Multiple WalletConnect instances with isolated sessions - Accessing wallets by composite key (e.g., 'walletconnect:biatec') Add deprecation notice for `WalletId.BIATEC` with migration guidance.
Replace deprecated `WalletId.BIATEC` with WalletConnect using `skin: 'biatec'` option across all example projects. - nextjs - nuxt - react-ts - solid-ts - svelte-ts - vanilla-ts - vue-ts
|
@drichar I agree this is a great approach |
|
@drichar looks great! I love the idea. I think the only question I would have is the performance/memory overhead of opening separate WC sessions / websockets for each wallet? This might be a problem for low-end mobile devices if you add too many of them. If so, maybe just document that and recommend using generic WC skins if that's a concern for the developer. |
Thanks! The sessions are only created when a user actually connects a wallet, not when This feature just makes them easier to manage, avoiding separate implementations when all you're really doing is presenting a WalletConnect provider instance as a unique list item with a name and logo. |
makes sense. |
Description
This PR introduces "WalletConnect Skins" - a pattern that allows multiple WalletConnect-based wallets to coexist in the same application with distinct branding and isolated session state.
Instead of creating separate wallet implementations for each WalletConnect-based wallet (like Biatec, Voi Wallet, etc.), developers can now configure a single
WalletId.WALLETCONNECTwith askinoption that provides custom name/icon metadata. Built-in skins are still documented in the library's Supported Wallets page for discoverability.Details
Composite Key Architecture
Each skinned wallet instance gets a unique
walletKey(e.g.,walletconnect:biatec) derived from the skin ID. This key is used for:manager.getWallet()Skin Configuration
Changes
Core Library
WalletConnectSkintype and skin registry (skins.ts)walletKeyproperty toBaseWalletfor state isolationwalletKeyinstead ofidWalletManagerto derive composite keys and prevent duplicatesWalletId.BIATECin favor ofskin: 'biatec'Framework Adapters
walletKeyto theWalletinterface in React, Vue, Solid, and Svelte adapterswalletKeyExamples
Documentation
WalletId.BIATECcc @scholtz @xarmian - I'd appreciate your feedback on this approach. This was inspired by #407 (Voi Wallet) which follows the same pattern as Biatec. Rather than continuing to add separate wallet IDs for each WalletConnect-based wallet, this skins pattern allows them to be configured as branded WalletConnect instances while maintaining full backward compatibility.
The
WalletId.BIATECenum value is deprecated but will continue to work until v5. The built-in'biatec'skin uses the same icon and metadata, so existing users can migrate at their convenience.WalletId.VOIWALLETcan be added to the built-in skins registry and documentation similarly.