Address

Address

Create a new Address object.

Address represents a single address in the Stellar network. An address can represent an account or a contract.

Constructor

new Address(address)

Source:
Parameters:
Name Type Description
address string

ID of the account (ex. GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA). If you provide a muxed account address, this will throw; use MuxedAccount instead.

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) 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