Address

Address

Create a new Address object.

Address represents a single address in the Stellar network that can be inputted to or outputted by a smart contract. An address can represent an account, muxed account, contract, claimable balance, or a liquidity pool (the latter two can only be present as the output of Core in the form of an event, never an input to a smart contract).

Constructor

new Address(address)

Source:
Parameters:
Name Type Description
address string

a StrKey of the address value

Classes

Address

Methods

toBuffer() → {Buffer}

Return the raw public key bytes for this address.

Source:
Returns:
Type:
Buffer

toScAddress() → {xdr.ScAddress}

Convert this Address to an xdr.ScAddress type.

Source:
Returns:
Type:
xdr.ScAddress

toScVal() → {xdr.ScVal}

Convert this Address to an xdr.ScVal type.

Source:
Returns:
Type:
xdr.ScVal

toString() → {string}

Serialize an address to string.

Source:
Returns:
Type:
string

(static) account(buffer) → {Address}

Creates a new account Address object from a buffer of raw bytes.

Source:
Parameters:
Name Type Description
buffer Buffer

The bytes of an address to parse.

Returns:
Type:
Address

(static) claimableBalance(buffer) → {Address}

Creates a new claimable balance Address object from a buffer of raw bytes.

Source:
Parameters:
Name Type Description
buffer Buffer

The bytes of a claimable balance ID to parse.

Returns:
Type:
Address

(static) contract(buffer) → {Address}

Creates a new contract Address object from a buffer of raw bytes.

Source:
Parameters:
Name Type Description
buffer Buffer

The bytes of an address to parse.

Returns:
Type:
Address

(static) fromScAddress(scAddress) → {Address}

Convert this from an xdr.ScAddress type

Source:
Parameters:
Name Type Description
scAddress xdr.ScAddress

The xdr.ScAddress type to parse

Returns:
Type:
Address

(static) fromScVal(scVal) → {Address}

Convert this from an xdr.ScVal type.

Source:
Parameters:
Name Type Description
scVal xdr.ScVal

The xdr.ScVal type to parse

Returns:
Type:
Address

(static) fromString(address) → {Address}

Parses a string and returns an Address object.

Source:
Parameters:
Name Type Description
address string

The address to parse. ex. GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA

Returns:
Type:
Address

(static) liquidityPool(buffer) → {Address}

Creates a new liquidity pool Address object from a buffer of raw bytes.

Source:
Parameters:
Name Type Description
buffer Buffer

The bytes of an LP ID to parse.

Returns:
Type:
Address

(static) muxedAccount(buffer) → {Address}

Creates a new muxed account Address object from a buffer of raw bytes.

Source:
Parameters:
Name Type Description
buffer Buffer

The bytes of an address to parse.

Returns:
Type:
Address