getAllOrders
Provides the all orders of the user:
import { Nectar, KLineInterval } from "@wasd3rplay/nectar-sdk";
const nectar = new Nectar();
const trades = await nectar.getAllOrders({
symbol: "ETH_ETH:USDT_ETH",
page: 1
});Parameters
symbol(optional)The market symbol
The symbol expression is a combination of
base_ticker, a colon (':'), andquote_ticker.If this value is not provided, it will retrieve the all user orders for all markets.
page(default: 1)The page number to retrieve, which should be greater than or equal to 1
Each page has 20 items
Result
The result of this method is a list of user's all orders:
e.g.
{
previous: "<url>" | null,
next: "<url>" | null,
count: 10,
results: [
{
id: 'lprgev7xpz3xdjn6',
time: 1689565830,
order_type: 0,
price: '1000000000',
symbol: 'ETH_ETH:USDT_ETH',
base_ticker: 'ETH_ETH',
quote_ticker: 'USDT_ETH',
base_ticker_display: 'ETH',
quote_ticker_display: 'USDT',
request_amount: '1000000000000000',
traded_amount: '1000000000000000',
status: 2,
tx_list: [
{
status: 4
time: 1689565843
txhash: '0xe4bef80805788337a93d207f57c78b3374d3b6d2dbdd6b92d8e0c5161a279e5b'
},
...
]
},
...
]
}previousThe URL to retrieve the previous page
If this value is null, it indicates that there is no previous page to query.
nextThe staring point of the history item as a timestamp
If this value is null, it indicates that there is no next page to query.
countThe total number of orders
resultsThe list of orders in the current page
idThe order ID
timeThe creation timestamp of the order
order_typeThe order type of the order
priceThe amount for buying or selling, expressed in the quote token
symbolThe market symbol
The symbol expression is a combination of
base_ticker, a colon (':'), andquote_ticker.
base_tickerThe base token of the market to buy or sell
The ticker expression is a combination of token symbol, an underscore('_'), and the blockchain (network) symbol. So, the above example shows that the base token is the token with the symbol
ETHprovided by Ethereum (ETH) network.
base_ticker_displayHow to display the base token in the UI
quote_tickerThe quote token of the market used to buy or sell the base token as the currency
The ticker expression is a combination of token symbol, an underscore('_'), and the blockchain (network) symbol. So, the above example shows that the quote token is the token with the symbol
USDTprovided by Ethereum (ETH) network.
quote_ticker_displayHow to display the quote token in the UI
request_amountThe desired quantity of the base token for buying or selling
traded_amountThe traded quantity of the base token
statusThe order status
tx_listThe list of blockchain transactions
statusThe transaction status
timeThe transaction creation timestamp
txhashThe transaction hash
This value can be used to verify the actual transaction on each blockchain network's block explorer website.
Order Status
CREATED = 0
CANCELLED = 1
COMPLETED = 2
PARTIAL_FILLED = 3
PROCESSING = 4Transaction Status
CREATED = 0
SENT = 1
EXECUTED = 2
FAILED = 3
CONFIRMED = 4
CANCELLED = 5