2
0
mirror of synced 2025-02-25 04:25:16 +00:00
ethers.js/docs.wrm/api/utils/address.wrm

42 lines
1.6 KiB
Plaintext
Raw Normal View History

_title: Addresses
2020-01-10 01:01:00 -05:00
_section: Addresses @<addresses>
Explain addresses,formats and checksumming here.
2019-12-13 22:05:10 -05:00
Also see: [constants.AddressZero](constants)
2020-01-10 01:01:00 -05:00
_subsection: Address Formats @<address-formats>
2020-01-10 01:01:00 -05:00
_heading: Checksum Address @<address>
TODO
2020-01-10 01:01:00 -05:00
_heading: ICAP Address @<address-icap>
TODO
_subsection: Functions
_property: utils.getAddress(address) => string<[Address](address)> @<utils-getAddress> @SRC<address>
2019-12-13 22:05:10 -05:00
Returns //address// as a Checksum Address.
2019-12-13 22:05:10 -05:00
If //address// is an invalid 40-nibble [[hexstring]] or if it contains mixed case and
the checksum is invalid, an InvalidArgument Error is throw.
2019-12-13 22:05:10 -05:00
The value of //address// may be any supported address format.
2020-01-10 01:01:00 -05:00
_property: utils.isAddress(address) => boolean @<utils-isAddress> @SRC<address>
2019-12-13 22:05:10 -05:00
Returns true if //address// is valid (in any supported format).
2020-01-10 01:01:00 -05:00
_property: utils.getIcapAddress(address) => string<[IcapAddress](address-icap)> @<utils-getIcapAddress> @SRC<address>
Returns //address// as an [ICAP address](https://github.com/ethereum/wiki/wiki/Inter-exchange-Client-Address-Protocol-%28ICAP%29).
Supports the same restrictions as [utils.getAddress](utils-getAddress).
2019-12-13 22:05:10 -05:00
2020-01-10 01:01:00 -05:00
_property: utils.getContractAddress(transaction) => string<[Address](address)> @<utils-getContractAddress> @SRC<address>
2019-12-13 22:05:10 -05:00
Returns the contract address that would result if //transaction// was
used to deploy a contract.
2020-01-10 01:01:00 -05:00
_property: utils.getCreate2Address(from, salt, initCodeHash) => string<[Address](address)> @<utils.getCreate2Address> @SRC<address>
Returns the contract address that would result from the given
[CREATE2](https://eips.ethereum.org/EIPS/eip-1014) call.