GetLastTrades
Retrieves the most recent trades for specified totems.
Endpoint: GET /nxt?requestType=GetLastTrades
Parameters:
- totems (long[], required): Comma-separated list of totem IDs
- includeTotemInfo (boolean, optional, default: false): Include totem information in results
Request Example: /nxt?requestType=GetLastTrades&totems=123456789,987654321&includeTotemInfo=true
Response:
{
"trades": [
{
"timestamp": 123456789,
"quantityQNT": "100000000",
"currency": "1",
"priceQNTPerShare": "100000000",
"totem": "123456789",
"askOrderFullHash": "abc123...",
"bidOrderFullHash": "def456...",
"askOrderHeight": 123450,
"bidOrderHeight": 123455,
"seller": "111111111",
"buyer": "222222222",
"block": "1234567890",
"height": 123456,
"tradeType": "buy"
}
]
}
Response Fields:
- trades: array - Array of trade objects
- trades[].timestamp: number - Timestamp of the trade
- trades[].quantityQNT: string - Quantity traded in Quantum Units
- trades[].currency: string - Currency ID (unsigned string)
- trades[].priceQNTPerShare: string - Price per share in Quantum Units
- trades[].totem: string - Totem ID (unsigned string)
- trades[].askOrderFullHash: string - Full hash of the ask order
- trades[].bidOrderFullHash: string - Full hash of the bid order
- trades[].askOrderHeight: number - Block height of ask order placement
- trades[].bidOrderHeight: number - Block height of bid order placement
- trades[].seller: string - Seller account ID (unsigned string)
- trades[].buyer: string - Buyer account ID (unsigned string)
- trades[].block: string - Block ID (unsigned string)
- trades[].height: number - Block height where trade occurred
- trades[].tradeType: string - "buy" or "sell"
- trades[].totemInfo: object - Only if includeTotemInfo=true, contains totem details from putTotemInfo()
Source: GetLastTrades.java, JSONData.trade() Notes: Returns most recent trades for each specified totem. Ordered by timestamp. Can query by chain.