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
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.