PaymentCallBuilder

PaymentCallBuilder

new PaymentCallBuilder(serverUrl)

Creates a new PaymentCallBuilder pointed to server defined by serverUrl.

Do not create this object directly, use Server#payments.

Parameters:
Name Type Description
serverUrl string

Horizon server URL.

Source:
See:

Extends

Methods

call() → {Promise}

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

Inherited From:
Source:
Returns:
Type
Promise

cursor(cursor)

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

Parameters:
Name Type Description
cursor string

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

Inherited From:
Source:
See:

forAccount(accountId) → {PaymentCallBuilder}

This endpoint responds with a collection of Payment operations where the given account was either the sender or receiver.

Parameters:
Name Type Description
accountId string

For example: GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD

Source:
See:
Returns:
Type
PaymentCallBuilder

forLedger(sequence) → {PaymentCallBuilder}

This endpoint represents all payment operations that are part of a valid transactions in a given ledger.

Parameters:
Name Type Description
sequence number | string

Ledger sequence

Source:
See:
Returns:
Type
PaymentCallBuilder

forTransaction(transactionId) → {PaymentCallBuilder}

This endpoint represents all payment operations that are part of a given transaction.

Parameters:
Name Type Description
transactionId string

Transaction ID

Source:
See:
Returns:
Type
PaymentCallBuilder

limit(number)

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

Parameters:
Name Type Description
number number

Number of records the server should return.

Inherited From:
Source:
See:

order(direction)

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

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

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.

Parameters:
Name Type Attributes Description
options object <optional>

EventSource options.

Properties
Name Type Attributes Description
onmessage function <optional>

Callback function to handle incoming messages.

onerror function <optional>

Callback function to handle errors.

Inherited From:
Source:
See:
Returns:

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

Type
function