TransactionCallBuilder

TransactionCallBuilder

TransactionCallBuilder

Constructor

new TransactionCallBuilder(serverUrl)

Source:
See:
Parameters:
Name Type Description
serverUrl string

Horizon server URL.

Extends

Methods

call() → {Promise}

Triggers a HTTP request using this builder's current configuration.

Inherited From:
Source:
Returns:
Type:
Promise

a Promise that resolves to the server's response.

cursor(cursor) → {object}

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

Inherited From:
Source:
See:
Parameters:
Name Type Description
cursor string

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

Returns:
Type:
object

current CallBuilder instance

forAccount(accountId) → {TransactionCallBuilder}

This endpoint represents all transactions that affected a given account.

Source:
See:
Parameters:
Name Type Description
accountId string

For example: GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD

Returns:
Type:
TransactionCallBuilder

current TransactionCallBuilder instance

forLedger(sequence) → {TransactionCallBuilder}

This endpoint represents all transactions in a given ledger.

Source:
See:
Parameters:
Name Type Description
sequence number | string

Ledger sequence

Returns:
Type:
TransactionCallBuilder

current TransactionCallBuilder instance

includeFailed(value) → {TransactionCallBuilder}

Adds a parameter defining whether to include failed transactions. By default only successful transactions are returned.

Source:
Parameters:
Name Type Description
value bool

Set to true to include failed transactions.

Returns:
Type:
TransactionCallBuilder

current TransactionCallBuilder instance

limit(number) → {object}

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

Inherited From:
Source:
See:
Parameters:
Name Type Description
number number

Number of records the server should return.

Returns:
Type:
object

current CallBuilder instance

order(direction) → {object}

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

Inherited From:
Source:
Parameters:
Name Type Description
direction "asc" | "desc"

Sort direction

Returns:
Type:
object

current CallBuilder instance

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.

Inherited From:
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.

transaction(transactionId) → {TransactionCallBuilder}

The transaction details endpoint provides information on a single transaction. The transaction hash provided in the hash argument specifies which transaction to load.

Source:
See:
Parameters:
Name Type Description
transactionId string

Transaction ID

Returns:
Type:
TransactionCallBuilder

current TransactionCallBuilder instance