getTrades
Get trades associated with a given asset and/or account in reverse block height order.
Request:
requestType is getTrades
asset is the asset ID
account is the account ID (optional if asset provided)
firstIndex is a zero-based index to the first trade to retrieve (optional)
lastIndex is a zero-based index to the last trade to retrieve (optional)
includeAssetInfo is true if the decimals and name fields are to be included (optional)
Response:
(A) trades is the array of trade objects with the following fields for each trade:
(S)
selleris the account number of the seller(S)
quantityQNTis the quantity (in QNT) of the asset traded(S)
bidOrderis the bid order ID(S)
sellerRSis the Reed-Solomon address of the seller(S)
buyeris the account number of the buyer(S)
priceNQTis the trade price (in NQT, the ask price for a buy or the bid price for a sell)(S)
askOrderis the ask order ID(S)
buyerRSis the Reed-Solomon address of the buyer(N)
decimalsis the number of decimal places used by the asset(S)
nameis the name of the asset (if includeAssetInfo is true)(S)
blockis the block ID of the trade (if includeAssetInfo is true)(S)
assetis the asset ID(N)
askOrderHeightis the block height of the ask order(N)
bidOrderHeightis the block height of the bid order(S)
tradeTypeis the trade type (sell or buy, where buy implies that the bid occurred after the ask, or if in the same block, has a greater order ID)(N)
timestampis the timestamp (in seconds since the genesis block) of the trade block(N)
heightis the height of the trade block
(N) requestProcessingTime is the API request processing time (in millisec)
Example:
Request:
http://localhost:801/BEAM?requestType=getTrades&asset=3702027329806229573&lastIndex=2&includeAssetInfo=false
Response:
{ “trades”: [ { “seller”: “2695253629713716937”, “quantityQNT”: “7700”, “bidOrder”: “17489219850997945774”, “sellerRS”: “BEAM-7X92-29W5-6VE2-4QVTC”, “buyer”: “14676337193484961173”, “priceNQT”: “100000”, “askOrder”: “7125231493760146086”, “buyerRS”: “BEAM-7X92-29W5-6YPW-EL8DR”, “block”: “10810208340839229954”, “asset”: “3702027329806229573”, “askOrderHeight”: 504189, “tradeType”: “sell”, “timestamp”: 122140342, “height”: 504949 }, { “seller”: “13248005565246971693”, “quantityQNT”: “100000”, “bidOrder”: “6312065606850043247”, “sellerRS”: “BEAM-7X92-29W5-X6SQ-DYLQH”, “buyer”: “9582909050628712440”, “priceNQT”: “120000”, “askOrder”: “17472059594274895773”, “buyerRS”: “BEAM-7X92-29W5-45QV-APCZB”, “block”: “12097007668561592790”, “asset”: “3702027329806229573”, “askOrderHeight”: 504899, “tradeType”: “buy”, “timestamp”: 122129038, “height”: 504899 } ], “requestProcessingTime”: 1 }
Last updated