use of org.knowm.xchange.bibox.dto.trade.BiboxTradeCommand in project XChange by knowm.
the class BiboxTradeServiceRaw method placeBiboxMarketOrder.
public String placeBiboxMarketOrder(MarketOrder marketOrder) {
try {
BiboxTradeCommand cmd = new BiboxTradeCommand(BiboxAdapters.toBiboxPair(marketOrder.getCurrencyPair()), BiboxAccountType.REGULAR.asInt(), BiboxOrderType.MARKET_ORDER.asInt(), BiboxOrderSide.fromOrderType(marketOrder.getType()).asInt(), true, null, marketOrder.getOriginalAmount(), null);
BiboxSingleResponse<String> response = bibox.trade(BiboxCommands.of(cmd).json(), apiKey, signatureCreator);
throwErrors(response);
return response.get().getResult();
} catch (BiboxException e) {
throw new ExchangeException(e.getMessage());
}
}
use of org.knowm.xchange.bibox.dto.trade.BiboxTradeCommand in project XChange by knowm.
the class BiboxTradeServiceRaw method placeBiboxLimitOrder.
public String placeBiboxLimitOrder(LimitOrder limitOrder) {
try {
BiboxTradeCommand cmd = new BiboxTradeCommand(BiboxAdapters.toBiboxPair(limitOrder.getCurrencyPair()), BiboxAccountType.REGULAR.asInt(), BiboxOrderType.LIMIT_ORDER.asInt(), BiboxOrderSide.fromOrderType(limitOrder.getType()).asInt(), true, limitOrder.getLimitPrice(), limitOrder.getOriginalAmount(), null);
BiboxSingleResponse<String> response = bibox.trade(BiboxCommands.of(cmd).json(), apiKey, signatureCreator);
throwErrors(response);
return response.get().getResult();
} catch (BiboxException e) {
throw new ExchangeException(e.getMessage());
}
}
Aggregations