Package org.knowm.xchange
Class BaseExchange
java.lang.Object
org.knowm.xchange.BaseExchange
- All Implemented Interfaces:
Exchange
- Direct Known Subclasses:
AscendexExchange
,BankeraExchange
,BiboxExchange
,BinanceExchange
,BitbayExchange
,BitbayExchange
,BitcoinAverageExchange
,BitcoinChartsExchange
,BitcoinCoreWallet
,BitcoindeExchange
,BitcoindeExchange
,BitcointoyouExchange
,BitfinexExchange
,BitflyerExchange
,BithumbExchange
,BitmexExchange
,BitsoExchange
,BitstampExchange
,BittrexExchange
,BityExchange
,BitZExchange
,Bl3pExchange
,BleutradeExchange
,BlockchainExchange
,BTCCExchange
,BTCMarketsExchange
,BTCTurkExchange
,BybitExchange
,CCEXExchange
,CexIOExchange
,CmcExchange
,CoinbaseExchange
,CoinbaseExchange
,CoinbaseProExchange
,CoincheckExchange
,CoindealExchange
,CoindirectExchange
,CoinEggExchange
,CoinexExchange
,CoinfloorExchange
,CoingiExchange
,CoinjarExchange
,CoinMarketCapExchange
,CoinmateExchange
,CoinoneExchange
,CryptoFacilitiesExchange
,CryptowatchExchange
,DeribitExchange
,DVChainExchange
,dydxExchange
,EnigmaExchange
,ExmoExchange
,FtxExchange
,GateioExchange
,GeminiExchange
,GlobitexExchange
,HitbtcExchange
,HuobiExchange
,IdexExchange
,IndependentReserveExchange
,ItBitExchange
,KoineksExchange
,KoinimExchange
,KrakenExchange
,KucoinExchange
,KunaExchange
,LatokenExchange
,LgoExchange
,LivecoinExchange
,LunoExchange
,LykkeExchange
,MercadoBitcoinExchange
,MEXCExchange
,OERExchange
,OkCoinExchange
,OkexExchange
,OkexExchangeV3
,ParibuExchange
,PaymiumExchange
,PoloniexExchange
,QuoineExchange
,RippleExchange
,SerumExchange
,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
Fields inherited from interface org.knowm.xchange.Exchange
USE_SANDBOX
-
Constructor Summary
Constructors Constructor Description BaseExchange()
-
Method Summary
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 dataList<Instrument>
getExchangeInstruments()
Returns a list of CurrencyPair objects.ExchangeMetaData
getExchangeMetaData()
The Meta Data defining some semi-static properties of an exchange such as currency pairs, trading fees, etc.ExchangeSpecification
getExchangeSpecification()
MarketDataService
getMarketDataService()
A market data service typically consists of a regularly updated list of the available prices for the various symbolsString
getMetaDataFileName(ExchangeSpecification exchangeSpecification)
si.mazi.rescu.SynchronizedValueFactory<Long>
getNonceFactory()
The nonce factory used to create a nonce value.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, getResilienceRegistries
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
exchangeSpecification
-
exchangeMetaData
-
marketDataService
-
tradeService
-
accountService
-
-
Constructor Details
-
BaseExchange
public BaseExchange()
-
-
Method Details
-
initServices
protected abstract void initServices() -
applySpecification
Description copied from interface:Exchange
Applies any exchange specific parameters- Specified by:
applySpecification
in interfaceExchange
- Parameters:
exchangeSpecification
- TheExchangeSpecification
-
remoteInit
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
-
getNonceFactory
Description copied from interface:Exchange
The nonce factory used to create a nonce value. Allows services to accept a placeholder that is replaced with generated value just before message is serialized and sent. If a method of a rest accepts ValueFactory as a parameter, it's evaluated, the message is serialized and sent in a single synchronized block.- Specified by:
getNonceFactory
in interfaceExchange
- Returns:
- Synchronized value factory
-
loadExchangeMetaData
-
loadMetaData
-
getExchangeInstruments
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:
getExchangeInstruments
in interfaceExchange
- Returns:
- The exchange's symbols
-
getMetaDataFileName
-
getExchangeSpecification
- Specified by:
getExchangeSpecification
in interfaceExchange
- Returns:
- The ExchangeSpecification in use for this exchange
-
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
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
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
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
-
toString
-