Trade For Offer

Trades for Offer

This endpoint represents all trades for a given offer.

This endpoint can also be used in streaming mode, making it possible to listen for new trades for the given offer as they occur on the HCNet. 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.

Request:-

GET /offers/{offer_id}/trades{?cursor,limit,order}

Arguments

Name Notes Description Example
offer_id required, number ID of an offer 323223
?cursor optional, any, default null A paging token, specifying where to start returning records from. When streaming this can be set to nowto stream object created since your request time. 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

This endpoint responds with a list of trades that consumed a given offer. See the trade resource for reference.

Example Streaming Event
  • {
  • _links:
  • { self: { href: '' },
  • base: { href:
  • '/accounts/GDJNMHET4DTS7HUHU7IG5DB274OSMHUYA7TRRKOD6ZABHPUW5YWJ4SUD'
  • },
  • counter:
  • { href: '/accounts/GCALYDRCCJEUPMV24TAX2N2N3IBX7NUUYZNM7I5FQS5GIEQ4A7EVKUOP' },
  • operation: { href: '/operations/47261068505915393' }
  • },
  • id: '47261068505915393-0',
  • paging_token: '47261068505915393-0',
  • ledger_close_time: '2018-09-11T19:42:04Z',
  • offer_id: '734529',
  • base_account: 'GDJNMHET4DTS7HUHU7IG5DB274OSMHUYA7TRRKOD6ZABHPUW5YWJ4SUD',
  • base_amount: '0.0175999',
  • base_asset_type: 'credit_alphanum4',
  • base_asset_code: 'BOC',
  • base_asset_issuer: 'GCTS32RGWRH6RJM62UVZ4UT5ZN5L6B2D3LPGO6Z2NM2EOGVQA7TA6SKO',
  • counter_account: 'GCALYDRCCJEUPMV24TAX2N2N3IBX7NUUYZNM7I5FQS5GIEQ4A7EVKUOP',
  • counter_amount: '0.0199998',
  • counter_asset_type: 'credit_alphanum4',
  • counter_asset_code: 'ABC',
  • counter_asset_issuer: 'GCTS32RGWRH6RJM62UVZ4UT5ZN5L6B2D3LPGO6Z2NM2EOGVQA7TA6SKO',
  • base_is_seller: true,
  • price: { n: 2840909, d: 2500000 }
  • }

curl "https://network.paybito.com/offers/1/trades"

{

"_links" : {

"self" : {

"href" : "https://network.paybito.com/offers/1/trades?cursor=\u0026limit=10\u0026order=asc"

},

"next" : {

"href" : "https://network.paybito.com/offers/1/trades?cursor=63080184680449-0\u0026limit=10\u0026order=asc"

},

"prev" : {

"href" : "https://network.paybito.com/offers/1/trades?cursor=63080184680449-0\u0026limit=10\u0026order=desc"

}

},

"_embedded" : {

"records" : [

{

"_links" : {

"self" : {

"href" : ""

},

"base" : {

"href" : "https://network.paybito.com/accounts/GAJWKTWAE254DNPNDRDAZ5VBSLPMZXXUX7ZZBS2C7K2FAC4PTXC6WJQW"

},

"counter" : {

"href" : "https://network.paybito.com/accounts/GAUQV36N4BPFR4ELDTTIK5TXJLSRSR42XIROTBIK5QOCRTJMNP4A6J2B"

},

"operation" : {

"href" : "https://network.paybito.com/operations/63080184680449"

}

},

"id" : "63080184680449-0",

"paging_token" : "63080184680449-0",

"ledger_close_time" : "2018-12-20T11:53:14Z",

"offer_id" : "1",

"base_account" : "GAJWKTWAE254DNPNDRDAZ5VBSLPMZXXUX7ZZBS2C7K2FAC4PTXC6WJQW",

"base_amount" : "100.0000981",

"base_asset_type" : "credit_alphanum12",

"base_asset_code" : "USDBCH",

"base_asset_issuer" : "GAJWKTWAE254DNPNDRDAZ5VBSLPMZXXUX7ZZBS2C7K2FAC4PTXC6WJQW",

"counter_account" : "GAUQV36N4BPFR4ELDTTIK5TXJLSRSR42XIROTBIK5QOCRTJMNP4A6J2B",

"counter_amount" : "0.9999999",

"counter_asset_type" : "credit_alphanum12",

"counter_asset_code" : "BCHUSD",

"counter_asset_issuer" : "GAUQV36N4BPFR4ELDTTIK5TXJLSRSR42XIROTBIK5QOCRTJMNP4A6J2B",

"base_is_seller" : true,

"price" :{

"n" : 3120367,

"d" : 312037037

}

}

]

}

}