ethers.js/docs/v5/api/utils/address
2021-02-08 15:26:10 -05:00
..
index.html docs: commit built docs 2021-02-08 15:26:10 -05:00
README.md docs: commit built docs 2021-02-08 15:26:10 -05:00

Documentation: html

Addresses

Address Formats

Address

ICAP Address

Converting and Verifying

ethers . utils . getAddress( address ) => string< Address >

Returns address as a Checksum Address.

If address is an invalid 40-nibble HexString or if it contains mixed case and the checksum is invalid, an INVALID_ARGUMENT Error is thrown.

The value of address may be any supported address format.

ethers . utils . getIcapAddress( address ) => string< IcapAddress >

Returns address as an ICAP address. Supports the same restrictions as getAddress.

ethers . utils . isAddress( address ) => boolean

Returns true if address is valid (in any supported format).

Derivation

ethers . utils . computeAddress( publicOrPrivateKey ) => string< Address >

Returns the address for publicOrPrivateKey. A public key may be compressed or uncompressed, and a private key will be converted automatically to a public key for the derivation.

ethers . utils . recoverAddress( digest , signature ) => string< Address >

Use ECDSA Public Key Recovery to determine the address that signed digest to which generated signature.

Contracts Addresses

ethers . utils . getContractAddress( transaction ) => string< Address >

Returns the contract address that would result if transaction was used to deploy a contract.

ethers . utils . getCreate2Address( from , salt , initCodeHash ) => string< Address >

Returns the contract address that would result from the given CREATE2 call.