Documentation ¶
Index ¶
- Constants
- func GetPrices() ([]PricePair, []Currency, error)
- func GetWhiteBitPrices() ([]PricePair, []Currency, error)
- func InitClients(withBinance bool, binanceKey string, binanceSecret string) (err error)
- type BinanceClient
- type Currency
- type Observer
- type PricePair
- type TickerResponse
- type WhitebitClient
Constants ¶
View Source
const ( BinancePairLTCBTC = "LTCBTC" BinancePairWBTCETH = "WBTCETH" BinancePairBTCUSDT = "BTCUSDT" BinancePairLTCUSDT = "LTCUSDT" BinancePairETHUSDT = "ETHUSDT" BinancePairETHUSDC = "ETHUSDC" BinancePairBTCUSDC = "BTCUSDC" BinancePairETHBTC = "ETHBTC" BinancePairDCRBTC = "DCRBTC" BinancePairXLMBTC = "XLMBTC" BinancePairEOSBTC = "EOSBTC" BinancePairZECBTC = "ZECBTC" BinancePairBNBBTC = "BNBBTC" BinancePairADABTC = "ADABTC" BinancePairXTZBTC = "XTZBTC" BinancePairATOMBTC = "ATOMBTC" BinancePairZRXBTC = "ZRXBTC" )
View Source
const ( PairXSNBTC = "XSN_BTC" PairXSNLTC = "XSN_LTC" PairLTCBTC = "LTC_BTC" PairETHBTC = "ETH_BTC" PairDCRBTC = "DCR_BTC" PairXLMBTC = "XLM_BTC" PairEOSBTC = "EOS_BTC" PairZECBTC = "ZEC_BTC" PairBNBBTC = "BNB_BTC" PairADABTC = "ADA_BTC" PairXTZBTC = "XTZ_BTC" PairATOMBTC = "ATOM_BTC" PairZRXBTC = "ZRX_BTC" PairETHUSDT = "ETH_USDT" PairBTCUSDT = "BTC_USDT" PairETHUSDC = "ETH_USDC" PairBTCUSDC = "BTC_USDC" PairBTCETH = "BTC_ETH" PairWBTCETH = "WBTC_ETH" CurrencyXSN = "XSN" CurrencyWBTC = "WBTC" CurrencyBTC = "BTC" CurrencyLTC = "LTC" CurrencyETH = "ETH" CurrencyDCR = "DCR" CurrencyXLM = "XLM" CurrencyEOS = "EOS" CurrencyZEC = "ZEC" CurrencyBNB = "BNB" CurrencyADA = "ADA" CurrencyXTZ = "XTZ" CurrencyATOM = "ATOM" CurrencyZRX = "ZRX" CurrencyUSDT = "USDT" CurrencyUSDC = "USDC" SourceBinance = "Binance" SourceWhitebit = "Whitebit" )
View Source
const ( WhiteBitHost = "https://whitebit.com" WhiteBiTickerRoute = "/api/v1/public/tickers" WhiteBitPairXSNUSDT = "XSN_USDT" WhiteBitPairBTCUSDT = "BTC_USDT" WhiteBitPairETHUSDT = "ETH_USDT" )
Variables ¶
This section is empty.
Functions ¶
func GetWhiteBitPrices ¶
Types ¶
type BinanceClient ¶
type BinanceClient struct {
// contains filtered or unexported fields
}
func NewBinanceClient ¶
func NewBinanceClient(apiKey string, secret string) (*BinanceClient, error)
func (*BinanceClient) GetPairs ¶
func (b *BinanceClient) GetPairs(symbols []string) ([]binance.SymbolPrice, error)
type Observer ¶
type Observer struct { *BinanceClient *WhitebitClient Ticker time.Duration WithBinance bool }
var O Observer
type TickerResponse ¶
type TickerResponse struct { Success bool `json:"success"` Message string `json:"message"` Result struct { ETHBTC struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"ETH_BTC"` BTCUSD struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"BTC_USD"` ETHUSD struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"ETH_USD"` LTCBTC struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"LTC_BTC"` LTCETH struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"LTC_ETH"` LTCUSD struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"LTC_USD"` BCHRUB struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"BCH_RUB"` USDTUAH struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"USDT_UAH"` USDTUSD struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"USDT_USD"` USDTEUR struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"USDT_EUR"` BTCTUSD struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"BTC_TUSD"` ETHTUSD struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"ETH_TUSD"` BTCUSDC struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"BTC_USDC"` ETHUSDC struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"ETH_USDC"` DAIUSDT struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"DAI_USDT"` BTCUSDT struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"BTC_USDT"` XSNUSDT struct { At int `json:"at"` Ticker struct { Bid string `json:"bid"` Ask string `json:"ask"` Low string `json:"low"` High string `json:"high"` Last string `json:"last"` Vol string `json:"vol"` Deal string `json:"deal"` Change string `json:"change"` } `json:"ticker"` } `json:"XSN_USDT"` } `json:"result"` }
type WhitebitClient ¶
func NewWhitebitClient ¶
func NewWhitebitClient(apiHost string) *WhitebitClient
func (*WhitebitClient) GetTicker ¶
func (w *WhitebitClient) GetTicker() (TickerResponse, error)
Click to show internal directories.
Click to hide internal directories.