People on the HcNet can make offers to buy or sell assets. When an offer is fully or partially fulfilled, a trade happens.
Trades can be filtered for specific orderbook, defined by an asset pair: base and counter.
This endpoint can also be used in streaming mode, making it possible to listen for new trades as they occur on the Hashcash network. If called in streaming mode Aurora will start at the earliest known trade unless a cursor is set. In that case it will start from the cursor. You can also set cursor value to now to only stream trades created since your request time.
GET /trades?base_asset_type={base_asset_type}&base_asset_code={base_asset_code}&base_asset_issuer={base_asset_issuer}&counter_asset_type={counter_asset_type}&counter_asset_code={counter_asset_code}&counter_asset_issuer={counter_asset_issuer}
Arguments
Name | Notes | Description | Example |
---|---|---|---|
base_asset_type | optional, string | Type of base asset | native |
base_asset_code | optional, string | Code of base asset, not required if type is native | USD |
base_asset_issuer | optional, string | Issuer of base asset, not required if type is native | ‘GA2HGBJIJKI6O4XEM7CZWY5PS6GKSXL6D34ERAJYQSPYA6X6AI7HYW36’ |
counter_asset_type | optional, string | Type of counter asset | credit_alphanum4 |
counter_asset_code | optional, string | Code of counter asset, not required if type is native | BTC |
counter_asset_issuer | optional, string | Issuer of counter asset, not required if type is native | ‘GD6VWBXI6NY3AOOR55RLVQ4MNIDSXE5JSAVXUTF35FRRI72LYPI3WL6Z’ |
offer_id | optional, string | filter for by a specific offer id | 283606 |
?cursor | optional, any, default null | A paging token, specifying where to start returning records from. | 12884905984 |
?order | optional, string, default asc | The order in which to return rows, “asc” or “desc”. | asc |
?limit | optional, number, default: 10 | Maximum number of records to return. | 200 |
Response
The list of trades. base and counter in the records will match the asset pair filter order. If an asset pair is not specified, the order is arbitrary.
{
"_links" : {
"self" : {
"href" : "/trades?base_asset_type=native\u0026counter_asset_code=BTCHCX\u0026counter_asset_issuer=GA2UAQA75KMZUA6OM44C2ITX7L2AIGTFRPGQGURWOMJKV55V2TTSORBJ\u0026counter_asset_type=credit_alphanum12\u0026cursor=\u0026limit=2\u0026order=desc"
},
"next" : {
"href" : "/trades?base_asset_type=native\u0026counter_asset_code=BTCHCX\u0026counter_asset_issuer=GA2UAQA75KMZUA6OM44C2ITX7L2AIGTFRPGQGURWOMJKV55V2TTSORBJ\u0026counter_asset_type=credit_alphanum12\u0026cursor=\u0026limit=2\u0026order=desc"
},
"prev" : {
"href" : "/trades?base_asset_type=native\u0026counter_asset_code=BTCHCX\u0026counter_asset_issuer=GA2UAQA75KMZUA6OM44C2ITX7L2AIGTFRPGQGURWOMJKV55V2TTSORBJ\u0026counter_asset_type=credit_alphanum12\u0026cursor=\u0026limit=2\u0026order=asc"
}
},
"_embedded" : {
"records" : []
}
}
Support Agent
*Powered by HashCash