Versions in this module Expand all Collapse all v1 v1.2.1 Apr 24, 2021 Changes in this version type TickerStats + Symbol string v1.2.0 Apr 22, 2021 Changes in this version + const BaseHost + const DefaultUserAgent + const EndpointAccount + const EndpointAccountTrades + const EndpointAggTrades + const EndpointAvgPrice + const EndpointDataStream + const EndpointDepth + const EndpointExchangeInfo + const EndpointKlines + const EndpointOpenOrders + const EndpointOrder + const EndpointOrderTest + const EndpointOrdersAll + const EndpointPing + const EndpointTicker24h + const EndpointTickerBook + const EndpointTickerPrice + const EndpointTime + const EndpointTrades + const OrderRespTypeAsk + const OrderRespTypeFull + const OrderRespTypeResult + var ErrEmptyLimit = errors.New("empty price or quantity") + var ErrEmptyMarket = errors.New("quantity or quote quantity expected") + var ErrEmptyOrderID = errors.New("order id must be set") + var ErrEmptySymbol = errors.New("symbol are missing") + var ErrInvalidJson = errors.New("invalid json") + var ErrNilRequest = errors.New("request is nil") + var ErrNilUnmarshal = errors.New("UnmarshalJSON on nil pointer") + type APIError struct + Code int + Msg string + func (e *APIError) Error() string + type AccountInfo struct + Balances []*Balance + BuyerCommission int + CanDeposit bool + CanTrade bool + CanWithdraw bool + MakerCommission int + SellerCommission int + TakerCommission int + type AccountTrades struct + BestMatch bool + Buyer bool + Commission string + CommissionAsset string + ID int + Maker bool + Price string + Qty string + Time uint64 + type AccountTradesReq struct + FromID int + Limit int + Symbol string + type AggregatedTrade struct + BestMatch bool + FirstTradeID int + LastTradeID int + Maker bool + Price string + Quantity string + Time uint64 + TradeID int + type AggregatedTradeReq struct + EndTime uint64 + FromID int + Limit int + StartTime uint64 + Symbol string + type AllOrdersReq struct + Limit int + OrderID int + Symbol string + type AvgPrice struct + Mins int + Price string + type AvgPriceReq struct + Symbol string + type Balance struct + Asset string + Free string + Locked string + type BookTicker struct + AskPrice string + AskQty string + BidPrice string + BidQty string + Symbol string + type BookTickerReq struct + Symbol string + type CancelOpenOrdersReq struct + Symbol string + type CancelOrder struct + ClientOrderID string + CummulativeQuoteQty string + ExecutedQty string + OrderID int + OrderListID int + OrigClientOrderID string + OrigQty string + Price string + Side OrderSide + Status OrderStatus + Symbol string + TimeInForce string + Type OrderType + type CancelOrderReq struct + NewClientOrderId string + OrderID int + OrigClientOrderId string + Symbol string + type Client struct + func NewClient(apikey, secret string) *Client + func (c *Client) Account() (*AccountInfo, error) + func (c *Client) AccountTrades(req *AccountTradesReq) (*AccountTrades, error) + func (c *Client) AggregatedTrades(req *AggregatedTradeReq) ([]*AggregatedTrade, error) + func (c *Client) AllOrders(req *AllOrdersReq) ([]*QueryOrder, error) + func (c *Client) AvgPrice(req *AvgPriceReq) (*AvgPrice, error) + func (c *Client) BookTicker(req *BookTickerReq) (*BookTicker, error) + func (c *Client) BookTickers() ([]*BookTicker, error) + func (c *Client) CancelOpenOrders(req *CancelOpenOrdersReq) ([]*CancelOrder, error) + func (c *Client) CancelOrder(req *CancelOrderReq) (*CancelOrder, error) + func (c *Client) DataStream() (string, error) + func (c *Client) DataStreamClose(listenKey string) error + func (c *Client) DataStreamKeepAlive(listenKey string) error + func (c *Client) Depth(req *DepthReq) (*Depth, error) + func (c *Client) ExchangeInfo() (*ExchangeInfo, error) + func (c *Client) Klines(req *KlinesReq) ([]*Klines, error) + func (c *Client) NewOrder(req *OrderReq) (*OrderRespAck, error) + func (c *Client) NewOrderFull(req *OrderReq) (*OrderRespFull, error) + func (c *Client) NewOrderResult(req *OrderReq) (*OrderRespResult, error) + func (c *Client) NewOrderTest(req *OrderReq) error + func (c *Client) OpenOrders(req *OpenOrdersReq) ([]*QueryOrder, error) + func (c *Client) Ping() error + func (c *Client) Price(req *TickerPriceReq) (*SymbolPrice, error) + func (c *Client) Prices() ([]*SymbolPrice, error) + func (c *Client) QueryOrder(req *QueryOrderReq) (*QueryOrder, error) + func (c *Client) ReqWindow(window int) *Client + func (c *Client) Ticker(req *TickerReq) (*TickerStats, error) + func (c *Client) Tickers() ([]*TickerStats, error) + func (c *Client) Time() (*ServerTime, error) + func (c *Client) Trades(req *TradeReq) ([]*Trade, error) + type DatastreamReq struct + ListenKey string + type Depth struct + Asks []DepthElem + Bids []DepthElem + LastUpdateID int + type DepthElem struct + Price decimal.Decimal + Quantity decimal.Decimal + func (b *DepthElem) UnmarshalJSON(data []byte) error + type DepthReq struct + Limit int + Symbol string + type ExchangeInfo struct + Symbols []SymbolInfo + type FilterType string + const FilterTypeLotSize + const FilterTypeMinNotional + const FilterTypePrice + type KlineInterval string + const KlineInterval12hour + const KlineInterval15min + const KlineInterval1day + const KlineInterval1hour + const KlineInterval1min + const KlineInterval1month + const KlineInterval1week + const KlineInterval2hour + const KlineInterval30min + const KlineInterval3day + const KlineInterval3min + const KlineInterval4hour + const KlineInterval5min + const KlineInterval6hour + const KlineInterval8hour + type Klines struct + ClosePrice decimal.Decimal + CloseTime uint64 + High decimal.Decimal + Low decimal.Decimal + OpenPrice decimal.Decimal + OpenTime uint64 + QuoteAssetVolume decimal.Decimal + TakerBuyBaseAssetVolume decimal.Decimal + TakerBuyQuoteAssetVolume decimal.Decimal + Trades int + Volume decimal.Decimal + func (b *Klines) UnmarshalJSON(data []byte) error + type KlinesReq struct + EndTime uint64 + Interval KlineInterval + Limit int + StartTime uint64 + Symbol string + type OpenOrdersReq struct + Symbol string + type OrderFailure string + const OrderFailureAccountInaactive + const OrderFailureAccountSettle + const OrderFailureDuplicate + const OrderFailureInsufficientFunds + const OrderFailureMarketClosed + const OrderFailureNone + const OrderFailurePriceExceed + const OrderFailureUnknownAccount + const OrderFailureUnknownInstrument + const OrderFailureUnknownOrder + type OrderReq struct + IcebergQty string + NewClientOrderId string + OrderRespType OrderRespType + Price string + Quantity string + QuoteQuantity string + Side OrderSide + StopPrice string + Symbol string + TimeInForce TimeInForce + Type OrderType + type OrderRespAck struct + OrderID int + OrigClientOrderID string + Symbol string + TransactTime uint64 + type OrderRespFull struct + ClientOrderID string + CummulativeQuoteQty string + ExecutedQty string + Fills []OrderRespFullFill + OrderID int + OrderListID int + OrigQty string + Price string + Side OrderSide + Status OrderStatus + Symbol string + TimeInForce string + TransactTime int64 + Type OrderType + type OrderRespFullFill struct + Commission string + CommissionAsset string + Price string + Qty string + type OrderRespResult struct + ClientOrderID string + CummulativeQuoteQty string + ExecutedQty string + OrderID int + OrderListID int + OrigQty string + Price string + Side OrderSide + Status OrderStatus + Symbol string + TimeInForce string + TransactTime int64 + Type OrderType + type OrderRespType string + type OrderSide string + const OrderSideBuy + const OrderSideSell + type OrderStatus string + const OrderStatusCanceled + const OrderStatusExpired + const OrderStatusFilled + const OrderStatusNew + const OrderStatusPartial + const OrderStatusPending + const OrderStatusRejected + const OrderStatusReplaced + const OrderStatusTrade + type OrderType string + const OrderTypeLimit + const OrderTypeLimitMaker + const OrderTypeMarket + const OrderTypeStopLoss + const OrderTypeStopLossLimit + const OrderTypeTakeProfit + const OrderTypeTakeProfitLimit + type QueryOrder struct + ClientOrderID string + CummulativeQuoteQty string + ExecutedQty string + IcebergQty string + OrderID int + OrderListID int + OrigQty string + OrigQuoteOrderQty string + Price string + Side OrderSide + Status OrderStatus + StopPrice string + Symbol string + Time uint64 + TimeInForce TimeInForce + Type OrderType + UpdateTime uint64 + type QueryOrderReq struct + OrderID int + OrigClientOrderId string + Symbol string + type ServerTime struct + ServerTime uint64 + type SymbolInfo struct + BaseAsset string + BaseAssetPrecision int + BaseCommissionPrecision int + Filters []SymbolInfoFilter + IcebergAllowed bool + OCOAllowed bool + OrderTypes []OrderType + QuoteAsset string + QuoteAssetPrecision int + QuoteCommissionPrecision int + QuoteQtyAllowed bool + Status SymbolStatus + Symbol string + type SymbolInfoFilter struct + MaxPrice string + MaxQty string + MinNotional string + MinPrice string + MinQty string + StepSize string + TickSize string + Type FilterType + type SymbolPrice struct + Price string + Symbol string + type SymbolStatus string + const SymbolStatusTrading + type TickerPriceReq struct + Symbol string + type TickerReq struct + Symbol string + type TickerStats struct + AskPrice string + BidPrice string + CloseTime uint64 + Count int + FirstID int + HighPrice string + LastID int + LastPrice string + LowPrice string + OpenPrice string + OpenTime uint64 + PrevClosePrice string + PriceChange string + PriceChangePercentage string + QuoteVolume string + Volume string + WeightedAvgPrice string + type TimeInForce string + const TimeInForceFOK + const TimeInForceGTC + const TimeInForceIOC + type Trade struct + ID int + IsBestMatch bool + IsBuyerMaker bool + Price string + Qty string + QuoteQty string + Time int64 + type TradeReq struct + Limit int + Symbol string