Documentation ¶
Index ¶
- type AggregatedTrade
- type BestPrice
- type Binance
- func (b *Binance) CheckIntervals(interval string) error
- func (b *Binance) CheckLimit(limit int64) error
- func (b *Binance) CheckSymbol(symbol string) error
- func (b *Binance) GetAggregatedTrades(symbol string, limit int64) ([]AggregatedTrade, error)
- func (b *Binance) GetBestPrice(symbol string) (BestPrice, error)
- func (b *Binance) GetCandleStickData(symbol, interval string, limit int64) ([]CandleStick, error)
- func (b *Binance) GetExchangeAccountInfo() (exchange.AccountInfo, error)
- func (b *Binance) GetExchangeHistory(p pair.CurrencyPair, assetType string) ([]exchange.TradeHistory, error)
- func (b *Binance) GetExchangeInfo() (ExchangeInfo, error)
- func (b *Binance) GetExchangeValidCurrencyPairs() ([]string, error)
- func (b *Binance) GetHistoricalTrades(symbol string, limit, fromID int64) ([]HistoricalTrade, error)
- func (b *Binance) GetLatestSpotPrice(symbol string) (SymbolPrice, error)
- func (b *Binance) GetOrderBook(symbol string, limit int64) (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(symbol string, limit int64) ([]RecentTrade, error)
- func (b *Binance) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- func (b *Binance) GetTickers() ([]PriceChangeStats, error)
- func (b *Binance) NewOrder(o NewOrderRequest) (NewOrderResponse, error)
- func (b *Binance) NewOrderTest() (interface{}, 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()
- func (b *Binance) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)
- func (b *Binance) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)
- type CandleStick
- type ExchangeInfo
- type HistoricalTrade
- type NewOrderRequest
- type NewOrderResponse
- type OrderBook
- type OrderBookData
- type PriceChangeStats
- type QueryOrderData
- type RecentTrade
- type SymbolPrice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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 ¶
Binance is the overarching type across the Bithumb package
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) GetAggregatedTrades ¶
func (b *Binance) GetAggregatedTrades(symbol string, limit int64) ([]AggregatedTrade, error)
GetAggregatedTrades returns aggregated trade activity
symbol: string of currency pair limit: returned limit amount WARNING: MAX 500!
func (*Binance) GetBestPrice ¶
GetBestPrice returns the latest best price for symbol
symbol: string of currency pair
func (*Binance) GetCandleStickData ¶
func (b *Binance) GetCandleStickData(symbol, interval string, limit int64) ([]CandleStick, error)
GetCandleStickData returns candle stick data
symbol: limit: interval
func (*Binance) GetExchangeAccountInfo ¶
func (b *Binance) GetExchangeAccountInfo() (exchange.AccountInfo, error)
GetExchangeAccountInfo retrieves balances for all enabled currencies for the Bithumb exchange
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) 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, fromID int64) ([]HistoricalTrade, error)
GetHistoricalTrades returns historical trade activity
symbol: string of currency pair limit: returned limit amount WARNING: MAX 500! (NOT REQUIRED) 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 ¶
GetOrderBook returns full orderbook information
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(symbol string, limit int64) ([]RecentTrade, error)
GetRecentTrades returns recent trade activity
symbol: string of currency pair limit: returned limit amount WARNING: MAX 500!
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) 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) 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) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Binance) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
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 NewOrderRequest ¶
type NewOrderRequest struct { Symbol string Side string TradeType string TimeInForce string Quantity float64 Price float64 NewClientOrderID string StopPrice float64 IcebergQty float64 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 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 int64 `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 int64 `json:"time"` IsBuyerMaker bool `json:"isBuyerMaker"` IsBestMatch bool `json:"isBestMatch"` }
RecentTrade holds recent trade data
type SymbolPrice ¶
SymbolPrice holds basic symbol price