refactor: adopt WalletFactory pattern for type-safe wallet IDs#2588
Open
DanielSinclair wants to merge 3 commits intomainfrom
Open
refactor: adopt WalletFactory pattern for type-safe wallet IDs#2588DanielSinclair wants to merge 3 commits intomainfrom
DanielSinclair wants to merge 3 commits intomainfrom
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
7204b49 to
b6ff8bb
Compare
Refactors wallet connectors to use the new WalletFactory helper type, which preserves literal ID types through 'as const' assertions. This provides better type safety and enables stricter type checking for wallet identifiers throughout the codebase. Changes: - Add WalletFactory helper type to Wallet.ts - Add appName and appIcon to CreateWalletFn type for wallets that require them (baseAccount, coinbaseWallet, geminiWallet) - Convert all wallet connectors to use WalletFactory pattern - Flatten type definitions in baseAccount and coinbaseWallet - Update WalletButton components to work with new types - All wallet IDs now use 'as const' for literal type preservation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
b6ff8bb to
eac8f7f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Refactors wallet connectors to use the new WalletFactory helper type,
which preserves literal ID types through 'as const' assertions. This
provides better type safety and enables stricter type checking for
wallet identifiers throughout the codebase.
Changes:
(baseAccount, coinbaseWallet, geminiWallet)
PR-Codex overview
This PR focuses on improving the TypeScript typings and structure of various wallet connector implementations in the
rainbowkitpackage. It enhances type safety and consistency by utilizing thesatisfiesoperator and updating the wallet connector functions.Detailed summary
satisfies Walletfor type safety.(): Walletto() =>for consistency.iddefinitions withas constfor literal type preservation.WalletButtonand related props to useWalletId.argentWallet,wigwamWallet,tahoWallet, and others to align with new type definitions.