ethers.js/docs/v5/api/utils/address
2020-06-09 23:56:58 -04:00
..
index.html Check-in old v5 docs changes. 2020-06-09 23:56:58 -04:00
README.md Check-in old v5 docs changes. 2020-06-09 23:56:58 -04: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 InvalidArgument Error is throw.

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 utils.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.