Skip to main content

Recommended: JavaScript SDK with React Hooks

For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.
The Global Wallet Native API provides a direct interface for interacting with and managing global wallets without requiring any wallet SDK. This API is designed for:
  • App developers who want to integrate global wallet functionality
  • Wallet developers who need to create custom wallet interfaces

Quick Start

The API is available through the @dynamic-labs/global-wallet-client/features entry point. Here’s a simple example to get started:

Implementation Options

When creating your global wallet package, you have two implementation approaches: This approach leverages the @dynamic-labs/global-wallet-client package to re-export all native APIs through the features entry point. Benefits include:
  • Simpler maintenance
  • Automatic feature updates
  • Consistent API across the ecosystem
To implement this approach, follow the package creation guide.

2. Custom Interface

You can create a custom interface using the Global Wallet Native API. This gives you complete control over the API design:

Complete Integration Example

Let’s walk through a complete React integration example using a fictional wallet called “Droplet”:

Provider Integration

Viem Integration

Ethers.js Integration

API Reference

Core Methods

connect

Connects the global wallet to your dapp via a pop-up interface.
Parameters:
  • client: GlobalWalletClient – The global wallet client instance
Returns:
  • Promise<Array<BaseWallet>> – List of connected wallet objects

disconnect

Disconnects the global wallet and emits a disconnect event.
Parameters:
  • client: GlobalWalletClient – The global wallet client instance

Wallet Management

getEthereumWallets

Retrieves all connected Ethereum wallets. Parameters:
  • client: GlobalWalletClient – The global wallet client instance
Returns:
  • Array<BaseWallet> – Array of Ethereum wallets

getSolanaWallets

Retrieves all connected Solana wallets. Parameters:
  • client: GlobalWalletClient – The global wallet client instance
Returns:
  • Array<BaseWallet> – Array of Solana wallets

Network Management

getSupportedEthereumNetworks

Returns supported Ethereum networks. Parameters:
  • client: GlobalWalletClient – The global wallet client instance
Returns:
  • Array<{ chainId: number; rpcUrl?: string }> – Supported networks

getWalletNetwork

Returns the current network for a specific wallet. Parameters:
  • wallet: BaseWallet – The wallet to check
Returns:
  • number | string | null – Network ID or name

Account Abstraction

createKernelClient

Creates a kernel account client for a given wallet. Parameters:
  • wallet: BaseWallet – The smart wallet to create the kernel account client for
  • chainId?: number – The chain ID to use for the kernel account client
  • bundlerProvider?: ZerodevBundlerProvider – The bundler provider to use for the kernel account client
  • bundlerRpc?: string – The bundler RPC URL to use for the kernel account client
  • paymasterRpc?: string – The paymaster RPC URL to use for the kernel account client
  • paymaster?: PaymasterType (‘SPONSOR’ | ‘NONE’) – The paymaster to use for the kernel account client
Returns:
  • KernelAccountClient<Transport, ViemChain, SmartAccount, Client, RpcSchema> – The kernel account client

getEoaWalletForSmartWallet

Retrieves the EOA wallet for a given smart address address. Parameters:
  • smartWallet: BaseWallet – The smart wallet to get the EOA for
Returns:
  • BaseWallet – The EOA wallet

Utility Methods

isEthereumWallet

Checks if a wallet is Ethereum-based. Parameters:
  • wallet: BaseWallet – The wallet to check
Returns:
  • boolean – true if Ethereum-based

isSolanaWallet

Checks if a wallet is Solana-based. Parameters:
  • wallet: BaseWallet – The wallet to check
Returns:
  • boolean – true if Solana-based

onEvent

Attaches an event listener to the global wallet client.
Parameters:
  • client: GlobalWalletClient – The global wallet client instance
  • eventName: keyof ClientEventEmitterEvents – Event name
  • callback: Function – Event handler
Returns:
  • VoidFunction – Unsubscribe function

signMessage

Signs a message using the wallet.
Parameters:
  • wallet: BaseWallet – The wallet to use
  • message: string – Message to sign
Returns:
  • Promise<{ signature: string; signedMessage: string }> – Signature details

switchNetwork

Switches an Ethereum wallet’s network.
Parameters:
  • wallet: BaseWallet – The wallet to switch
  • networkId: number – Target network ID
Last modified on June 25, 2026