Skip to content
On this page

getAddresses

Returns a list of account addresses owned by the wallet or client.

Usage

ts
import { walletClient } from './client'
 
const accounts = await walletClient.getAddresses() 
// ['0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC']
ts
import { createWalletClient, custom } from 'viem'
import { mainnet } from 'viem/chains'

export const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum)
})

Returns

Address[]

A list of checksummed addresses.

JSON-RPC Methods

eth_accounts

Released under the MIT License.