public

package
v0.0.0-...-65b99db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BINANCE_BASE_URL = "https://api.binance.com"
)
View Source
const (
	BITFLYER_BASE_URL = "https://api.bitflyer.jp/v1"
)
View Source
const (
	COBINHOOD_BASE_URL = "https://api.cobinhood.com"
)
View Source
const (
	HITBTC_BASE_URL = "https://api.hitbtc.com/api/2"
)
View Source
const (
	HUOBI_BASE_URL = "https://api.huobi.pro"
)
View Source
const (
	KUCOIN_BASE_URL = "https://api.kucoin.com"
)
View Source
const (
	LBANK_BASE_URL = "https://api.lbkex.com"
)
View Source
const (
	OKEX_BASE_URL = "https://www.okex.com"
)
View Source
const (
	P2PB2B_BASE_URL = "https://api.p2pb2b.io/api/v1"
)
View Source
const (
	POLONIEX_BASE_URL = "https://poloniex.com"
)

Variables

This section is empty.

Functions

func Precision

func Precision(numStr string) int

func RandomProxyUrl

func RandomProxyUrl(proxyUrlListGroup ProxyUrlList) func(*http.Request) (*url.URL, error)

Types

type BinanceApi

type BinanceApi struct {
	BaseURL           string
	RateCacheDuration time.Duration

	HttpClient    *http.Client
	ShrimpyClient *unified.ShrimpyApiClient
	// contains filtered or unexported fields
}

func NewBinancePublicApi

func NewBinancePublicApi() (*BinanceApi, error)

func (*BinanceApi) Board

func (h *BinanceApi) Board(trading string, settlement string) (board *models.Board, err error)

func (*BinanceApi) BoardTicker

func (h *BinanceApi) BoardTicker(trading string, settlement string) (board *models.Board, err error)

duplicated

func (*BinanceApi) CurrencyPairs

func (h *BinanceApi) CurrencyPairs() ([]models.CurrencyPair, error)

func (*BinanceApi) FrozenCurrency

func (h *BinanceApi) FrozenCurrency() ([]string, error)

func (*BinanceApi) OrderBookTickMap

func (h *BinanceApi) OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)

func (*BinanceApi) Precise

func (h *BinanceApi) Precise(trading string, settlement string) (*models.Precisions, error)

func (*BinanceApi) Rate

func (h *BinanceApi) Rate(trading string, settlement string) (float64, error)

func (*BinanceApi) RateMap

func (h *BinanceApi) RateMap() (map[string]map[string]float64, error)

func (*BinanceApi) SetTransport

func (h *BinanceApi) SetTransport(transport http.RoundTripper) error

func (*BinanceApi) Volume

func (h *BinanceApi) Volume(trading string, settlement string) (float64, error)

func (*BinanceApi) VolumeMap

func (h *BinanceApi) VolumeMap() (map[string]map[string]float64, error)

type BinanceTickResponse

type BinanceTickResponse struct {
	Trading    string
	Settlement string
	// contains filtered or unexported fields
}

type BitflyerApi

type BitflyerApi struct {
	BaseURL           string
	RateCacheDuration time.Duration
	HttpClient        http.Client
	// contains filtered or unexported fields
}

func NewBitflyerPublicApi

func NewBitflyerPublicApi() (*BitflyerApi, error)

func (*BitflyerApi) Board

func (b *BitflyerApi) Board(trading string, settlement string) (board *models.Board, err error)

func (*BitflyerApi) CurrencyPairs

func (b *BitflyerApi) CurrencyPairs() ([]models.CurrencyPair, error)

func (*BitflyerApi) FrozenCurrency

func (b *BitflyerApi) FrozenCurrency() ([]string, error)

func (*BitflyerApi) OrderBookTickMap

func (b *BitflyerApi) OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)

func (*BitflyerApi) Precise

func (h *BitflyerApi) Precise(trading string, settlement string) (*models.Precisions, error)

func (*BitflyerApi) Rate

func (b *BitflyerApi) Rate(trading string, settlement string) (float64, error)

func (*BitflyerApi) RateMap

func (b *BitflyerApi) RateMap() (map[string]map[string]float64, error)

func (*BitflyerApi) SetTransport

func (h *BitflyerApi) SetTransport(transport http.RoundTripper) error

func (*BitflyerApi) Volume

func (b *BitflyerApi) Volume(trading string, settlement string) (float64, error)

func (*BitflyerApi) VolumeMap

func (b *BitflyerApi) VolumeMap() (map[string]map[string]float64, error)

type CobinhoodApi

type CobinhoodApi struct {
	BaseURL           string
	RateCacheDuration time.Duration

	CurrencyPairsCacheDuration time.Duration

	HttpClient http.Client
	// contains filtered or unexported fields
}

func NewCobinhoodPublicApi

func NewCobinhoodPublicApi() (*CobinhoodApi, error)

func (*CobinhoodApi) Board

func (h *CobinhoodApi) Board(trading string, settlement string) (board *models.Board, err error)

func (*CobinhoodApi) CurrencyPairs

func (h *CobinhoodApi) CurrencyPairs() ([]models.CurrencyPair, error)

func (*CobinhoodApi) FrozenCurrency

func (h *CobinhoodApi) FrozenCurrency() ([]string, error)

func (*CobinhoodApi) OrderBookTickMap

func (h *CobinhoodApi) OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)

func (*CobinhoodApi) Precise

func (h *CobinhoodApi) Precise(trading string, settlement string) (*models.Precisions, error)

func (*CobinhoodApi) Rate

func (h *CobinhoodApi) Rate(trading string, settlement string) (float64, error)

func (*CobinhoodApi) RateMap

func (h *CobinhoodApi) RateMap() (map[string]map[string]float64, error)

func (*CobinhoodApi) SetTransport

func (h *CobinhoodApi) SetTransport(transport http.RoundTripper) error

func (*CobinhoodApi) Volume

func (h *CobinhoodApi) Volume(trading string, settlement string) (float64, error)

func (*CobinhoodApi) VolumeMap

func (h *CobinhoodApi) VolumeMap() (map[string]map[string]float64, error)

type CobinhoodApiConfig

type CobinhoodApiConfig struct {
}

type Currency

type Currency struct {
	ID             int     `json:"id"`
	Name           string  `json:"name"`
	TxFee          float64 `json:"txFee,string"`
	MinConf        int     `json:"minConf"`
	DepositAddress string  `json:"depositAddress"`
	Disabled       int     `json:"disabled"`
	Delisted       int     `json:"delisted"`
	Frozen         int     `json:"frozen"`
}

type HitbtcApi

type HitbtcApi struct {
	BaseURL           string
	RateCacheDuration time.Duration

	HttpClient    *http.Client
	ShrimpyClient *unified.ShrimpyApiClient
	// contains filtered or unexported fields
}

func NewHitbtcPublicApi

func NewHitbtcPublicApi() (*HitbtcApi, error)

func (*HitbtcApi) Board

func (h *HitbtcApi) Board(trading string, settlement string) (board *models.Board, err error)

func (*HitbtcApi) CurrencyPairs

func (h *HitbtcApi) CurrencyPairs() ([]models.CurrencyPair, error)

func (*HitbtcApi) FrozenCurrency

func (h *HitbtcApi) FrozenCurrency() ([]string, error)

func (*HitbtcApi) OrderBookTickMap

func (h *HitbtcApi) OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)

func (*HitbtcApi) Precise

func (h *HitbtcApi) Precise(trading string, settlement string) (*models.Precisions, error)

func (*HitbtcApi) Rate

func (h *HitbtcApi) Rate(trading string, settlement string) (float64, error)

func (*HitbtcApi) RateMap

func (h *HitbtcApi) RateMap() (map[string]map[string]float64, error)

func (*HitbtcApi) SetTransport

func (h *HitbtcApi) SetTransport(transport http.RoundTripper) error

func (*HitbtcApi) Volume

func (h *HitbtcApi) Volume(trading string, settlement string) (float64, error)

func (*HitbtcApi) VolumeMap

func (h *HitbtcApi) VolumeMap() (map[string]map[string]float64, error)

type HitbtcApiConfig

type HitbtcApiConfig struct {
}

type HuobiApi

type HuobiApi struct {
	BaseURL           string
	RateCacheDuration time.Duration

	HttpClient    *http.Client
	ShrimpyClient *unified.ShrimpyApiClient
	// contains filtered or unexported fields
}

func NewHuobiPublicApi

func NewHuobiPublicApi() (*HuobiApi, error)

func (*HuobiApi) Board

func (h *HuobiApi) Board(trading string, settlement string) (board *models.Board, err error)

func (*HuobiApi) CurrencyPairs

func (h *HuobiApi) CurrencyPairs() ([]models.CurrencyPair, error)

func (*HuobiApi) FrozenCurrency

func (h *HuobiApi) FrozenCurrency() ([]string, error)

func (*HuobiApi) OrderBookTickMap

func (h *HuobiApi) OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)

func (*HuobiApi) Precise

func (h *HuobiApi) Precise(trading string, settlement string) (*models.Precisions, error)

func (*HuobiApi) Rate

func (h *HuobiApi) Rate(trading string, settlement string) (float64, error)

func (*HuobiApi) RateMap

func (h *HuobiApi) RateMap() (map[string]map[string]float64, error)

func (*HuobiApi) SetTransport

func (h *HuobiApi) SetTransport(transport http.RoundTripper) error

func (*HuobiApi) Volume

func (h *HuobiApi) Volume(trading string, settlement string) (float64, error)

func (*HuobiApi) VolumeMap

func (h *HuobiApi) VolumeMap() (map[string]map[string]float64, error)

type HuobiTickResponse

type HuobiTickResponse struct {
	Trading    string
	Settlement string
	// contains filtered or unexported fields
}

type KucoinApi

type KucoinApi struct {
	BaseURL           string
	RateCacheDuration time.Duration

	ShrimpyClient *unified.ShrimpyApiClient

	HttpClient *http.Client
	// contains filtered or unexported fields
}

func NewKucoinPublicApi

func NewKucoinPublicApi() (*KucoinApi, error)

func (*KucoinApi) Board

func (h *KucoinApi) Board(trading string, settlement string) (board *models.Board, err error)

func (*KucoinApi) CurrencyPairs

func (h *KucoinApi) CurrencyPairs() ([]models.CurrencyPair, error)

func (*KucoinApi) FrozenCurrency

func (h *KucoinApi) FrozenCurrency() ([]string, error)

func (*KucoinApi) OrderBookTickMap

func (h *KucoinApi) OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)

func (*KucoinApi) Precise

func (h *KucoinApi) Precise(trading string, settlement string) (*models.Precisions, error)

func (*KucoinApi) Rate

func (h *KucoinApi) Rate(trading string, settlement string) (float64, error)

func (*KucoinApi) RateMap

func (h *KucoinApi) RateMap() (map[string]map[string]float64, error)

func (*KucoinApi) SetTransport

func (h *KucoinApi) SetTransport(transport http.RoundTripper) error

func (*KucoinApi) Volume

func (h *KucoinApi) Volume(trading string, settlement string) (float64, error)

func (*KucoinApi) VolumeMap

func (h *KucoinApi) VolumeMap() (map[string]map[string]float64, error)

type KucoinTickResponse

type KucoinTickResponse struct {
	Trading    string
	Settlement string
	// contains filtered or unexported fields
}

type LbankApi

type LbankApi struct {
	BaseURL           string
	RateCacheDuration time.Duration

	HttpClient *http.Client
	// contains filtered or unexported fields
}

func NewLbankPublicApi

func NewLbankPublicApi() (*LbankApi, error)

func (*LbankApi) Board

func (h *LbankApi) Board(trading string, settlement string) (board *models.Board, err error)

func (*LbankApi) CurrencyPairs

func (h *LbankApi) CurrencyPairs() ([]models.CurrencyPair, error)

func (*LbankApi) FrozenCurrency

func (h *LbankApi) FrozenCurrency() ([]string, error)

func (*LbankApi) OrderBookTickMap

func (h *LbankApi) OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)

func (*LbankApi) Precise

func (h *LbankApi) Precise(trading string, settlement string) (*models.Precisions, error)

func (*LbankApi) Rate

func (h *LbankApi) Rate(trading string, settlement string) (float64, error)

func (*LbankApi) RateMap

func (h *LbankApi) RateMap() (map[string]map[string]float64, error)

func (*LbankApi) SetTransport

func (h *LbankApi) SetTransport(transport http.RoundTripper) error

func (*LbankApi) Volume

func (h *LbankApi) Volume(trading string, settlement string) (float64, error)

func (*LbankApi) VolumeMap

func (h *LbankApi) VolumeMap() (map[string]map[string]float64, error)

type LbankTickResponse

type LbankTickResponse struct {
	Trading    string
	Settlement string
	// contains filtered or unexported fields
}

type OkexApi

type OkexApi struct {
	BaseURL           string
	RateCacheDuration time.Duration

	CurrencyPairsCacheDuration time.Duration

	HttpClient    *http.Client
	ShrimpyClient *unified.ShrimpyApiClient
	// contains filtered or unexported fields
}

func NewOkexPublicApi

func NewOkexPublicApi() (*OkexApi, error)

func (*OkexApi) Board

func (h *OkexApi) Board(trading string, settlement string) (board *models.Board, err error)

func (*OkexApi) CurrencyPairs

func (h *OkexApi) CurrencyPairs() ([]models.CurrencyPair, error)

func (*OkexApi) FrozenCurrency

func (h *OkexApi) FrozenCurrency() ([]string, error)

func (*OkexApi) OrderBookTickMap

func (h *OkexApi) OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)

func (*OkexApi) Precise

func (h *OkexApi) Precise(trading string, settlement string) (*models.Precisions, error)

func (*OkexApi) Rate

func (h *OkexApi) Rate(trading string, settlement string) (float64, error)

func (*OkexApi) RateMap

func (h *OkexApi) RateMap() (map[string]map[string]float64, error)

func (*OkexApi) SetTransport

func (h *OkexApi) SetTransport(transport http.RoundTripper) error

func (*OkexApi) Volume

func (h *OkexApi) Volume(trading string, settlement string) (float64, error)

func (*OkexApi) VolumeMap

func (h *OkexApi) VolumeMap() (map[string]map[string]float64, error)

type OkexTickResponse

type OkexTickResponse struct {
	Trading    string
	Settlement string
	// contains filtered or unexported fields
}

type P2pb2bApi

type P2pb2bApi struct {
	BaseURL           string
	RateCacheDuration time.Duration

	HttpClient *http.Client
	// contains filtered or unexported fields
}

func NewP2pb2bPublicApi

func NewP2pb2bPublicApi() (*P2pb2bApi, error)

func (*P2pb2bApi) Board

func (h *P2pb2bApi) Board(trading string, settlement string) (board *models.Board, err error)

func (*P2pb2bApi) CurrencyPairs

func (h *P2pb2bApi) CurrencyPairs() ([]models.CurrencyPair, error)

func (*P2pb2bApi) FrozenCurrency

func (h *P2pb2bApi) FrozenCurrency() ([]string, error)

func (*P2pb2bApi) OrderBookTickMap

func (h *P2pb2bApi) OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)

func (*P2pb2bApi) Precise

func (h *P2pb2bApi) Precise(trading string, settlement string) (*models.Precisions, error)

func (*P2pb2bApi) Rate

func (h *P2pb2bApi) Rate(trading string, settlement string) (float64, error)

func (*P2pb2bApi) RateMap

func (h *P2pb2bApi) RateMap() (map[string]map[string]float64, error)

func (*P2pb2bApi) SetTransport

func (h *P2pb2bApi) SetTransport(transport http.RoundTripper) error

func (*P2pb2bApi) Volume

func (h *P2pb2bApi) Volume(trading string, settlement string) (float64, error)

func (*P2pb2bApi) VolumeMap

func (h *P2pb2bApi) VolumeMap() (map[string]map[string]float64, error)

type P2pb2bApiConfig

type P2pb2bApiConfig struct {
}

type PoloniexApi

type PoloniexApi struct {
	BaseURL           string
	RateCacheDuration time.Duration

	HttpClient    http.Client
	ShrimpyClient *unified.ShrimpyApiClient
	// contains filtered or unexported fields
}

func NewPoloniexPublicApi

func NewPoloniexPublicApi() (*PoloniexApi, error)

func (*PoloniexApi) Board

func (p *PoloniexApi) Board(trading string, settlement string) (*models.Board, error)

func (*PoloniexApi) CurrencyPairs

func (p *PoloniexApi) CurrencyPairs() ([]models.CurrencyPair, error)

func (*PoloniexApi) FrozenCurrency

func (p *PoloniexApi) FrozenCurrency() ([]string, error)

func (*PoloniexApi) OrderBookTickMap

func (h *PoloniexApi) OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)

func (*PoloniexApi) Precise

func (p *PoloniexApi) Precise(trading string, settlement string) (*models.Precisions, error)

func (*PoloniexApi) Rate

func (p *PoloniexApi) Rate(trading string, settlement string) (float64, error)

func (*PoloniexApi) RateMap

func (p *PoloniexApi) RateMap() (map[string]map[string]float64, error)

func (*PoloniexApi) SetTransport

func (p *PoloniexApi) SetTransport(transport http.RoundTripper) error

func (*PoloniexApi) Volume

func (p *PoloniexApi) Volume(trading string, settlement string) (float64, error)

func (*PoloniexApi) VolumeMap

func (p *PoloniexApi) VolumeMap() (map[string]map[string]float64, error)

type ProxyUrlList

type ProxyUrlList struct {
	BASE_URL string

	ListCacheDuration time.Duration
	// contains filtered or unexported fields
}

func NewProxyUrlList

func NewProxyUrlList(baseUrl string) ProxyUrlList

func (*ProxyUrlList) GetList

func (pul *ProxyUrlList) GetList() ([]*url.URL, error)

type PublicClient

type PublicClient interface {
	// Volume(trading string, settlement string) (float64, error)
	CurrencyPairs() ([]models.CurrencyPair, error)
	// Rate(trading string, settlement string) (float64, error)
	// RateMap() (map[string]map[string]float64, error)
	// VolumeMap() (map[string]map[string]float64, error)
	OrderBookTickMap() (map[string]map[string]models.OrderBookTick, error)
	FrozenCurrency() ([]string, error)
	Board(trading string, settlement string) (*models.Board, error)
	Precise(trading string, settlement string) (*models.Precisions, error)

	SetTransport(transport http.RoundTripper) error
}

func NewClient

func NewClient(exchangeName string) (PublicClient, error)

func NewDefaultClient

func NewDefaultClient(exchangeName string) PublicClient

Directories

Path Synopsis
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL