ethereumjs-monorepo

@ethereumjs/util


@ethereumjs/util / toChecksumAddress

Function: toChecksumAddress()

toChecksumAddress(hexAddress, eip1191ChainId?): `0x${string}`

Defined in: packages/util/src/account.ts:408

Returns a checksummed address.

If an eip1191ChainId is provided, the chainId will be included in the checksum calculation. This has the effect of checksummed addresses for one chain having invalid checksums for others. For more details see EIP-1191.

WARNING: Checksums with and without the chainId will differ and the EIP-1191 checksum is not backwards compatible to the original widely adopted checksum format standard introduced in EIP-55, so this will break in existing applications. Usage of this EIP is therefore discouraged unless you have a very targeted use case.

Parameters

hexAddress

string

eip1191ChainId?

BigIntLike

Returns

`0x${string}`