- 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:1. Native API Interface (Recommended)
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
 
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.
client: GlobalWalletClient – The global wallet client instance
Promise<Array<BaseWallet>>– List of connected wallet objects
disconnect
Disconnects the global wallet and emits a disconnect event.
client: GlobalWalletClient – The global wallet client instance
Wallet Management
getEthereumWallets
Retrieves all connected Ethereum wallets.
Parameters:
client: GlobalWalletClient – The global wallet client instance
Array<BaseWallet>– Array of Ethereum wallets
getSolanaWallets
Retrieves all connected Solana wallets.
Parameters:
client: GlobalWalletClient – The global wallet client instance
Array<BaseWallet>– Array of Solana wallets
Network Management
getSupportedEthereumNetworks
Returns supported Ethereum networks.
Parameters:
client: GlobalWalletClient – The global wallet client instance
Array<{ chainId: number; rpcUrl?: string }>– Supported networks
getWalletNetwork
Returns the current network for a specific wallet.
Parameters:
wallet: BaseWallet – The wallet to check
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 forchainId?: number – The chain ID to use for the kernel account clientbundlerProvider?: ZerodevBundlerProvider – The bundler provider to use for the kernel account clientbundlerRpc?: string – The bundler RPC URL to use for the kernel account clientpaymasterRpc?: string – The paymaster RPC URL to use for the kernel account clientpaymaster?: PaymasterType (‘SPONSOR’ | ‘NONE’) – The paymaster to use for the kernel account client
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
BaseWallet– The EOA wallet
Utility Methods
isEthereumWallet
Checks if a wallet is Ethereum-based.
Parameters:
wallet: BaseWallet – The wallet to check
boolean– true if Ethereum-based
isSolanaWallet
Checks if a wallet is Solana-based.
Parameters:
wallet: BaseWallet – The wallet to check
boolean– true if Solana-based
onEvent
Attaches an event listener to the global wallet client.
client: GlobalWalletClient – The global wallet client instanceeventName: keyof ClientEventEmitterEvents – Event namecallback: Function – Event handler
VoidFunction– Unsubscribe function
signMessage
Signs a message using the wallet.
wallet: BaseWallet – The wallet to usemessage: string – Message to sign
Promise<{ signature: string; signedMessage: string }>– Signature details
switchNetwork
Switches an Ethereum wallet’s network.
wallet: BaseWallet – The wallet to switchnetworkId: number – Target network ID