Documentation ¶
Index ¶
- Variables
- type Account
- type AggregatedTrade
- type Balance
- type BestPrice
- type Binance
- func (b *Binance) AllOrders(symbol, orderID, limit string) ([]QueryOrderData, error)
- func (b *Binance) CancelAllExchangeOrders() error
- func (b *Binance) CancelExchangeOrder(orderID int64) error
- func (b *Binance) CancelOrder(symbol string, orderID int64, origClientOrderID string) (CancelOrderResponse, error)
- func (b *Binance) CheckIntervals(interval string) error
- func (b *Binance) CheckLimit(limit int) error
- func (b *Binance) CheckSymbol(symbol string) error
- func (b *Binance) GetAccount() (*Account, error)
- func (b *Binance) GetAggregatedTrades(symbol string, limit int) ([]AggregatedTrade, error)
- func (b *Binance) GetBestPrice(symbol string) (BestPrice, error)
- func (b *Binance) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (b *Binance) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
- func (b *Binance) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error)
- func (b *Binance) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (b *Binance) GetExchangeInfo() (ExchangeInfo, error)
- func (b *Binance) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error)
- func (b *Binance) GetExchangeValidCurrencyPairs() ([]string, error)
- func (b *Binance) GetHistoricalTrades(symbol string, limit int, fromID int64) ([]HistoricalTrade, error)
- func (b *Binance) GetLatestSpotPrice(symbol string) (SymbolPrice, error)
- func (b *Binance) GetOrderBook(obd OrderBookDataRequestParams) (OrderBook, error)
- func (b *Binance) GetOrderbookEx(currency pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (b *Binance) GetPriceChangeStats(symbol string) (PriceChangeStats, error)
- func (b *Binance) GetRecentTrades(rtr RecentTradeRequestParams) ([]RecentTrade, error)
- func (b *Binance) GetSpotKline(arg KlinesRequestParams) ([]CandleStick, error)
- func (b *Binance) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (b *Binance) GetTickers() ([]PriceChangeStats, error)
- func (b *Binance) ModifyExchangeOrder(orderID int64, action exchange.ModifyOrder) (int64, error)
- func (b *Binance) NewOrder(o NewOrderRequest) (NewOrderResponse, error)
- func (b *Binance) NewOrderTest() (interface{}, error)
- func (b *Binance) OpenOrders(symbol string) ([]QueryOrderData, error)
- func (b *Binance) QueryOrder(symbol, origClientOrderID string, orderID int64) (QueryOrderData, error)
- func (b *Binance) Run()
- func (b *Binance) SendAuthHTTPRequest(method, path string, params url.Values, result interface{}) error
- func (b *Binance) SendHTTPRequest(path string, result interface{}) error
- func (b *Binance) SetDefaults()
- func (b *Binance) SetValues()
- func (b *Binance) Setup(exch config.ExchangeConfig)
- func (b *Binance) Start(wg *sync.WaitGroup)
- func (b *Binance) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, ...) (int64, error)
- func (b *Binance) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (b *Binance) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (b *Binance) WebsocketClient()
- func (b *Binance) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
- func (b *Binance) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
- func (b *Binance) WithdrawFiatExchangeFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error)
- type CancelOrderResponse
- type CandleStick
- type ExchangeInfo
- type HistoricalTrade
- type KlineStream
- type KlinesRequestParams
- type MultiStreamData
- type NewOrderRequest
- type NewOrderResponse
- type OrderBook
- type OrderBookData
- type OrderBookDataRequestParams
- type PriceChangeStats
- type QueryOrderData
- type RecentTrade
- type RecentTradeRequestParams
- type RequestParamsOrderType
- type RequestParamsSideType
- type RequestParamsTimeForceType
- type Response
- type SymbolPrice
- type TickerStream
- type TimeInterval
- type TradeStream
Constants ¶
This section is empty.
Variables ¶
var ( // BinanceRequestParamsSideBuy buy order type BinanceRequestParamsSideBuy = RequestParamsSideType("BUY") // BinanceRequestParamsSideSell sell order type BinanceRequestParamsSideSell = RequestParamsSideType("SELL") )
var ( // BinanceRequestParamsTimeGTC GTC BinanceRequestParamsTimeGTC = RequestParamsTimeForceType("GTC") // BinanceRequestParamsTimeIOC IOC BinanceRequestParamsTimeIOC = RequestParamsTimeForceType("IOC") // BinanceRequestParamsTimeFOK FOK BinanceRequestParamsTimeFOK = RequestParamsTimeForceType("FOK") )
var ( // BinanceRequestParamsOrderLimit Limit order BinanceRequestParamsOrderLimit = RequestParamsOrderType("LIMIT") // BinanceRequestParamsOrderMarket Market order BinanceRequestParamsOrderMarket = RequestParamsOrderType("MARKET") // BinanceRequestParamsOrderStopLoss STOP_LOSS BinanceRequestParamsOrderStopLoss = RequestParamsOrderType("STOP_LOSS") // BinanceRequestParamsOrderStopLossLimit STOP_LOSS_LIMIT BinanceRequestParamsOrderStopLossLimit = RequestParamsOrderType("STOP_LOSS_LIMIT") // BinanceRequestParamsOrderTakeProfit TAKE_PROFIT BinanceRequestParamsOrderTakeProfit = RequestParamsOrderType("TAKE_PROFIT") // BinanceRequestParamsOrderTakeProfitLimit TAKE_PROFIT_LIMIT BinanceRequestParamsOrderTakeProfitLimit = RequestParamsOrderType("TAKE_PROFIT_LIMIT") // BinanceRequestParamsOrderLimitMarker LIMIT_MAKER BinanceRequestParamsOrderLimitMarker = RequestParamsOrderType("LIMIT_MAKER") )
var ( TimeIntervalMinute = TimeInterval("1m") TimeIntervalThreeMinutes = TimeInterval("3m") TimeIntervalFiveMinutes = TimeInterval("5m") TimeIntervalFifteenMinutes = TimeInterval("15m") TimeIntervalThirtyMinutes = TimeInterval("30m") TimeIntervalHour = TimeInterval("1h") TimeIntervalTwoHours = TimeInterval("2h") TimeIntervalFourHours = TimeInterval("4h") TimeIntervalSixHours = TimeInterval("6h") TimeIntervalEightHours = TimeInterval("8h") TimeIntervalTwelveHours = TimeInterval("12h") TimeIntervalDay = TimeInterval("1d") TimeIntervalThreeDays = TimeInterval("3d") TimeIntervalWeek = TimeInterval("1w") TimeIntervalMonth = TimeInterval("1M") )
Vars related to time intervals
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { MakerCommission int `json:"makerCommission"` TakerCommission int `json:"takerCommission"` BuyerCommission int `json:"buyerCommission"` SellerCommission int `json:"sellerCommission"` CanTrade bool `json:"canTrade"` CanWithdraw bool `json:"canWithdraw"` CanDeposit bool `json:"canDeposit"` UpdateTime int64 `json:"updateTime"` Balances []Balance `json:"balances"` }
Account holds the account data
type AggregatedTrade ¶
type AggregatedTrade struct { ATradeID int64 `json:"a"` Price float64 `json:"p,string"` Quantity float64 `json:"q,string"` FirstTradeID int64 `json:"f"` LastTradeID int64 `json:"l"` TimeStamp int64 `json:"T"` Maker bool `json:"m"` BestMatchPrice bool `json:"M"` }
AggregatedTrade holds aggregated trade information
type Balance ¶
type Balance struct { Asset string `json:"asset"` Free string `json:"free"` Locked string `json:"locked"` }
Balance holds query order data
type BestPrice ¶
type BestPrice struct { Symbol string `json:"symbol"` BidPrice float64 `json:"bidPrice,string"` BidQty float64 `json:"bidQty,string"` AskPrice float64 `json:"askPrice,string"` AskQty float64 `json:"askQty,string"` }
BestPrice holds best price data
type Binance ¶
type Binance struct { exchange.Base WebsocketConn *websocket.Conn // contains filtered or unexported fields }
Binance is the overarching type across the Bithumb package
func (*Binance) AllOrders ¶
func (b *Binance) AllOrders(symbol, orderID, limit string) ([]QueryOrderData, error)
AllOrders Get all account orders; active, canceled, or filled. orderId optional param limit optional param, default 500; max 500
func (*Binance) CancelAllExchangeOrders ¶
CancelAllExchangeOrders cancels all orders associated with a currency pair
func (*Binance) CancelExchangeOrder ¶
CancelExchangeOrder cancels an order by its corresponding ID number
func (*Binance) CancelOrder ¶
func (b *Binance) CancelOrder(symbol string, orderID int64, origClientOrderID string) (CancelOrderResponse, error)
CancelOrder sends a cancel order to Binance
func (*Binance) CheckIntervals ¶
CheckIntervals checks value against a variable list
func (*Binance) CheckLimit ¶
CheckLimit checks value against a variable list
func (*Binance) CheckSymbol ¶
CheckSymbol checks value against a variable list
func (*Binance) GetAccount ¶
GetAccount returns binance user accounts
func (*Binance) GetAggregatedTrades ¶
func (b *Binance) GetAggregatedTrades(symbol string, limit int) ([]AggregatedTrade, error)
GetAggregatedTrades returns aggregated trade activity
symbol: string of currency pair limit: Optional. Default 500; max 1000.
func (*Binance) GetBestPrice ¶
GetBestPrice returns the latest best price for symbol
symbol: string of currency pair
func (*Binance) GetExchangeAccountInfo ¶
func (b *Binance) GetExchangeAccountInfo() (exchange.AccountInfo, error)
GetExchangeAccountInfo retrieves balances for all enabled currencies for the Bithumb exchange
func (*Binance) GetExchangeDepositAddress ¶
func (b *Binance) GetExchangeDepositAddress(cryptocurrency pair.CurrencyItem) (string, error)
GetExchangeDepositAddress returns a deposit address for a specified currency
func (*Binance) GetExchangeFundTransferHistory ¶
func (b *Binance) GetExchangeFundTransferHistory() ([]exchange.FundHistory, error)
GetExchangeFundTransferHistory returns funding history, deposits and withdrawals
func (*Binance) GetExchangeHistory ¶
func (b *Binance) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data since exchange opening.
func (*Binance) GetExchangeInfo ¶
func (b *Binance) GetExchangeInfo() (ExchangeInfo, error)
GetExchangeInfo returns exchange information. Check binance_types for more information
func (*Binance) GetExchangeOrderInfo ¶
func (b *Binance) GetExchangeOrderInfo(orderID int64) (exchange.OrderDetail, error)
GetExchangeOrderInfo returns information on a current open order
func (*Binance) GetExchangeValidCurrencyPairs ¶
GetExchangeValidCurrencyPairs returns the full pair list from the exchange at the moment do not integrate with config currency pairs automatically
func (*Binance) GetHistoricalTrades ¶
func (b *Binance) GetHistoricalTrades(symbol string, limit int, fromID int64) ([]HistoricalTrade, error)
GetHistoricalTrades returns historical trade activity
symbol: string of currency pair limit: Optional. Default 500; max 1000. fromID:
func (*Binance) GetLatestSpotPrice ¶
func (b *Binance) GetLatestSpotPrice(symbol string) (SymbolPrice, error)
GetLatestSpotPrice returns latest spot price of symbol
symbol: string of currency pair
func (*Binance) GetOrderBook ¶
func (b *Binance) GetOrderBook(obd OrderBookDataRequestParams) (OrderBook, error)
GetOrderBook returns full orderbook information
OrderBookDataRequestParams contains the following members symbol: string of currency pair limit: returned limit amount
func (*Binance) GetOrderbookEx ¶
func (b *Binance) GetOrderbookEx(currency pair.CurrencyPair, assetType string) (orderbook.Base, error)
GetOrderbookEx returns orderbook base on the currency pair
func (*Binance) GetPriceChangeStats ¶
func (b *Binance) GetPriceChangeStats(symbol string) (PriceChangeStats, error)
GetPriceChangeStats returns price change statistics for the last 24 hours
symbol: string of currency pair
func (*Binance) GetRecentTrades ¶
func (b *Binance) GetRecentTrades(rtr RecentTradeRequestParams) ([]RecentTrade, error)
GetRecentTrades returns recent trade activity limit: Up to 500 results returned
func (*Binance) GetSpotKline ¶
func (b *Binance) GetSpotKline(arg KlinesRequestParams) ([]CandleStick, error)
GetSpotKline returns kline data
KlinesRequestParams supports 5 parameters symbol: the symbol to get the kline data for limit: optinal interval: the interval time for the data startTime: startTime filter for kline data endTime: endTime filter for the kline data
func (*Binance) GetTickerPrice ¶
GetTickerPrice returns the ticker for a currency pair
func (*Binance) GetTickers ¶
func (b *Binance) GetTickers() ([]PriceChangeStats, error)
GetTickers returns the ticker data for the last 24 hrs
func (*Binance) ModifyExchangeOrder ¶
ModifyExchangeOrder will allow of changing orderbook placement and limit to market conversion
func (*Binance) NewOrder ¶
func (b *Binance) NewOrder(o NewOrderRequest) (NewOrderResponse, error)
NewOrder sends a new order to Binance
func (*Binance) NewOrderTest ¶
NewOrderTest sends a new order
func (*Binance) OpenOrders ¶
func (b *Binance) OpenOrders(symbol string) ([]QueryOrderData, error)
OpenOrders Current open orders Get all open orders on a symbol. Careful when accessing this with no symbol.
func (*Binance) QueryOrder ¶
func (b *Binance) QueryOrder(symbol, origClientOrderID string, orderID int64) (QueryOrderData, error)
QueryOrder returns information on a past order
func (*Binance) SendAuthHTTPRequest ¶
func (b *Binance) SendAuthHTTPRequest(method, path string, params url.Values, result interface{}) error
SendAuthHTTPRequest sends an authenticated HTTP request
func (*Binance) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated request
func (*Binance) SetDefaults ¶
func (b *Binance) SetDefaults()
SetDefaults sets the basic defaults for Binance
func (*Binance) Setup ¶
func (b *Binance) Setup(exch config.ExchangeConfig)
Setup takes in the supplied exchange configuration details and sets params
func (*Binance) SubmitExchangeOrder ¶
func (b *Binance) SubmitExchangeOrder(p pair.CurrencyPair, side exchange.OrderSide, orderType exchange.OrderType, amount, price float64, clientID string) (int64, error)
SubmitExchangeOrder submits a new order
func (*Binance) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Binance) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*Binance) WebsocketClient ¶
func (b *Binance) WebsocketClient()
WebsocketClient starts and handles the websocket client connection
func (*Binance) WithdrawCryptoExchangeFunds ¶
func (b *Binance) WithdrawCryptoExchangeFunds(address string, cryptocurrency pair.CurrencyItem, amount float64) (string, error)
WithdrawCryptoExchangeFunds returns a withdrawal ID when a withdrawal is submitted
func (*Binance) WithdrawFiatExchangeFunds ¶
func (b *Binance) WithdrawFiatExchangeFunds(currency pair.CurrencyItem, amount float64) (string, error)
WithdrawFiatExchangeFunds returns a withdrawal ID when a withdrawal is submitted
func (*Binance) WithdrawFiatExchangeFundsToInternationalBank ¶
func (b *Binance) WithdrawFiatExchangeFundsToInternationalBank(currency pair.CurrencyItem, amount float64) (string, error)
WithdrawFiatExchangeFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
type CancelOrderResponse ¶
type CancelOrderResponse struct { Symbol string `json:"symbol"` OrigClientOrderID string `json:"origClientOrderId"` OrderID int64 `json:"orderId"` ClientOrderID string `json:"clientOrderId"` }
CancelOrderResponse is the return structured response from the exchange
type CandleStick ¶
type CandleStick struct { OpenTime float64 Open float64 High float64 Low float64 Close float64 Volume float64 CloseTime float64 QuoteAssetVolume float64 TradeCount float64 TakerBuyAssetVolume float64 TakerBuyQuoteAssetVolume float64 }
CandleStick holds kline data
type ExchangeInfo ¶
type ExchangeInfo struct { Code int `json:"code"` Msg string `json:"msg"` Timezone string `json:"timezone"` Servertime int64 `json:"serverTime"` RateLimits []struct { RateLimitType string `json:"rateLimitType"` Interval string `json:"interval"` Limit int `json:"limit"` } `json:"rateLimits"` ExchangeFilters interface{} `json:"exchangeFilters"` Symbols []struct { Symbol string `json:"symbol"` Status string `json:"status"` BaseAsset string `json:"baseAsset"` BaseAssetPrecision int `json:"baseAssetPrecision"` QuoteAsset string `json:"quoteAsset"` QuotePrecision int `json:"quotePrecision"` OrderTypes []string `json:"orderTypes"` IcebergAllowed bool `json:"icebergAllowed"` Filters []struct { FilterType string `json:"filterType"` MinPrice float64 `json:"minPrice,string"` MaxPrice float64 `json:"maxPrice,string"` TickSize float64 `json:"tickSize,string"` MinQty float64 `json:"minQty,string"` MaxQty float64 `json:"maxQty,string"` StepSize float64 `json:"stepSize,string"` MinNotional float64 `json:"minNotional,string"` } `json:"filters"` } `json:"symbols"` }
ExchangeInfo holds the full exchange information type
type HistoricalTrade ¶
type HistoricalTrade struct { Code int `json:"code"` Msg string `json:"msg"` ID int64 `json:"id"` Price float64 `json:"price,string"` Quantity float64 `json:"qty,string"` Time int64 `json:"time"` IsBuyerMaker bool `json:"isBuyerMaker"` IsBestMatch bool `json:"isBestMatch"` }
HistoricalTrade holds recent trade data
type KlineStream ¶
type KlineStream struct { EventType string `json:"e"` EventTime int64 `json:"E"` Symbol string `json:"s"` Kline struct { StartTime int64 `json:"t"` CloseTime int64 `json:"T"` Symbol string `json:"s"` Interval string `json:"i"` FirstTradeID int64 `json:"f"` LastTradeID int64 `json:"L"` OpenPrice string `json:"o"` ClosePrice string `json:"c"` HighPrice string `json:"h"` LowPrice string `json:"l"` Volume string `json:"v"` NumberOfTrades int64 `json:"n"` KlineClosed bool `json:"x"` Quote string `json:"q"` TakerBuyBaseAssetVolume string `json:"V"` TakerBuyQuoteAssetVolume string `json:"Q"` } `json:"k"` }
KlineStream holds the kline stream data
type KlinesRequestParams ¶
type KlinesRequestParams struct { Symbol string // Required field; example LTCBTC, BTCUSDT Interval TimeInterval // Time interval period Limit int // Default 500; max 500. StartTime int64 EndTime int64 }
KlinesRequestParams represents Klines request data.
type MultiStreamData ¶
type MultiStreamData struct { Stream string `json:"stream"` Data json.RawMessage `json:"data"` }
MultiStreamData holds stream data
type NewOrderRequest ¶
type NewOrderRequest struct { // Symbol (currency pair to trade) Symbol string // Side Buy or Sell Side RequestParamsSideType // TradeType (market or limit order) TradeType RequestParamsOrderType // TimeInForce specifies how long the order remains in effect. // Examples are (Good Till Cancel (GTC), Immediate or Cancel (IOC) and Fill Or Kill (FOK)) TimeInForce RequestParamsTimeForceType // Quantity Quantity float64 Price float64 NewClientOrderID string StopPrice float64 //Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders. IcebergQty float64 //Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order. NewOrderRespType string }
NewOrderRequest request type
type NewOrderResponse ¶
type NewOrderResponse struct { Code int `json:"code"` Msg string `json:"msg"` Symbol string `json:"symbol"` OrderID int64 `json:"orderId"` ClientOrderID string `json:"clientOrderId"` TransactionTime int64 `json:"transactTime"` Price float64 `json:"price,string"` OrigQty float64 `json:"origQty,string"` ExecutedQty float64 `json:"executedQty,string"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` Type string `json:"type"` Side string `json:"side"` Fills []struct { Price float64 `json:"price,string"` Qty float64 `json:"qty,string"` Commission float64 `json:"commission,string"` CommissionAsset float64 `json:"commissionAsset,string"` } `json:"fills"` }
NewOrderResponse is the return structured response from the exchange
type OrderBook ¶
type OrderBook struct { Code int Msg string Bids []struct { Price float64 Quantity float64 } Asks []struct { Price float64 Quantity float64 } }
OrderBook actual structured data that can be used for orderbook
type OrderBookData ¶
type OrderBookData struct { Code int `json:"code"` Msg string `json:"msg"` LastUpdateID int64 `json:"lastUpdateId"` Bids []interface{} `json:"bids"` Asks []interface{} `json:"asks"` }
OrderBookData is resp data from orderbook endpoint
type OrderBookDataRequestParams ¶
type OrderBookDataRequestParams struct { Symbol string `json:"symbol"` // Required field; example LTCBTC,BTCUSDT Limit int `json:"limit"` // Default 100; max 1000. Valid limits:[5, 10, 20, 50, 100, 500, 1000] }
OrderBookDataRequestParams represents Klines request data.
type PriceChangeStats ¶
type PriceChangeStats struct { Symbol string `json:"symbol"` PriceChange float64 `json:"priceChange,string"` PriceChangePercent float64 `json:"priceChangePercent,string"` WeightedAvgPrice float64 `json:"weightedAvgPrice,string"` PrevClosePrice float64 `json:"prevClosePrice,string"` LastPrice float64 `json:"lastPrice,string"` LastQty float64 `json:"lastQty,string"` BidPrice float64 `json:"bidPrice,string"` AskPrice float64 `json:"askPrice,string"` OpenPrice float64 `json:"openPrice,string"` HighPrice float64 `json:"highPrice,string"` LowPrice float64 `json:"lowPrice,string"` Volume float64 `json:"volume,string"` QuoteVolume float64 `json:"quoteVolume,string"` OpenTime int64 `json:"openTime"` CloseTime int64 `json:"closeTime"` FirstID int64 `json:"fristId"` LastID int64 `json:"lastId"` Count int64 `json:"count"` }
PriceChangeStats contains statistics for the last 24 hours trade
type QueryOrderData ¶
type QueryOrderData struct { Code int `json:"code"` Msg string `json:"msg"` Symbol string `json:"symbol"` OrderID int64 `json:"orderId"` ClientOrderID string `json:"clientOrderId"` Price float64 `json:"price,string"` OrigQty float64 `json:"origQty,string"` ExecutedQty float64 `json:"executedQty,string"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` Type string `json:"type"` Side string `json:"side"` StopPrice float64 `json:"stopPrice,string"` IcebergQty float64 `json:"icebergQty,string"` Time float64 `json:"time"` IsWorking bool `json:"isWorking"` }
QueryOrderData holds query order data
type RecentTrade ¶
type RecentTrade struct { Code int `json:"code"` Msg string `json:"msg"` ID int64 `json:"id"` Price float64 `json:"price,string"` Quantity float64 `json:"qty,string"` Time float64 `json:"time"` IsBuyerMaker bool `json:"isBuyerMaker"` IsBestMatch bool `json:"isBestMatch"` }
RecentTrade holds recent trade data
type RecentTradeRequestParams ¶
type RecentTradeRequestParams struct { Symbol string `json:"symbol"` // Required field. example LTCBTC, BTCUSDT Limit int `json:"limit"` // Default 500; max 500. }
RecentTradeRequestParams represents Klines request data.
type RequestParamsOrderType ¶
type RequestParamsOrderType string
RequestParamsOrderType trade order type
type RequestParamsSideType ¶
type RequestParamsSideType string
RequestParamsSideType trade order side (buy or sell)
type RequestParamsTimeForceType ¶
type RequestParamsTimeForceType string
RequestParamsTimeForceType Time in force
type SymbolPrice ¶
SymbolPrice holds basic symbol price
type TickerStream ¶
type TickerStream struct { EventType string `json:"e"` EventTime int64 `json:"E"` Symbol string `json:"s"` PriceChange string `json:"p"` PriceChangePercent string `json:"P"` WeightedAvgPrice string `json:"w"` PrevDayClose string `json:"x"` CurrDayClose string `json:"c"` CloseTradeQuantity string `json:"Q"` BestBidPrice string `json:"b"` BestBidQuantity string `json:"B"` BestAskPrice string `json:"a"` BestAskQuantity string `json:"A"` OpenPrice string `json:"o"` HighPrice string `json:"h"` LowPrice string `json:"l"` TotalTradedVolume string `json:"v"` TotalTradedQuoteVolume string `json:"q"` OpenTime int64 `json:"O"` CloseTime int64 `json:"C"` FirstTradeID int64 `json:"F"` LastTradeID int64 `json:"L"` NumberOfTrades int64 `json:"n"` }
TickerStream holds the ticker stream data
type TradeStream ¶
type TradeStream struct { EventType string `json:"e"` EventTime int64 `json:"E"` Symbol string `json:"s"` TradeID int64 `json:"t"` Price string `json:"p"` Quantity string `json:"q"` BuyerOrderID int64 `json:"b"` SellerOrderID int64 `json:"a"` TimeStamp int64 `json:"T"` Maker bool `json:"m"` BestMatchPrice bool `json:"M"` }
TradeStream holds the trade stream data