Address
Utility class for ethereum addresses. Wraps EthjsAddress with a tevm style API. toString returns a checksummed address rather than lowercase
Example
Extends
Constructors
new Address()
new Address(
bytes
):Address
Parameters
• bytes: Uint8Array
Returns
Inherited from
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
Inherited from
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
Inherited from
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
Inherited from
EthjsAddress
.isPrecompileOrSystemAddress
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
Inherited from
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
Inherited from
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 the checksummed address.
Returns
`0x${string}`
The checksummed address.
Overrides
Defined in
packages/address/src/Address.js:27
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
Inherited from
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
Inherited from
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
Inherited from
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
Inherited from
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
Inherited from
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
Inherited from
Defined in
node_modules/.pnpm/@ethereumjs+util@9.1.0/node_modules/@ethereumjs/util/dist/esm/address.d.ts:11