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:
BaseService
,TradeService
-
Field Summary
Fields inherited from class org.knowm.xchange.ripple.service.RippleBaseService
rippleAuthenticated, ripplePublic
Fields inherited from class org.knowm.xchange.service.BaseExchangeService
exchange
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
cancelOrder
(String orderId) cancels order with matching orderId (conveniance method, typical just delegate to cancelOrder(CancelOrderByIdParams))boolean
cancelOrder
(CancelOrderParams orderParams) cancels order with matching orderParamsCreateOpenOrdersParams
object specific to this exchange.CreateTradeHistoryParams
object specific to this exchange.The additional data map of an order will be populated withinvalid @link
RippleExchange.DATA_BASE_COUNTERPARTY
invalid @link
RippleExchange.DATA_COUNTER_COUNTERPARTY
getOpenOrders
(OpenOrdersParams params) Gets the open ordersgetTradeHistory
(TradeHistoryParams params) Ripple trade history is a request intensive process.placeLimitOrder
(LimitOrder order) Place a limit orderMethods 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
verifyOrder, verifyOrder, verifyOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.knowm.xchange.service.trade.TradeService
cancelAllOrders, changeOrder, getOpenPositions, getOrder, getOrder, getRequiredCancelOrderParamClasses, getRequiredOrderQueryParamClass, placeMarketOrder, placeStopOrder, verifyOrder, verifyOrder
-
Constructor Details
-
RippleTradeService
-
-
Method Details
-
getOpenOrders
The additional data map of an order will be populated withinvalid @link
RippleExchange.DATA_BASE_COUNTERPARTY
invalid @link
RippleExchange.DATA_COUNTER_COUNTERPARTY
- Specified by:
getOpenOrders
in interfaceTradeService
- Returns:
- the open orders, null if some sort of error occurred. Implementers should log the error.
- Throws:
IOException
- - Indication that a networking error occurred while fetching JSON data
-
getOpenOrders
Description copied from interface:TradeService
Gets the open orders- Specified by:
getOpenOrders
in interfaceTradeService
- Parameters:
params
- The parameters describing the filter. Note thatOpenOrdersParams
is an empty interface. Exchanges should implement its own params object. Params should be create withTradeService.createOpenOrdersParams()
.- Returns:
- the open orders, null if some sort of error occurred. Implementers should log the error.
- Throws:
IOException
- - Indication that a networking error occurred while fetching JSON data
-
placeLimitOrder
Description copied from interface:TradeService
Place a limit orderIf your orders amount or limit price does to meet the restrictions dictated by
InstrumentMetaData
then the exchange will reject your order. UseOrderValuesHelper
to validate and / or adjust those values while you'r building an order.- Specified by:
placeLimitOrder
in interfaceTradeService
- Parameters:
order
- this should be a RippleLimitOrder object with the base and counter counterparties populated for any currency other than XRP.- Returns:
- the order ID
- Throws:
IOException
- - Indication that a networking error occurred while fetching JSON data- See Also:
-
cancelOrder
Description copied from interface:TradeService
cancels order with matching orderId (conveniance method, typical just delegate to cancelOrder(CancelOrderByIdParams))- Specified by:
cancelOrder
in interfaceTradeService
- Returns:
- true if order was successfully cancelled, false otherwise.
- Throws:
IOException
- - Indication that a networking error occurred while fetching JSON data
-
cancelOrder
Description copied from interface:TradeService
cancels order with matching orderParams- Specified by:
cancelOrder
in interfaceTradeService
- Returns:
- true if order was successfully cancelled, false otherwise.
- Throws:
IOException
- - Indication that a networking error occurred while fetching JSON data
-
getTradeHistory
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 interfaceTradeService
- Parameters:
params
- Can optionally implement , , , ,TradeHistoryParamPaging
, ,TradeHistoryParamsTimeSpan
. All other TradeHistoryParams types will be ignored.- Returns:
- UserTrades as returned by the exchange API
- Throws:
IOException
- - Indication that a networking error occurred while fetching JSON data- See Also:
-
createTradeHistoryParams
Description copied from interface:TradeService
CreateTradeHistoryParams
object specific to this exchange. Object created by this method may be used to discover supported and requiredTradeService.getTradeHistory(TradeHistoryParams)
parameters and should be passed only to the method in the same class as the createTradeHistoryParams that created the object.- Specified by:
createTradeHistoryParams
in interfaceTradeService
-
createOpenOrdersParams
Description copied from interface:TradeService
CreateOpenOrdersParams
object specific to this exchange. Object created by this method may be used to discover supported and requiredTradeService.getOpenOrders(OpenOrdersParams)
parameters and should be passed only to the method in the same class as the createOpenOrdersParams that created the object.- Specified by:
createOpenOrdersParams
in interfaceTradeService
-