Skip to content

Get Buy / Sell Offers

Get currency buy or sell offers given a currency ID and/or an account ID in order of rate (if sortByRate is true for expected offers, otherwise in the expected order of execution).

Request:

  • requestType is one of getBuyOffers, getSellOffers, getExpectedBuyOffers or getExpectedSellOffers, where expected offers are from the unconfirmed transactions pool or are phased transactions scheduled to finish in the next block
  • currency is the currency ID (optional)
  • account is the account ID (optional if currency provided)
  • availableOnly is true to include only offers with non-zero supply and limit, but is ignored when both currency and account are given (optional, does not apply to expected offers)
  • sortByRate is true to sort by rate (optional, applies only to expected offers, which are returned in expected order of execution by default)
  • firstIndex is a zero-based index to the first offer to retrieve (optional, does not apply to expected offers)
  • lastIndex is a zero-based index to the last offer to retrieve (optional, does not apply to expected offers)
  • requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
  • requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

Response:

  • offers (A) is an array of buy or sell offer objects (refer to Get Offers for details) with the following additional field only for an expected offer:
    • phased (B) is true if the offer is phased, false otherwise
  • lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
  • requestProcessingTime (N) is the API request processing time (in millisec)