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) (Orderbook, 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) (Ticker, 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 HuobiResponse
- type HuobiWebsocketLastTimeline
- type HuobiWebsocketMarketOverview
- type HuobiWebsocketTrade
- type HuobiWebsocketTradeDetail
- type Orderbook
- type Ticker
- type TickerResponse
Constants ¶
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 ¶
var HuobiSocket *socketio.SocketIO
Functions ¶
This section is empty.
Types ¶
type HUOBI ¶
type HUOBI struct {
exchange.Base
}
HUOBI is the overarching type across this package
func (*HUOBI) BuildHuobiWebsocketParamsList ¶
func (*HUOBI) BuildHuobiWebsocketRequest ¶
func (*HUOBI) BuildHuobiWebsocketRequestExtra ¶
func (*HUOBI) CancelOrder ¶
CancelOrder cancels order by order ID
func (*HUOBI) GetAccountInfo ¶
func (h *HUOBI) GetAccountInfo()
GetAccountInfo returns account information
func (*HUOBI) GetExchangeAccountInfo ¶
GetExchangeAccountInfo retrieves balances for all enabled currencies for the HUOBI exchange - to-do
func (*HUOBI) GetNewDealOrders ¶
GetNewDealOrders creates a new deal
func (*HUOBI) GetOrderBook ¶
GetOrderBook returns the Huobi current orderbook for a currency pair
func (*HUOBI) GetOrderIDByTradeID ¶
GetOrderIDByTradeID returns ORDERID by Trade ID
func (*HUOBI) GetOrderInfo ¶
GetOrderInfo returns specific info on an order
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 ¶
MarketTrade initiates a market trade
func (*HUOBI) ModifyOrder ¶
ModifyOrder modifies an order
func (*HUOBI) OnDisconnect ¶
func (*HUOBI) SendAuthenticatedRequest ¶
SendAuthenticatedRequest sends an autheticated HTTP request to Huobi
func (*HUOBI) SetDefaults ¶
func (h *HUOBI) SetDefaults()
SetDefaults sets default values for the exchange
func (*HUOBI) Setup ¶
func (h *HUOBI) Setup(exch config.ExchangeConfig)
Setup sets user configuration
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 HuobiResponse ¶
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"` }
type Orderbook ¶
type Orderbook struct { ID float64 TS float64 Bids [][]float64 `json:"bids"` Asks [][]float64 `json:"asks"` Symbol string `json:"string"` }
Orderbook holds the order book information
type TickerResponse ¶
TickerResponse holds the initial response type