Skip to main content

Try it Live

Run Address examples in the interactive playground

Address Variants

Branded hex string types representing different address formats with compile-time guarantees.

Overview

Address variants provide type-safe hex strings with specific casing guarantees:
  • Checksummed - EIP-55 mixed-case format for display and verification
  • Lowercase - All lowercase hex for canonical storage
  • Uppercase - All uppercase hex for specific protocols
Each variant is a branded hex string type extending Hex.Sized<20>, not a Uint8Array.

ChecksumAddress

EIP-55 checksummed address format with mixed casing based on keccak256 hash.

Address.Checksummed.from(addr)

Create checksummed hex string from Address.
Parameters:
  • addr: AddressType - Address to checksum
Returns: Checksummed - Branded checksummed hex string Type:
Defined in: primitives/Address/AddressType/ChecksumAddress.js:23 Note: Uses keccak256 internally.

Address.Checksummed.isValid(str)

Validate EIP-55 checksum of address string.
Parameters:
  • str: string - Address string to validate
Returns: boolean Defined in: primitives/Address/AddressType/ChecksumAddress.js:55 EIP-55 Logic:
  • If all letters same case (all lower or all upper), valid
  • If mixed case, each letter’s case must match keccak256-based checksum

LowercaseAddress

All lowercase hex format for canonical representation.

Address.Lowercase.from(addr)

Create lowercase hex string from Address.
Parameters:
  • addr: AddressType - Address to convert
Returns: Lowercase - Branded lowercase hex string Type:
Defined in: primitives/Address/AddressType/LowercaseAddress.js:20

UppercaseAddress

All uppercase hex format.

Address.Uppercase.from(addr)

Create uppercase hex string from Address.
Parameters:
  • addr: AddressType - Address to convert
Returns: Uppercase - Branded uppercase hex string Type:
Defined in: primitives/Address/AddressType/UppercaseAddress.js:20

Variant Comparison