new OfferCallBuilder(serverUrl)
Creates a new OfferCallBuilder pointed to server defined by serverUrl. Do not create this object directly, use Server#offers.
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
serverUrl |
string
|
Horizon server URL. |
Extends
Methods
buying(asset) → {OfferCallBuilder}
Returns all offers buying an asset.
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
asset |
Asset
|
For example: |
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(id) → {OfferCallBuilder}
Returns all offers where the given account is involved.
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
For example: |
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)`.
- Inherited From:
- Source:
Parameters:
Name | Type | Description |
---|---|---|
endpoint |
string
|
neighbor endpoint in question, like /operations |
param |
string
|
filter parameter, like an operation ID |
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.
- Inherited From:
- Source:
Parameters:
Name | Type | Description |
---|---|---|
"include" |
join Records to be included in the response. |
Returns:
- Type:
-
object
current CallBuilder instance.
limit(recordsNumber) → {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 |
---|---|---|
recordsNumber |
number
|
Number of records the server should return. |
Returns:
- Type:
-
object
current CallBuilder instance
offer(offerId) → {CallBuilder.<ServerApi.OfferRecord>}
The offer details endpoint provides information on a single offer. The offer ID provided in the id argument specifies which offer to load.
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
offerId |
string
|
Offer ID |
Returns:
- Type:
-
CallBuilder.<ServerApi.OfferRecord>
CallBuilder<ServerApi.OfferRecord> OperationCallBuilder 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
seller(seller) → {OfferCallBuilder}
This endpoint filters offers where the given account is the seller.
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
seller |
string
|
For example: |
selling(asset) → {OfferCallBuilder}
Returns all offers selling an asset.
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
asset |
Asset
|
For example: |
sponsor(id) → {OfferCallBuilder}
This endpoint filters offers where the given account is sponsoring the offer entry.
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
For example: |
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.
|
Returns:
- Type:
-
function
Close function. Run to close the connection and stop listening for new events.