Skip to main content
@tevm/voltaire
@tevm/voltaire / primitives/Address

primitives/Address

Classes

InvalidAddressError

Defined in: src/primitives/Address/errors.js:159 Error thrown when address is invalid

Throws

Extends

Constructors

Constructor
new InvalidAddressError(message?, options?): InvalidAddressError
Defined in: src/primitives/Address/errors.js:170
Parameters
message?
string Error message
options?
Error options
cause?
Error Root cause error
code?
string Error code
context?
Record<string, unknown> Additional context
docsPath?
string Documentation path
expected?
string Expected format
value?
unknown Invalid value
Returns
InvalidAddressError
Overrides
ValidationError.constructor

Properties

cause?
optional cause: Error
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)
Inherited from
ValidationError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39 Machine-readable error code for programmatic handling
Example
'INVALID_FORMAT', 'INVALID_LENGTH'
Inherited from
ValidationError.code
context?
optional context: Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debugging
Example
{ value: '0x123', expected: '20 bytes' }
Inherited from
ValidationError.context
docsPath?
optional docsPath: string
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this error
Example
'/primitives/address/from-hex#error-handling'
Inherited from
ValidationError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
ValidationError.expected
name
name: string
Defined in: src/primitives/Address/errors.js:180
Inherited from
ValidationError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
ValidationError.value

Methods

getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94 Get full error chain as string for logging
Returns
string
Inherited from
ValidationError.getErrorChain
toJSON()
toJSON(): Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetry
Returns
Record<string, unknown>
Inherited from
ValidationError.toJSON

InvalidAddressLengthError

Defined in: src/primitives/Address/errors.js:74 Error thrown when address has invalid length

Throws

Extends

Constructors

Constructor
new InvalidAddressLengthError(message?, options?): InvalidAddressLengthError
Defined in: src/primitives/Address/errors.js:85
Parameters
message?
string Error message
options?
Error options
cause?
Error Root cause error
code?
string Error code
context?
Record<string, unknown> Additional context
docsPath?
string Documentation path
expected?
string Expected length
value?
unknown Invalid value
Returns
InvalidAddressLengthError
Overrides
InvalidLengthError.constructor

Properties

cause?
optional cause: Error
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)
Inherited from
InvalidLengthError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39 Machine-readable error code for programmatic handling
Example
'INVALID_FORMAT', 'INVALID_LENGTH'
Inherited from
InvalidLengthError.code
context?
optional context: Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debugging
Example
{ value: '0x123', expected: '20 bytes' }
Inherited from
InvalidLengthError.context
docsPath?
optional docsPath: string
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this error
Example
'/primitives/address/from-hex#error-handling'
Inherited from
InvalidLengthError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
InvalidLengthError.expected
name
name: string
Defined in: src/primitives/Address/errors.js:95
Inherited from
InvalidLengthError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
InvalidLengthError.value

Methods

getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94 Get full error chain as string for logging
Returns
string
Inherited from
InvalidLengthError.getErrorChain
toJSON()
toJSON(): Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetry
Returns
Record<string, unknown>
Inherited from
InvalidLengthError.toJSON

InvalidChecksumError

Defined in: src/primitives/Address/errors.js:189 Error thrown when address checksum is invalid

Throws

Extends

Constructors

Constructor
new InvalidChecksumError(message?, options?): InvalidChecksumError
Defined in: src/primitives/Address/errors.js:200
Parameters
message?
string Error message
options?
Error options
cause?
Error Root cause error
code?
string Error code
context?
Record<string, unknown> Additional context
docsPath?
string Documentation path
expected?
string Expected checksum
value?
unknown Invalid value
Returns
InvalidChecksumError
Overrides
ValidationError.constructor

Properties

cause?
optional cause: Error
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)
Inherited from
ValidationError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39 Machine-readable error code for programmatic handling
Example
'INVALID_FORMAT', 'INVALID_LENGTH'
Inherited from
ValidationError.code
context?
optional context: Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debugging
Example
{ value: '0x123', expected: '20 bytes' }
Inherited from
ValidationError.context
docsPath?
optional docsPath: string
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this error
Example
'/primitives/address/from-hex#error-handling'
Inherited from
ValidationError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
ValidationError.expected
name
name: string
Defined in: src/primitives/Address/errors.js:210
Inherited from
ValidationError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
ValidationError.value

Methods

getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94 Get full error chain as string for logging
Returns
string
Inherited from
ValidationError.getErrorChain
toJSON()
toJSON(): Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetry
Returns
Record<string, unknown>
Inherited from
ValidationError.toJSON

InvalidHexFormatError

Defined in: src/primitives/Address/errors.js:13 Error thrown when address hex format is invalid

Throws

Extends

Constructors

Constructor
new InvalidHexFormatError(message?, options?): InvalidHexFormatError
Defined in: src/primitives/Address/errors.js:24
Parameters
message?
string Error message
options?
Error options
cause?
Error Root cause error
code?
string Error code
context?
Record<string, unknown> Additional context
docsPath?
string Documentation path
expected?
string Expected format
value?
unknown Invalid value
Returns
InvalidHexFormatError
Overrides
InvalidFormatError.constructor

Properties

cause?
optional cause: Error
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)
Inherited from
InvalidFormatError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39 Machine-readable error code for programmatic handling
Example
'INVALID_FORMAT', 'INVALID_LENGTH'
Inherited from
InvalidFormatError.code
context?
optional context: Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debugging
Example
{ value: '0x123', expected: '20 bytes' }
Inherited from
InvalidFormatError.context
docsPath?
optional docsPath: string
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this error
Example
'/primitives/address/from-hex#error-handling'
Inherited from
InvalidFormatError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
InvalidFormatError.expected
name
name: string
Defined in: src/primitives/Address/errors.js:34
Inherited from
InvalidFormatError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
InvalidFormatError.value

Methods

getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94 Get full error chain as string for logging
Returns
string
Inherited from
InvalidFormatError.getErrorChain
toJSON()
toJSON(): Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetry
Returns
Record<string, unknown>
Inherited from
InvalidFormatError.toJSON

InvalidHexStringError

Defined in: src/primitives/Address/errors.js:43 Error thrown when hex string contains invalid characters

Throws

Extends

Constructors

Constructor
new InvalidHexStringError(message?, options?): InvalidHexStringError
Defined in: src/primitives/Address/errors.js:54
Parameters
message?
string Error message
options?
Error options
cause?
Error Root cause error
code?
string Error code
context?
Record<string, unknown> Additional context
docsPath?
string Documentation path
expected?
string Expected format
value?
unknown Invalid value
Returns
InvalidHexStringError
Overrides
InvalidFormatError.constructor

Properties

cause?
optional cause: Error
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)
Inherited from
InvalidFormatError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39 Machine-readable error code for programmatic handling
Example
'INVALID_FORMAT', 'INVALID_LENGTH'
Inherited from
InvalidFormatError.code
context?
optional context: Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debugging
Example
{ value: '0x123', expected: '20 bytes' }
Inherited from
InvalidFormatError.context
docsPath?
optional docsPath: string
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this error
Example
'/primitives/address/from-hex#error-handling'
Inherited from
InvalidFormatError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
InvalidFormatError.expected
name
name: string
Defined in: src/primitives/Address/errors.js:65
Inherited from
InvalidFormatError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
InvalidFormatError.value

Methods

getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94 Get full error chain as string for logging
Returns
string
Inherited from
InvalidFormatError.getErrorChain
toJSON()
toJSON(): Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetry
Returns
Record<string, unknown>
Inherited from
InvalidFormatError.toJSON

InvalidValueError

Defined in: src/primitives/Address/errors.js:104 Error thrown when value is invalid

Throws

Extends

Constructors

Constructor
new InvalidValueError(message, options?): InvalidValueError
Defined in: src/primitives/Address/errors.js:115
Parameters
message
string Error message
options?
Error options
cause?
Error Root cause error
code?
string Error code
context?
Record<string, unknown> Additional context
docsPath?
string Documentation path
expected?
string Expected value
value?
unknown Invalid value
Returns
InvalidValueError
Overrides
ValidationError.constructor

Properties

cause?
optional cause: Error
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)
Inherited from
ValidationError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39 Machine-readable error code for programmatic handling
Example
'INVALID_FORMAT', 'INVALID_LENGTH'
Inherited from
ValidationError.code
context?
optional context: Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debugging
Example
{ value: '0x123', expected: '20 bytes' }
Inherited from
ValidationError.context
docsPath?
optional docsPath: string
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this error
Example
'/primitives/address/from-hex#error-handling'
Inherited from
ValidationError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
ValidationError.expected
name
name: string
Defined in: src/primitives/Address/errors.js:125
Inherited from
ValidationError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
ValidationError.value

Methods

getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94 Get full error chain as string for logging
Returns
string
Inherited from
ValidationError.getErrorChain
toJSON()
toJSON(): Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetry
Returns
Record<string, unknown>
Inherited from
ValidationError.toJSON

NotImplementedError

Defined in: src/primitives/Address/errors.js:134 Error thrown when feature is not implemented

Throws

Extends

Constructors

Constructor
new NotImplementedError(message?, options?): NotImplementedError
Defined in: src/primitives/Address/errors.js:143
Parameters
message?
string Error message
options?
Error options
cause?
Error Root cause error
code?
string Error code
context?
Record<string, unknown> Additional context
docsPath?
string Documentation path
Returns
NotImplementedError
Overrides
PrimitiveError.constructor

Properties

cause?
optional cause: Error
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)
Inherited from
PrimitiveError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39 Machine-readable error code for programmatic handling
Example
'INVALID_FORMAT', 'INVALID_LENGTH'
Inherited from
PrimitiveError.code
context?
optional context: Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debugging
Example
{ value: '0x123', expected: '20 bytes' }
Inherited from
PrimitiveError.context
docsPath?
optional docsPath: string
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this error
Example
'/primitives/address/from-hex#error-handling'
Inherited from
PrimitiveError.docsPath
name
name: string
Defined in: src/primitives/Address/errors.js:150
Inherited from
PrimitiveError.name

Methods

getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94 Get full error chain as string for logging
Returns
string
Inherited from
PrimitiveError.getErrorChain
toJSON()
toJSON(): Record<string, unknown>
Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetry
Returns
Record<string, unknown>
Inherited from
PrimitiveError.toJSON

Interfaces

AddressCrypto

Defined in: src/primitives/Address/index.ts:23 Crypto dependencies for Address operations

Properties

keccak256()?
optional keccak256: (data) => Uint8Array
Defined in: src/primitives/Address/index.ts:24
Parameters
data
Uint8Array
Returns
Uint8Array
rlpEncode()?
optional rlpEncode: (items) => Uint8Array
Defined in: src/primitives/Address/index.ts:25
Parameters
items
unknown[]
Returns
Uint8Array

AddressWithFullCrypto

Defined in: src/primitives/Address/index.ts:61 Address with full crypto support (enables all contract address methods)

Extends

Indexable

[index: number]: number

Properties

[brand]
readonly [brand]: "Address"
Defined in: src/primitives/Address/AddressType.ts:4
Inherited from
AddressWithKeccak.[brand]

Methods

calculateCreate2Address()
calculateCreate2Address(salt, initCode): AddressType
Defined in: src/primitives/Address/index.ts:52
Parameters
salt
HashType
initCode
BrandedBytecode
Returns
AddressType
Inherited from
AddressWithKeccak.calculateCreate2Address
calculateCreateAddress()
calculateCreateAddress(nonce): AddressType
Defined in: src/primitives/Address/index.ts:62
Parameters
nonce
bigint
Returns
AddressType
clone()
clone(): AddressType
Defined in: src/primitives/Address/index.ts:41
Returns
AddressType
Inherited from
AddressWithKeccak.clone
compare()
compare(other): number
Defined in: src/primitives/Address/index.ts:42
Parameters
other
AddressType
Returns
number
Inherited from
AddressWithKeccak.compare
equals()
equals(other): boolean
Defined in: src/primitives/Address/index.ts:39
Parameters
other
AddressType
Returns
boolean
Inherited from
AddressWithKeccak.equals
greaterThan()
greaterThan(other): boolean
Defined in: src/primitives/Address/index.ts:44
Parameters
other
AddressType
Returns
boolean
Inherited from
AddressWithKeccak.greaterThan
isZero()
isZero(): boolean
Defined in: src/primitives/Address/index.ts:38
Returns
boolean
Inherited from
AddressWithKeccak.isZero
lessThan()
lessThan(other): boolean
Defined in: src/primitives/Address/index.ts:43
Parameters
other
AddressType
Returns
boolean
Inherited from
AddressWithKeccak.lessThan
toAbiEncoded()
toAbiEncoded(): Uint8Array
Defined in: src/primitives/Address/index.ts:36
Returns
Uint8Array
Inherited from
AddressWithKeccak.toAbiEncoded
toBytes()
toBytes(): Uint8Array
Defined in: src/primitives/Address/index.ts:40
Returns
Uint8Array
Inherited from
AddressWithKeccak.toBytes
toChecksummed()
toChecksummed(): string
Defined in: src/primitives/Address/index.ts:51
Returns
string
Inherited from
AddressWithKeccak.toChecksummed
toHex()
toHex(): string
Defined in: src/primitives/Address/index.ts:32 Convert the Uint8Array to a hex encoded string
Returns
string The hex encoded string representation of the Uint8Array
Inherited from
AddressWithKeccak.toHex
toLowercase()
toLowercase(): string
Defined in: src/primitives/Address/index.ts:33
Returns
string
Inherited from
AddressWithKeccak.toLowercase
toShortHex()
toShortHex(startLength?, endLength?): string
Defined in: src/primitives/Address/index.ts:37
Parameters
startLength?
number
endLength?
number
Returns
string
Inherited from
AddressWithKeccak.toShortHex
toU256()
toU256(): bigint
Defined in: src/primitives/Address/index.ts:35
Returns
bigint
Inherited from
AddressWithKeccak.toU256
toUppercase()
toUppercase(): string
Defined in: src/primitives/Address/index.ts:34
Returns
string
Inherited from
AddressWithKeccak.toUppercase

AddressWithKeccak

Defined in: src/primitives/Address/index.ts:50 Address with keccak256 support (enables checksum methods)

Extends

Extended by

Indexable

[index: number]: number

Properties

[brand]
readonly [brand]: "Address"
Defined in: src/primitives/Address/AddressType.ts:4
Inherited from
BaseAddress.[brand]

Methods

calculateCreate2Address()
calculateCreate2Address(salt, initCode): AddressType
Defined in: src/primitives/Address/index.ts:52
Parameters
salt
HashType
initCode
BrandedBytecode
Returns
AddressType
clone()
clone(): AddressType
Defined in: src/primitives/Address/index.ts:41
Returns
AddressType
Inherited from
BaseAddress.clone
compare()
compare(other): number
Defined in: src/primitives/Address/index.ts:42
Parameters
other
AddressType
Returns
number
Inherited from
BaseAddress.compare
equals()
equals(other): boolean
Defined in: src/primitives/Address/index.ts:39
Parameters
other
AddressType
Returns
boolean
Inherited from
BaseAddress.equals
greaterThan()
greaterThan(other): boolean
Defined in: src/primitives/Address/index.ts:44
Parameters
other
AddressType
Returns
boolean
Inherited from
BaseAddress.greaterThan
isZero()
isZero(): boolean
Defined in: src/primitives/Address/index.ts:38
Returns
boolean
Inherited from
BaseAddress.isZero
lessThan()
lessThan(other): boolean
Defined in: src/primitives/Address/index.ts:43
Parameters
other
AddressType
Returns
boolean
Inherited from
BaseAddress.lessThan
toAbiEncoded()
toAbiEncoded(): Uint8Array
Defined in: src/primitives/Address/index.ts:36
Returns
Uint8Array
Inherited from
BaseAddress.toAbiEncoded
toBytes()
toBytes(): Uint8Array
Defined in: src/primitives/Address/index.ts:40
Returns
Uint8Array
Inherited from
BaseAddress.toBytes
toChecksummed()
toChecksummed(): string
Defined in: src/primitives/Address/index.ts:51
Returns
string
toHex()
toHex(): string
Defined in: src/primitives/Address/index.ts:32 Convert the Uint8Array to a hex encoded string
Returns
string The hex encoded string representation of the Uint8Array
Inherited from
BaseAddress.toHex
toLowercase()
toLowercase(): string
Defined in: src/primitives/Address/index.ts:33
Returns
string
Inherited from
BaseAddress.toLowercase
toShortHex()
toShortHex(startLength?, endLength?): string
Defined in: src/primitives/Address/index.ts:37
Parameters
startLength?
number
endLength?
number
Returns
string
Inherited from
BaseAddress.toShortHex
toU256()
toU256(): bigint
Defined in: src/primitives/Address/index.ts:35
Returns
bigint
Inherited from
BaseAddress.toU256
toUppercase()
toUppercase(): string
Defined in: src/primitives/Address/index.ts:34
Returns
string
Inherited from
BaseAddress.toUppercase

BaseAddress

Defined in: src/primitives/Address/index.ts:31 Base Address type without crypto-dependent methods

Extends

Extended by

Indexable

[index: number]: number

Properties

[brand]
readonly [brand]: "Address"
Defined in: src/primitives/Address/AddressType.ts:4
Inherited from
AddressType.[brand]

Methods

clone()
clone(): AddressType
Defined in: src/primitives/Address/index.ts:41
Returns
AddressType
compare()
compare(other): number
Defined in: src/primitives/Address/index.ts:42
Parameters
other
AddressType
Returns
number
equals()
equals(other): boolean
Defined in: src/primitives/Address/index.ts:39
Parameters
other
AddressType
Returns
boolean
greaterThan()
greaterThan(other): boolean
Defined in: src/primitives/Address/index.ts:44
Parameters
other
AddressType
Returns
boolean
isZero()
isZero(): boolean
Defined in: src/primitives/Address/index.ts:38
Returns
boolean
lessThan()
lessThan(other): boolean
Defined in: src/primitives/Address/index.ts:43
Parameters
other
AddressType
Returns
boolean
toAbiEncoded()
toAbiEncoded(): Uint8Array
Defined in: src/primitives/Address/index.ts:36
Returns
Uint8Array
toBytes()
toBytes(): Uint8Array
Defined in: src/primitives/Address/index.ts:40
Returns
Uint8Array
toHex()
toHex(): string
Defined in: src/primitives/Address/index.ts:32 Convert the Uint8Array to a hex encoded string
Returns
string The hex encoded string representation of the Uint8Array
Overrides
AddressType.toHex
toLowercase()
toLowercase(): string
Defined in: src/primitives/Address/index.ts:33
Returns
string
toShortHex()
toShortHex(startLength?, endLength?): string
Defined in: src/primitives/Address/index.ts:37
Parameters
startLength?
number
endLength?
number
Returns
string
toU256()
toU256(): bigint
Defined in: src/primitives/Address/index.ts:35
Returns
bigint
toUppercase()
toUppercase(): string
Defined in: src/primitives/Address/index.ts:34
Returns
string

Type Aliases

AddressType

AddressType = Uint8Array & object
Defined in: src/primitives/Address/AddressType.ts:3

Type Declaration

[brand]
readonly [brand]: "Address"

Variables

equals()

const equals: (address, other) => boolean = Address.equals
Defined in: src/primitives/Address/index.ts:262 Check if two addresses are equal

Parameters

address
AddressType First address
other
AddressType Address to compare with

Returns

boolean True if addresses are identical

Example

if (Address.equals(addr1, addr2)) {
  console.log("Addresses match");
}

fromHex()

const fromHex: (value, crypto?) => AddressType = Address.fromHex
Defined in: src/primitives/Address/index.ts:261

Parameters

value
string
crypto?
AddressCrypto

Returns

AddressType

fromPublicKey()

const fromPublicKey: {(x, y): AddressType; (publicKey): AddressType; } = Address.fromPublicKey
Defined in: src/primitives/Address/index.ts:186

Call Signature

(x, y): AddressType
Parameters
x
bigint
y
bigint
Returns
AddressType

Call Signature

(publicKey): AddressType
Parameters
publicKey
Uint8Array
Returns
AddressType

HEX_SIZE

const HEX_SIZE: 42 = 42
Defined in: src/primitives/Address/constants.js:11 Address hex string size (including 0x prefix)

NATIVE_ASSET_ADDRESS

const NATIVE_ASSET_ADDRESS: string = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
Defined in: src/primitives/Address/constants.js:19 Native ETH address constant as defined in ERC-7528 Used to represent native ETH in token-related operations

See

https://eips.ethereum.org/EIPS/eip-7528

SIZE

const SIZE: 20 = 20
Defined in: src/primitives/Address/constants.js:5 Address size in bytes

toHex()

const toHex: (address) => HexType = BrandedAddress.toHex
Defined in: src/primitives/Address/index.ts:260 Convert Address to hex string

Parameters

address
AddressType Address to convert

Returns

HexType Lowercase hex string with 0x prefix

Example

const hex = Address.toHex(addr);
// "0x742d35cc6634c0532925a3b844bc9e7595f251e3"

Functions

Address()

Call Signature

Address(value): BaseAddress
Defined in: src/primitives/Address/index.ts:80 Creates Address instances with prototype chain
Parameters
value
Value to convert (hex string, bytes, or number) string | number | bigint | Uint8Array<ArrayBufferLike>
Returns
BaseAddress Address instance with prototype methods
See
https://voltaire.tevm.sh/primitives/address for Address documentation
Since
0.0.0
Throws
If value format is invalid
Example
import { Address } from './primitives/Address/index.js';
const addr = Address('0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb');
console.log(addr.toHex());

Call Signature

Address(value, crypto): AddressWithKeccak
Defined in: src/primitives/Address/index.ts:91 Creates Address with keccak256 support
Parameters
value
Value to convert string | number | bigint | Uint8Array<ArrayBufferLike>
crypto
Crypto dependencies with keccak256
keccak256
(data) => Uint8Array
Returns
AddressWithKeccak Address with checksum methods

Call Signature

Address(value, crypto): AddressWithFullCrypto
Defined in: src/primitives/Address/index.ts:103 Creates Address with full crypto support
Parameters
value
Value to convert string | number | bigint | Uint8Array<ArrayBufferLike>
crypto
Crypto dependencies with keccak256 and rlpEncode
keccak256
(data) => Uint8Array
rlpEncode
(items) => Uint8Array
Returns
AddressWithFullCrypto Address with all contract address methods

deduplicateAddresses()

deduplicateAddresses(addresses): AddressType[]
Defined in: src/primitives/Address/index.ts:251

Parameters

addresses
AddressType[]

Returns

AddressType[]

sortAddresses()

sortAddresses(addresses): AddressType[]
Defined in: src/primitives/Address/index.ts:244

Parameters

addresses
AddressType[]

Returns

AddressType[]

References

BrandedAddress

Renames and re-exports AddressType

default

Renames and re-exports Address