-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: add caipNetworkIds parameter to fetchWallets #5457
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
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
10 Skipped Deployments
|
Visual Regression Test Results ✅ PassedChromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=603 👉 Please review the visual changes in Chromatic and accept or reject them. |
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
This PR adds support for filtering wallets by specific CAIP network IDs when fetching or searching wallets through the useAppKitWallets hook. This enables consumers to request wallets for particular chains rather than always using the globally configured networks.
Changes:
- Added optional
caipNetworkIdsparameter toApiController.fetchWalletsByPageandApiController.searchWalletmethods - Extended
useAppKitWalletshook'sfetchWalletsfunction to accept and pass throughcaipNetworkIdsparameter - Added comprehensive test coverage for the new functionality
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/controllers/src/controllers/ApiController.ts | Added SearchWalletParams and FetchWalletsByPageParams interfaces with optional caipNetworkIds parameter; updated methods to use custom network IDs when provided |
| packages/controllers/exports/react.ts | Added FetchWalletsProps interface and updated fetchWallets function to accept and pass through caipNetworkIds |
| packages/controllers/tests/controllers/ApiController.test.ts | Added test cases verifying custom caipNetworkIds behavior for both fetch and search operations |
| packages/controllers/tests/hooks/react.test.ts | Added test cases verifying the React hook correctly passes caipNetworkIds to underlying controller methods |
| packages/appkit/exports/constants.ts | Version bump from 1.8.14 to 1.8.16 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * Function to fetch WalletConnect wallets from the explorer API. Allows to list, search and paginate through the wallets. | ||
| * @param options - Options for fetching wallets | ||
| * @param options.page - Page number to fetch (default: 1) | ||
| * @param options.query - Search query to filter wallets (default: '') |
Copilot
AI
Jan 12, 2026
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.
The JSDoc comment for the fetchWallets function should be updated to document the new caipNetworkIds parameter. The current documentation only mentions page and query options, but the new parameter allows filtering by specific CAIP network IDs.
| * @param options.query - Search query to filter wallets (default: '') | |
| * @param options.query - Search query to filter wallets (default: '') | |
| * @param options.caipNetworkIds - List of CAIP network IDs to filter wallets by specific networks |
📦 Bundle Size Check✅ All bundles are within size limits 📊 View detailed bundle sizes> @reown/appkit-monorepo@1.7.1 size /home/runner/work/appkit/appkit > size-limit [baseline-browser-mapping] The data in this module is over two months old. To ensure accurate Baseline data, please update: |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Summary
This PR adds support for filtering wallets by specific CAIP network IDs when fetching or searching wallets through the
useAppKitWalletshook. This allows consumers to request wallets for specific chains (e.g.,['eip155:1', 'solana:mainnet']) rather than always using the globally configured networks fromChainController.Changes Made
API Changes
ApiController.fetchWalletsByPage: Added optionalcaipNetworkIdsparameter that, when provided, overrides the default behavior of usingChainController.getRequestedCaipNetworkIds()ApiController.searchWallet: Added optionalcaipNetworkIdsparameter with the same override behaviorSearchWalletParamsandFetchWalletsByPageParamsinterfaces to type the new parametersReact Hooks
useAppKitWallets.fetchWallets: Extended theFetchWalletsPropsinterface to include an optionalcaipNetworkIdsparameter that gets passed through to the underlyingApiControllermethodsType Imports
CaipNetworkIdtype import from@reown/appkit-commonin both affected filesTesting
New Test Cases Added
ApiController.test.ts:should fetch wallets by page with custom caipNetworkIds- Verifies that custom network IDs are used andChainController.getRequestedCaipNetworkIds()is not calledshould search wallet with custom caipNetworkIds- Same verification for the search functionalityreact.test.ts:should fetch wallets with custom caipNetworkIds- Tests the hook correctly passescaipNetworkIdstofetchWalletsByPageshould search wallets with custom caipNetworkIds- Tests the hook correctly passescaipNetworkIdstosearchWalletTest Results
All 807 tests pass (3 skipped - pre-existing).
Related Issues
N/A
Additional Notes
Usage Example
Backward Compatibility
caipNetworkIdsparameter is optionalcaipNetworkIdsis not provided (falls back toChainController.getRequestedCaipNetworkIds())Note
Enables filtering wallet lists by explicit CAIP network IDs instead of global chain config.
caipNetworkIdstoApiController.fetchWalletsByPageandApiController.searchWallet, overridingChainController.getRequestedCaipNetworkIds()when provided; introducesSearchWalletParamsandFetchWalletsByPageParamsuseAppKitWallets.fetchWalletsoptions withcaipNetworkIdsand forwards to API methodsApiController.test.tsandreact.test.tsto validate customcaipNetworkIdsusage and hook propagationPACKAGE_VERSIONto1.8.16Written by Cursor Bugbot for commit bb11ba0. This will update automatically on new commits. Configure here.