Obtaining Order Status

An API is provided to obtain order status for all offers created by a given address. When obtaining order status, it is recommended to keep track of the latest update time since the last call to obtain order status and to obtain orders in ascending sort order. In this way order status can be queried to only retrieve the orders that had changed status since the last call. This is especially important since the API returns completed orders and thus order history for interacting with a contract grows indefinitely.

Aphelion REST API call

Order status can be obtained for any past created order by issuing an http GET:


URL Encoded Parameters

  • contractScriptHash (required) - the script hash of the DEX contract
    • The entries themselves are always returned in descending order by updated time.
  • after (optional) - limits to return orders after this epoch timestamp in seconds
    • This value is ignored if <= 0
    • Note: If wanting to get orders in ascending by last order update time, start with after=1, instead of after=0
  • before (optional) - limits to return orders before this epoch timestamp in seconds
    • This value is ignored if <= 0
  • sort (optional) -ASC to sort ascending and DESC to sort descending
    • This value is ignored if both after and before parameters are <= 0 or not present, in that case the sort order is sorted descending by order creation time (as opposed to order update time)
    • Note: By default when this value is not present the items are sorted descending
  • pageSize (optional) - max number of orders statuses to return in the result (defaults to 100)
  • limit (optional) - limit price
    • Only offers that meet the given limit price will be returned form the call.