Documentation
¶
Index ¶
- Variables
- type Account
- type AccountBalance
- type AccountBalanceDetail
- type CancelOrderBatch
- type Depth
- type Detail
- type DetailMerged
- 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) CancelAllExchangeOrders() error
- func (h *HUOBI) CancelExchangeOrder(orderID int64) error
- func (h *HUOBI) CancelOrder(orderID int64) (int64, error)
- func (h *HUOBI) CancelOrderBatch(orderIDs []int64) ([]CancelOrderBatch, error)
- func (h *HUOBI) CancelWithdraw(withdrawID int64) (int64, error)
- func (h *HUOBI) GetAccountBalance(accountID string) ([]AccountBalanceDetail, error)
- func (h *HUOBI) GetAccounts() ([]Account, error)
- func (h *HUOBI) GetCurrencies() ([]string, error)
- func (h *HUOBI) GetDepth(obd OrderBookDataRequestParams) (Orderbook, error)
- func (h *HUOBI) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (h *HUOBI) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
- func (h *HUOBI) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error)
- func (h *HUOBI) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (h *HUOBI) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error)
- func (h *HUOBI) GetFee() float64
- func (h *HUOBI) GetLatestSpotPrice(symbol string) (float64, error)
- func (h *HUOBI) GetMarginAccountBalance(symbol string) ([]MarginAccountBalance, error)
- func (h *HUOBI) GetMarginLoanOrders(symbol, currency, start, end, states, from, direct, size string) ([]MarginOrder, error)
- func (h *HUOBI) GetMarketDetail(symbol string) (Detail, error)
- func (h *HUOBI) GetMarketDetailMerged(symbol string) (DetailMerged, error)
- func (h *HUOBI) GetOrder(orderID int64) (OrderInfo, error)
- func (h *HUOBI) GetOrderMatchResults(orderID int64) ([]OrderMatchInfo, error)
- func (h *HUOBI) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (h *HUOBI) GetOrders(symbol, types, start, end, states, from, direct, size string) ([]OrderInfo, error)
- func (h *HUOBI) GetOrdersMatch(symbol, types, start, end, from, direct, size string) ([]OrderMatchInfo, error)
- func (h *HUOBI) GetSpotKline(arg KlinesRequestParams) ([]KlineItem, error)
- func (h *HUOBI) GetSymbols() ([]Symbol, error)
- func (h *HUOBI) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (h *HUOBI) GetTimestamp() (int64, error)
- func (h *HUOBI) GetTradeHistory(symbol, size string) ([]TradeHistory, error)
- func (h *HUOBI) GetTrades(symbol string) ([]Trade, error)
- func (h *HUOBI) MarginOrder(symbol, currency string, amount float64) (int64, error)
- func (h *HUOBI) MarginRepayment(orderID int64, amount float64) (int64, error)
- func (h *HUOBI) MarginTransfer(symbol, currency string, amount float64, in bool) (int64, error)
- func (h *HUOBI) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error)
- 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) SendAuthenticatedHTTPRequest(method, endpoint string, values url.Values, result interface{}) error
- func (h *HUOBI) SendHTTPRequest(path string, result interface{}) error
- func (h *HUOBI) SetDefaults()
- func (h *HUOBI) Setup(exch config.ExchangeConfig)
- func (h *HUOBI) SpotNewOrder(arg SpotNewOrderRequestParams) (int64, error)
- func (h *HUOBI) Start(wg *sync.WaitGroup)
- func (h *HUOBI) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, ...) (int64, error)
- 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()
- func (h *HUOBI) Withdraw(address, currency, addrTag string, amount, fee float64) (int64, error)
- func (h *HUOBI) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
- func (h *HUOBI) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
- func (h *HUOBI) WithdrawFiatExchangeFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error)
- type KlineItem
- type KlinesRequestParams
- type MarginAccountBalance
- type MarginOrder
- type OrderBookDataRequestParams
- type OrderBookDataRequestParamsType
- type OrderInfo
- type OrderMatchInfo
- type Orderbook
- type Response
- type SpotNewOrderRequestParams
- type SpotNewOrderRequestParamsType
- type Symbol
- type TimeInterval
- type Trade
- type TradeHistory
- type WebsocketLastTimeline
- type WebsocketMarketOverview
- type WebsocketResponse
- type WebsocketTrade
- type WebsocketTradeDetail
Constants ¶
This section is empty.
Variables ¶
var ( OrderBookDataRequestParamsTypeNone = OrderBookDataRequestParamsType("") OrderBookDataRequestParamsTypeStep0 = OrderBookDataRequestParamsType("step0") OrderBookDataRequestParamsTypeStep1 = OrderBookDataRequestParamsType("step1") OrderBookDataRequestParamsTypeStep2 = OrderBookDataRequestParamsType("step2") OrderBookDataRequestParamsTypeStep3 = OrderBookDataRequestParamsType("step3") OrderBookDataRequestParamsTypeStep4 = OrderBookDataRequestParamsType("step4") OrderBookDataRequestParamsTypeStep5 = OrderBookDataRequestParamsType("step5") )
vars for OrderBookDataRequestParamsTypes
var ( // SpotNewOrderRequestTypeBuyMarket buy market order SpotNewOrderRequestTypeBuyMarket = SpotNewOrderRequestParamsType("buy-market") // SpotNewOrderRequestTypeSellMarket sell market order SpotNewOrderRequestTypeSellMarket = SpotNewOrderRequestParamsType("sell-market") // SpotNewOrderRequestTypeBuyLimit buy limit order SpotNewOrderRequestTypeBuyLimit = SpotNewOrderRequestParamsType("buy-limit") // SpotNewOrderRequestTypeSellLimit sell lmit order SpotNewOrderRequestTypeSellLimit = SpotNewOrderRequestParamsType("sell-limit") )
var ( TimeIntervalMinute = TimeInterval("1min") TimeIntervalFiveMinutes = TimeInterval("5min") TimeIntervalFifteenMinutes = TimeInterval("15min") TimeIntervalThirtyMinutes = TimeInterval("30min") TimeIntervalHour = TimeInterval("60min") TimeIntervalDay = TimeInterval("1day") TimeIntervalWeek = TimeInterval("1week") TimeIntervalMohth = TimeInterval("1mon") TimeIntervalYear = TimeInterval("1year") )
TimeInterval vars
var HuobiSocket *socketio.SocketIO
HuobiSocket is a pointer to a IO Socket
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID int64 `json:"id"` Type string `json:"type"` State string `json:"working"` UserID int64 `json:"user-id"` }
Account stores the account data
type AccountBalance ¶
type AccountBalance struct { ID int64 `json:"id"` Type string `json:"type"` State string `json:"state"` AccountBalanceDetails []AccountBalanceDetail `json:"list"` }
AccountBalance stores the user all account balance
type AccountBalanceDetail ¶
type AccountBalanceDetail struct { Currency string `json:"currency"` Type string `json:"type"` Balance float64 `json:"balance,string"` }
AccountBalanceDetail stores the user account balance
type CancelOrderBatch ¶
type CancelOrderBatch struct { Success []string `json:"success"` Failed []struct { OrderID int64 `json:"order-id,string"` ErrorCode string `json:"err-code"` ErrorMessage string `json:"err-msg"` } `json:"failed"` }
CancelOrderBatch stores the cancel order batch data
type Depth ¶
type Depth 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"` }
Depth holds depth information
type Detail ¶
type Detail struct { Amount float64 `json:"amount"` Open float64 `json:"open"` Close float64 `json:"close"` High float64 `json:"high"` Timestamp int64 `json:"timestamp"` ID int `json:"id"` Count int `json:"count"` Low float64 `json:"low"` Volume float64 `json:"vol"` }
Detail stores the ticker detail data
type DetailMerged ¶
type DetailMerged struct { Detail Version int `json:"version"` Ask []float64 `json:"ask"` Bid []float64 `json:"bid"` }
DetailMerged stores the ticker detail merged data
type HUOBI ¶
HUOBI is the overarching type across this package
func (*HUOBI) BuildHuobiWebsocketParamsList ¶
func (h *HUOBI) BuildHuobiWebsocketParamsList(objectName, currency, pushType, period, count, from, to, percentage string) interface{}
BuildHuobiWebsocketParamsList packages a parameter list
func (*HUOBI) BuildHuobiWebsocketRequest ¶
func (h *HUOBI) BuildHuobiWebsocketRequest(msgType string, requestIndex int64, symbolRequest []string) map[string]interface{}
BuildHuobiWebsocketRequest packages a new request
func (*HUOBI) BuildHuobiWebsocketRequestExtra ¶
func (h *HUOBI) BuildHuobiWebsocketRequestExtra(msgType string, requestIndex int64, symbolIDList interface{}) interface{}
BuildHuobiWebsocketRequestExtra packages an extra request
func (*HUOBI) CancelAllExchangeOrders ¶
CancelAllExchangeOrders cancels all orders associated with a currency pair
func (*HUOBI) CancelExchangeOrder ¶
CancelExchangeOrder cancels an order by its corresponding ID number
func (*HUOBI) CancelOrder ¶
CancelOrder cancels an order on Huobi
func (*HUOBI) CancelOrderBatch ¶
func (h *HUOBI) CancelOrderBatch(orderIDs []int64) ([]CancelOrderBatch, error)
CancelOrderBatch cancels a batch of orders -- to-do
func (*HUOBI) CancelWithdraw ¶
CancelWithdraw cancels a withdraw request
func (*HUOBI) GetAccountBalance ¶
func (h *HUOBI) GetAccountBalance(accountID string) ([]AccountBalanceDetail, error)
GetAccountBalance returns the users Huobi account balance
func (*HUOBI) GetAccounts ¶
GetAccounts returns the Huobi user accounts
func (*HUOBI) GetCurrencies ¶
GetCurrencies returns a list of currencies supported by Huobi
func (*HUOBI) GetDepth ¶
func (h *HUOBI) GetDepth(obd OrderBookDataRequestParams) (Orderbook, error)
GetDepth returns the depth for the specified symbol
func (*HUOBI) GetExchangeAccountInfo ¶
GetExchangeAccountInfo retrieves balances for all enabled currencies for the HUOBI exchange - to-do
func (*HUOBI) GetExchangeDepositAddress ¶
func (h *HUOBI) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
GetExchangeDepositAddress returns a deposit address for a specified currency
func (*HUOBI) GetExchangeFundTransferHistory ¶
GetExchangeFundTransferHistory returns funding history, deposits and withdrawals
func (*HUOBI) GetExchangeHistory ¶
func (h *HUOBI) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*HUOBI) GetExchangeOrderInfo ¶
GetExchangeOrderInfo returns information on a current open order
func (*HUOBI) GetLatestSpotPrice ¶
GetLatestSpotPrice returns latest spot price of symbol
symbol: string of currency pair
func (*HUOBI) GetMarginAccountBalance ¶
func (h *HUOBI) GetMarginAccountBalance(symbol string) ([]MarginAccountBalance, error)
GetMarginAccountBalance returns the margin account balances
func (*HUOBI) GetMarginLoanOrders ¶
func (h *HUOBI) GetMarginLoanOrders(symbol, currency, start, end, states, from, direct, size string) ([]MarginOrder, error)
GetMarginLoanOrders returns the margin loan orders
func (*HUOBI) GetMarketDetail ¶
GetMarketDetail returns the ticker for the specified symbol
func (*HUOBI) GetMarketDetailMerged ¶
func (h *HUOBI) GetMarketDetailMerged(symbol string) (DetailMerged, error)
GetMarketDetailMerged returns the ticker for the specified symbol
func (*HUOBI) GetOrderMatchResults ¶
func (h *HUOBI) GetOrderMatchResults(orderID int64) ([]OrderMatchInfo, error)
GetOrderMatchResults returns matched order info for the specified order
func (*HUOBI) GetOrderbookEx ¶
GetOrderbookEx returns orderbook base on the currency pair
func (*HUOBI) GetOrders ¶
func (h *HUOBI) GetOrders(symbol, types, start, end, states, from, direct, size string) ([]OrderInfo, error)
GetOrders returns a list of orders
func (*HUOBI) GetOrdersMatch ¶
func (h *HUOBI) GetOrdersMatch(symbol, types, start, end, from, direct, size string) ([]OrderMatchInfo, error)
GetOrdersMatch returns a list of matched orders
func (*HUOBI) GetSpotKline ¶
func (h *HUOBI) GetSpotKline(arg KlinesRequestParams) ([]KlineItem, error)
GetSpotKline returns kline data KlinesRequestParams contains symbol, period and size
func (*HUOBI) GetSymbols ¶
GetSymbols returns an array of symbols supported by Huobi
func (*HUOBI) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*HUOBI) GetTimestamp ¶
GetTimestamp returns the Huobi server time
func (*HUOBI) GetTradeHistory ¶
func (h *HUOBI) GetTradeHistory(symbol, size string) ([]TradeHistory, error)
GetTradeHistory returns the trades for the specified symbol
func (*HUOBI) MarginOrder ¶
MarginOrder submits a margin order application
func (*HUOBI) MarginRepayment ¶
MarginRepayment repays a margin amount for a margin ID
func (*HUOBI) MarginTransfer ¶
MarginTransfer transfers assets into or out of the margin account
func (*HUOBI) ModifyExchangeOrder ¶
ModifyExchangeOrder will allow of changing orderbook placement and limit to market conversion
func (*HUOBI) OnDisconnect ¶
OnDisconnect handles disconnection
func (*HUOBI) SendAuthenticatedHTTPRequest ¶
func (h *HUOBI) SendAuthenticatedHTTPRequest(method, endpoint string, values url.Values, result interface{}) error
SendAuthenticatedHTTPRequest sends authenticated requests to the HUOBI API
func (*HUOBI) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated HTTP request
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) SpotNewOrder ¶
func (h *HUOBI) SpotNewOrder(arg SpotNewOrderRequestParams) (int64, error)
SpotNewOrder submits an order to Huobi
func (*HUOBI) SubmitExchangeOrder ¶
func (h *HUOBI) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error)
SubmitExchangeOrder submits a new order
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()
WebsocketClient creates a new websocket client
func (*HUOBI) WithdrawCryptoExchangeFunds ¶
func (h *HUOBI) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
WithdrawCryptoExchangeFunds returns a withdrawal ID when a withdrawal is submitted
func (*HUOBI) WithdrawFiatExchangeFunds ¶
func (h *HUOBI) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
WithdrawFiatExchangeFunds returns a withdrawal ID when a withdrawal is submitted
func (*HUOBI) WithdrawFiatExchangeFundsToInternationalBank ¶
func (h *HUOBI) WithdrawFiatExchangeFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error)
WithdrawFiatExchangeFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
type KlineItem ¶
type KlineItem struct { ID int64 `json:"id"` Open float64 `json:"open"` Close float64 `json:"close"` Low float64 `json:"low"` High float64 `json:"high"` Amount float64 `json:"amount"` Vol float64 `json:"vol"` Count int `json:"count"` }
KlineItem stores a kline item
type KlinesRequestParams ¶
type KlinesRequestParams struct { Symbol string // Symbol to be used; example btcusdt, bccbtc...... Period TimeInterval // Kline time interval; 1min, 5min, 15min...... Size int // Size; [1-2000] }
KlinesRequestParams represents Klines request data.
type MarginAccountBalance ¶
type MarginAccountBalance struct { ID int `json:"id"` Type string `json:"type"` State string `json:"state"` Symbol string `json:"symbol"` FlPrice string `json:"fl-price"` FlType string `json:"fl-type"` RiskRate string `json:"risk-rate"` List []AccountBalance `json:"list"` }
MarginAccountBalance stores the margin account balance info
type MarginOrder ¶
type MarginOrder struct { Currency string `json:"currency"` Symbol string `json:"symbol"` AccruedAt int64 `json:"accrued-at"` LoanAmount string `json:"loan-amount"` LoanBalance string `json:"loan-balance"` InterestBalance string `json:"interest-balance"` CreatedAt int64 `json:"created-at"` InterestAmount string `json:"interest-amount"` InterestRate string `json:"interest-rate"` AccountID int `json:"account-id"` UserID int `json:"user-id"` UpdatedAt int64 `json:"updated-at"` ID int `json:"id"` State string `json:"state"` }
MarginOrder stores the margin order info
type OrderBookDataRequestParams ¶
type OrderBookDataRequestParams struct { Symbol string `json:"symbol"` // Required; example LTCBTC,BTCUSDT Type OrderBookDataRequestParamsType `json:"type"` // step0, step1, step2, step3, step4, step5 (combined depth 0-5); when step0, no depth is merged }
OrderBookDataRequestParams represents Klines request data.
type OrderBookDataRequestParamsType ¶
type OrderBookDataRequestParamsType string
OrderBookDataRequestParamsType var for request param types
type OrderInfo ¶
type OrderInfo struct { ID int `json:"id"` Symbol string `json:"symbol"` AccountID int `json:"account-id"` Amount string `json:"amount"` Price string `json:"price"` CreatedAt int64 `json:"created-at"` Type string `json:"type"` FieldAmount string `json:"field-amount"` FieldCashAmount string `json:"field-cash-amount"` FieldFees string `json:"field-fees"` FinishedAt int64 `json:"finished-at"` UserID int `json:"user-id"` Source string `json:"source"` State string `json:"state"` CanceledAt int `json:"canceled-at"` Exchange string `json:"exchange"` Batch string `json:"batch"` }
OrderInfo stores the order info
type OrderMatchInfo ¶
type OrderMatchInfo struct { ID int `json:"id"` OrderID int `json:"order-id"` MatchID int `json:"match-id"` Symbol string `json:"symbol"` Type string `json:"type"` Source string `json:"source"` Price string `json:"price"` FilledAmount string `json:"filled-amount"` FilledFees string `json:"filled-fees"` CreatedAt int64 `json:"created-at"` }
OrderMatchInfo stores the order match info
type Orderbook ¶
type Orderbook struct { ID int64 `json:"id"` Timetstamp int64 `json:"ts"` Bids [][]float64 `json:"bids"` Asks [][]float64 `json:"asks"` }
Orderbook stores the orderbook data
type Response ¶
type Response struct { Status string `json:"status"` Channel string `json:"ch"` Timestamp int64 `json:"ts"` ErrorCode string `json:"err-code"` ErrorMessage string `json:"err-msg"` }
Response stores the Huobi response information
type SpotNewOrderRequestParams ¶
type SpotNewOrderRequestParams struct { AccountID int `json:"account-id"` // Account ID, obtained using the accounts method. Curency trades use the accountid of the ‘spot’ account; for loan asset transactions, please use the accountid of the ‘margin’ account. Amount float64 `json:"amount"` // The limit price indicates the quantity of the order, the market price indicates how much to buy when the order is paid, and the market price indicates how much the coin is sold when the order is sold. Price float64 `json:"price"` // Order price, market price does not use this parameter Source string `json:"source"` // Order source, api: API call, margin-api: loan asset transaction Symbol string `json:"symbol"` // The symbol to use; example btcusdt, bccbtc...... Type SpotNewOrderRequestParamsType `json:"type"` // 订单类型, buy-market: 市价买, sell-market: 市价卖, buy-limit: 限价买, sell-limit: 限价卖 }
SpotNewOrderRequestParams holds the params required to place an order
type SpotNewOrderRequestParamsType ¶
type SpotNewOrderRequestParamsType string
SpotNewOrderRequestParamsType order type
type Symbol ¶
type Symbol struct { BaseCurrency string `json:"base-currency"` QuoteCurrency string `json:"quote-currency"` PricePrecision int `json:"price-precision"` AmountPrecision int `json:"amount-precision"` SymbolPartition string `json:"symbol-partition"` }
Symbol stores the symbol data
type Trade ¶
type Trade struct { ID float64 `json:"id"` Price float64 `json:"price"` Amount float64 `json:"amount"` Direction string `json:"direction"` Timestamp int64 `json:"ts"` }
Trade stores the trade data
type TradeHistory ¶
type TradeHistory struct { ID int64 `json:"id"` Timestamp int64 `json:"ts"` Trades []Trade `json:"data"` }
TradeHistory stores the the trade history data
type WebsocketLastTimeline ¶
type WebsocketLastTimeline struct { ID int64 `json:"_id"` SymbolID string `json:"symbolId"` Time int64 `json:"time"` LastPrice float64 `json:"priceLast"` Amount float64 `json:"amount"` Volume float64 `json:"volume"` Count int64 `json:"count"` }
WebsocketLastTimeline holds timeline data
type WebsocketMarketOverview ¶
type WebsocketMarketOverview 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"` }
WebsocketMarketOverview holds market overview data
type WebsocketResponse ¶
type WebsocketResponse struct { Version int `json:"version"` MsgType string `json:"msgType"` RequestIndex int64 `json:"requestIndex"` RetCode int64 `json:"retCode"` RetMessage string `json:"retMsg"` Payload map[string]interface{} `json:"payload"` }
WebsocketResponse is a general response type for websocket
type WebsocketTrade ¶
type WebsocketTrade struct { Price []float64 `json:"price"` Level []float64 `json:"level"` Amount []float64 `json:"amount"` AccuAmount []float64 `json:"accuAmount"` }
WebsocketTrade holds full trade data
type WebsocketTradeDetail ¶
type WebsocketTradeDetail struct { SymbolID string `json:"symbolId"` TradeID []int64 `json:"tradeId"` Price []float64 `json:"price"` Time []int64 `json:"time"` Amount []float64 `json:"amount"` TopBids []WebsocketTrade `json:"topBids"` TopAsks []WebsocketTrade `json:"topAsks"` }
WebsocketTradeDetail holds specific trade details