Documentation
¶
Index ¶
- Constants
- func GenerateSignature(secretKey, data string) string
- func Timestamp() int64
- type APIError
- type CancelAllOrdersParams
- type CancelOrderParams
- type Client
- func (c *Client) CancelAllOpenOrders(ctx context.Context, p CancelAllOrdersParams) error
- func (c *Client) CancelOrder(ctx context.Context, p CancelOrderParams) (*OrderResponse, error)
- func (c *Client) Delete(ctx context.Context, endpoint string, params map[string]interface{}, ...) error
- func (c *Client) Depth(ctx context.Context, symbol string, limit int) (*DepthResponse, error)
- func (c *Client) ExchangeInfo(ctx context.Context) (*ExchangeInfoResponse, error)
- func (c *Client) Get(ctx context.Context, endpoint string, params map[string]interface{}, ...) error
- func (c *Client) GetOpenOrders(ctx context.Context, symbol string) ([]OrderResponse, error)
- func (c *Client) GetOrder(ctx context.Context, symbol, orderID, clientOrderID string) (*OrderResponse, error)
- func (c *Client) GetOrderHistory(ctx context.Context, symbol string) ([]OrderResponse, error)
- func (c *Client) HasCredentials() bool
- func (c *Client) Klines(ctx context.Context, symbol, interval string, limit int, ...) ([]KlineResponse, error)
- func (c *Client) PlaceOrder(ctx context.Context, p PlaceOrderParams) (*OrderResponse, error)
- func (c *Client) Post(ctx context.Context, endpoint string, params map[string]interface{}, ...) error
- func (c *Client) Ticker(ctx context.Context, symbol string) (*TickerResponse, error)
- func (c *Client) Trades(ctx context.Context, symbol string, limit int) ([]TradeResponse, error)
- func (c *Client) WithBaseURL(baseURL string) *Client
- func (c *Client) WithCredentials(apiKey, secretKey string) *Client
- type DepthResponse
- type ExchangeInfoResponse
- type KlineResponse
- type NumberString
- type OptionSymbol
- type OrderResponse
- type PlaceOrderParams
- type TickerResponse
- type TradeResponse
Constants ¶
View Source
const BaseURL = "https://eapi.binance.com"
Variables ¶
This section is empty.
Functions ¶
func GenerateSignature ¶
Types ¶
type CancelAllOrdersParams ¶
type CancelAllOrdersParams struct {
Symbol string
}
type CancelOrderParams ¶
type Client ¶
type Client struct {
BaseURL string
APIKey string
SecretKey string
HTTPClient *http.Client
Logger *zap.SugaredLogger
UsedWeight mbx.UsedWeight
OrderCount mbx.OrderCount
}
func (*Client) CancelAllOpenOrders ¶
func (c *Client) CancelAllOpenOrders(ctx context.Context, p CancelAllOrdersParams) error
func (*Client) CancelOrder ¶
func (c *Client) CancelOrder(ctx context.Context, p CancelOrderParams) (*OrderResponse, error)
func (*Client) ExchangeInfo ¶
func (c *Client) ExchangeInfo(ctx context.Context) (*ExchangeInfoResponse, error)
func (*Client) GetOpenOrders ¶
func (*Client) GetOrderHistory ¶
func (*Client) HasCredentials ¶
func (*Client) PlaceOrder ¶
func (c *Client) PlaceOrder(ctx context.Context, p PlaceOrderParams) (*OrderResponse, error)
func (*Client) WithBaseURL ¶
func (*Client) WithCredentials ¶
type DepthResponse ¶
type ExchangeInfoResponse ¶
type ExchangeInfoResponse struct {
OptionSymbols []OptionSymbol `json:"optionSymbols"`
}
type KlineResponse ¶
type KlineResponse []interface{}
type NumberString ¶
type NumberString string
func (*NumberString) UnmarshalJSON ¶
func (n *NumberString) UnmarshalJSON(data []byte) error
type OptionSymbol ¶
type OptionSymbol struct {
Symbol string `json:"symbol"`
Status string `json:"status"`
BaseAsset string `json:"baseAsset"`
QuoteAsset string `json:"quoteAsset"`
Underlying string `json:"underlying"`
SettleAsset string `json:"settleAsset"`
Side string `json:"side"`
StrikePrice string `json:"strikePrice"`
ExpiryDate int64 `json:"expiryDate"`
Unit NumberString `json:"unit"`
PriceScale int32 `json:"priceScale"`
QuantityScale int32 `json:"quantityScale"`
MinQty string `json:"minQty"`
}
type OrderResponse ¶
type OrderResponse struct {
ID NumberString `json:"id"`
OrderID NumberString `json:"orderId"`
ClientOrderID string `json:"clientOrderId"`
Symbol string `json:"symbol"`
Price string `json:"price"`
Quantity string `json:"quantity"`
ExecutedQty string `json:"executedQty"`
Fee string `json:"fee"`
Side string `json:"side"`
Type string `json:"type"`
TimeInForce string `json:"timeInForce"`
Status string `json:"status"`
AvgPrice string `json:"avgPrice"`
ReduceOnly bool `json:"reduceOnly"`
CreateDate int64 `json:"createDate"`
UpdateTime int64 `json:"updateTime"`
}
func (OrderResponse) IDString ¶
func (o OrderResponse) IDString() string
type PlaceOrderParams ¶
type TickerResponse ¶
type TickerResponse struct {
Symbol string `json:"symbol"`
LastPrice string `json:"lastPrice"`
BidPrice string `json:"bidPrice"`
AskPrice string `json:"askPrice"`
OpenPrice string `json:"openPrice"`
HighPrice string `json:"highPrice"`
LowPrice string `json:"lowPrice"`
Volume string `json:"volume"`
Amount string `json:"amount"`
CloseTime int64 `json:"closeTime"`
OpenTime int64 `json:"openTime"`
TradeCount int64 `json:"tradeCount"`
StrikePrice string `json:"strikePrice"`
}
Click to show internal directories.
Click to hide internal directories.