Documentation ¶
Overview ¶
Package binance binance rest api
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) CancelOrder(ctx context.Context, quote string, base string, orderID int64, ...) error
- func (c *Client) GetAccount(ctx context.Context, recvWindow int64) ([]model.Balance, error)
- func (c *Client) GetAllOrders(ctx context.Context, quote string, base string, orderID int64, limit int64, ...) ([]model.Order, error)
- func (c *Client) GetBookTickers(ctx context.Context) ([]model.BookTicker, error)
- func (c *Client) GetDepth(ctx context.Context, quote string, base string, limit int64) (*model.OrderBook, error)
- func (c *Client) GetMyTrades(ctx context.Context, quote string, base string, fromID int64, limit int64, ...) ([]model.Trade, error)
- func (c *Client) GetOrder(ctx context.Context, quote string, base string, orderID int64, ...) (*model.Order, error)
- func (c *Client) GetOrders(ctx context.Context, quote string, base string, recvWindow int64) ([]model.Order, error)
- func (c *Client) GetRecords(ctx context.Context, quote string, base string, interval string, ...) ([]model.Record, error)
- func (c *Client) GetTicker(ctx context.Context, quote string, base string) (*model.Ticker, error)
- func (c *Client) GetTickers(ctx context.Context) ([]model.SimpleTicker, error)
- func (c *Client) GetTime(ctx context.Context) (*time.Time, error)
- func (c *Client) GetTrades(ctx context.Context, quote string, base string, fromID int64, startTime int64, ...) ([]model.Trade, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) Trade(ctx context.Context, quote string, base string, side string, typ string, ...) (int64, error)
Constants ¶
const ( RestHost = "www.binance.com" ApiV1 = "v1" ApiV3 = "v3" )
Variables ¶
var ( Interval enums.Enum Interval1m = Interval.Iota("1m") Interval3m = Interval.Iota("3m") Interval5m = Interval.Iota("5m") Interval15m = Interval.Iota("15m") Interval30m = Interval.Iota("30m") Interval1h = Interval.Iota("1h") Interval2h = Interval.Iota("2h") Interval4h = Interval.Iota("4h") Interval6h = Interval.Iota("6h") Interval8h = Interval.Iota("8h") Interval12h = Interval.Iota("12h") Interval1d = Interval.Iota("1d") Interval3d = Interval.Iota("3d") Interval1w = Interval.Iota("1w") Interval1M = Interval.Iota("1M") )
Kline intervals m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
var ( OrderType enums.Enum OrderLimit = OrderType.Iota("LIMIT") OrderMarket = OrderType.Iota("MARKET") )
Order types
var ( OrderSide enums.Enum OrderBuy = OrderSide.Iota("BUY") OrderSell = OrderSide.Iota("SELL") )
Order Side
var ( TimeInForce enums.Enum GTC = TimeInForce.Iota("GTC") IOC = TimeInForce.Iota("IOC") )
Time in force
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client Binance client
func (*Client) CancelOrder ¶
func (c *Client) CancelOrder(ctx context.Context, quote string, base string, orderID int64, recvWindow int64) error
CancelOrder Cancel an active orderf for DELETE /api/v3/order
func (*Client) GetAccount ¶
GetAccount Account information (SIGNED), for GET /api/v3/account
func (*Client) GetAllOrders ¶
func (c *Client) GetAllOrders(ctx context.Context, quote string, base string, orderID int64, limit int64, recvWindow int64) ([]model.Order, error)
GetAllOrders Get all account orders; active, canceled, or filled, for GET /api/v3/allOrders
func (*Client) GetBookTickers ¶
GetBookTickers Symbols order book ticker, for GET /api/v1/ticker/allBookTickers
func (*Client) GetDepth ¶
func (c *Client) GetDepth(ctx context.Context, quote string, base string, limit int64) (*model.OrderBook, error)
GetDepth Order book, for GET /api/v1/depth
func (*Client) GetMyTrades ¶
func (c *Client) GetMyTrades(ctx context.Context, quote string, base string, fromID int64, limit int64, recvWindow int64) ([]model.Trade, error)
GetMyTrades Get trades for a specific account and symbol, for GET /api/v3/myTrades
func (*Client) GetOrder ¶
func (c *Client) GetOrder(ctx context.Context, quote string, base string, orderID int64, recvWindow int64) (*model.Order, error)
GetOrder Check an order's status, for GET /api/v3/order
func (*Client) GetOrders ¶
func (c *Client) GetOrders(ctx context.Context, quote string, base string, recvWindow int64) ([]model.Order, error)
GetOrders Get all open orders on a symbol, for GET /api/v3/openOrders
func (*Client) GetRecords ¶
func (c *Client) GetRecords(ctx context.Context, quote string, base string, interval string, startTime int64, endTime int64, limit int64) ([]model.Record, error)
GetRecords for Kline/candlesticks, for GET /api/v1/ticker/allPrices
func (*Client) GetTicker ¶
GetTicker 24hr ticker price change statistics, for GET /api/v1/ticker/24hr
func (*Client) GetTickers ¶
GetTickers Symbols price ticker, for GET /api/v1/ticker/allPrices
func (*Client) GetTrades ¶
func (c *Client) GetTrades(ctx context.Context, quote string, base string, fromID int64, startTime int64, endTime int64, limit int64) ([]model.Trade, error)
GetTrades Compressed/Aggregate trades list, for GET /api/v1/aggTrades