Documentation
¶
Index ¶
- type Client
- func (c *Client) AccountInfo() (*ResponseAccount, error)
- func (c *Client) AccountInfoPretty() (string, error)
- func (c *Client) ExchangeInfo() (*ResponseExchangeInfo, error)
- func (c *Client) Order(opts map[string]string) (*ResponseOrder, error)
- func (c *Client) StepSize(symbols ...string) (map[string]string, error)
- func (c *Client) Time() (int64, error)
- type ExchangeFilters
- type Filters
- type OrderSide
- type OrderType
- type RateLimits
- type ResponseAccount
- type ResponseExchangeInfo
- type ResponseOrder
- type ResponseTime
- type Symbols
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is aclient for the Binance API.
func (*Client) AccountInfo ¶
func (c *Client) AccountInfo() (*ResponseAccount, error)
AccountInfo returns teh account information.
func (*Client) AccountInfoPretty ¶
AccountInfoPretty returns the account information in a pretty format.
func (*Client) ExchangeInfo ¶
func (c *Client) ExchangeInfo() (*ResponseExchangeInfo, error)
ExchangeInfo returns the exchange info.
func (*Client) Order ¶
func (c *Client) Order(opts map[string]string) (*ResponseOrder, error)
Order places an order.
type ExchangeFilters ¶
type ExchangeFilters struct{}
ExchangeFilters is the exchange filters for the exchange info endpoint.
type Filters ¶
type Filters struct { FilterType string `json:"filterType"` PriceFilter string `json:"priceFilter"` MinPrice string `json:"minPrice"` MaxPrice string `json:"maxPrice"` TickSize string `json:"tickSize"` MinQty string `json:"minQty"` MaxQty string `json:"maxQty"` StepSize string `json:"stepSize"` Limit int `json:"limit"` MinTrailingAboveDelta int `json:"minTrailingAboveDelta"` MaxTrailingAboveDelta int `json:"maxTrailingAboveDelta"` MinTrailingBelowDelta int `json:"minTrailingBelowDelta"` MaxTrailingBelowDelta int `json:"maxTrailingBelowDelta"` BidMultiplierUp string `json:"bidMultiplierUp"` BidMultiplierDown string `json:"bidMultiplierDown"` AskMultiplierUp string `json:"askMultiplierUp"` AskMultiplierDown string `json:"askMultiplierDown"` AvgPriceMins int `json:"avgPriceMins"` MinNotional string `json:"minNotional"` MaxNotional string `json:"maxNotional"` ApplyMinToMarket bool `json:"applyMinToMarket"` ApplyMaxToMarket bool `json:"applyMaxToMarket"` MaxNumOrders int `json:"maxNumOrders"` MaxNumAlgoOrders int `json:"maxNumAlgoOrders"` }
Filters is the filters for the exchange info endpoint.
type OrderSide ¶
type OrderSide string
OrderSide is an enum for the order side.
const OrderSideBuy OrderSide = "BUY"
OrderSideBuy represents the buy side of an order.
const OrderSideSell OrderSide = "SELL"
OrderSideSell represents the sell side of an order.
type OrderType ¶
type OrderType string
OrderType is an enum for the order type.
const OrderTypeLimit OrderType = "LIMIT"
OrderTypeLimit represents a limit order.
const OrderTypeMarket OrderType = "MARKET"
OrderTypeMarket represents a market order.
type RateLimits ¶
type RateLimits struct { RateLimitType string `json:"rateLimitType"` Interval string `json:"interval"` IntervalNum int `json:"intervalNum"` Limit int `json:"limit"` }
RateLimits is the rate limits for the exchange info endpoint.
type ResponseAccount ¶
type ResponseAccount struct { Balances []struct { Asset string `json:"asset"` Free string `json:"free"` } `json:"balances"` }
ResponseAccount is the response from the account endpoint.
type ResponseExchangeInfo ¶
type ResponseExchangeInfo struct { Timezone string `json:"timezone"` ServerTime int64 `json:"serverTime"` RateLimits []RateLimits `json:"rateLimits"` ExchangeFilters []ExchangeFilters `json:"exchangeFilters"` Symbols []Symbols `json:"symbols"` }
ResponseExchangeInfo is the response from the exchange info endpoint.
type ResponseOrder ¶
type ResponseOrder struct { Code int `json:"code"` Msg string `json:"msg"` Symbol string `json:"symbol"` OrderId int `json:"orderId"` OrderListId int `json:"orderListId"` ClientOrderId string `json:"clientOrderId"` TransactTime int64 `json:"transactTime"` Price string `json:"price"` OrigQty string `json:"origQty"` ExecutedQty string `json:"executedQty"` CumulativeQuoteQty string `json:"cumulativeQuoteQty"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` Type string `json:"type"` Side string `json:"side"` WorkingTime int64 `json:"workingTime"` Fills []struct { Price string `json:"price"` Qty string `json:"qty"` Commission string `json:"commission"` CommissionAsset string `json:"commissionAsset"` TradeId int `json:"tradeId"` SelfTradePreventionMode string `json:"selfTradePreventionMode"` } }
ResponseOrder is the response from the order endpoint.
type ResponseTime ¶
type ResponseTime struct {
ServerTime int64 `json:"serverTime"`
}
ResponseTime is the response from the endpoint.
type Symbols ¶
type 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"` QuoteAssetPrecision int `json:"quoteAssetPrecision"` OrderTypes []string `json:"orderTypes"` IcebergAllowed bool `json:"icebergAllowed"` OcoAllowed bool `json:"ocoAllowed"` QuoteOrderQtyMarketAllowed bool `json:"quoteOrderQtyMarketAllowed"` AllowTrailingStop bool `json:"allowTrailingStop"` CancelReplaceAllowed bool `json:"cancelReplaceAllowed"` IsSpotTradingAllowed bool `json:"isSpotTradingAllowed"` IsMarginTradingAllowed bool `json:"isMarginTradingAllowed"` Filters []Filters `json:"filters"` Permissions []string `json:"permissions"` DefaultSelfTradePreventionMode string `json:"defaultSelfTradePreventionMode"` AllowedSelfTradePreventionModes []string `json:"allowedSelfTradePreventionModes"` }
Symbols is the symbols for the exchange info endpoint.