Skip to content

Conversation

@tomiir
Copy link
Collaborator

@tomiir tomiir commented Jan 12, 2026

Summary

This PR adds support for filtering wallets by specific CAIP network IDs when fetching or searching wallets through the useAppKitWallets hook. This allows consumers to request wallets for specific chains (e.g., ['eip155:1', 'solana:mainnet']) rather than always using the globally configured networks from ChainController.

Changes Made

API Changes

  • ApiController.fetchWalletsByPage: Added optional caipNetworkIds parameter that, when provided, overrides the default behavior of using ChainController.getRequestedCaipNetworkIds()
  • ApiController.searchWallet: Added optional caipNetworkIds parameter with the same override behavior
  • New interfaces: Added SearchWalletParams and FetchWalletsByPageParams interfaces to type the new parameters

React Hooks

  • useAppKitWallets.fetchWallets: Extended the FetchWalletsProps interface to include an optional caipNetworkIds parameter that gets passed through to the underlying ApiController methods

Type Imports

  • Added CaipNetworkId type import from @reown/appkit-common in both affected files

Testing

New Test Cases Added

  • ApiController.test.ts:

    • should fetch wallets by page with custom caipNetworkIds - Verifies that custom network IDs are used and ChainController.getRequestedCaipNetworkIds() is not called
    • should search wallet with custom caipNetworkIds - Same verification for the search functionality
  • react.test.ts:

    • should fetch wallets with custom caipNetworkIds - Tests the hook correctly passes caipNetworkIds to fetchWalletsByPage
    • should search wallets with custom caipNetworkIds - Tests the hook correctly passes caipNetworkIds to searchWallet

Test Results

All 807 tests pass (3 skipped - pre-existing).

Related Issues

N/A

Additional Notes

Usage Example

const { fetchWallets } = useAppKitWallets()

// Fetch wallets for specific networks only
await fetchWallets({ 
  page: 1, 
  caipNetworkIds: ['eip155:1', 'eip155:137'] 
})

// Search wallets for specific networks
await fetchWallets({ 
  query: 'metamask', 
  caipNetworkIds: ['eip155:1'] 
})

Backward Compatibility

  • No breaking changes - the caipNetworkIds parameter is optional
  • Existing behavior is preserved when caipNetworkIds is not provided (falls back to ChainController.getRequestedCaipNetworkIds())

Note

Enables filtering wallet lists by explicit CAIP network IDs instead of global chain config.

  • Adds optional caipNetworkIds to ApiController.fetchWalletsByPage and ApiController.searchWallet, overriding ChainController.getRequestedCaipNetworkIds() when provided; introduces SearchWalletParams and FetchWalletsByPageParams
  • Extends useAppKitWallets.fetchWallets options with caipNetworkIds and forwards to API methods
  • Updates tests in ApiController.test.ts and react.test.ts to validate custom caipNetworkIds usage and hook propagation
  • Bumps PACKAGE_VERSION to 1.8.16

Written by Cursor Bugbot for commit bb11ba0. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings January 12, 2026 10:06
@changeset-bot
Copy link

changeset-bot bot commented Jan 12, 2026

⚠️ No Changeset found

Latest commit: bb11ba0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
appkit-basic-html Ready Ready Preview, Comment Jan 12, 2026 10:09am
appkit-demo Ready Ready Preview, Comment Jan 12, 2026 10:09am
appkit-gallery Ready Ready Preview, Comment Jan 12, 2026 10:09am
appkit-headless-sample-app Ready Ready Preview, Comment Jan 12, 2026 10:09am
appkit-laboratory Ready Ready Preview, Comment Jan 12, 2026 10:09am
10 Skipped Deployments
Project Deployment Review Updated (UTC)
appkit-basic-example Ignored Ignored Jan 12, 2026 10:09am
appkit-basic-sign-client-example Ignored Ignored Jan 12, 2026 10:09am
appkit-basic-up-example Ignored Ignored Jan 12, 2026 10:09am
appkit-ethers5-bera Ignored Ignored Jan 12, 2026 10:09am
appkit-nansen-demo Ignored Ignored Jan 12, 2026 10:09am
appkit-vue-solana Ignored Ignored Jan 12, 2026 10:09am
appkit-wagmi-cdn-example Ignored Ignored Jan 12, 2026 10:09am
ethereum-provider-wagmi-example Ignored Ignored Jan 12, 2026 10:09am
next-wagmi-solana-bitcoin-example Ignored Ignored Jan 12, 2026 10:09am
vue-wagmi-example Ignored Ignored Jan 12, 2026 10:09am

@github-actions
Copy link
Contributor

Visual Regression Test Results ✅ Passed

⚠️ 7 visual change(s) detected

Chromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=603
Storybook Preview: https://6493191bf4b10fed8ca7353f-xeqawgbxzt.chromatic.com/

👉 Please review the visual changes in Chromatic and accept or reject them.

Copy link
Contributor

Copilot AI left a 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 caipNetworkIds parameter to ApiController.fetchWalletsByPage and ApiController.searchWallet methods
  • Extended useAppKitWallets hook's fetchWallets function to accept and pass through caipNetworkIds parameter
  • 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: '')
Copy link

Copilot AI Jan 12, 2026

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.

Suggested change
* @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

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

📦 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: npm i baseline-browser-mapping@latest -D

@reown/appkit - Main Entry
Size limit:   80 kB
Size:         75.04 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 1.2 s    on Snapdragon 410
Total time:   2.6 s
@reown/appkit/react
Size limit:   235 kB
Size:         233.53 kB with all dependencies, minified and gzipped
Loading time: 4.6 s     on slow 3G
Running time: 5.3 s     on Snapdragon 410
Total time:   9.8 s
@reown/appkit/vue
Size limit:   80 kB
Size:         75.04 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 2.1 s    on Snapdragon 410
Total time:   3.6 s
@reown/appkit-scaffold-ui
Size limit:   220 kB
Size:         212.88 kB with all dependencies, minified and gzipped
Loading time: 4.2 s     on slow 3G
Running time: 2.7 s     on Snapdragon 410
Total time:   6.8 s
@reown/appkit-ui
Size limit:   500 kB
Size:         13.15 kB with all dependencies, minified and gzipped
Loading time: 257 ms   on slow 3G
Running time: 435 ms   on Snapdragon 410
Total time:   692 ms

@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.63% 39389 / 50094
🔵 Statements 78.63% 39389 / 50094
🔵 Functions 76.38% 4243 / 5555
🔵 Branches 86.74% 9578 / 11041
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/exports/constants.ts 100% 100% 100% 100%
packages/controllers/exports/react.ts 86.29% 95.71% 47.82% 86.29% 72-81, 102-110, 117-124, 147, 452-470, 139-165, 410
packages/controllers/src/controllers/ApiController.ts 94.83% 96.62% 86.44% 94.83% 129-130, 192, 202-205, 280-281, 518-526, 553, 567, 571, 575, 213
Generated in workflow #16642 for commit bb11ba0 by the Vitest Coverage Report Action

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.

2 participants