huobi

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HB_POINT_ACCOUNT = "point"
	HB_SPOT_ACCOUNT  = "spot"
)

Variables

View Source
var HBPOINT = NewCurrency("HBPOINT")

Functions

func NewSpotAPI

func NewSpotAPI(client *http.Client, apikey, secretkey string) SpotAPI

*

  • spot

func NewSpotWebsocket

func NewSpotWebsocket(wsURL, proxyURL string) (sw SpotWebsocket, err error)

Types

type AccountInfo

type AccountInfo struct {
	Id    string
	Type  string
	State string
}

type HuoBiPro

type HuoBiPro struct {
	// contains filtered or unexported fields
}

func NewHuoBiPro

func NewHuoBiPro(client *http.Client, apikey, secretkey, accountId string) *HuoBiPro

func (*HuoBiPro) Cancel

func (hbpro *HuoBiPro) Cancel(orderId string, pair CurrencyPair) (bool, error)

func (*HuoBiPro) GetAccount

func (hbpro *HuoBiPro) GetAccount() (*Account, error)

func (*HuoBiPro) GetAccountInfo

func (hbpro *HuoBiPro) GetAccountInfo(acc string) (AccountInfo, error)

func (*HuoBiPro) GetAllCurrencyPair

func (hbpro *HuoBiPro) GetAllCurrencyPair() (map[string]SymbolSetting, error)

func (*HuoBiPro) GetAllCurrencyStatus

func (hbpro *HuoBiPro) GetAllCurrencyStatus() (all map[string]CurrencyStatus, err error)

func (*HuoBiPro) GetAllTicker

func (hbpro *HuoBiPro) GetAllTicker() ([]Ticker, error)

func (*HuoBiPro) GetCurrenciesList

func (hbpro *HuoBiPro) GetCurrenciesList() ([]string, error)

func (*HuoBiPro) GetCurrenciesPrecision

func (hbpro *HuoBiPro) GetCurrenciesPrecision() ([]HuoBiProSymbol, error)

func (*HuoBiPro) GetCurrencyStatus

func (hbpro *HuoBiPro) GetCurrencyStatus(currency Currency) (CurrencyStatus, error)

func (*HuoBiPro) GetDepth

func (hbpro *HuoBiPro) GetDepth(pair CurrencyPair, size int, step int) (*Depth, error)

取值 说明 step0 无聚合 step1 聚合度为报价精度*10 step2 聚合度为报价精度*100 step3 聚合度为报价精度*1000 step4 聚合度为报价精度*10000 step5 聚合度为报价精度*100000

func (*HuoBiPro) GetExchangeName

func (hbpro *HuoBiPro) GetExchangeName() string

func (*HuoBiPro) GetFinishedOrders

func (hbpro *HuoBiPro) GetFinishedOrders(pair CurrencyPair) ([]Order, error)

func (*HuoBiPro) GetKlineRecords

func (hbpro *HuoBiPro) GetKlineRecords(pair CurrencyPair, period KlinePeriod, size, since int) ([]Kline, error)

倒序

func (*HuoBiPro) GetOrder

func (hbpro *HuoBiPro) GetOrder(orderId string, pair CurrencyPair) (*Order, error)

func (*HuoBiPro) GetOrderDeal

func (hbpro *HuoBiPro) GetOrderDeal(orderId string, pair CurrencyPair) ([]OrderDeal, error)

func (*HuoBiPro) GetPendingOrders

func (hbpro *HuoBiPro) GetPendingOrders(pair CurrencyPair) ([]Order, error)

func (*HuoBiPro) GetTicker

func (hbpro *HuoBiPro) GetTicker(pair CurrencyPair) (*Ticker, error)

func (*HuoBiPro) GetTradeFee

func (hbpro *HuoBiPro) GetTradeFee(symbols string) (tf *TradeFee, err error)

func (*HuoBiPro) GetTradeFeeMap

func (hbpro *HuoBiPro) GetTradeFeeMap() (tfmap map[string]TradeFee, err error)

func (*HuoBiPro) GetTrades

func (hbpro *HuoBiPro) GetTrades(pair CurrencyPair, size int) ([]Trade, error)

func (*HuoBiPro) GetURL

func (hbpro *HuoBiPro) GetURL() string

func (*HuoBiPro) GetUserTrades

func (hbpro *HuoBiPro) GetUserTrades(pair CurrencyPair) ([]Trade, error)

func (*HuoBiPro) LimitBuy

func (hbpro *HuoBiPro) LimitBuy(pair CurrencyPair, price, amount string) (*Order, error)

func (*HuoBiPro) LimitSell

func (hbpro *HuoBiPro) LimitSell(pair CurrencyPair, price, amount string) (*Order, error)

func (*HuoBiPro) MarketBuy

func (hbpro *HuoBiPro) MarketBuy(pair CurrencyPair, amount string) (*Order, error)

func (*HuoBiPro) MarketSell

func (hbpro *HuoBiPro) MarketSell(pair CurrencyPair, amount string) (*Order, error)

func (*HuoBiPro) SetURL

func (hbpro *HuoBiPro) SetURL(exurl string)

type HuoBiProSymbol

type HuoBiProSymbol struct {
	BaseCurrency    string
	QuoteCurrency   string
	PricePrecision  float64
	AmountPrecision float64
	SymbolPartition string
	Symbol          string
}

type HuobiSpotWs

type HuobiSpotWs struct {
	SpotWsBase
}

func (*HuobiSpotWs) FormatTopicName

func (ws *HuobiSpotWs) FormatTopicName(topic string, pair CurrencyPair) string

格式化流名称

func (*HuobiSpotWs) FormatTopicSubData

func (ws *HuobiSpotWs) FormatTopicSubData(topic string, pair CurrencyPair) []byte

格式化流订阅消息

func (*HuobiSpotWs) FormatTopicUnsubData

func (ws *HuobiSpotWs) FormatTopicUnsubData(topic string, pair CurrencyPair) []byte

格式化流取消订阅消息

func (*HuobiSpotWs) GetExchangeName

func (ws *HuobiSpotWs) GetExchangeName() string

func (*HuobiSpotWs) OnMessage

func (ws *HuobiSpotWs) OnMessage(data []byte) (err error)

消息解析函数

type TradeFee

type TradeFee struct {
	Symbol          string  `json:"symbol"`
	ActualMakerRate float64 `json:"actualMakerRate,string"` // 挂单手续费
	ActualTakerRate float64 `json:"actualTakerRate,string"` // 吃单手续费
}

"symbol": "btcusdt", "makerFeeRate":"0.002", "takerFeeRate":"0.002", "actualMakerRate": "0.002", "actualTakerRate":"0.002

Jump to

Keyboard shortcuts

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