Documentation ¶
Index ¶
- Constants
- Variables
- func ParseCurrencyPairFromSpotWsCh(ch string) goex.CurrencyPair
- func ParseDepthFromResponse(r DepthResponse) goex.Depth
- type AccountInfo
- 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) GetExchangeName() string
- 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)
- type HbdmSwap
- func (swap *HbdmSwap) FutureCancelOrder(currencyPair CurrencyPair, contractType, orderId string) (bool, error)
- func (swap *HbdmSwap) GetContractValue(currencyPair CurrencyPair) (float64, error)
- func (swap *HbdmSwap) GetDeliveryTime() (int, int, int, int)
- func (swap *HbdmSwap) GetExchangeName() string
- func (swap *HbdmSwap) GetFee() (float64, error)
- func (swap *HbdmSwap) GetFutureDepth(currencyPair CurrencyPair, contractType string, size int) (*Depth, error)
- func (swap *HbdmSwap) GetFutureEstimatedPrice(currencyPair CurrencyPair) (float64, error)
- func (swap *HbdmSwap) GetFutureIndex(currencyPair CurrencyPair) (float64, error)
- func (swap *HbdmSwap) GetFutureOrder(orderId string, currencyPair CurrencyPair, contractType string) (*FutureOrder, error)
- func (swap *HbdmSwap) GetFutureOrderHistory(pair CurrencyPair, contractType string, optional ...OptionalParameter) ([]FutureOrder, error)
- func (swap *HbdmSwap) GetFutureOrders(orderIds []string, currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
- func (swap *HbdmSwap) GetFuturePosition(currencyPair CurrencyPair, contractType string) ([]FuturePosition, error)
- func (swap *HbdmSwap) GetFutureTicker(currencyPair CurrencyPair, contractType string) (*Ticker, error)
- func (swap *HbdmSwap) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error)
- func (swap *HbdmSwap) GetKlineRecords(contractType string, currency CurrencyPair, period KlinePeriod, size int, ...) ([]FutureKline, error)
- func (swap *HbdmSwap) GetTrades(contractType string, currencyPair CurrencyPair, since int64) ([]Trade, error)
- func (swap *HbdmSwap) GetUnfinishFutureOrders(currencyPair CurrencyPair, contractType string) ([]FutureOrder, error)
- func (swap *HbdmSwap) LimitFuturesOrder(currencyPair CurrencyPair, contractType, price, amount string, openType int, ...) (*FutureOrder, error)
- func (swap *HbdmSwap) MarketFuturesOrder(currencyPair CurrencyPair, contractType, amount string, openType int) (*FutureOrder, error)
- func (swap *HbdmSwap) PlaceFutureOrder(currencyPair CurrencyPair, contractType, price, amount string, ...) (string, error)
- 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 (hbpro *HuoBiPro) CancelOrder(orderId string, currency CurrencyPair) (bool, error)
- func (hbpro *HuoBiPro) GetAccount() (*Account, error)
- func (hbpro *HuoBiPro) GetAccountInfo(acc string) (AccountInfo, error)
- func (hbpro *HuoBiPro) GetCurrenciesList() ([]string, error)
- func (hbpro *HuoBiPro) GetCurrenciesPrecision() ([]HuoBiProSymbol, error)
- func (hbpro *HuoBiPro) GetDepth(size int, currency CurrencyPair) (*Depth, error)
- func (hbpro *HuoBiPro) GetExchangeName() string
- func (hbpro *HuoBiPro) GetKlineRecords(currency CurrencyPair, period KlinePeriod, size int, ...) ([]Kline, error)
- func (hbpro *HuoBiPro) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)
- func (hbpro *HuoBiPro) GetOrderHistorys(currency CurrencyPair, optional ...OptionalParameter) ([]Order, error)
- func (hbpro *HuoBiPro) GetTicker(currencyPair CurrencyPair) (*Ticker, error)
- func (hbpro *HuoBiPro) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)
- func (hbpro *HuoBiPro) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)
- func (hbpro *HuoBiPro) LimitBuy(amount, price string, currency CurrencyPair, ...) (*Order, error)
- func (hbpro *HuoBiPro) LimitSell(amount, price string, currency CurrencyPair, ...) (*Order, error)
- func (hbpro *HuoBiPro) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error)
- func (hbpro *HuoBiPro) MarketSell(amount, price string, currency CurrencyPair) (*Order, error)
- type HuoBiProSymbol
- type OrderInfo
- type SpotWs
- func (ws *SpotWs) DepthCallback(call func(depth *Depth))
- 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 ¶
func ParseCurrencyPairFromSpotWsCh ¶ added in v1.3.2
func ParseCurrencyPairFromSpotWsCh(ch string) goex.CurrencyPair
func ParseDepthFromResponse ¶ added in v1.3.2
func ParseDepthFromResponse(r DepthResponse) goex.Depth
Types ¶
type AccountInfo ¶
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) GetExchangeName ¶
func (*Hbdm) GetExchangeRate ¶
func (*Hbdm) GetFutureDepth ¶
func (*Hbdm) GetFutureEstimatedPrice ¶
func (*Hbdm) GetFutureIndex ¶
func (*Hbdm) GetFutureOrder ¶
func (*Hbdm) GetFutureOrderHistory ¶ added in v1.3.2
func (*Hbdm) GetFutureOrders ¶
func (*Hbdm) GetFuturePosition ¶
func (*Hbdm) GetFutureTicker ¶
func (*Hbdm) GetFutureUserinfo ¶
func (*Hbdm) GetKlineRecords ¶
func (*Hbdm) GetUnfinishFutureOrders ¶
func (*Hbdm) LimitFuturesOrder ¶ added in v1.3.2
func (*Hbdm) MarketFuturesOrder ¶ added in v1.3.2
func (*Hbdm) PlaceFutureOrder ¶
type HbdmSwap ¶ added in v1.3.2
type HbdmSwap struct {
// contains filtered or unexported fields
}
func NewHbdmSwap ¶ added in v1.3.2
func NewHbdmSwap(c *APIConfig) *HbdmSwap
func (*HbdmSwap) FutureCancelOrder ¶ added in v1.3.2
func (*HbdmSwap) GetContractValue ¶ added in v1.3.2
func (*HbdmSwap) GetDeliveryTime ¶ added in v1.3.2
func (*HbdmSwap) GetExchangeName ¶ added in v1.3.2
func (*HbdmSwap) GetFutureDepth ¶ added in v1.3.2
func (*HbdmSwap) GetFutureEstimatedPrice ¶ added in v1.3.2
func (*HbdmSwap) GetFutureIndex ¶ added in v1.3.2
func (*HbdmSwap) GetFutureOrder ¶ added in v1.3.2
func (*HbdmSwap) GetFutureOrderHistory ¶ added in v1.3.2
func (*HbdmSwap) GetFutureOrders ¶ added in v1.3.2
func (*HbdmSwap) GetFuturePosition ¶ added in v1.3.2
func (*HbdmSwap) GetFutureTicker ¶ added in v1.3.2
func (*HbdmSwap) GetFutureUserinfo ¶ added in v1.3.2
func (*HbdmSwap) GetKlineRecords ¶ added in v1.3.2
func (*HbdmSwap) GetUnfinishFutureOrders ¶ added in v1.3.2
func (*HbdmSwap) LimitFuturesOrder ¶ added in v1.3.2
func (*HbdmSwap) MarketFuturesOrder ¶ added in v1.3.2
type HbdmSwapWs ¶ added in v1.3.2
func NewHbdmSwapWs ¶ added in v1.3.2
func NewHbdmSwapWs() *HbdmSwapWs
func (*HbdmSwapWs) DepthCallback ¶ added in v1.3.2
func (ws *HbdmSwapWs) DepthCallback(call func(depth *Depth))
func (*HbdmSwapWs) SetCallbacks ¶ added in v1.3.2
func (ws *HbdmSwapWs) SetCallbacks(tickerCallback func(*FutureTicker), depthCallback func(*Depth), tradeCallback func(*Trade, string))
func (*HbdmSwapWs) SubscribeDepth ¶ added in v1.3.2
func (ws *HbdmSwapWs) SubscribeDepth(pair CurrencyPair, contract string) error
func (*HbdmSwapWs) SubscribeTicker ¶ added in v1.3.2
func (ws *HbdmSwapWs) SubscribeTicker(pair CurrencyPair, contract string) error
func (*HbdmSwapWs) SubscribeTrade ¶ added in v1.3.2
func (ws *HbdmSwapWs) SubscribeTrade(pair CurrencyPair, contract string) error
func (*HbdmSwapWs) TickerCallback ¶ added in v1.3.2
func (ws *HbdmSwapWs) TickerCallback(call func(ticker *FutureTicker))
func (*HbdmSwapWs) TradeCallback ¶ added in v1.3.2
func (ws *HbdmSwapWs) TradeCallback(call func(trade *Trade, contract string))
type HbdmWs ¶
func (*HbdmWs) DepthCallback ¶ added in v1.3.2
func (hbdmWs *HbdmWs) DepthCallback(call func(depth *Depth))
func (*HbdmWs) SetCallbacks ¶
func (*HbdmWs) SubscribeDepth ¶
func (*HbdmWs) SubscribeTicker ¶
func (*HbdmWs) SubscribeTrade ¶
func (*HbdmWs) TickerCallback ¶ added in v1.3.2
func (hbdmWs *HbdmWs) TickerCallback(call func(ticker *FutureTicker))
func (*HbdmWs) TradeCallback ¶ added in v1.3.2
type HuoBiPro ¶
type HuoBiPro struct { Symbols map[string]HuoBiProSymbol // contains filtered or unexported fields }
func NewHuoBiPro ¶
func NewHuobiWithConfig ¶ added in v1.3.2
func NewHuobiWithConfig(config *APIConfig) *HuoBiPro
func (*HuoBiPro) CancelOrder ¶
func (*HuoBiPro) GetAccount ¶
func (*HuoBiPro) GetAccountInfo ¶
func (hbpro *HuoBiPro) GetAccountInfo(acc string) (AccountInfo, error)
func (*HuoBiPro) GetCurrenciesList ¶
func (*HuoBiPro) GetCurrenciesPrecision ¶
func (hbpro *HuoBiPro) GetCurrenciesPrecision() ([]HuoBiProSymbol, error)
func (*HuoBiPro) GetExchangeName ¶
func (*HuoBiPro) GetKlineRecords ¶
func (hbpro *HuoBiPro) GetKlineRecords(currency CurrencyPair, period KlinePeriod, size int, optional ...OptionalParameter) ([]Kline, error)
倒序
func (*HuoBiPro) GetOneOrder ¶
func (*HuoBiPro) GetOrderHistorys ¶
func (*HuoBiPro) GetUnfinishOrders ¶
func (*HuoBiPro) MarketSell ¶
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 ¶ added in v1.3.2
func (*SpotWs) DepthCallback ¶ added in v1.3.2
func (ws *SpotWs) DepthCallback(call func(depth *Depth))
func (*SpotWs) SubscribeDepth ¶ added in v1.3.2
func (*SpotWs) SubscribeTicker ¶ added in v1.3.2
func (*SpotWs) SubscribeTrade ¶ added in v1.3.2
func (*SpotWs) TickerCallback ¶ added in v1.3.2
func (ws *SpotWs) TickerCallback(call func(ticker *Ticker))
func (*SpotWs) TradeCallback ¶ added in v1.3.2
func (ws *SpotWs) TradeCallback(call func(trade *Trade))
type TradeResponse ¶
type Wallet ¶ added in v1.3.2
type Wallet struct {
// contains filtered or unexported fields
}
func (*Wallet) GetDepositHistory ¶ added in v1.3.2
func (*Wallet) GetWithDrawHistory ¶ added in v1.3.2
func (*Wallet) Withdrawal ¶ added in v1.3.2
type WsResponse ¶
type WsResponse struct { Ch string Ts int64 Tick json.RawMessage }
Click to show internal directories.
Click to hide internal directories.