Skip to content

getAddress

Converts an address into an address that is checksum encoded. Supports EIP-1191.

Import

import { getAddress } from 'viem'

Usage

import { getAddress } from 'viem'
 
getAddress('0xa5cc3c03994db5b0d9a5eEdD10Cabab0813678ac') 
// '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC'

Returns

Address

The checksummed address.

Parameters

address

  • Type: string

An Ethereum address.

chainId (optional)

  • Type: number

The chain ID of the network the address is on. Complies to EIP-1191.