Documentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
UsegetWalletClient to create a Viem WalletClient for your server wallet. This allows you to interact with EVM chains using Viem’s familiar API for signing messages, transactions, and typed data.
Prerequisites
- A Dynamic server wallet (see Server Wallets Setup)
@dynamic-labs-wallet/node-evminstalled- An authenticated
DynamicEvmWalletClientinstance
Usage
Basic example
With external server key shares
If you’re storing key shares externally, pass them when creating the wallet client:With password protection
For password-protected wallets:Using Viem chain objects
You can pass a ViemChain object directly instead of chainId and rpcUrl:
Custom chain configuration
For custom or unsupported chains, usechainId and rpcUrl:
When providing
chainId, you must also provide rpcUrl. The chain will be automatically configured with default ETH currency settings.Common operations
Sign a message
Sign typed data
Send a transaction
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
accountAddress | string | Yes | The wallet address to create a client for. |
password | string | No | Password for password-protected wallets. |
externalServerKeyShares | ServerKeyShare[] | No | External key shares if stored outside Dynamic’s service. |
chain | Chain | No | Viem chain object. Takes precedence over chainId and rpcUrl. |
chainId | number | No | Chain ID. Requires rpcUrl when provided. |
rpcUrl | string | No | RPC URL for the chain. Required when chainId is provided. |
If no chain configuration is provided, the wallet client defaults to Ethereum mainnet.
Return value
Returns a ViemWalletClient<Transport, Chain, Account> instance with the following properties:
account- The wallet account adapterchain- The configured chaintransport- HTTP transport for RPC calls
signMessage, signTypedData, sendTransaction, and more.