getAskOrders
Retrieves sorted open sell-side (ask) orders for a specific Totem and payment currency pair resting on a BetaChain order book, sorted in Price-Time Priority (ascending price).
Endpoint Details
- HTTP Method:
POST - Gateway Path:
/nxt - Content-Type:
application/x-www-form-urlencoded - API Tags:
AE - Chain Specific: Yes
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
requestType | String | Yes | Must be set to getAskOrders. |
totem | long / String | Yes | Unique -bit identifier of the Totem being sold. |
currency | long / String | Yes | Unique -bit identifier of the target payment currency. |
chain | int | Yes | Sovereign BetaChain ID. |
firstIndex | int | No | Zero-based start index for pagination. Default: 0. |
lastIndex | int | No | End index for pagination. Default: -1. |
showExpectedCancellations | boolean | No | If true, checks the unconfirmed transaction pool and sets "expectedCancellation": true on orders pending cancellation. Default: false. |
Example Request
curl -X POST http://localhost:22024/nxt \
-d "requestType=getAskOrders" \
-d "chain=2" \
-d "totem=9876543210123456789" \
-d "currency=5544332211" \
-d "firstIndex=0" \
-d "lastIndex=10" \
-d "showExpectedCancellations=true"
Successful Response
{
"askOrders": [
{
"order": "88492019481029384",
"totem": "9876543210123456789",
"currency": "5544332211",
"account": "1234567890123456789",
"accountRS": "SHAMWARI-ABCD-EFGH-JKLM-NOPQR",
"quantityQNT": "1000000",
"priceNQT": "50000",
"height": 500120,
"expectedCancellation": true
}
]
}
Error Codes
| Error Code | Cause / Description |
|---|---|
UNKNOWN_TOTEM | Totem ID does not exist on the network. |
UNKNOWN_CURRENCY | Currency ID does not exist on the specified BetaChain. |
INCORRECT_CHAIN | Invalid or inactive BetaChain ID specified. |