Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Address

@fuel-ts/address v0.94.2 Docs


Icon LinkClass: Address

Address provides a type safe wrapper for converting between different address formats ands comparing them for equality.

Icon LinkExtends

Icon LinkConstructors

Icon Linknew Address()

Icon InfoCircle

new Address(address): Address

Icon LinkParameters

address: `fuel${string}`

A Bech32 address

Icon LinkReturns

Address

Icon LinkOverrides

AbstractAddress .constructor

Icon LinkDefined in

address.ts:33 Icon Link

Icon LinkProperties

Icon Linkbech32Address

Icon InfoCircle

readonly bech32Address: `fuel${string}`

Icon LinkDefined in

address.ts:27 Icon Link

Icon LinkMethods

Icon Linkequals()

Icon InfoCircle

equals(other): boolean

Compares this the bech32Address property to another for direct equality

Icon LinkParameters

other: Address

Another address to compare against

Icon LinkReturns

boolean

The equality of the comparison

Icon LinkOverrides

AbstractAddress .equals

Icon LinkDefined in

address.ts:138 Icon Link


Icon LinktoAddress()

Icon InfoCircle

toAddress(): `fuel${string}`

Returns the bech32Address property

Icon LinkReturns

`fuel${string}`

The bech32Address property

Icon LinkOverrides

AbstractAddress .toAddress

Icon LinkDefined in

address.ts:50 Icon Link


Icon LinktoAssetId()

Icon InfoCircle

toAssetId(): AssetId

Wraps the bech32Address property and returns as an AssetId.

Icon LinkReturns

AssetId

The bech32Address property as an AssetId

Icon LinkDefined in

address.ts:117 Icon Link


Icon LinktoB256()

Icon InfoCircle

toB256(): string

Converts and returns the bech32Address property to a 256 bit hash string

Icon LinkReturns

string

The bech32Address property as a 256 bit hash string

Icon LinkOverrides

AbstractAddress .toB256

Icon LinkDefined in

address.ts:59 Icon Link


Icon LinktoBytes()

Icon InfoCircle

toBytes(): Uint8Array

Converts and returns the bech32Address property to a byte array

Icon LinkReturns

Uint8Array

The bech32Address property as a byte array

Icon LinkOverrides

AbstractAddress .toBytes

Icon LinkDefined in

address.ts:68 Icon Link


Icon LinktoEvmAddress()

Icon InfoCircle

toEvmAddress(): EvmAddress

Clears the first 12 bytes of the bech32Address property and returns it as a EvmAddress

Icon LinkReturns

EvmAddress

The bech32Address property as an EvmAddress

Icon LinkDefined in

address.ts:104 Icon Link


Icon LinktoHexString()

Icon InfoCircle

toHexString(): string

Converts

Icon LinkReturns

string

The bech32Address property as a 256 bit hash string

Icon LinkOverrides

AbstractAddress .toHexString

Icon LinkDefined in

address.ts:77 Icon Link


Icon LinktoJSON()

Icon InfoCircle

toJSON(): string

Converts and returns the bech32Address property as a string

Icon LinkReturns

string

The bech32Address property as a string

Icon LinkOverrides

AbstractAddress .toJSON

Icon LinkDefined in

address.ts:95 Icon Link


Icon LinktoString()

Icon InfoCircle

toString(): string

Converts and returns the bech32Address property as a string

Icon LinkReturns

string

The bech32Address property as a string

Icon LinkOverrides

AbstractAddress .toString

Icon LinkDefined in

address.ts:86 Icon Link


Icon LinkvalueOf()

Icon InfoCircle

valueOf(): string

Returns the value of the bech32Address property

Icon LinkReturns

string

The value of bech32Address property

Icon LinkDefined in

address.ts:128 Icon Link


Icon LinkfromAddressOrString()

Icon InfoCircle

static fromAddressOrString(address): AbstractAddress

Takes an ambiguous string or address and creates an Address

Icon LinkParameters

address: string | AbstractAddress

Icon LinkReturns

AbstractAddress

a new Address instance

Icon LinkDefined in

address.ts:198 Icon Link


Icon LinkfromB256()

Icon InfoCircle

static fromB256(b256Address): Address

Takes a B256 Address and creates an Address

Icon LinkParameters

b256Address: string

A b256 hash

Icon LinkReturns

Address

A new Address instance

Icon LinkDefined in

address.ts:163 Icon Link


Icon LinkfromDynamicInput()

Icon InfoCircle

static fromDynamicInput(address): Address

Takes a dynamic string or AbstractAddress and creates an Address

Icon LinkParameters

address: string | AbstractAddress

Icon LinkReturns

Address

A new Address instance

Icon LinkThrows

Error - Unknown address if the format is not recognised

Icon LinkDefined in

address.ts:209 Icon Link


Icon LinkfromEvmAddress()

Icon InfoCircle

static fromEvmAddress(evmAddress): Address

Takes an Evm Address and returns back an Address

Icon LinkParameters

evmAddress: string

Icon LinkReturns

Address

A new Address instance

Icon LinkDefined in

address.ts:243 Icon Link


Icon LinkfromPublicKey()

Icon InfoCircle

static fromPublicKey(publicKey): Address

Takes a Public Key, hashes it, and creates an Address

Icon LinkParameters

publicKey: string

A wallets public key

Icon LinkReturns

Address

A new Address instance

Icon LinkDefined in

address.ts:148 Icon Link


Icon LinkfromRandom()

Icon InfoCircle

static fromRandom(): Address

Creates an Address with a randomized bech32Address property

Icon LinkReturns

Address

A new Address instance

Icon LinkDefined in

address.ts:179 Icon Link


Icon LinkfromString()

Icon InfoCircle

static fromString(address): Address

Takes an ambiguous string and attempts to create an Address

Icon LinkParameters

address: string

An ambiguous string

Icon LinkReturns

Address

A new Address instance

Icon LinkDefined in

address.ts:189 Icon Link