Package org.knowm.xchange
Class BaseExchange
- java.lang.Object
-
- org.knowm.xchange.BaseExchange
-
- All Implemented Interfaces:
Exchange
- Direct Known Subclasses:
BankeraExchange
,BiboxExchange
,BinanceExchange
,BitbayExchange
,BitbayExchange
,BitcoinAverageExchange
,BitcoinChartsExchange
,BitcoinCoreWallet
,BitcoindeExchange
,BitcoindeExchange
,BitcoiniumExchange
,BitcointoyouExchange
,BitfinexExchange
,BitflyerExchange
,BithumbExchange
,BitmexExchange
,BitsoExchange
,BitstampExchange
,BittrexExchange
,BityExchange
,BitZExchange
,Bl3pExchange
,BleutradeExchange
,BlockchainExchange
,BTCCExchange
,BTCMarketsExchange
,BTCTradeExchange
,BTCTurkExchange
,CCEXExchange
,CexIOExchange
,CmcExchange
,CobinhoodExchange
,CoinbaseExchange
,CoinbaseExchange
,CoinbaseProExchange
,CoinbeneExchange
,CoindealExchange
,CoindirectExchange
,CoinEggExchange
,CoinexExchange
,CoinfloorExchange
,CoingiExchange
,CoinjarExchange
,CoinMarketCapExchange
,CoinmateExchange
,CoinoneExchange
,CoinsuperExchange
,CryptoFacilitiesExchange
,CryptopiaExchange
,CryptowatchExchange
,DeribitExchange
,DragonexExchange
,DsxExchange
,DVChainExchange
,EnigmaExchange
,ExmoExchange
,EXXExchange
,FCoinExchange
,GateioExchange
,GeminiExchange
,GlobitexExchange
,HitbtcExchange
,HuobiExchange
,IdexExchange
,IndependentReserveExchange
,ItBitExchange
,KoineksExchange
,KoinimExchange
,KrakenExchange
,KucoinExchange
,KunaExchange
,LakeBTCExchange
,LatokenExchange
,LgoExchange
,LivecoinExchange
,LunoExchange
,LykkeExchange
,MercadoBitcoinExchange
,OERExchange
,OkCoinExchange
,OkexExchangeV3
,ParibuExchange
,PaymiumExchange
,PoloniexExchange
,QuoineExchange
,RippleExchange
,SimulatedExchange
,TheRockExchange
,TradeOgreExchange
,TrueFxExchange
,UpbitExchange
,VaultoroExchange
,YoBitExchange
,ZaifExchange
public abstract class BaseExchange extends Object implements Exchange
-
-
Field Summary
Fields Modifier and Type Field Description protected AccountService
accountService
protected ExchangeMetaData
exchangeMetaData
protected ExchangeSpecification
exchangeSpecification
protected org.slf4j.Logger
logger
protected MarketDataService
marketDataService
protected TradeService
tradeService
-
Constructor Summary
Constructors Constructor Description BaseExchange()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
applySpecification(ExchangeSpecification exchangeSpecification)
Applies any exchange specific parametersAccountService
getAccountService()
An account service typically provides access to the user's private exchange dataExchangeMetaData
getExchangeMetaData()
The Meta Data defining some semi-static properties of an exchange such as currency pairs, trading fees, etc.ExchangeSpecification
getExchangeSpecification()
List<CurrencyPair>
getExchangeSymbols()
Returns a list of CurrencyPair objects.MarketDataService
getMarketDataService()
A market data service typically consists of a regularly updated list of the available prices for the various symbolsString
getMetaDataFileName(ExchangeSpecification exchangeSpecification)
TradeService
getTradeService()
An trade service typically provides access to trading functionalityprotected abstract void
initServices()
protected void
loadExchangeMetaData(InputStream is)
protected <T> T
loadMetaData(InputStream is, Class<T> type)
void
remoteInit()
Initialize this instance with the remote meta data.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.knowm.xchange.Exchange
getDefaultExchangeSpecification, getExchangeInstruments, getNonceFactory, getResilienceRegistries
-
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
-
exchangeSpecification
protected ExchangeSpecification exchangeSpecification
-
exchangeMetaData
protected ExchangeMetaData exchangeMetaData
-
marketDataService
protected MarketDataService marketDataService
-
tradeService
protected TradeService tradeService
-
accountService
protected AccountService accountService
-
-
Method Detail
-
initServices
protected abstract void initServices()
-
applySpecification
public void applySpecification(ExchangeSpecification exchangeSpecification)
Description copied from interface:Exchange
Applies any exchange specific parameters- Specified by:
applySpecification
in interfaceExchange
- Parameters:
exchangeSpecification
- TheExchangeSpecification
-
remoteInit
public void remoteInit() throws IOException, ExchangeException
Description copied from interface:Exchange
Initialize this instance with the remote meta data. Most exchanges require this method to be called beforeExchange.getExchangeMetaData()
. Some exchanges require it before using some of their services.- Specified by:
remoteInit
in interfaceExchange
- Throws:
IOException
ExchangeException
-
loadExchangeMetaData
protected void loadExchangeMetaData(InputStream is)
-
loadMetaData
protected <T> T loadMetaData(InputStream is, Class<T> type)
-
getExchangeSymbols
public List<CurrencyPair> getExchangeSymbols()
Description copied from interface:Exchange
Returns a list of CurrencyPair objects. This list can either come originally from a loaded json file or from a remote call if the implementation override's the `remoteInit` method.- Specified by:
getExchangeSymbols
in interfaceExchange
- Returns:
- The exchange's symbols
-
getMetaDataFileName
public String getMetaDataFileName(ExchangeSpecification exchangeSpecification)
-
getExchangeSpecification
public ExchangeSpecification getExchangeSpecification()
- Specified by:
getExchangeSpecification
in interfaceExchange
- Returns:
- The ExchangeSpecification in use for this exchange
-
getExchangeMetaData
public ExchangeMetaData getExchangeMetaData()
Description copied from interface:Exchange
The Meta Data defining some semi-static properties of an exchange such as currency pairs, trading fees, etc.- Specified by:
getExchangeMetaData
in interfaceExchange
- Returns:
- The exchange's meta data
-
getMarketDataService
public MarketDataService getMarketDataService()
Description copied from interface:Exchange
A market data service typically consists of a regularly updated list of the available prices for the various symbolsThis is the non-streaming (blocking) version of the service
- Specified by:
getMarketDataService
in interfaceExchange
- Returns:
- The exchange's market data service
-
getTradeService
public TradeService getTradeService()
Description copied from interface:Exchange
An trade service typically provides access to trading functionalityTypically access is restricted by a secret API key and/or username password authentication which are usually provided in the
ExchangeSpecification
- Specified by:
getTradeService
in interfaceExchange
- Returns:
- The exchange's trade service
-
getAccountService
public AccountService getAccountService()
Description copied from interface:Exchange
An account service typically provides access to the user's private exchange dataTypically access is restricted by a secret API key and/or username password authentication which are usually provided in the
ExchangeSpecification
- Specified by:
getAccountService
in interfaceExchange
- Returns:
- The exchange's account service
-
-