Skip to main content

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

ParameterTypeRequiredDescription
requestTypeStringYesMust be set to getAllTrades.
chainintYesTarget sovereign BetaChain ID.
timestampintNoFilter trades executed at or after this blockchain timestamp. Default: 0.
firstIndexintNoZero-based start index for pagination. Default: 0.
lastIndexintNoEnd index for pagination. Default: -1 (returns all trades).
includeTotemInfobooleanNoIf 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 CodeCause / Description
INCORRECT_CHAINInvalid or inactive BetaChain ID specified.
INCORRECT_TIMESTAMPProvided timestamp parameter is non-numeric or negative.