Package org.knowm.xchange.ripple.service
Class RippleTradeService
- java.lang.Object
-
- org.knowm.xchange.service.BaseExchangeService
-
- org.knowm.xchange.ripple.service.RippleBaseService
-
- org.knowm.xchange.ripple.service.RippleTradeServiceRaw
-
- org.knowm.xchange.ripple.service.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
-
-
Field Summary
-
Fields inherited from class org.knowm.xchange.ripple.service.RippleBaseService
rippleAuthenticated, ripplePublic
-
-
Constructor Summary
Constructors Constructor Description RippleTradeService(RippleExchange exchange)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancelOrder(String orderId)booleancancelOrder(org.knowm.xchange.service.trade.params.CancelOrderParams orderParams)org.knowm.xchange.service.trade.params.orders.OpenOrdersParamscreateOpenOrdersParams()RippleTradeHistoryParamscreateTradeHistoryParams()org.knowm.xchange.dto.trade.OpenOrdersgetOpenOrders()The additional data map of an order will be populated withRippleExchange.DATA_BASE_COUNTERPARTYif the base currency is not XRP, similarly if the counter currency is not XRP thenRippleExchange.DATA_COUNTER_COUNTERPARTYwill be populated.org.knowm.xchange.dto.trade.OpenOrdersgetOpenOrders(org.knowm.xchange.service.trade.params.orders.OpenOrdersParams params)org.knowm.xchange.dto.trade.UserTradesgetTradeHistory(org.knowm.xchange.service.trade.params.TradeHistoryParams params)Ripple trade history is a request intensive process.StringplaceLimitOrder(org.knowm.xchange.dto.trade.LimitOrder order)-
Methods inherited from class org.knowm.xchange.ripple.service.RippleTradeServiceRaw
cancelOrder, clearOrderDetailsStore, getExpectedBaseTransferFee, getExpectedCounterTransferFee, getExpectedTransferFee, getNotifications, getOpenAccountOrders, getTrade, getTradesForAccount, getTransactionFee, placeOrder
-
Methods inherited from class org.knowm.xchange.service.BaseExchangeService
getClientConfig, verifyOrder, verifyOrder, verifyOrder
-
-
-
-
Constructor Detail
-
RippleTradeService
public RippleTradeService(RippleExchange exchange)
-
-
Method Detail
-
getOpenOrders
public org.knowm.xchange.dto.trade.OpenOrders getOpenOrders() throws IOExceptionThe additional data map of an order will be populated withRippleExchange.DATA_BASE_COUNTERPARTYif the base currency is not XRP, similarly if the counter currency is not XRP thenRippleExchange.DATA_COUNTER_COUNTERPARTYwill be populated.- Specified by:
getOpenOrdersin interfaceorg.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:
getOpenOrdersin interfaceorg.knowm.xchange.service.trade.TradeService- Throws:
IOException
-
placeLimitOrder
public String placeLimitOrder(org.knowm.xchange.dto.trade.LimitOrder order) throws IOException
- Specified by:
placeLimitOrderin interfaceorg.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:
cancelOrderin interfaceorg.knowm.xchange.service.trade.TradeService- Throws:
IOException
-
cancelOrder
public boolean cancelOrder(org.knowm.xchange.service.trade.params.CancelOrderParams orderParams) throws IOException- Specified by:
cancelOrderin interfaceorg.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 IOExceptionRipple 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:
getTradeHistoryin interfaceorg.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:
createTradeHistoryParamsin interfaceorg.knowm.xchange.service.trade.TradeService
-
createOpenOrdersParams
public org.knowm.xchange.service.trade.params.orders.OpenOrdersParams createOpenOrdersParams()
- Specified by:
createOpenOrdersParamsin interfaceorg.knowm.xchange.service.trade.TradeService
-
-