Documentation ¶
Index ¶
- Constants
- Variables
- type HUOBI
- func (h *HUOBI) BuildHuobiWebsocketParamsList(objectName, currency, pushType, period, count, from, to, percentage string) interface{}
- func (h *HUOBI) BuildHuobiWebsocketRequest(msgType string, requestIndex int64, symbolRequest []string) map[string]interface{}
- func (h *HUOBI) BuildHuobiWebsocketRequestExtra(msgType string, requestIndex int64, symbolIdList interface{}) interface{}
- func (h *HUOBI) CancelOrder(orderID, coinType int)
- func (h *HUOBI) GetAccountInfo()
- func (h *HUOBI) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (h *HUOBI) GetFee() float64
- func (h *HUOBI) GetNewDealOrders(coinType int)
- func (h *HUOBI) GetOrderBook(symbol string) (HuobiOrderbook, error)
- func (h *HUOBI) GetOrderIDByTradeID(coinType, orderID int)
- func (h *HUOBI) GetOrderInfo(orderID, coinType int)
- func (h *HUOBI) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (h *HUOBI) GetOrders(coinType int)
- func (h *HUOBI) GetTicker(symbol string) (HuobiTicker, error)
- func (h *HUOBI) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (h *HUOBI) MarketTrade(orderType string, coinType int, price, amount float64)
- func (h *HUOBI) ModifyOrder(orderType string, coinType, orderID int, price, amount float64)
- func (h *HUOBI) OnConnect(output chan socketio.Message)
- func (h *HUOBI) OnDisconnect(output chan socketio.Message)
- func (h *HUOBI) OnError()
- func (h *HUOBI) OnMessage(message []byte, output chan socketio.Message)
- func (h *HUOBI) OnRequest(message []byte, output chan socketio.Message)
- func (h *HUOBI) Run()
- func (h *HUOBI) SendAuthenticatedRequest(method string, v url.Values) error
- func (h *HUOBI) SetDefaults()
- func (h *HUOBI) Setup(exch config.ExchangeConfig)
- func (h *HUOBI) Start()
- func (h *HUOBI) Trade(orderType string, coinType int, price, amount float64)
- func (h *HUOBI) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (h *HUOBI) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (h *HUOBI) WebsocketClient()
- type HuobiDepth
- type HuobiOrderbook
- type HuobiResponse
- type HuobiTicker
- type HuobiTickerResponse
- type HuobiWebsocketLastTimeline
- type HuobiWebsocketMarketOverview
- type HuobiWebsocketTrade
- type HuobiWebsocketTradeDetail
Constants ¶
View Source
const ( HUOBI_API_URL = "https://api.huobi.com/apiv2.php" HUOBI_API_VERSION = "2" )
View Source
const ( HUOBI_SOCKETIO_ADDRESS = "https://hq.huobi.com:443" //Service API HUOBI_SOCKET_REQ_SYMBOL_LIST = "reqSymbolList" HUOBI_SOCKET_REQ_SYMBOL_DETAIL = "reqSymbolDetail" HUOBI_SOCKET_REQ_SUBSCRIBE = "reqMsgSubscribe" HUOBI_SOCKET_REQ_UNSUBSCRIBE = "reqMsgUnsubscribe" // Market data API HUOBI_SOCKET_MARKET_DETAIL = "marketDetail" HUOBI_SOCKET_TRADE_DETAIL = "tradeDetail" HUOBI_SOCKET_MARKET_DEPTH_TOP = "marketDepthTop" HUOBI_SOCKET_MARKET_DEPTH_TOP_SHORT = "marketDepthTopShort" HUOBI_SOCKET_MARKET_DEPTH = "marketDepth" HUOBI_SOCKET_MARKET_DEPTH_TOP_DIFF = "marketDepthTopDiff" HUOBI_SOCKET_MARKET_DEPTH_DIFF = "marketDepthDiff" HUOBI_SOCKET_MARKET_LAST_KLINE = "lastKLine" HUOBI_SOCKET_MARKET_LAST_TIMELINE = "lastTimeLine" HUOBI_SOCKET_MARKET_OVERVIEW = "marketOverview" HUOBI_SOCKET_MARKET_STATIC = "marketStatic" // History data API HUOBI_SOCKET_REQ_TIMELINE = "reqTimeLine" HUOBI_SOCKET_REQ_KLINE = "reqKLine" HUOBI_SOCKET_REQ_DEPTH_TOP = "reqMarketDepthTop" HUOBI_SOCKET_REQ_DEPTH = "reqMarketDepth" HUOBI_SOCKET_REQ_TRADE_DETAIL_TOP = "reqTradeDetailTop" HUOBI_SOCKET_REQ_MARKET_DETAIL = "reqMarketDetail" )
Variables ¶
View Source
var HuobiSocket *socketio.SocketIO
Functions ¶
This section is empty.
Types ¶
type HUOBI ¶
type HUOBI struct {
exchange.Base
}
func (*HUOBI) BuildHuobiWebsocketParamsList ¶
func (*HUOBI) BuildHuobiWebsocketRequest ¶
func (*HUOBI) BuildHuobiWebsocketRequestExtra ¶
func (*HUOBI) CancelOrder ¶
func (*HUOBI) GetAccountInfo ¶
func (h *HUOBI) GetAccountInfo()
func (*HUOBI) GetExchangeAccountInfo ¶
GetExchangeAccountInfo retrieves balances for all enabled currencies for the HUOBI exchange - to-do
func (*HUOBI) GetNewDealOrders ¶
func (*HUOBI) GetOrderBook ¶
func (h *HUOBI) GetOrderBook(symbol string) (HuobiOrderbook, error)
func (*HUOBI) GetOrderIDByTradeID ¶
func (*HUOBI) GetOrderInfo ¶
func (*HUOBI) GetOrderbookEx ¶
GetOrderbookEx returns orderbook base on the currency pair
func (*HUOBI) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*HUOBI) MarketTrade ¶
func (*HUOBI) ModifyOrder ¶
func (*HUOBI) OnDisconnect ¶
func (*HUOBI) SendAuthenticatedRequest ¶
func (*HUOBI) SetDefaults ¶
func (h *HUOBI) SetDefaults()
func (*HUOBI) Setup ¶
func (h *HUOBI) Setup(exch config.ExchangeConfig)
func (*HUOBI) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*HUOBI) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*HUOBI) WebsocketClient ¶
func (h *HUOBI) WebsocketClient()
type HuobiDepth ¶
type HuobiDepth struct { SymbolID string `json:"symbolId"` Time float64 `json:"time"` Version float64 `json:"version"` BidName string `json:"bidName"` BidPrice []float64 `json:"bidPrice"` BidTotal []float64 `json:"bidTotal"` BidAmount []float64 `json:"bidAmount"` AskName string `json:"askName"` AskPrice []float64 `json:"askPrice"` AskTotal []float64 `json:"askTotal"` AskAmount []float64 `json:"askAmount"` }
type HuobiOrderbook ¶
type HuobiResponse ¶
type HuobiTicker ¶
type HuobiTickerResponse ¶
type HuobiTickerResponse struct { Time string Ticker HuobiTicker }
type HuobiWebsocketMarketOverview ¶
type HuobiWebsocketMarketOverview struct { SymbolID string `json:"symbolId"` Last float64 `json:"priceNew"` Open float64 `json:"priceOpen"` High float64 `json:"priceHigh"` Low float64 `json:"priceLow"` Ask float64 `json:"priceAsk"` Bid float64 `json:"priceBid"` Volume float64 `json:"totalVolume"` TotalAmount float64 `json:"totalAmount"` }
type HuobiWebsocketTrade ¶
type HuobiWebsocketTradeDetail ¶
type HuobiWebsocketTradeDetail struct { SymbolID string `json:"symbolId"` TradeID []int64 `json:"tradeId"` Price []float64 `json:"price"` Time []int64 `json:"time"` Amount []float64 `json:"amount"` TopBids []HuobiWebsocketTrade `json:"topBids"` TopAsks []HuobiWebsocketTrade `json:"topAsks"` }
Click to show internal directories.
Click to hide internal directories.