public class RippleTradeService extends RippleTradeServiceRaw implements PollingTradeService
rippleAuthenticated, ripplePublic
exchange
Constructor and Description |
---|
RippleTradeService(RippleExchange exchange) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancelOrder(String orderId)
cancels order with matching orderId
|
RippleTradeHistoryParams |
createTradeHistoryParams()
Create
TradeHistoryParams object specific to this exchange. |
OpenOrders |
getOpenOrders()
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. |
UserTrades |
getTradeHistory(Object... arguments)
Search through the last
RippleTradeHistoryParams.DEFAULT_PAGE_LENGTH notifications looking for a maximum of
RippleTradeHistoryCount.DEFAULT_TRADE_COUNT_LIMIT trades. |
UserTrades |
getTradeHistory(TradeHistoryParams params)
Ripple trade history is a request intensive process.
|
String |
placeLimitOrder(LimitOrder order)
Place a limit order
|
String |
placeMarketOrder(MarketOrder order)
Place a market order
|
cancelOrder, clearOrderDetailsStore, getExpectedBaseTransferFee, getExpectedCounterTransferFee, getExpectedTransferFee, getNotifications, getOpenAccountOrders, getOrderDetails, getTradesForAccount, getTransactionFee, placeOrder
getExchangeSymbols, verifyOrder, verifyOrder, verifyOrder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
verifyOrder, verifyOrder
getExchangeSymbols
public RippleTradeService(RippleExchange exchange)
public OpenOrders getOpenOrders() throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException
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.getOpenOrders
in interface PollingTradeService
ExchangeException
- - Indication that the exchange reported some kind of error with the request or responseNotAvailableFromExchangeException
- - Indication that the exchange does not support the requested function or dataNotYetImplementedForExchangeException
- - Indication that the exchange supports the requested function or data, but it has not yet been
implementedIOException
- - Indication that a networking error occurred while fetching JSON datapublic String placeMarketOrder(MarketOrder order) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException
PollingTradeService
placeMarketOrder
in interface PollingTradeService
ExchangeException
- - Indication that the exchange reported some kind of error with the request or responseNotAvailableFromExchangeException
- - Indication that the exchange does not support the requested function or dataNotYetImplementedForExchangeException
- - Indication that the exchange supports the requested function or data, but it has not yet been
implementedIOException
- - Indication that a networking error occurred while fetching JSON datapublic String placeLimitOrder(LimitOrder order) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException
PollingTradeService
placeLimitOrder
in interface PollingTradeService
order
- this should be a RippleLimitOrder object with the base and counter counterparties populated for any currency other than XRP.ExchangeException
- - Indication that the exchange reported some kind of error with the request or responseNotAvailableFromExchangeException
- - Indication that the exchange does not support the requested function or dataNotYetImplementedForExchangeException
- - Indication that the exchange supports the requested function or data, but it has not yet been
implementedIOException
- - Indication that a networking error occurred while fetching JSON datapublic boolean cancelOrder(String orderId) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException
PollingTradeService
cancelOrder
in interface PollingTradeService
ExchangeException
- - Indication that the exchange reported some kind of error with the request or responseNotAvailableFromExchangeException
- - Indication that the exchange does not support the requested function or dataNotYetImplementedForExchangeException
- - Indication that the exchange supports the requested function or data, but it has not yet been
implementedIOException
- - Indication that a networking error occurred while fetching JSON datapublic UserTrades getTradeHistory(Object... arguments) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException
RippleTradeHistoryParams.DEFAULT_PAGE_LENGTH
notifications looking for a maximum of
RippleTradeHistoryCount.DEFAULT_TRADE_COUNT_LIMIT
trades. If an account enters many orders and receives few executions then it is likely
that this query will return no trades. See getTradeHistory(TradeHistoryParams)
for details of how to structure the query to fit your use
case.getTradeHistory
in interface PollingTradeService
arguments
- these are ignored.ExchangeException
- - Indication that the exchange reported some kind of error with the request or responseNotAvailableFromExchangeException
- - Indication that the exchange does not support the requested function or dataNotYetImplementedForExchangeException
- - Indication that the exchange supports the requested function or data, but it has not yet been
implementedIOException
- - Indication that a networking error occurred while fetching JSON datapublic UserTrades getTradeHistory(TradeHistoryParams params) throws IOException
RippleTradeHistoryHashLimit#setHashLimit(String)
to the last known trade, this query will
then terminate once it has been found.RippleTradeHistoryCount#setTradeCountLimit(int)
to restrict the number of trades to return,
the default is RippleTradeHistoryCount.DEFAULT_TRADE_COUNT_LIMIT
.RippleTradeHistoryCount#setApiCallCountLimit(int)
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.setStartTime(java.util.Date)
to limit the number of trades
searched for to those done since the given start time.getTradeHistory
in interface PollingTradeService
params
- Can optionally implement , , ,
, TradeHistoryParamPaging
, ,
TradeHistoryParamsTimeSpan
. All other TradeHistoryParams types will be ignored.IOException
- - Indication that a networking error occurred while fetching JSON dataPollingTradeService.getTradeHistory(Object...)
,
PollingTradeService.createTradeHistoryParams()
,
TradeHistoryParamsAll
public RippleTradeHistoryParams createTradeHistoryParams()
PollingTradeService
TradeHistoryParams
object specific to this exchange. Object created by this method may be used to discover supported and required
PollingTradeService.getTradeHistory(TradeHistoryParams)
parameters and should be passed only to the method in the same class as the createTradeHistoryParams
that created the object.createTradeHistoryParams
in interface PollingTradeService
Copyright © 2012–2017 Xeiam, LLC. All rights reserved.