@fuel-ts/address v0.94.2 • Docs
Address
provides a type safe wrapper for converting between different address formats
ands comparing them for equality.
new Address(
address
):Address
• address: `fuel${string}`
A Bech32 address
readonly
bech32Address: `fuel${string}`
equals(
other
):boolean
Compares this the bech32Address
property to another for direct equality
• other: Address
Another address to compare against
boolean
The equality of the comparison
toAddress(): `fuel${string}`
Returns the bech32Address
property
`fuel${string}`
The bech32Address
property
toAssetId():
AssetId
Wraps the bech32Address
property and returns as an AssetId
.
The bech32Address
property as an AssetId
toB256():
string
Converts and returns the bech32Address
property to a 256 bit hash string
string
The bech32Address
property as a 256 bit hash string
toBytes():
Uint8Array
Converts and returns the bech32Address
property to a byte array
Uint8Array
The bech32Address
property as a byte array
toEvmAddress():
EvmAddress
Clears the first 12 bytes of the bech32Address
property and returns it as a EvmAddress
The bech32Address
property as an EvmAddress
toHexString():
string
Converts
string
The bech32Address
property as a 256 bit hash string
toJSON():
string
Converts and returns the bech32Address
property as a string
string
The bech32Address
property as a string
toString():
string
Converts and returns the bech32Address
property as a string
string
The bech32Address
property as a string
valueOf():
string
Returns the value of the bech32Address
property
string
The value of bech32Address
property
static
fromAddressOrString(address
):AbstractAddress
Takes an ambiguous string or address and creates an Address
• address: string
| AbstractAddress
a new Address
instance
static
fromB256(b256Address
):Address
Takes a B256 Address and creates an Address
• b256Address: string
A b256 hash
A new Address
instance
static
fromDynamicInput(address
):Address
Takes a dynamic string or AbstractAddress
and creates an Address
• address: string
| AbstractAddress
A new Address
instance
Error - Unknown address if the format is not recognised
static
fromEvmAddress(evmAddress
):Address
Takes an Evm Address and returns back an Address
• evmAddress: string
A new Address
instance
static
fromPublicKey(publicKey
):Address
Takes a Public Key, hashes it, and creates an Address
• publicKey: string
A wallets public key
A new Address
instance
static
fromRandom():Address
Creates an Address
with a randomized bech32Address
property
A new Address
instance
static
fromString(address
):Address
Takes an ambiguous string and attempts to create an Address
• address: string
An ambiguous string
A new Address
instance