AccountCallBuilder

AccountCallBuilder

AccountCallBuilder

Constructor

new AccountCallBuilder(serverUrl)

Source:
See:
Parameters:
Name Type Description
serverUrl string

Horizon server URL.

Extends

Methods

accountId(id) → {AccountCallBuilder}

Returns information and links relating to a single account. The balances section in the returned JSON will also list all the trust lines this account has set up.

Source:
See:
Parameters:
Name Type Description
id string

For example: GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD

Returns:
Type:
AccountCallBuilder

call() → {Promise}

Triggers a HTTP request using this builder's current configuration. Returns a Promise that resolves to the server's response.

Overrides:
Source:
Returns:
Type:
Promise

cursor(cursor)

Sets cursor parameter for the current call. Returns the CallBuilder object on which this method has been called.

Overrides:
Source:
See:
Parameters:
Name Type Description
cursor string

A cursor is a value that points to a specific location in a collection of resources.

limit(number)

Sets limit parameter for the current call. Returns the CallBuilder object on which this method has been called.

Overrides:
Source:
See:
Parameters:
Name Type Description
number number

Number of records the server should return.

order(direction)

Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.

Overrides:
Source:
Parameters:
Name Type Description
direction "asc" | "desc"

stream(optionsopt) → {function}

Creates an EventSource that listens for incoming messages from the server. To stop listening for new events call the function returned by this method.

Overrides:
Source:
See:
Parameters:
Name Type Attributes Description
options object <optional>

EventSource options.

Name Type Attributes Description
onmessage function <optional>

Callback function to handle incoming messages.

onerror function <optional>

Callback function to handle errors.

reconnectTimeout number <optional>

Custom stream connection timeout in ms, default is 15 seconds.

Returns:
Type:
function

Close function. Run to close the connection and stop listening for new events.