Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinanceProvider ¶
type BinanceProvider struct {
// contains filtered or unexported fields
}
BinanceProvider defines an Oracle provider implemented by the Binance public API.
REF: https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md
func NewBinanceProvider ¶
func NewBinanceProvider() *BinanceProvider
func NewBinanceProviderWithTimeout ¶
func NewBinanceProviderWithTimeout(timeout time.Duration) *BinanceProvider
func (BinanceProvider) GetTickerPrices ¶
type BinanceTickerResponse ¶
type BinanceTickerResponse struct { Symbol string `json:"symbol"` Price string `json:"price"` Code int `json:"code"` Msg string `json:"msg"` }
BinanceTickerResponse defines the response structure of a Binance ticker request.
type KrakenProvider ¶
type KrakenProvider struct {
// contains filtered or unexported fields
}
KrakenProvider defines an Oracle provider implemented by the Kraken public API.
REF: https://docs.kraken.com/rest/
func NewKrakenProvider ¶
func NewKrakenProvider() *KrakenProvider
func NewKrakenProviderWithTimeout ¶
func NewKrakenProviderWithTimeout(timeout time.Duration) *KrakenProvider
func (KrakenProvider) GetTickerPrices ¶
type KrakenTickerPair ¶
type KrakenTickerPair struct {
C []string `json:"c"`
}
KrakenTickerPair defines the structure returned from Kraken for a ticker query.
Note, we only care about 'c', which is the last trade closed [<price>, <lot volume>].
type KrakenTickerResponse ¶
type KrakenTickerResponse struct { Error []interface{} Result map[string]KrakenTickerPair }
KrakenTickerResponse defines the response structure of a Kraken ticker request. The response may contain one or more tickers.