# private new ClaimableBalanceCallBuilder(serverUrl)
Parameters:
Name | Type | Description |
---|---|---|
serverUrl |
string
|
Horizon server URL. |
Extends
Members
# private _handleNetworkError
# private _parseRecord
Given the json response, find and convert each link into a function that calls that link.
# private _parseResponse
# private _requestFnForLink
Convert a link object to a function that fetches that link.
# private _toCollectionPage
# private checkFilter
Methods
# asset(asset) → {ClaimableBalanceCallBuilder}
Returns all claimable balances which provide a balance for the given asset.
Parameters:
Name | Type | Description |
---|---|---|
asset |
Asset
|
The Asset held by the claimable balance |
current ClaimableBalanceCallBuilder instance
# call() → {Promise}
Triggers a HTTP request using this builder's current configuration.
a Promise that resolves to the server's response.
Promise
# claimableBalance(claimableBalanceId) → {CallBuilder.<ServerApi.ClaimableBalanceRecord>}
The claimable balance details endpoint provides information on a single claimable balance.
Parameters:
Name | Type | Description |
---|---|---|
claimableBalanceId |
string
|
Claimable balance ID |
CallBuilder<ServerApi.ClaimableBalanceRecord> OperationCallBuilder instance
CallBuilder.<ServerApi.ClaimableBalanceRecord>
# claimant(claimant) → {ClaimableBalanceCallBuilder}
Returns all claimable balances which can be claimed by the given account ID.
Parameters:
Name | Type | Description |
---|---|---|
claimant |
string
|
For example: |
current ClaimableBalanceCallBuilder instance
# cursor(cursor) → {object}
Sets cursor
parameter for 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. |
- Overrides:
- See:
current CallBuilder instance
object
# protected forEndpoint(endpoint, param) → {CallBuilder}
A helper method to craft queries to "neighbor" endpoints.
For example, we have an /effects
suffix endpoint on many different
"root" endpoints, such as /transactions/:id
and /accounts/:id
. So,
it's helpful to be able to conveniently create queries to the
/accounts/:id/effects
endpoint:
this.forEndpoint("accounts", accountId)`.
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string
|
neighbor endpoint in question, like /operations |
param |
string
|
filter parameter, like an operation ID |
this CallBuilder instance
# join("include") → {object}
Sets join
parameter for the current call. The join
parameter
includes the requested resource in the response. Currently, the
only valid value for the parameter is transactions
and is only
supported on the operations and payments endpoints. The response
will include a transaction
field for each operation in the
response.
Parameters:
Name | Type | Description |
---|---|---|
"include" |
join Records to be included in the response. |
current CallBuilder instance.
object
# limit(recordsNumber) → {object}
Sets limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.
Parameters:
Name | Type | Description |
---|---|---|
recordsNumber |
number
|
Number of records the server should return. |
- Overrides:
- See:
current CallBuilder instance
object
# order(direction) → {object}
Sets order
parameter for the current call. Returns the CallBuilder object on which this method has been called.
Parameters:
Name | Type | Description |
---|---|---|
direction |
"asc"
|
"desc"
|
Sort direction |
current CallBuilder instance
object
# sponsor(sponsor) → {ClaimableBalanceCallBuilder}
Returns all claimable balances which are sponsored by the given account ID.
Parameters:
Name | Type | Description |
---|---|---|
sponsor |
string
|
For example: |
current ClaimableBalanceCallBuilder 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.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
object
|
<optional> |
EventSource options. |
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. |
- Overrides:
- See:
Close function. Run to close the connection and stop listening for new events.
function