Constructor
new Server(serverURL, optsopt)
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
serverURL |
string
|
Frontier Server URL (ex. |
|||||||||
opts |
object
|
<optional> |
|
Methods
accounts() → {AccountCallBuilder}
Returns new AccountCallBuilder object configured by a current Frontier server configuration.
- Source:
Returns:
- Type:
-
AccountCallBuilder
assets() → {AssetsCallBuilder}
Returns new AssetsCallBuilder object configured with the current Frontier server configuration.
- Source:
Returns:
- Type:
-
AssetsCallBuilder
effects() → {EffectCallBuilder}
Returns new EffectCallBuilder object configured with the current Frontier server configuration.
- Source:
Returns:
- Type:
-
EffectCallBuilder
ledgers() → {LedgerCallBuilder}
Returns new LedgerCallBuilder object configured by a current Frontier server configuration.
- Source:
Returns:
- Type:
-
LedgerCallBuilder
loadAccount(accountId) → {Promise}
Fetches an account's most current state in the ledger and then creates and returns an Account object.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
accountId |
string
|
The account to load. |
Returns:
- Type:
-
Promise
Returns a promise to the AccountResponse object with populated sequence number.
offers(resource, …resourceParams)
People on the DigitalBits network can make offers to buy or sell assets. This endpoint represents all the offers a particular account makes. Currently this method only supports querying offers for account and should be used like this:
server.offers('accounts', accountId).call()
.then(function(offers) {
console.log(offers);
});
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
resource |
string
|
Resource to query offers |
|
resourceParams |
string
|
<repeatable> |
Parameters for selected resource |
Returns:
OfferCallBuilder
operations() → {OperationCallBuilder}
Returns new OperationCallBuilder object configured by a current Frontier server configuration.
- Source:
Returns:
- Type:
-
OperationCallBuilder
orderbook(selling, buying) → {OrderbookCallBuilder}
Returns new OrderbookCallBuilder object configured by a current Frontier server configuration.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
selling |
Asset
|
Asset being sold |
buying |
Asset
|
Asset being bought |
Returns:
- Type:
-
OrderbookCallBuilder
paths(source, destination, destinationAsset, destinationAmount)
The DigitalBits Network allows payments to be made between assets through path payments. A path payment specifies a series of assets to route a payment through, from source asset (the asset debited from the payer) to destination asset (the asset credited to the payee).
A path search is specified using:
- The destination address
- The source address
- The asset and amount that the destination account should receive
As part of the search, frontier will load a list of assets available to the source address and will find any payment paths from those source assets to the desired destination asset. The search's amount parameter will be used to determine if there a given path can satisfy a payment of the desired amount.
Returns new PathCallBuilder object configured with the current Frontier server configuration.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
source |
string
|
The sender's account ID. Any returned path will use a source that the sender can hold. |
destination |
string
|
The destination account ID that any returned path should use. |
destinationAsset |
Asset
|
The destination asset. |
destinationAmount |
string
|
The amount, denominated in the destination asset, that any returned path should be able to satisfy. |
Returns:
payments() → {PaymentCallBuilder}
Returns new PaymentCallBuilder object configured with the current Frontier server configuration.
- Source:
Returns:
- Type:
-
PaymentCallBuilder
submitTransaction(transaction) → {Promise}
Submits a transaction to the network.
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
transaction |
Transaction
|
The transaction to submit. |
Returns:
- Type:
-
Promise
Promise that resolves or rejects with response from frontier.
tradeAggregation(base, counter, start_time, end_time, resolution) → {TradeAggregationCallBuilder}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
base |
Asset
|
base aseet |
counter |
Asset
|
counter asset |
start_time |
long
|
lower time boundary represented as millis since epoch |
end_time |
long
|
upper time boundary represented as millis since epoch |
resolution |
long
|
segment duration as millis since epoch. *Supported values are 5 minutes (300000), 15 minutes (900000), 1 hour (3600000), 1 day (86400000) and 1 week (604800000). Returns new TradeAggregationCallBuilder object configured with the current Frontier server configuration. |
Returns:
trades() → {TradesCallBuilder}
Returns new TradesCallBuilder object configured by a current Frontier server configuration.
- Source:
Returns:
- Type:
-
TradesCallBuilder
transactions() → {TransactionCallBuilder}
Returns new TransactionCallBuilder object configured by a current Frontier server configuration.
- Source:
Returns:
- Type:
-
TransactionCallBuilder