fromString

NOTE: This function has relaxed parsing behavior. For strict behavior, please use the [fromStringStrict] function. Where possible use fromStringStrict rather than this function, [fromString] is only provided for backwards compatibility.

Creates an instance of AccountAddress from a hex string.

This function allows all formats defined by AIP-40. In short this means the following formats are accepted:

  • LONG, with or without leading 0x

  • SHORT, with or without leading 0x

Where:

  • LONG is 64 hex characters.

  • SHORT is 1 to 63 hex characters inclusive.

  • Padding zeroes are allowed, e.g. 0x0123 is valid.

Learn more about the different address formats by reading AIP-40: https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md.

Return

An instance of AccountAddress.

Parameters

input

A hex string representing an account address.