Versions in this module Expand all Collapse all v0 v0.2.0 Jan 13, 2025 Changes in this version + const HB_POINT_ACCOUNT + const HB_SPOT_ACCOUNT + var FuturesContractInfos []FuturesContractInfo + var HBPOINT = NewCurrency("HBPOINT", "") + type AccountInfo struct + Id string + State string + Type string + type BBOResponse struct + Ask float64 + AskSize float64 + Bid float64 + BidSize float64 + QuoteTime float64 + SeqId float64 + Symbol string + type BaseResponse struct + Ch string + Data json.RawMessage + ErrCode int + ErrMsg string + Status string + Ts int64 + type DepthResponse struct + Asks [][]float64 + Bids [][]float64 + Ts int64 + type DetailResponse struct + Amount float64 + Close float64 + Count int64 + High float64 + Id int64 + Low float64 + Open float64 + Vol float64 + type Hbdm struct + func NewHbdm(conf *APIConfig) *Hbdm + func (dm *Hbdm) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error) + func (dm *Hbdm) GetContractValue(currencyPair CurrencyPair) (float64, error) + func (dm *Hbdm) GetDeliveryTime() (int, int, int, int) + func (dm *Hbdm) GetExchangeRate() (float64, error) + func (dm *Hbdm) GetFee() (float64, error) + func (dm *Hbdm) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error) + func (dm *Hbdm) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error) + func (dm *Hbdm) GetFutureIndex(currencyPair CurrencyPair) (float64, error) + func (dm *Hbdm) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error) + func (dm *Hbdm) GetFutureOrderHistory(pair CurrencyPair, contractType string, optional ...OptionalParameter) ([]FutureOrder, error) + func (dm *Hbdm) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (dm *Hbdm) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error) + func (dm *Hbdm) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error) + func (dm *Hbdm) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error) + func (dm *Hbdm) GetKlineRecords(contract_type string, currency CurrencyPair, period KlinePeriod, size int, ...) ([]FutureKline, error) + func (dm *Hbdm) GetTrades(contract_type string, currencyPair CurrencyPair, since int64) ([]Trade, error) + func (dm *Hbdm) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error) + func (dm *Hbdm) LimitFuturesOrder(currencyPair CurrencyPair, contractType, price, amount string, openType int, ...) (*FutureOrder, error) + func (dm *Hbdm) MarketFuturesOrder(currencyPair CurrencyPair, contractType, amount string, openType int) (*FutureOrder, error) + func (dm *Hbdm) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error) + func (dm *Hbdm) PlaceFutureOrder2(currencyPair CurrencyPair, contractType, price, amount string, ...) (*FutureOrder, error) + func (dm *Hbdm) String() string + type HbdmSwap struct + func NewHbdmSwap(c *APIConfig) *HbdmSwap + func (swap *HbdmSwap) FutureCancelOrder(currencyPair cons.CurrencyPair, contractType, orderId string) (bool, error) + func (swap *HbdmSwap) GetContractValue(currencyPair cons.CurrencyPair) (float64, error) + func (swap *HbdmSwap) GetDeliveryTime() (int, int, int, int) + func (swap *HbdmSwap) GetFee() (float64, error) + func (swap *HbdmSwap) GetFutureDepth(currencyPair cons.CurrencyPair, contractType string, size int) (*Depth, error) + func (swap *HbdmSwap) GetFutureEstimatedPrice(currencyPair cons.CurrencyPair) (float64, error) + func (swap *HbdmSwap) GetFutureIndex(currencyPair cons.CurrencyPair) (float64, error) + func (swap *HbdmSwap) GetFutureOrder(orderId string, currencyPair cons.CurrencyPair, contractType string) (*FutureOrder, error) + func (swap *HbdmSwap) GetFutureOrderHistory(pair cons.CurrencyPair, contractType string, optional ...OptionalParameter) ([]FutureOrder, error) + func (swap *HbdmSwap) GetFutureOrders(orderIds []string, currencyPair cons.CurrencyPair, contractType string) ([]FutureOrder, error) + func (swap *HbdmSwap) GetFuturePosition(currencyPair cons.CurrencyPair, contractType string) ([]FuturePosition, error) + func (swap *HbdmSwap) GetFutureTicker(currencyPair cons.CurrencyPair, contractType string) (*Ticker, error) + func (swap *HbdmSwap) GetFutureUserinfo(currencyPair ...cons.CurrencyPair) (*FutureAccount, error) + func (swap *HbdmSwap) GetKlineRecords(contractType string, currency cons.CurrencyPair, period cons.KlinePeriod, ...) ([]FutureKline, error) + func (swap *HbdmSwap) GetTrades(contractType string, currencyPair cons.CurrencyPair, since int64) ([]q.Trade, error) + func (swap *HbdmSwap) GetUnfinishFutureOrders(currencyPair cons.CurrencyPair, contractType string) ([]FutureOrder, error) + func (swap *HbdmSwap) LimitFuturesOrder(currencyPair cons.CurrencyPair, contractType, price, amount string, ...) (*FutureOrder, error) + func (swap *HbdmSwap) MarketFuturesOrder(currencyPair cons.CurrencyPair, contractType, amount string, openType int) (*FutureOrder, error) + func (swap *HbdmSwap) PlaceFutureOrder(currencyPair cons.CurrencyPair, contractType, price, amount string, ...) (string, error) + func (swap *HbdmSwap) String() string + type HbdmSwapWs struct + func NewHbdmLinearSwapWs() *HbdmSwapWs + func NewHbdmSwapWs() *HbdmSwapWs + func (ws *HbdmSwapWs) DepthCallback(call func(depth *Depth)) + func (ws *HbdmSwapWs) SetCallbacks(tickerCallback func(*FutureTicker), depthCallback func(*Depth), ...) + func (ws *HbdmSwapWs) SubscribeDepth(pair CurrencyPair, contract string) error + func (ws *HbdmSwapWs) SubscribeTicker(pair CurrencyPair, contract string) error + func (ws *HbdmSwapWs) SubscribeTrade(pair CurrencyPair, contract string) error + func (ws *HbdmSwapWs) TickerCallback(call func(ticker *FutureTicker)) + func (ws *HbdmSwapWs) TradeCallback(call func(trade *Trade, contract string)) + type HbdmWs struct + func NewHbdmWs() *HbdmWs + func (hbdmWs *HbdmWs) DepthCallback(call func(depth *Depth)) + func (hbdmWs *HbdmWs) SetCallbacks(tickerCallback func(*FutureTicker), depthCallback func(*Depth), ...) + func (hbdmWs *HbdmWs) SubscribeDepth(pair CurrencyPair, contract string) error + func (hbdmWs *HbdmWs) SubscribeTicker(pair CurrencyPair, contract string) error + func (hbdmWs *HbdmWs) SubscribeTrade(pair CurrencyPair, contract string) error + func (hbdmWs *HbdmWs) TickerCallback(call func(ticker *FutureTicker)) + func (hbdmWs *HbdmWs) TradeCallback(call func(trade *Trade, contract string)) + type HuoBiPro struct + Symbols map[string]HuoBiProSymbol + func NewHuoBiPro(client *http.Client, apikey, secretkey, accountId string) *HuoBiPro + func NewHuoBiProPoint(client *http.Client, apikey, secretkey string) *HuoBiPro + func NewHuoBiProSpot(client *http.Client, apikey, secretkey string) *HuoBiPro + func NewHuobiWithConfig(config *APIConfig) *HuoBiPro + func (hb *HuoBiPro) AllTicker(SymPair map[string]q.D) (mdt *sync.Map, err error) + func (hb *HuoBiPro) Balances() (availables, frozens *sync.Map, err error) + func (hb *HuoBiPro) CancelOrder(orderId string, currency CurrencyPair) (bool, error) + func (hb *HuoBiPro) Fee() (f float64) + func (hb *HuoBiPro) GetAccount() (*Account, error) + func (hb *HuoBiPro) GetAccountInfo(acc string) (AccountInfo, error) + func (hb *HuoBiPro) GetAttr() (a q.Attr) + func (hb *HuoBiPro) GetCurrenciesList() ([]string, error) + func (hb *HuoBiPro) GetCurrenciesPrecision() ([]HuoBiProSymbol, error) + func (hb *HuoBiPro) GetDepth(size int, currency CurrencyPair) (*Depth, error) + func (hb *HuoBiPro) GetKlineRecords(currency CurrencyPair, period KlinePeriod, size int, ...) ([]Kline, error) + func (hb *HuoBiPro) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error) + func (hb *HuoBiPro) GetOrderHistorys(currency CurrencyPair, optional ...OptionalParameter) ([]Order, error) + func (hb *HuoBiPro) GetTicker(currencyPair CurrencyPair) (*Ticker, error) + func (hb *HuoBiPro) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error) + func (hb *HuoBiPro) GetUnfinishedOrders(currency CurrencyPair) ([]Order, error) + func (hb *HuoBiPro) LimitBuy(amount, price string, currency CurrencyPair, ...) (*Order, error) + func (hb *HuoBiPro) LimitSell(amount, price string, currency CurrencyPair, ...) (*Order, error) + func (hb *HuoBiPro) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error) + func (hb *HuoBiPro) MarketSell(amount, price string, currency CurrencyPair) (*Order, error) + func (hb *HuoBiPro) OneTicker(d q.D) (ticker q.Bbo, err error) + func (hb *HuoBiPro) PairArray() (map[string]q.D, map[q.D]q.P, error) + func (hb *HuoBiPro) Place(amount, price, symbol string, orderType string) (string, error) + func (hb *HuoBiPro) PlaceOrders(places [3]q.Order) (orders [3]q.Order, err error) + func (hb *HuoBiPro) String() string + func (hb *HuoBiPro) Test() bool + func (hb *HuoBiPro) TradeFee() (map[string]q.TradeFee, error) + func (hb *HuoBiPro) WithdrawFee() (sf []q.NetworkWithdraw, err error) + type HuoBiProSymbol struct + AmountPrecision int + BaseCurrency string + MinAmount float64 + MinValue float64 + PricePrecision int + QuoteCurrency string + Symbol string + SymbolPartition string + Trading string + ValuePrecision int + type OrderInfo struct + ClientOrderId int64 + ContractCode string + ContractType string + CreateDate int64 + CreatedAt int64 + Direction string + Fee float64 + LeverRate float64 + MarginFrozen float64 + Offset string + OrderId int64 + OrderPriceType string + OrderSource string + Price float64 + Status int + Symbol string + TradeAvgPrice float64 + TradeTurnover float64 + TradeVolume float64 + Volume float64 + type SpotWs struct + func NewSpotWs() *SpotWs + func (ws *SpotWs) BBOCallback(call func(bbo *Bbo)) + func (ws *SpotWs) DepthCallback(call func(depth *Depth)) + func (ws *SpotWs) SubscribeBBO(sm []string) (err error) + func (ws *SpotWs) SubscribeDepth(pair CurrencyPair) error + func (ws *SpotWs) SubscribeTicker(pair CurrencyPair) error + func (ws *SpotWs) SubscribeTrade(pair CurrencyPair) error + func (ws *SpotWs) TickerCallback(call func(ticker *Ticker)) + func (ws *SpotWs) TradeCallback(call func(trade *Trade)) + type TradeResponse struct + Data []struct{ ... } + Id int64 + Ts int64 + type Wallet struct + func NewWallet(c *APIConfig) *Wallet + func (w *Wallet) GetAccount() (*Account, error) + func (w *Wallet) GetDepositHistory(currency *Currency) ([]DepositWithdrawHistory, error) + func (w *Wallet) GetWithDrawHistory(currency *Currency) ([]DepositWithdrawHistory, error) + func (w *Wallet) Transfer(param TransferParameter) error + func (w *Wallet) Withdrawal(param WithdrawParameter) (withdrawId string, err error) + type WsResponse struct + Ch string + Tick json.RawMessage + Ts int64