use of org.knowm.xchange.bitstamp.BitstampAuthenticatedV2 in project XChange by knowm.
the class BitstampTradeService method placeMarketOrder.
@Override
public String placeMarketOrder(MarketOrder order) throws IOException, BitstampException {
BitstampAuthenticatedV2.Side side = order.getType().equals(BID) ? BitstampAuthenticatedV2.Side.buy : BitstampAuthenticatedV2.Side.sell;
BitstampOrder bitstampOrder = placeBitstampMarketOrder(order.getCurrencyPair(), side, order.getOriginalAmount());
if (bitstampOrder.getErrorMessage() != null) {
throw new ExchangeException(bitstampOrder.getErrorMessage());
}
return Long.toString(bitstampOrder.getId());
}
use of org.knowm.xchange.bitstamp.BitstampAuthenticatedV2 in project XChange by knowm.
the class BitstampTradeService method placeLimitOrder.
@Override
public String placeLimitOrder(LimitOrder order) throws IOException, BitstampException {
BitstampAuthenticatedV2.Side side = order.getType().equals(BID) ? BitstampAuthenticatedV2.Side.buy : BitstampAuthenticatedV2.Side.sell;
BitstampOrder bitstampOrder = placeBitstampOrder(order.getCurrencyPair(), side, order.getOriginalAmount(), order.getLimitPrice());
if (bitstampOrder.getErrorMessage() != null) {
throw new ExchangeException(bitstampOrder.getErrorMessage());
}
return Long.toString(bitstampOrder.getId());
}
Aggregations