Documentation ¶
Index ¶
- Constants
- Variables
- func GetRequestsPerSecond(client *Client, weight int) (float64, error)
- func GetSymbol(client *Client, name string) (*exchange.Symbol, error)
- func NewClientOrderID() string
- func NewClientOrderMetadata(metadata string) (string, error)
- func ParseClientOrderMetadata(order *Order) (string, error)
- type BinanceError
- type BookEntry
- type Cache
- type Client
- func (self *Client) CancelOrder(symbol string, orderID int64) error
- func (self *Client) Depth(symbol string, limit int) (*exchange.DepthResponse, error)
- func (self *Client) NewCreateOCOService() *CreateOCOService
- func (self *Client) NewCreateOrderService() *CreateOrderService
- func (self *Client) OpenOrders() ([]Order, error)
- func (self *Client) OpenOrdersEx(symbol string) ([]Order, error)
- func (self *Client) Orders(symbol string) ([]Order, error)
- func (self *Client) Ticker(symbol string) (*exchange.PriceChangeStats, error)
- type CreateOCOService
- func (self *CreateOCOService) Do(ctx context.Context, opts ...exchange.RequestOption) (*exchange.CreateOCOResponse, error)
- func (self *CreateOCOService) LimitClientOrderID(limitClientOrderID string) *CreateOCOService
- func (self *CreateOCOService) Price(price float64) *CreateOCOService
- func (self *CreateOCOService) Quantity(quantity float64) *CreateOCOService
- func (self *CreateOCOService) Side(side exchange.SideType) *CreateOCOService
- func (self *CreateOCOService) StopClientOrderID(stopClientOrderID string) *CreateOCOService
- func (self *CreateOCOService) StopLimitPrice(stopLimitPrice float64) *CreateOCOService
- func (self *CreateOCOService) StopLimitTimeInForce(stopLimitTimeInForce exchange.TimeInForceType) *CreateOCOService
- func (self *CreateOCOService) StopPrice(stopPrice float64) *CreateOCOService
- func (self *CreateOCOService) Symbol(symbol string) *CreateOCOService
- type CreateOrderService
- func (self *CreateOrderService) Do(ctx context.Context, opts ...exchange.RequestOption) (*exchange.CreateOrderResponse, error)
- func (self *CreateOrderService) NewClientOrderID(newClientOrderID string) *CreateOrderService
- func (self *CreateOrderService) Price(price float64) *CreateOrderService
- func (self *CreateOrderService) Quantity(quantity float64) *CreateOrderService
- func (self *CreateOrderService) Side(side exchange.SideType) *CreateOrderService
- func (self *CreateOrderService) StopPrice(stopPrice float64) *CreateOrderService
- func (self *CreateOrderService) Symbol(symbol string) *CreateOrderService
- func (self *CreateOrderService) TimeInForce(timeInForce exchange.TimeInForceType) *CreateOrderService
- func (self *CreateOrderService) Type(orderType exchange.OrderType) *CreateOrderService
- type Order
- type Prec
- type Precs
Constants ¶
View Source
const ( BASE_URL = "https://api.binance.com" BASE_URL_1 = "https://api1.binance.com" BASE_URL_2 = "https://api2.binance.com" BASE_URL_3 = "https://api3.binance.com" BASE_URL_US = "https://api.binance.us" )
View Source
const ( MAX_LEN = 36 BROKER = "J6MCRYME" )
View Source
const ( WEIGHT_ALL_ORDERS = 10 WEIGHT_CANCEL_ORDER = 1 WEIGHT_CREATE_OCO_ORDER = 1 WEIGHT_CREATE_ORDER = 1 WEIGHT_EXCHANGE_INFO = 10 WEIGHT_OPEN_ORDERS_WITH_SYMBOL = 3 WEIGHT_OPEN_ORDERS_WITHOUT_SYMBOL = 40 WEIGHT_TICKER_24H_WITH_SYMBOL = 1 WEIGHT_TICKER_24H_WITHOUT_SYMBOL = 40 )
Variables ¶
View Source
var ( SERVER_TIME_OFFSET int64 // offset between device time and server time SERVER_TIME_UPDATE time.Time // the last time we asked for server time )
Functions ¶
func NewClientOrderID ¶
func NewClientOrderID() string
func NewClientOrderMetadata ¶
func ParseClientOrderMetadata ¶
get metadata from order.ClientOrderId
Types ¶
type BinanceError ¶
func IsBinanceError ¶
func IsBinanceError(err error) (*BinanceError, bool)
type BookEntry ¶
type BookEntry = common.PriceLevel
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CancelOrder ¶
Cancel an active order.
func (*Client) NewCreateOCOService ¶
func (self *Client) NewCreateOCOService() *CreateOCOService
func (*Client) NewCreateOrderService ¶
func (self *Client) NewCreateOrderService() *CreateOrderService
func (*Client) OpenOrders ¶
Get all open orders without a symbol.
func (*Client) OpenOrdersEx ¶
Get all open orders on a symbol.
type CreateOCOService ¶
type CreateOCOService struct {
// contains filtered or unexported fields
}
func (*CreateOCOService) Do ¶
func (self *CreateOCOService) Do(ctx context.Context, opts ...exchange.RequestOption) (*exchange.CreateOCOResponse, error)
func (*CreateOCOService) LimitClientOrderID ¶
func (self *CreateOCOService) LimitClientOrderID(limitClientOrderID string) *CreateOCOService
func (*CreateOCOService) Price ¶
func (self *CreateOCOService) Price(price float64) *CreateOCOService
func (*CreateOCOService) Quantity ¶
func (self *CreateOCOService) Quantity(quantity float64) *CreateOCOService
func (*CreateOCOService) Side ¶
func (self *CreateOCOService) Side(side exchange.SideType) *CreateOCOService
func (*CreateOCOService) StopClientOrderID ¶
func (self *CreateOCOService) StopClientOrderID(stopClientOrderID string) *CreateOCOService
func (*CreateOCOService) StopLimitPrice ¶
func (self *CreateOCOService) StopLimitPrice(stopLimitPrice float64) *CreateOCOService
func (*CreateOCOService) StopLimitTimeInForce ¶
func (self *CreateOCOService) StopLimitTimeInForce(stopLimitTimeInForce exchange.TimeInForceType) *CreateOCOService
func (*CreateOCOService) StopPrice ¶
func (self *CreateOCOService) StopPrice(stopPrice float64) *CreateOCOService
func (*CreateOCOService) Symbol ¶
func (self *CreateOCOService) Symbol(symbol string) *CreateOCOService
type CreateOrderService ¶
type CreateOrderService struct {
// contains filtered or unexported fields
}
func (*CreateOrderService) Do ¶
func (self *CreateOrderService) Do(ctx context.Context, opts ...exchange.RequestOption) (*exchange.CreateOrderResponse, error)
func (*CreateOrderService) NewClientOrderID ¶
func (self *CreateOrderService) NewClientOrderID(newClientOrderID string) *CreateOrderService
func (*CreateOrderService) Price ¶
func (self *CreateOrderService) Price(price float64) *CreateOrderService
func (*CreateOrderService) Quantity ¶
func (self *CreateOrderService) Quantity(quantity float64) *CreateOrderService
func (*CreateOrderService) Side ¶
func (self *CreateOrderService) Side(side exchange.SideType) *CreateOrderService
func (*CreateOrderService) StopPrice ¶
func (self *CreateOrderService) StopPrice(stopPrice float64) *CreateOrderService
func (*CreateOrderService) Symbol ¶
func (self *CreateOrderService) Symbol(symbol string) *CreateOrderService
func (*CreateOrderService) TimeInForce ¶
func (self *CreateOrderService) TimeInForce(timeInForce exchange.TimeInForceType) *CreateOrderService
func (*CreateOrderService) Type ¶
func (self *CreateOrderService) Type(orderType exchange.OrderType) *CreateOrderService
type Order ¶
func (*Order) GetStopPrice ¶
GetStopPrice returns the StopPrice as float64
Click to show internal directories.
Click to hide internal directories.