Skip to content

EthjsAddress

Handling and generating Ethereum addresses

Extended by

Constructors

new EthjsAddress()

new EthjsAddress(bytes): EthjsAddress

Parameters

bytes: Uint8Array

Returns

EthjsAddress

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:7

Properties

bytes

readonly bytes: Uint8Array

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:6

Methods

equals()

equals(address): boolean

Is address equal to another.

Parameters

address: EthjsAddress

Returns

boolean

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:43


isPrecompileOrSystemAddress()

isPrecompileOrSystemAddress(): boolean

True if address is in the address range defined by EIP-1352

Returns

boolean

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:52


isZero()

isZero(): boolean

Is address zero.

Returns

boolean

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:47


toBytes()

toBytes(): Uint8Array

Returns a new Uint8Array representation of address.

Returns

Uint8Array

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:60


toString()

toString(): `0x${string}`

Returns hex encoding of address.

Returns

`0x${string}`

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:56


fromPrivateKey()

static fromPrivateKey(privateKey): EthjsAddress

Returns an address for a given private key.

Parameters

privateKey: Uint8Array

A private key must be 256 bits wide

Returns

EthjsAddress

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:26


fromPublicKey()

static fromPublicKey(pubKey): EthjsAddress

Returns an address for a given public key.

Parameters

pubKey: Uint8Array

The two points of an uncompressed key

Returns

EthjsAddress

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:21


fromString()

static fromString(str): EthjsAddress

Returns an Address object from a hex-encoded string.

Parameters

str: string

Hex-encoded address

Returns

EthjsAddress

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:16


generate()

static generate(from, nonce): EthjsAddress

Generates an address for a newly created contract.

Parameters

from: EthjsAddress

The address which is creating this new address

nonce: bigint

The nonce of the from account

Returns

EthjsAddress

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:32


generate2()

static generate2(from, salt, initCode): EthjsAddress

Generates an address for a contract created using CREATE2.

Parameters

from: EthjsAddress

The address which is creating this new address

salt: Uint8Array

A salt

initCode: Uint8Array

The init code of the contract being created

Returns

EthjsAddress

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:39


zero()

static zero(): EthjsAddress

Returns the zero address.

Returns

EthjsAddress

Defined in

node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:11