fromString

Parses relaxed address formats. Use fromStringStrict when input must satisfy canonical AIP-40 formatting.

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.