Documentation ¶
Index ¶
- Constants
- func NewBinanceClient(baseURL, apiKey, secretKey string, l *zap.Logger) *api.Client
- func NewBinanceFuturesClient(baseURL, apiKey, secretKey string, l *zap.Logger) *apiFutures.Client
- func SubscribeToOrders(ctx context.Context, urls BinanceURLs, client *api.Client, lg *zap.Logger) (<-chan exchanges.OrderEvent, error)
- func SubscribeToOrdersFutures(ctx context.Context, wsEndpoint string, lg *zap.Logger) (<-chan exchanges.OrderEvent, error)
- func SubscribeToOrdersV2(ctx context.Context, wsEndpoint string, lg *zap.Logger) (<-chan exchanges.OrderEvent, error)
- func SubscribeToPositions(ctx context.Context, wsEndpoint string, lg *zap.Logger) (<-chan exchanges.PositionEvent, error)
- func SubscribeToPositionsFutures(ctx context.Context, wsEndpoint string, lg *zap.Logger) (<-chan exchanges.PositionEvent, error)
- func SubscribeToPrice(ctx context.Context, urls BinanceURLs, symbol string, lg *zap.Logger) (<-chan exchanges.PriceEvent, error)
- func SubscribeToPriceV2(ctx context.Context, wsEndpoint string, symbol string, lg *zap.Logger) (<-chan exchanges.PriceEvent, error)
- func ToBinanceSymbol(symbol string) string
- func ToFullSymbol(binanceSymbol string) string
- type AccountUpdate
- type BinanceBalancePositions
- type BinanceFutures
- func (b *BinanceFutures) CancelOrder(ctx context.Context, symbol, id string) error
- func (b *BinanceFutures) GenerateClientOrderID(ctx context.Context, identifierID string) (string, error)
- func (b *BinanceFutures) GetAccount(ctx context.Context) (exchanges.Account, error)
- func (b *BinanceFutures) GetName() string
- func (b *BinanceFutures) GetOpenOrders(ctx context.Context) ([]exchanges.OrderDetailInfo, error)
- func (b *BinanceFutures) GetOrderInfo(ctx context.Context, symbol, id string, _ *time.Time) (exchanges.OrderInfo, error)
- func (b *BinanceFutures) GetOrderInfoByClientOrderID(ctx context.Context, symbol, clientOrderID string, _ *time.Time) (exchanges.OrderInfo, error)
- func (b *BinanceFutures) GetOrders(ctx context.Context, filter exchanges.OrderFilter) ([]exchanges.OrderDetailInfo, error)
- func (b *BinanceFutures) GetPrefix() string
- func (b *BinanceFutures) GetPrice(ctx context.Context, symbol string) (*apd.Decimal, error)
- func (b *BinanceFutures) GetTradableSymbols(ctx context.Context) ([]exchanges.SymbolInfo, error)
- func (b *BinanceFutures) PlaceBuyOrder(ctx context.Context, _ bool, symbol string, price, quantity *apd.Decimal, ...) (id string, e error)
- func (b *BinanceFutures) PlaceBuyOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, ...) (id string, e error)
- func (b *BinanceFutures) PlaceSellOrder(ctx context.Context, _ bool, symbol string, price, quantity *apd.Decimal, ...) (id string, e error)
- func (b *BinanceFutures) PlaceSellOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, ...) (id string, e error)
- func (b *BinanceFutures) ReleaseOrder(_ context.Context, symbol, id string) error
- func (b *BinanceFutures) RoundPrice(_ context.Context, symbol string, price *apd.Decimal, tickSize *string) (*apd.Decimal, error)
- func (b *BinanceFutures) RoundQuantity(_ context.Context, symbol string, qty *apd.Decimal) (*apd.Decimal, error)
- func (b *BinanceFutures) WatchAccountPositions(ctx context.Context) (<-chan exchanges.PositionEvent, error)
- func (b *BinanceFutures) WatchOrdersStatuses(ctx context.Context) (<-chan exchanges.OrderEvent, error)
- func (b *BinanceFutures) WatchSymbolPrice(ctx context.Context, symbol string) (<-chan exchanges.PriceEvent, error)
- type BinanceLong
- func (b *BinanceLong) CancelOrder(ctx context.Context, symbol, id string) error
- func (b *BinanceLong) GenerateClientOrderID(ctx context.Context, identifierID string) (string, error)
- func (b *BinanceLong) GetAccount(ctx context.Context) (exchanges.Account, error)
- func (b *BinanceLong) GetName() string
- func (b *BinanceLong) GetOpenOrders(ctx context.Context) ([]exchanges.OrderDetailInfo, error)
- func (b *BinanceLong) GetOrderInfo(ctx context.Context, symbol, id string, _ *time.Time) (exchanges.OrderInfo, error)
- func (b *BinanceLong) GetOrderInfoByClientOrderID(ctx context.Context, symbol, clientOrderID string, _ *time.Time) (exchanges.OrderInfo, error)
- func (b *BinanceLong) GetOrders(ctx context.Context, filter exchanges.OrderFilter) (res []exchanges.OrderDetailInfo, err error)
- func (b *BinanceLong) GetPrefix() string
- func (b *BinanceLong) GetPrice(ctx context.Context, symbol string) (*apd.Decimal, error)
- func (b *BinanceLong) GetTradableSymbols(ctx context.Context) ([]exchanges.SymbolInfo, error)
- func (b *BinanceLong) PlaceBuyOrder(ctx context.Context, _ bool, symbol string, price, quantity *apd.Decimal, ...) (id string, e error)
- func (b *BinanceLong) PlaceBuyOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, ...) (id string, e error)
- func (b *BinanceLong) PlaceSellOrder(ctx context.Context, _ bool, symbol string, price, quantity *apd.Decimal, ...) (id string, e error)
- func (b *BinanceLong) PlaceSellOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, ...) (id string, e error)
- func (b *BinanceLong) ReleaseOrder(_ context.Context, symbol, id string) error
- func (b *BinanceLong) RoundPrice(_ context.Context, symbol string, price *apd.Decimal, tickSize *string) (*apd.Decimal, error)
- func (b *BinanceLong) RoundQuantity(_ context.Context, symbol string, qty *apd.Decimal) (*apd.Decimal, error)
- func (b *BinanceLong) WatchAccountPositions(ctx context.Context) (<-chan exchanges.PositionEvent, error)
- func (b *BinanceLong) WatchOrdersStatuses(ctx context.Context) (<-chan exchanges.OrderEvent, error)
- func (b *BinanceLong) WatchSymbolPrice(ctx context.Context, symbol string) (<-chan exchanges.PriceEvent, error)
- type BinanceOrderCanceller
- type BinanceURLs
- func (u BinanceURLs) WSAllMiniMarketsStatURL() string
- func (u BinanceURLs) WSFuturesAllMiniMarketStatsURL() string
- func (u BinanceURLs) WSFuturesUserDataURL(listenKey string) string
- func (u BinanceURLs) WSUSAllMiniMarketsStatURL() string
- func (u BinanceURLs) WSUSUserDataURL(listenKey string) string
- func (u BinanceURLs) WSUserDataURL(listenKey string) string
- type BinanceUS
- func (b *BinanceUS) CancelOrder(ctx context.Context, symbol, id string) error
- func (b *BinanceUS) GenerateClientOrderID(ctx context.Context, identifierID string) (string, error)
- func (b *BinanceUS) GetAccount(ctx context.Context) (exchanges.Account, error)
- func (b *BinanceUS) GetName() string
- func (b *BinanceUS) GetOpenOrders(ctx context.Context) ([]exchanges.OrderDetailInfo, error)
- func (b *BinanceUS) GetOrderInfo(ctx context.Context, symbol, id string, _ *time.Time) (exchanges.OrderInfo, error)
- func (b *BinanceUS) GetOrderInfoByClientOrderID(ctx context.Context, symbol, clientOrderID string, _ *time.Time) (exchanges.OrderInfo, error)
- func (b *BinanceUS) GetOrders(ctx context.Context, filter exchanges.OrderFilter) (res []exchanges.OrderDetailInfo, err error)
- func (b *BinanceUS) GetPrefix() string
- func (b *BinanceUS) GetPrice(ctx context.Context, symbol string) (*apd.Decimal, error)
- func (b *BinanceUS) GetTradableSymbols(ctx context.Context) ([]exchanges.SymbolInfo, error)
- func (b *BinanceUS) PlaceBuyOrder(ctx context.Context, _ bool, symbol string, price, quantity *apd.Decimal, ...) (id string, e error)
- func (b *BinanceUS) PlaceBuyOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, ...) (id string, e error)
- func (b *BinanceUS) PlaceSellOrder(ctx context.Context, _ bool, symbol string, price, quantity *apd.Decimal, ...) (id string, e error)
- func (b *BinanceUS) PlaceSellOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, ...) (id string, e error)
- func (b *BinanceUS) ReleaseOrder(_ context.Context, symbol, id string) error
- func (b *BinanceUS) RoundPrice(_ context.Context, symbol string, price *apd.Decimal, tickSize *string) (*apd.Decimal, error)
- func (b *BinanceUS) RoundQuantity(_ context.Context, symbol string, qty *apd.Decimal) (*apd.Decimal, error)
- func (b *BinanceUS) WatchAccountPositions(ctx context.Context) (<-chan exchanges.PositionEvent, error)
- func (b *BinanceUS) WatchOrdersStatuses(ctx context.Context) (<-chan exchanges.OrderEvent, error)
- func (b *BinanceUS) WatchSymbolPrice(ctx context.Context, symbol string) (<-chan exchanges.PriceEvent, error)
- type FuturesAccountUpdate
- type FuturesAccountUpdateData
- type FuturesBinancePositions
- type OrderGetter
- func (og *OrderGetter) GetBinanceOrder(ctx context.Context, symbol, clientOrderID string) (*api.Order, error)
- func (og *OrderGetter) GetHistoryOrders(ctx context.Context, symbol string, orderID *string, clientOrderID *string) (res []exchanges.OrderDetailInfo, err error)
- func (og *OrderGetter) GetOpenOrders(ctx context.Context) (res []exchanges.OrderDetailInfo, err error)
- func (og *OrderGetter) GetOrderBinanceStatus(ctx context.Context, symbol, clientOrderID string) (api.OrderStatusType, error)
- func (og *OrderGetter) GetOrderInfoByClientOrderID(ctx context.Context, symbol, clientOrderID string) (exchanges.OrderInfo, error)
- type OrderPlacer
- func (op *OrderPlacer) CreateOrderRequest(symbol string, price, quantity *apd.Decimal, prefferedID string, ...) (*orderFields, error)
- func (op *OrderPlacer) CreateOrderRequestV2(symbol string, price, quantity *apd.Decimal, preferredID string, ...) (*orderFields, error)
- func (op *OrderPlacer) PlaceOrder(ctx context.Context, symbol string, price, quantity *apd.Decimal, ...) (id string, e error)
- func (op *OrderPlacer) PlaceOrderV2(ctx context.Context, symbol string, price, quantity *apd.Decimal, ...) (id string, e error)
- func (op *OrderPlacer) TestOrder(ctx context.Context, symbol string, price, quantity *apd.Decimal, ...) error
- type OrderUpdate
- type OrderUpdateDataFutures
- type OrderUpdateFutures
- type PositionGetter
- type WSAllMiniMarketsStatEvent
- type WSMiniMarketsStatEvent
Constants ¶
const (
BINANCE_FUTURES_LINK_ID_PREFIX = "x-9Oc4JrZL"
)
const BINANCE_PREFIX = "BINANCE-"
const (
BINANCE_SPOT_LINK_ID_PREFIX = "x-INHON5QW"
)
Variables ¶
This section is empty.
Functions ¶
func NewBinanceClient ¶
func NewBinanceFuturesClient ¶
func NewBinanceFuturesClient(baseURL, apiKey, secretKey string, l *zap.Logger) *apiFutures.Client
func SubscribeToOrders ¶
func SubscribeToOrders( ctx context.Context, urls BinanceURLs, client *api.Client, lg *zap.Logger, ) (<-chan exchanges.OrderEvent, error)
func SubscribeToOrdersV2 ¶
func SubscribeToOrdersV2( ctx context.Context, wsEndpoint string, lg *zap.Logger, ) (<-chan exchanges.OrderEvent, error)
Similar with SubscribeToOrders but it accepts ws endpoint instead of urls object
func SubscribeToPositions ¶
func SubscribeToPrice ¶
func SubscribeToPrice(ctx context.Context, urls BinanceURLs, symbol string, lg *zap.Logger) (<-chan exchanges.PriceEvent, error)
SubscribeToPrice No reconnection in case of error Returns control after connect
func SubscribeToPriceV2 ¶
func SubscribeToPriceV2(ctx context.Context, wsEndpoint string, symbol string, lg *zap.Logger) (<-chan exchanges.PriceEvent, error)
Similar with SubscribeToPrice but it accepts ws endpoint instead of urls object
func ToBinanceSymbol ¶
func ToFullSymbol ¶
Types ¶
type AccountUpdate ¶
type AccountUpdate struct { EventType string `json:"e"` EventTime int64 `json:"E"` BalancesArray []BinanceBalancePositions `json:"B"` }
type BinanceBalancePositions ¶
type BinanceFutures ¶
BinanceLong TODO: probably it's better to switch to orderID instead of clientOrderID Order ID in the methods input and output is clientOrderID internally.
func NewBinanceFutures ¶
func NewBinanceFutures(urls BinanceURLs, apiKey, secretKey string, lg *zap.Logger) *BinanceFutures
func (*BinanceFutures) CancelOrder ¶
func (b *BinanceFutures) CancelOrder(ctx context.Context, symbol, id string) error
func (*BinanceFutures) GenerateClientOrderID ¶
func (*BinanceFutures) GetAccount ¶
func (*BinanceFutures) GetName ¶
func (b *BinanceFutures) GetName() string
func (*BinanceFutures) GetOpenOrders ¶
func (b *BinanceFutures) GetOpenOrders(ctx context.Context) ([]exchanges.OrderDetailInfo, error)
func (*BinanceFutures) GetOrderInfo ¶
func (*BinanceFutures) GetOrderInfoByClientOrderID ¶
func (*BinanceFutures) GetOrders ¶
func (b *BinanceFutures) GetOrders(ctx context.Context, filter exchanges.OrderFilter) ([]exchanges.OrderDetailInfo, error)
func (*BinanceFutures) GetPrefix ¶
func (b *BinanceFutures) GetPrefix() string
func (*BinanceFutures) GetTradableSymbols ¶
func (b *BinanceFutures) GetTradableSymbols(ctx context.Context) ([]exchanges.SymbolInfo, error)
func (*BinanceFutures) PlaceBuyOrder ¶
func (*BinanceFutures) PlaceBuyOrderV2 ¶
func (b *BinanceFutures) PlaceBuyOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, preferredID string, orderType string) (id string, e error)
PlaceBuyOrderV2 Place Buy Order with OrderType param
func (*BinanceFutures) PlaceSellOrder ¶
func (*BinanceFutures) PlaceSellOrderV2 ¶
func (b *BinanceFutures) PlaceSellOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, preferredID string, orderType string) (id string, e error)
PlaceSellOrderV2 Place Sell Order with OrderType param
func (*BinanceFutures) ReleaseOrder ¶
func (b *BinanceFutures) ReleaseOrder(_ context.Context, symbol, id string) error
func (*BinanceFutures) RoundPrice ¶
func (*BinanceFutures) RoundQuantity ¶
func (*BinanceFutures) WatchAccountPositions ¶
func (b *BinanceFutures) WatchAccountPositions(ctx context.Context) (<-chan exchanges.PositionEvent, error)
func (*BinanceFutures) WatchOrdersStatuses ¶
func (b *BinanceFutures) WatchOrdersStatuses(ctx context.Context) (<-chan exchanges.OrderEvent, error)
func (*BinanceFutures) WatchSymbolPrice ¶
func (b *BinanceFutures) WatchSymbolPrice(ctx context.Context, symbol string) (<-chan exchanges.PriceEvent, error)
type BinanceLong ¶
type BinanceLong struct {
// contains filtered or unexported fields
}
BinanceLong TODO: probably it's better to switch to orderID instead of clientOrderID Order ID in the methods input and output is clientOrderID internally.
func NewBinanceLong ¶
func NewBinanceLong(urls BinanceURLs, apiKey, secretKey string, lg *zap.Logger) *BinanceLong
func (*BinanceLong) CancelOrder ¶
func (b *BinanceLong) CancelOrder(ctx context.Context, symbol, id string) error
func (*BinanceLong) GenerateClientOrderID ¶
func (*BinanceLong) GetAccount ¶
func (*BinanceLong) GetName ¶
func (b *BinanceLong) GetName() string
func (*BinanceLong) GetOpenOrders ¶
func (b *BinanceLong) GetOpenOrders(ctx context.Context) ([]exchanges.OrderDetailInfo, error)
func (*BinanceLong) GetOrderInfo ¶
func (*BinanceLong) GetOrderInfoByClientOrderID ¶
func (*BinanceLong) GetOrders ¶
func (b *BinanceLong) GetOrders(ctx context.Context, filter exchanges.OrderFilter) (res []exchanges.OrderDetailInfo, err error)
func (*BinanceLong) GetPrefix ¶
func (b *BinanceLong) GetPrefix() string
func (*BinanceLong) GetTradableSymbols ¶
func (b *BinanceLong) GetTradableSymbols(ctx context.Context) ([]exchanges.SymbolInfo, error)
func (*BinanceLong) PlaceBuyOrder ¶
func (*BinanceLong) PlaceBuyOrderV2 ¶
func (b *BinanceLong) PlaceBuyOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, preferredID string, orderType string) (id string, e error)
PlaceBuyOrderV2 Place Buy Order with OrderType param
func (*BinanceLong) PlaceSellOrder ¶
func (*BinanceLong) PlaceSellOrderV2 ¶
func (b *BinanceLong) PlaceSellOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, preferredID string, orderType string) (id string, e error)
PlaceSellOrderV2 Place Sell Order with OrderType param
func (*BinanceLong) ReleaseOrder ¶
func (b *BinanceLong) ReleaseOrder(_ context.Context, symbol, id string) error
func (*BinanceLong) RoundPrice ¶
func (*BinanceLong) RoundQuantity ¶
func (*BinanceLong) WatchAccountPositions ¶
func (b *BinanceLong) WatchAccountPositions(ctx context.Context) (<-chan exchanges.PositionEvent, error)
func (*BinanceLong) WatchOrdersStatuses ¶
func (b *BinanceLong) WatchOrdersStatuses(ctx context.Context) (<-chan exchanges.OrderEvent, error)
WatchOrdersStatuses Returns control immediately
func (*BinanceLong) WatchSymbolPrice ¶
func (b *BinanceLong) WatchSymbolPrice(ctx context.Context, symbol string) (<-chan exchanges.PriceEvent, error)
WatchSymbolPrice OPTIMIZATION: subscribe to single symbol on client side not to all symbols.
type BinanceOrderCanceller ¶
type BinanceOrderCanceller struct {
// contains filtered or unexported fields
}
func NewBinanceOrderCanceller ¶
func NewBinanceOrderCanceller(client *api.Client) *BinanceOrderCanceller
func (*BinanceOrderCanceller) CancelOrder ¶
func (b *BinanceOrderCanceller) CancelOrder(ctx context.Context, symbol, clientOrderID string) error
type BinanceURLs ¶
type BinanceURLs struct { APIURL string WebSocketBaseURL string USAPIURL string FutureAPIURL string USWebSocketBaseURL string FutureWebSocketBaseURL string }
var OriginalBinanceURLs BinanceURLs = BinanceURLs{
APIURL: "https://api.binance.com",
WebSocketBaseURL: "wss://stream.binance.com:9443/ws",
USAPIURL: "https://api.binance.us",
FutureAPIURL: "https://fapi.binance.com",
USWebSocketBaseURL: "wss://stream.binance.us:9443/ws",
FutureWebSocketBaseURL: "wss://fstream.binance.com/ws",
}
var TestnetBinanceURLs BinanceURLs = BinanceURLs{
APIURL: "https://testnet.binance.vision/api",
WebSocketBaseURL: "wss://testnet.binance.vision/ws",
FutureWebSocketBaseURL: "wss://stream.binancefuture.com/ws",
FutureAPIURL: "https://testnet.binancefuture.com",
}
func (BinanceURLs) WSAllMiniMarketsStatURL ¶
func (u BinanceURLs) WSAllMiniMarketsStatURL() string
WSAllMiniMarketsStatServe serve websocket that push mini version of 24hr statistics for all market every second
func (BinanceURLs) WSFuturesAllMiniMarketStatsURL ¶
func (u BinanceURLs) WSFuturesAllMiniMarketStatsURL() string
func (BinanceURLs) WSFuturesUserDataURL ¶
func (u BinanceURLs) WSFuturesUserDataURL(listenKey string) string
func (BinanceURLs) WSUSAllMiniMarketsStatURL ¶
func (u BinanceURLs) WSUSAllMiniMarketsStatURL() string
func (BinanceURLs) WSUSUserDataURL ¶
func (u BinanceURLs) WSUSUserDataURL(listenKey string) string
func (BinanceURLs) WSUserDataURL ¶
func (u BinanceURLs) WSUserDataURL(listenKey string) string
WSUserDataServe serve user data handler with listen key
type BinanceUS ¶
BinanceLong TODO: probably it's better to switch to orderID instead of clientOrderID Order ID in the methods input and output is clientOrderID internally.
func NewBinanceUS ¶
func NewBinanceUS(urls BinanceURLs, apiKey, secretKey string, lg *zap.Logger) *BinanceUS
func (*BinanceUS) CancelOrder ¶
func (*BinanceUS) GenerateClientOrderID ¶
func (*BinanceUS) GetAccount ¶
func (*BinanceUS) GetOpenOrders ¶
func (*BinanceUS) GetOrderInfo ¶
func (*BinanceUS) GetOrderInfoByClientOrderID ¶
func (*BinanceUS) GetOrders ¶
func (b *BinanceUS) GetOrders(ctx context.Context, filter exchanges.OrderFilter) (res []exchanges.OrderDetailInfo, err error)
func (*BinanceUS) GetTradableSymbols ¶
func (*BinanceUS) PlaceBuyOrder ¶
func (*BinanceUS) PlaceBuyOrderV2 ¶
func (b *BinanceUS) PlaceBuyOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, preferredID string, orderType string) (id string, e error)
PlaceBuyOrderV2 Place Buy Order with OrderType param
func (*BinanceUS) PlaceSellOrder ¶
func (*BinanceUS) PlaceSellOrderV2 ¶
func (b *BinanceUS) PlaceSellOrderV2(ctx context.Context, _ bool, symbol string, price, qty *apd.Decimal, preferredID string, orderType string) (id string, e error)
PlaceSellOrderV2 Place Sell Order with OrderType param
func (*BinanceUS) ReleaseOrder ¶
func (*BinanceUS) RoundPrice ¶
func (*BinanceUS) RoundQuantity ¶
func (*BinanceUS) WatchAccountPositions ¶
func (*BinanceUS) WatchOrdersStatuses ¶
func (*BinanceUS) WatchSymbolPrice ¶
type FuturesAccountUpdate ¶
type FuturesAccountUpdate struct { EventType string `json:"e"` EventTime int64 `json:"E"` Data FuturesAccountUpdateData `json:"a"` }
type FuturesAccountUpdateData ¶
type FuturesAccountUpdateData struct { EventReasonType string `json:"m"` Positions []FuturesBinancePositions `json:"P"` }
type FuturesBinancePositions ¶
type OrderGetter ¶
type OrderGetter struct {
// contains filtered or unexported fields
}
func (*OrderGetter) GetBinanceOrder ¶
func (*OrderGetter) GetHistoryOrders ¶
func (og *OrderGetter) GetHistoryOrders( ctx context.Context, symbol string, orderID *string, clientOrderID *string, ) (res []exchanges.OrderDetailInfo, err error)
func (*OrderGetter) GetOpenOrders ¶
func (og *OrderGetter) GetOpenOrders(ctx context.Context) (res []exchanges.OrderDetailInfo, err error)
func (*OrderGetter) GetOrderBinanceStatus ¶
func (og *OrderGetter) GetOrderBinanceStatus(ctx context.Context, symbol, clientOrderID string) (api.OrderStatusType, error)
func (*OrderGetter) GetOrderInfoByClientOrderID ¶
type OrderPlacer ¶
type OrderPlacer struct {
// contains filtered or unexported fields
}
func NewOrderPlacer ¶
func NewOrderPlacer(client *api.Client) *OrderPlacer
func (*OrderPlacer) CreateOrderRequest ¶
func (op *OrderPlacer) CreateOrderRequest( symbol string, price, quantity *apd.Decimal, prefferedID string, side api.SideType, ) (*orderFields, error)
CreateOrderRequest Don't forget to floor `price` and `quantity`
func (*OrderPlacer) CreateOrderRequestV2 ¶
func (*OrderPlacer) PlaceOrder ¶
func (*OrderPlacer) PlaceOrderV2 ¶
type OrderUpdate ¶
type OrderUpdate struct { // !WARNING Keep upper and lower case letters -- this is workaround to make case-sensetive JSON EventType string `json:"e"` // "e": "executionReport", // Event type EventTime int64 `json:"E"` // "E": 1499405658658, // Event time ClientOrderID string `json:"c"` // "c": "mUvoqJxFIILMdfAW5iGSOW", // Client order ID OriginalClientOrderID *string `json:"C"` // "C": null, // Original client order ID; This is the ID of the order being canceled CurrentExecutionType string `json:"x"` // "x": "NEW", // Current execution type CurrentOrderStatus string `json:"X"` // "X": "NEW", // Current order status Symbol string `json:"s"` // "s": "ETHBTC", // Symbol Side string `json:"S"` // "S": "BUY", // Side }
type OrderUpdateDataFutures ¶
type OrderUpdateDataFutures struct { ClientOrderID string `json:"c"` // "c": "mUvoqJxFIILMdfAW5iGSOW", // Client order ID // Original client order ID; This is the ID of the order being canceled CurrentExecutionType string `json:"x"` // "x": "NEW", // Current execution type CurrentOrderStatus string `json:"X"` // "X": "NEW", // Current order status Symbol string `json:"s"` // "s": "ETHBTC", // Symbol Side string `json:"S"` // "S": "BUY", // Side }
type OrderUpdateFutures ¶
type OrderUpdateFutures struct { EventType string `json:"e"` // "e": "ORDER_TRADE_UPDATE", // Event type EventTime int64 `json:"E"` // "E": 1499405658658, // Event time OrderData OrderUpdateDataFutures `json:"o"` }
type PositionGetter ¶
type PositionGetter struct {
// contains filtered or unexported fields
}
func (*PositionGetter) GetAccountBalances ¶
type WSAllMiniMarketsStatEvent ¶
type WSAllMiniMarketsStatEvent []*WSMiniMarketsStatEvent
type WSMiniMarketsStatEvent ¶
type WSMiniMarketsStatEvent struct { // ! DON'T REMOVE NullJSONValue fields. They are used to make JSON case-senitive Event string `json:"e"` Time int64 `json:"E"` Symbol string `json:"s"` Ignore1 utils.NullJSONValue `json:"S"` LastPrice string `json:"c"` Ignore2 utils.NullJSONValue `json:"C"` OpenPrice string `json:"o"` Ignore3 utils.NullJSONValue `json:"O"` HighPrice string `json:"h"` Ignore4 utils.NullJSONValue `json:"H"` LowPrice string `json:"l"` Ignore5 utils.NullJSONValue `json:"L"` BaseVolume string `json:"v"` Ignore6 utils.NullJSONValue `json:"V"` QuoteVolume string `json:"q"` Ignore7 utils.NullJSONValue `json:"Q"` }
WSMiniMarketsStatEvent define websocket market mini-ticker statistics event