Class RippleTradeService

  • All Implemented Interfaces:
    org.knowm.xchange.service.BaseService, org.knowm.xchange.service.trade.TradeService

    public class RippleTradeService
    extends RippleTradeServiceRaw
    implements org.knowm.xchange.service.trade.TradeService
    • Constructor Detail

      • RippleTradeService

        public RippleTradeService​(RippleExchange exchange)
    • Method Detail

      • getOpenOrders

        public org.knowm.xchange.dto.trade.OpenOrders getOpenOrders()
                                                             throws IOException
        The additional data map of an order will be populated with RippleExchange.DATA_BASE_COUNTERPARTY if the base currency is not XRP, similarly if the counter currency is not XRP then RippleExchange.DATA_COUNTER_COUNTERPARTY will be populated.
        Specified by:
        getOpenOrders in interface org.knowm.xchange.service.trade.TradeService
        Throws:
        IOException
      • getOpenOrders

        public org.knowm.xchange.dto.trade.OpenOrders getOpenOrders​(org.knowm.xchange.service.trade.params.orders.OpenOrdersParams params)
                                                             throws IOException
        Specified by:
        getOpenOrders in interface org.knowm.xchange.service.trade.TradeService
        Throws:
        IOException
      • placeLimitOrder

        public String placeLimitOrder​(org.knowm.xchange.dto.trade.LimitOrder order)
                               throws IOException
        Specified by:
        placeLimitOrder in interface org.knowm.xchange.service.trade.TradeService
        Parameters:
        order - this should be a RippleLimitOrder object with the base and counter counterparties populated for any currency other than XRP.
        Throws:
        IOException
      • cancelOrder

        public boolean cancelOrder​(String orderId)
                            throws IOException
        Specified by:
        cancelOrder in interface org.knowm.xchange.service.trade.TradeService
        Throws:
        IOException
      • cancelOrder

        public boolean cancelOrder​(org.knowm.xchange.service.trade.params.CancelOrderParams orderParams)
                            throws IOException
        Specified by:
        cancelOrder in interface org.knowm.xchange.service.trade.TradeService
        Throws:
        IOException
      • getTradeHistory

        public org.knowm.xchange.dto.trade.UserTrades getTradeHistory​(org.knowm.xchange.service.trade.params.TradeHistoryParams params)
                                                               throws IOException
        Ripple trade history is a request intensive process. The REST API does not provide a simple single trade history query. Trades are retrieved by querying account notifications and for those of type order details of the hash are then queried. These order detail queries could be order entry, cancel or execution, it is not possible to tell from the notification. Therefore if an account is entering many orders but executing few of them, this trade history query will result in many API calls without returning any trade history. In order to reduce the time and resources used in these repeated calls In order to reduce the number of API calls a number of different methods can be used:
        • RippleTradeHistoryHashLimit set the to the last known trade, this query will then terminate once it has been found.
        • RippleTradeHistoryCount set the to restrict the number of trades to return, the default is RippleTradeHistoryCount.DEFAULT_TRADE_COUNT_LIMIT.
        • RippleTradeHistoryCount set the to restrict the number of API calls that will be made during a single trade history query, the default is RippleTradeHistoryCount.DEFAULT_API_CALL_COUNT.
        • TradeHistoryParamsTimeSpan set the TradeHistoryParamsTimeSpan.setStartTime(java.util.Date) to limit the number of trades searched for to those done since the given start time. TradeHistoryParamsTimeSpan
        Specified by:
        getTradeHistory in interface org.knowm.xchange.service.trade.TradeService
        Parameters:
        params - Can optionally implement , , , , TradeHistoryParamPaging, , TradeHistoryParamsTimeSpan. All other TradeHistoryParams types will be ignored.
        Throws:
        IOException
      • createTradeHistoryParams

        public RippleTradeHistoryParams createTradeHistoryParams()
        Specified by:
        createTradeHistoryParams in interface org.knowm.xchange.service.trade.TradeService
      • createOpenOrdersParams

        public org.knowm.xchange.service.trade.params.orders.OpenOrdersParams createOpenOrdersParams()
        Specified by:
        createOpenOrdersParams in interface org.knowm.xchange.service.trade.TradeService