if (!(type.startsWith("buy") || type.startsWith("sell"))) {
return null;
}
final OrderType orderType = type.startsWith("buy") ? OrderType.BID : OrderType.ASK;
final CurrencyPair currencyPair = adaptCurrencyPair(transaction.getMarket());
final BigDecimal amount;
final BigDecimal money;
final int scale;
if (currencyPair.equals(CurrencyPair.BTC_CNY)) {
amount = transaction.getBtcAmount().abs();
money = transaction.getCnyAmount().abs();
scale = BTCChinaExchange.CNY_SCALE;
}
else if (currencyPair.equals(CurrencyPair.LTC_CNY)) {
amount = transaction.getLtcAmount().abs();
money = transaction.getCnyAmount().abs();
scale = BTCChinaExchange.CNY_SCALE;
}
else if (currencyPair.equals(CurrencyPair.LTC_BTC)) {
amount = transaction.getLtcAmount().abs();
money = transaction.getBtcAmount().abs();
scale = BTCChinaExchange.BTC_SCALE;
}
else {