Class BitfinexAdapters
java.lang.Object
org.knowm.xchange.bitfinex.service.BitfinexAdapters
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
adaptBitfinexCurrency
(String bitfinexSymbol) static CurrencyPair
adaptCurrencyPair
(String bitfinexSymbol) static String
static String
adaptCurrencyPairsToTickersParam
(Collection<CurrencyPair> currencyPairs) static Map<Instrument,
Fee> adaptDynamicTradingFees
(BitfinexTradingFeeResponse[] responses, List<Instrument> currencyPairs) Each element in the response array contains a set of currencies that are at a given fee tier.static FixedRateLoanOrder
adaptFixedRateLoanOrder
(String currency, BigDecimal amount, int dayPeriod, String direction, String id, BigDecimal rate) static List<FixedRateLoanOrder>
adaptFixedRateLoanOrders
(BitfinexLendLevel[] orders, String currency, String orderType, String id) static FloatingRateLoanOrder
adaptFloatingRateLoanOrder
(String currency, BigDecimal amount, int dayPeriod, String direction, String id, BigDecimal rate) static List<FloatingRateLoanOrder>
adaptFloatingRateLoanOrders
(BitfinexLendLevel[] orders, String currency, String orderType, String id) static List<FundingRecord>
adaptFundingHistory
(List<Movement> movementHistorys) static List<FundingRecord>
adaptFundingHistory
(BitfinexDepositWithdrawalHistoryResponse[] bitfinexDepositWithdrawalHistoryResponses) static ExchangeMetaData
adaptMetaData
(List<CurrencyPair> currencyPairs, ExchangeMetaData metaData) static ExchangeMetaData
adaptMetaData
(BitfinexAccountFeesResponse accountFeesResponse, int platformStatus, boolean platformStatusPresent, ExchangeMetaData metaData) static ExchangeMetaData
adaptMetaData
(BitfinexAccountInfosResponse[] bitfinexAccountInfos, ExchangeMetaData exchangeMetaData) static ExchangeMetaData
adaptMetaData
(ExchangeMetaData exchangeMetaData, List<BitfinexSymbolDetail> symbolDetails, Map<CurrencyPair, BigDecimal> lastPrices) Flipped order of arguments to avoid type-erasure clash withadaptMetaData(List, ExchangeMetaData)
static LimitOrder
adaptOrder
(BigDecimal originalAmount, BigDecimal price, CurrencyPair currencyPair, Order.OrderType orderType, Date timestamp) static OrderBook
adaptOrderBook
(BitfinexDepth btceDepth, CurrencyPair currencyPair) static BitfinexOrderType
adaptOrders
(BitfinexLevel[] bitfinexLevels, CurrencyPair currencyPair, Order.OrderType orderType) static OpenOrders
adaptOrders
(BitfinexOrderStatusResponse[] activeOrders) static Order.OrderStatus
static String
static Trade
adaptPublicTrade
(BitfinexPublicTrade trade, CurrencyPair currencyPair) static Trades
adaptPublicTrades
(BitfinexPublicTrade[] trades, CurrencyPair currencyPair) static Ticker
adaptTicker
(BitfinexTicker bitfinexTicker, CurrencyPair currencyPair) static Ticker
adaptTicker
(BitfinexTicker bitfinexTicker) static Trade
adaptTrade
(BitfinexTrade trade, CurrencyPair currencyPair) static UserTrades
adaptTradeHistory
(BitfinexTradeResponse[] trades, String symbol) static UserTrades
adaptTradeHistoryV2
(List<Trade> trades) static Trades
adaptTrades
(BitfinexTrade[] trades, CurrencyPair currencyPair) adaptWallets
(BitfinexBalancesResponse[] response) static BitfinexTicker[]
adoptBitfinexTickers
(List<com.fasterxml.jackson.databind.node.ArrayNode> tickers)
-
Field Details
-
log
public static final org.slf4j.Logger log
-
-
Method Details
-
adaptDynamicTradingFees
public static Map<Instrument,Fee> adaptDynamicTradingFees(BitfinexTradingFeeResponse[] responses, List<Instrument> currencyPairs) Each element in the response array contains a set of currencies that are at a given fee tier. The API returns the fee per currency in each tier and does not make any promises that they are all the same, so this adapter will use the fee per currency instead of the fee per tier. -
adaptBitfinexCurrency
-
adaptOrderType
-
adaptOrderFlagsToType
-
adaptCurrencyPair
-
adaptOrderStatus
-
adaptCurrencyPair
-
adaptOrderBook
-
adaptOrders
public static BitfinexAdapters.OrdersContainer adaptOrders(BitfinexLevel[] bitfinexLevels, CurrencyPair currencyPair, Order.OrderType orderType) -
adaptOrder
public static LimitOrder adaptOrder(BigDecimal originalAmount, BigDecimal price, CurrencyPair currencyPair, Order.OrderType orderType, Date timestamp) -
adaptFixedRateLoanOrders
public static List<FixedRateLoanOrder> adaptFixedRateLoanOrders(BitfinexLendLevel[] orders, String currency, String orderType, String id) -
adaptFixedRateLoanOrder
public static FixedRateLoanOrder adaptFixedRateLoanOrder(String currency, BigDecimal amount, int dayPeriod, String direction, String id, BigDecimal rate) -
adaptFloatingRateLoanOrders
public static List<FloatingRateLoanOrder> adaptFloatingRateLoanOrders(BitfinexLendLevel[] orders, String currency, String orderType, String id) -
adaptFloatingRateLoanOrder
public static FloatingRateLoanOrder adaptFloatingRateLoanOrder(String currency, BigDecimal amount, int dayPeriod, String direction, String id, BigDecimal rate) -
adaptTrade
-
adaptTrades
-
adaptTicker
-
adaptWallets
-
adaptOrders
-
adaptTradeHistory
-
adaptTradeHistoryV2
-
adaptMetaData
public static ExchangeMetaData adaptMetaData(List<CurrencyPair> currencyPairs, ExchangeMetaData metaData) -
adaptMetaData
public static ExchangeMetaData adaptMetaData(ExchangeMetaData exchangeMetaData, List<BitfinexSymbolDetail> symbolDetails, Map<CurrencyPair, BigDecimal> lastPrices) Flipped order of arguments to avoid type-erasure clash withadaptMetaData(List, ExchangeMetaData)
- Parameters:
exchangeMetaData
- The exchange metadata provided from bitfinex.json.symbolDetails
- The symbol data fetced from Bitfinex.- Returns:
- The combined result.
-
adaptMetaData
public static ExchangeMetaData adaptMetaData(BitfinexAccountFeesResponse accountFeesResponse, int platformStatus, boolean platformStatusPresent, ExchangeMetaData metaData) -
adaptMetaData
public static ExchangeMetaData adaptMetaData(BitfinexAccountInfosResponse[] bitfinexAccountInfos, ExchangeMetaData exchangeMetaData) -
adaptFundingHistory
-
adaptFundingHistory
public static List<FundingRecord> adaptFundingHistory(BitfinexDepositWithdrawalHistoryResponse[] bitfinexDepositWithdrawalHistoryResponses) -
adaptCurrencyPairsToTickersParam
-
adaptTicker
-
adaptPublicTrade
-
adaptPublicTrades
-
adoptBitfinexTickers
public static BitfinexTicker[] adoptBitfinexTickers(List<com.fasterxml.jackson.databind.node.ArrayNode> tickers) throws IOException - Throws:
IOException
-