getAllTrades
Retrieves executed trade history on a specified BetaChain order book, filtered by optional minimum block timestamp and embedded Totem details.
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 getAllTrades. |
chain | int | Yes | Target sovereign BetaChain ID. |
timestamp | int | No | Filter trades executed at or after this blockchain timestamp. Default: 0. |
firstIndex | int | No | Zero-based start index for pagination. Default: 0. |
lastIndex | int | No | End index for pagination. Default: -1 (returns all trades). |
includeTotemInfo | boolean | No | If true, embeds complete Totem metadata into each trade JSON record. Default: false. |
Example Request
curl -X POST http://localhost:22024/nxt \
-d "requestType=getAllTrades" \
-d "chain=2" \
-d "timestamp=89000000" \
-d "firstIndex=0" \
-d "lastIndex=10" \
-d "includeTotemInfo=true"
Successful Response
{
"trades": [
{
"totem": "9876543210123456789",
"block": 500150,
"buyer": "9876543210987654321",
"buyerRS": "SHAMWARI-WXYZ-EFGH-JKLM-NOPQR",
"seller": "1234567890123456789",
"sellerRS": "SHAMWARI-ABCD-EFGH-JKLM-NOPQR",
"askOrder": "88492019481029384",
"bidOrder": "47382019481029384",
"quantityQNT": "100000",
"priceNQT": "50000",
"timestamp": 89234102,
"totemInfo": {
"name": "HarareRealEstateFund",
"decimals": 4,
"type": 4
}
}
]
}
Error Codes
| Error Code | Cause / Description |
|---|---|
INCORRECT_CHAIN | Invalid or inactive BetaChain ID specified. |
INCORRECT_TIMESTAMP | Provided timestamp parameter is non-numeric or negative. |