@dynamic-labs/multi-wallet

中文文档
5.16.1发布于 2026/11/13MITTypeScriptESM + CJS近 30 天下载 34.3万

Multi-wallet is a toolkit for working with many different wallets to create and verify signatures

原始使用文档
文档目录14 节
  1. Overview
  2. Key Features
  3. Core Functions
  4. getSupportedWallets(opts)
  5. getWalletConnectorConstructorOptions(params)
  6. getEnabledWallets(props)
  7. generateMessageToSign(params)
  8. getEnabledProviders(providers)
  9. getSupportedChainsForWalletConnector(walletBook, walletConn…
  10. Usage
  11. Usage in Dynamic SDK
  12. Development
  13. Running unit tests
  14. Building the package

@dynamic-labs/multi-wallet

Overview

The multi-wallet package provides utility functions for filtering and configuring wallet connectors in the Dynamic Labs SDK. It contains helper functions used by the main SDK to determine which wallets should be available based on project settings and enabled chains.

Key Features

  • Wallet filtering: Filters wallet connectors based on enabled chains and project settings
  • Configuration building: Creates configuration objects needed to instantiate wallet connectors
  • Message generation: Generates standardized messages for wallet signature operations
  • Provider filtering: Determines which authentication providers are enabled

Core Functions

getSupportedWallets(opts)

Main function that returns a filtered list of available wallet connectors based on:

  • Project settings and enabled providers
  • Platform compatibility (mobile/desktop)
  • Wallet availability and installation status
  • User preferences and disabled connectors

getWalletConnectorConstructorOptions(params)

Builds configuration options for wallet connector constructors, including:

  • Network configurations for all supported chains
  • API providers and RPC configurations
  • Authentication modes and UI utilities
  • WalletConnect project settings

getEnabledWallets(props)

Filters wallet connectors based on enabled chains. Takes an object with:

  • enabledChains: Array of Chain types that are enabled
  • getSupportedWalletOpts: Configuration options for getting supported wallets

generateMessageToSign(params)

Creates standardized messages for wallet signing operations. Takes a MessageParameters object with fields like:

  • blockchain: The blockchain type (Chain)
  • domain: The domain requesting the signature
  • nonce: Unique nonce for the request
  • publicKey: User's public key
  • uri: URI of the requesting application
  • Additional optional fields for chainId, statement, resources, etc.

getEnabledProviders(providers)

Filters providers to return only those that are enabled (have enabledAt set, or are MagicLink with providerProjectId, or are Turnkey).

getSupportedChainsForWalletConnector(walletBook, walletConnector)

Returns the supported chains for a specific wallet connector instance. The behavior depends on the mergeWalletBookChains property of the connector:

  • When mergeWalletBookChains is true (default): Returns a merged set of chains from both the wallet book (global wallet brand capabilities) and the connector's supportedChains. This is the default behavior for most connectors.

  • When mergeWalletBookChains is false: Returns only the connector's supportedChains, ignoring wallet book chains. This is used for Solana WalletConnect connectors to ensure they are correctly filtered out when Solana is disabled, even if the wallet book indicates the wallet brand supports both ETH and SOL globally (e.g., Trust Wallet Solana connector with walletKey 'trust' matching the wallet book entry that lists both EVM and SOL chains).

Usage

import { getSupportedWallets } from '@dynamic-labs/multi-wallet';

const wallets = getSupportedWallets({
  settings: projectSettings,
  walletConnectorsProp: walletConnectors,
  walletBook: walletBookData,
  chainRpcProviders: rpcProviders,
  // ... other options
});

Usage in Dynamic SDK

This package is primarily used internally by the Dynamic SDK React Core package. The main usage patterns are:

  • Wallet List Building: getEnabledWallets is used to filter available wallets based on enabled chains
  • Configuration Setup: getWalletConnectorConstructorOptions builds the options needed to create wallet connector instances
  • Message Signing: generateMessageToSign creates SIWE-compliant messages for wallet authentication

Development

Running unit tests

npx nx test multi-wallet

Building the package

npx nx build multi-wallet

版本与发布记录

@dynamic-labs/multi-wallet 共发布 1,305 个版本,首次发布于 2022/05/07;过去 12 个月发布了 179 个版本。

版本发布日期距今
5.16.1latest2026/11/13今天
5.16.02026/11/112 天前
5.15.12026/11/103 天前
5.15.02026/11/103 天前
4.104.0v4-lts2026/11/0310 天前
5.14.02026/10/3014 天前

其他发布通道:alpha → 4.83.2-alpha.0,rc → 5.0.0-rc.4,v4-lts → 4.104.0。

关于 @dynamic-labs/multi-wallet 的常见问题

@dynamic-labs/multi-wallet 是什么?

Multi-wallet is a toolkit for working with many different wallets to create and verify signatures

如何安装 @dynamic-labs/multi-wallet?

在项目目录运行 npm install @dynamic-labs/multi-wallet,或使用 pnpm add / yarn add / bun add。

@dynamic-labs/multi-wallet 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dynamic-labs/multi-wallet 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@dynamic-labs/multi-wallet 可以商用吗?

@dynamic-labs/multi-wallet 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dynamic-labs/multi-wallet 的下载量有多少?

根据 npm 官方下载统计,@dynamic-labs/multi-wallet 在 2026/10/13 – 2026/11/11 这 30 天内被下载 342,977 次,日均约 11,433 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dynamic-labs/multi-wallet 还在维护吗?

最新版本 5.16.1 发布于 2026/11/13(今天);至今共发布 1305 个版本,其中过去 12 个月发布了 179 个;首次发布于 2022/05/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。