Documentation ¶
Index ¶
- Constants
- Variables
- type AccountInfo
- type BBOResponse
- type BaseResponse
- type DepthResponse
- type DetailResponse
- type 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
- 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
- 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
- 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
- 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
- type OrderInfo
- type 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
- type 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
Constants ¶
View Source
const ( HB_POINT_ACCOUNT = "point" HB_SPOT_ACCOUNT = "spot" )
Variables ¶
View Source
var (
FuturesContractInfos []FuturesContractInfo
)
View Source
var HBPOINT = NewCurrency("HBPOINT", "")
Functions ¶
This section is empty.
Types ¶
type AccountInfo ¶
type BBOResponse ¶
type BaseResponse ¶
type DepthResponse ¶
type DetailResponse ¶
type DetailResponse struct { Id int64 Open float64 Close float64 High float64 Low float64 Amount float64 Vol float64 Count int64 }
"id": 1539842340, "mrid": 268041138, "open": 6740.47, "close": 7800, "high": 7800, "low": 6726.13, "amount": 477.1200312075244664773339914558562673572, "vol": 32414, "count": 1716 }
type Hbdm ¶
type Hbdm struct {
// contains filtered or unexported fields
}
func (*Hbdm) FutureCancelOrder ¶
func (*Hbdm) GetContractValue ¶
func (*Hbdm) GetExchangeRate ¶
func (*Hbdm) GetFutureDepth ¶
func (*Hbdm) GetFutureEstimatedPrice ¶
func (*Hbdm) GetFutureIndex ¶
func (*Hbdm) GetFutureOrder ¶
func (*Hbdm) GetFutureOrderHistory ¶
func (*Hbdm) GetFutureOrders ¶
func (*Hbdm) GetFuturePosition ¶
func (*Hbdm) GetFutureTicker ¶
func (*Hbdm) GetFutureUserinfo ¶
func (*Hbdm) GetKlineRecords ¶
func (*Hbdm) GetUnfinishFutureOrders ¶
func (*Hbdm) LimitFuturesOrder ¶
func (*Hbdm) MarketFuturesOrder ¶
func (*Hbdm) PlaceFutureOrder ¶
func (*Hbdm) PlaceFutureOrder2 ¶
type HbdmSwap ¶
type HbdmSwap struct {
// contains filtered or unexported fields
}
func NewHbdmSwap ¶
func NewHbdmSwap(c *APIConfig) *HbdmSwap
func (*HbdmSwap) FutureCancelOrder ¶
func (*HbdmSwap) GetContractValue ¶
func (swap *HbdmSwap) GetContractValue(currencyPair cons.CurrencyPair) (float64, error)
func (*HbdmSwap) GetFutureDepth ¶
func (*HbdmSwap) GetFutureEstimatedPrice ¶
func (swap *HbdmSwap) GetFutureEstimatedPrice(currencyPair cons.CurrencyPair) (float64, error)
func (*HbdmSwap) GetFutureIndex ¶
func (swap *HbdmSwap) GetFutureIndex(currencyPair cons.CurrencyPair) (float64, error)
func (*HbdmSwap) GetFutureOrder ¶
func (*HbdmSwap) GetFutureOrderHistory ¶
func (swap *HbdmSwap) GetFutureOrderHistory(pair cons.CurrencyPair, contractType string, optional ...OptionalParameter) ([]FutureOrder, error)
func (*HbdmSwap) GetFutureOrders ¶
func (*HbdmSwap) GetFuturePosition ¶
func (swap *HbdmSwap) GetFuturePosition(currencyPair cons.CurrencyPair, contractType string) ([]FuturePosition, error)
func (*HbdmSwap) GetFutureTicker ¶
func (swap *HbdmSwap) GetFutureTicker(currencyPair cons.CurrencyPair, contractType string) (*Ticker, error)
func (*HbdmSwap) GetFutureUserinfo ¶
func (swap *HbdmSwap) GetFutureUserinfo(currencyPair ...cons.CurrencyPair) (*FutureAccount, error)
func (*HbdmSwap) GetKlineRecords ¶
func (swap *HbdmSwap) GetKlineRecords(contractType string, currency cons.CurrencyPair, period cons.KlinePeriod, size int, opt ...OptionalParameter) ([]FutureKline, error)
func (*HbdmSwap) GetUnfinishFutureOrders ¶
func (swap *HbdmSwap) GetUnfinishFutureOrders(currencyPair cons.CurrencyPair, contractType string) ([]FutureOrder, error)
func (*HbdmSwap) LimitFuturesOrder ¶
func (swap *HbdmSwap) LimitFuturesOrder(currencyPair cons.CurrencyPair, contractType, price, amount string, openType int, opt ...cons.LimitOrderOptionalParameter) (*FutureOrder, error)
func (*HbdmSwap) MarketFuturesOrder ¶
func (*HbdmSwap) PlaceFutureOrder ¶
type HbdmSwapWs ¶
func NewHbdmSwapWs ¶
func NewHbdmSwapWs() *HbdmSwapWs
func (*HbdmSwapWs) DepthCallback ¶
func (ws *HbdmSwapWs) DepthCallback(call func(depth *Depth))
func (*HbdmSwapWs) SetCallbacks ¶
func (ws *HbdmSwapWs) SetCallbacks(tickerCallback func(*FutureTicker), depthCallback func(*Depth), tradeCallback func(*Trade, string))
func (*HbdmSwapWs) SubscribeDepth ¶
func (ws *HbdmSwapWs) SubscribeDepth(pair CurrencyPair, contract string) error
func (*HbdmSwapWs) SubscribeTicker ¶
func (ws *HbdmSwapWs) SubscribeTicker(pair CurrencyPair, contract string) error
func (*HbdmSwapWs) SubscribeTrade ¶
func (ws *HbdmSwapWs) SubscribeTrade(pair CurrencyPair, contract string) error
func (*HbdmSwapWs) TickerCallback ¶
func (ws *HbdmSwapWs) TickerCallback(call func(ticker *FutureTicker))
func (*HbdmSwapWs) TradeCallback ¶
func (ws *HbdmSwapWs) TradeCallback(call func(trade *Trade, contract string))
type HbdmWs ¶
func (*HbdmWs) DepthCallback ¶
func (hbdmWs *HbdmWs) DepthCallback(call func(depth *Depth))
func (*HbdmWs) SetCallbacks ¶
func (*HbdmWs) SubscribeDepth ¶
func (*HbdmWs) SubscribeTicker ¶
func (*HbdmWs) SubscribeTrade ¶
func (*HbdmWs) TickerCallback ¶
func (hbdmWs *HbdmWs) TickerCallback(call func(ticker *FutureTicker))
func (*HbdmWs) TradeCallback ¶
type HuoBiPro ¶
type HuoBiPro struct { Symbols map[string]HuoBiProSymbol // contains filtered or unexported fields }
func NewHuoBiPro ¶
func NewHuobiWithConfig ¶
func NewHuobiWithConfig(config *APIConfig) *HuoBiPro
func (*HuoBiPro) CancelOrder ¶
func (*HuoBiPro) GetAccount ¶
func (*HuoBiPro) GetAccountInfo ¶
func (hb *HuoBiPro) GetAccountInfo(acc string) (AccountInfo, error)
func (*HuoBiPro) GetCurrenciesList ¶
func (*HuoBiPro) GetCurrenciesPrecision ¶
func (hb *HuoBiPro) GetCurrenciesPrecision() ([]HuoBiProSymbol, error)
func (*HuoBiPro) GetKlineRecords ¶
func (hb *HuoBiPro) GetKlineRecords(currency CurrencyPair, period KlinePeriod, size int, optional ...OptionalParameter) ([]Kline, error)
倒序
func (*HuoBiPro) GetOneOrder ¶
func (*HuoBiPro) GetOrderHistorys ¶
func (*HuoBiPro) GetUnfinishedOrders ¶
func (*HuoBiPro) MarketSell ¶
func (*HuoBiPro) PlaceOrders ¶
func (*HuoBiPro) WithdrawFee ¶
func (hb *HuoBiPro) WithdrawFee() (sf []q.NetworkWithdraw, err error)
type HuoBiProSymbol ¶
type OrderInfo ¶
type OrderInfo struct { Symbol string `json:"symbol"` ContractType string `json:"contract_type"` ContractCode string `json:"contract_code"` Volume float64 `json:"volume"` Price float64 `json:"price"` OrderPriceType string `json:"order_price_type"` Direction string `json:"direction"` Offset string `json:"offset"` LeverRate float64 `json:"lever_rate"` OrderId int64 `json:"order_id"` ClientOrderId int64 `json:"client_order_id"` OrderSource string `json:"order_source"` CreatedAt int64 `json:"created_at"` CreateDate int64 `json:"create_date"` //for swap contract TradeVolume float64 `json:"trade_volume"` TradeTurnover float64 `json:"trade_turnover"` Fee float64 `json:"fee"` TradeAvgPrice float64 `json:"trade_avg_price"` MarginFrozen float64 `json:"margin_frozen"` Status int `json:"status"` }
type SpotWs ¶
func (*SpotWs) BBOCallback ¶
func (ws *SpotWs) BBOCallback(call func(bbo *Bbo))
func (*SpotWs) DepthCallback ¶
func (ws *SpotWs) DepthCallback(call func(depth *Depth))
func (*SpotWs) SubscribeBBO ¶
func (*SpotWs) SubscribeDepth ¶
func (*SpotWs) SubscribeTicker ¶
func (*SpotWs) SubscribeTrade ¶
func (*SpotWs) TickerCallback ¶
func (ws *SpotWs) TickerCallback(call func(ticker *Ticker))
func (*SpotWs) TradeCallback ¶
func (ws *SpotWs) TradeCallback(call func(trade *Trade))
type TradeResponse ¶
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func (*Wallet) GetDepositHistory ¶
func (*Wallet) GetWithDrawHistory ¶
func (*Wallet) Withdrawal ¶
type WsResponse ¶
type WsResponse struct { Ch string Ts int64 Tick json.RawMessage }
Click to show internal directories.
Click to hide internal directories.