com.xeiam.xchange.mercadobitcoin.MercadoBitcoinUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-mercadobitcoin Show documentation
Show all versions of xchange-mercadobitcoin Show documentation
XChange implementation for the Mercado Bitcoin Exchange
The newest version!
package com.xeiam.xchange.mercadobitcoin;
import com.xeiam.xchange.currency.Currencies;
import com.xeiam.xchange.currency.CurrencyPair;
import com.xeiam.xchange.dto.trade.LimitOrder;
import com.xeiam.xchange.exceptions.NotAvailableFromExchangeException;
/**
* @author Felipe Micaroni Lalli
*/
public final class MercadoBitcoinUtils {
private MercadoBitcoinUtils() {
}
/**
* Return something like btc_brl:83948239
*/
public static String makeMercadoBitcoinOrderId(CurrencyPair currencyPair, String orderId) {
String pair;
if (currencyPair.equals(CurrencyPair.BTC_BRL)) {
pair = "btc_brl";
} else if (currencyPair.equals(new CurrencyPair(Currencies.LTC, Currencies.BRL))) {
pair = "ltc_brl";
} else {
throw new NotAvailableFromExchangeException();
}
return pair + ":" + orderId;
}
/**
* @see #makeMercadoBitcoinOrderId(com.xeiam.xchange.currency.CurrencyPair, String)
*/
public static String makeMercadoBitcoinOrderId(LimitOrder limitOrder) {
return makeMercadoBitcoinOrderId(limitOrder.getCurrencyPair(), limitOrder.getId());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy