Skip to content
This repository was archived by the owner on Jun 17, 2021. It is now read-only.

Latest commit

 

History

History
194 lines (109 loc) · 4.54 KB

_address_.address.md

File metadata and controls

194 lines (109 loc) · 4.54 KB

ethereumjs-util › "address" › Address

Class: Address

Hierarchy

  • Address

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Address(buf: Buffer): Address

Defined in address.ts:13

Parameters:

Name Type
buf Buffer

Returns: Address

Properties

buf

• buf: Buffer

Defined in address.ts:13

Methods

isZero

▸ isZero(): boolean

Defined in address.ts:81

Is address zero.

Returns: boolean


toBuffer

▸ toBuffer(): Buffer

Defined in address.ts:95

Returns Buffer representation of address.

Returns: Buffer


toString

▸ toString(): string

Defined in address.ts:88

Returns hex encoding of address.

Returns: string


Static fromPrivateKey

▸ fromPrivateKey(privateKey: Buffer): Address

Defined in address.ts:50

Returns an address for a given private key.

Parameters:

Name Type Description
privateKey Buffer A private key must be 256 bits wide

Returns: Address


Static fromPublicKey

▸ fromPublicKey(pubKey: Buffer): Address

Defined in address.ts:40

Returns an address for a given public key.

Parameters:

Name Type Description
pubKey Buffer The two points of an uncompressed key

Returns: Address


Static fromString

▸ fromString(str: string): Address

Defined in address.ts:31

Returns an Address object from a hex-encoded string.

Parameters:

Name Type Description
str string Hex-encoded address

Returns: Address


Static generate

▸ generate(from: Address, nonce: BN): Address

Defined in address.ts:61

Generates an address for a newly created contract.

Parameters:

Name Type Description
from Address The address which is creating this new address
nonce BN The nonce of the from account

Returns: Address


Static generate2

▸ generate2(from: Address, salt: Buffer, initCode: Buffer): Address

Defined in address.ts:72

Generates an address for a contract created using CREATE2.

Parameters:

Name Type Description
from Address The address which is creating this new address
salt Buffer A salt
initCode Buffer The init code of the contract being created

Returns: Address


Static zero

▸ zero(): Address

Defined in address.ts:23

Returns the zero address.

Returns: Address