Documentation
¶
Index ¶
- type AccountSettings
- type CancelOrderRequest
- type CapitalBalance
- type Client
- func (c *Client) CancelOpenOrders(ctx context.Context, symbol, marketType string) error
- func (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*Order, error)
- func (c *Client) ExecuteOrder(ctx context.Context, req CreateOrderRequest) (*Order, error)
- func (c *Client) GetAccount(ctx context.Context) (*AccountSettings, error)
- func (c *Client) GetBalances(ctx context.Context) (map[string]CapitalBalance, error)
- func (c *Client) GetDepth(ctx context.Context, symbol string, limit int) (*Depth, error)
- func (c *Client) GetFundingRates(ctx context.Context) ([]FundingRate, error)
- func (c *Client) GetKlines(ctx context.Context, symbol, interval string, startTime, endTime int64, ...) ([]Kline, error)
- func (c *Client) GetMarkets(ctx context.Context) ([]Market, error)
- func (c *Client) GetOpenOrders(ctx context.Context, marketType, symbol string) ([]Order, error)
- func (c *Client) GetOpenPositions(ctx context.Context, symbol string) ([]Position, error)
- func (c *Client) GetOrderBook(ctx context.Context, symbol string, limit int) (*Depth, error)
- func (c *Client) GetTicker(ctx context.Context, symbol string) (*Ticker, error)
- func (c *Client) GetTrades(ctx context.Context, symbol string, limit int) ([]Trade, error)
- func (c *Client) PlaceOrder(ctx context.Context, req CreateOrderRequest) (*Order, error)
- func (c *Client) WithCredentials(apiKey, privateKey string) *Client
- type CreateOrderRequest
- type Depth
- type DepthEvent
- type FundingRate
- type Kline
- type Market
- type MarketFilters
- type Order
- type OrderUpdateEvent
- type Position
- type PositionUpdateEvent
- type PriceFilter
- type QuantityFilter
- type StreamEnvelope
- type StringValue
- type Ticker
- type Trade
- type WSClient
- func (c *WSClient) Close() error
- func (c *WSClient) Connect(ctx context.Context) error
- func (c *WSClient) Subscribe(ctx context.Context, stream string, private bool, ...) error
- func (c *WSClient) Unsubscribe(ctx context.Context, stream string) error
- func (c *WSClient) WithCredentials(apiKey, privateKey string) *WSClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountSettings ¶
type CancelOrderRequest ¶
type CapitalBalance ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CancelOpenOrders ¶
func (*Client) CancelOrder ¶
func (*Client) ExecuteOrder ¶
ExecuteOrder is a compatibility wrapper for the preferred PlaceOrder name.
func (*Client) GetAccount ¶
func (c *Client) GetAccount(ctx context.Context) (*AccountSettings, error)
func (*Client) GetBalances ¶
func (*Client) GetFundingRates ¶
func (c *Client) GetFundingRates(ctx context.Context) ([]FundingRate, error)
func (*Client) GetOpenOrders ¶
func (*Client) GetOpenPositions ¶
func (*Client) GetOrderBook ¶
func (*Client) PlaceOrder ¶
func (*Client) WithCredentials ¶
type CreateOrderRequest ¶
type CreateOrderRequest struct {
Symbol string `json:"symbol"`
Side string `json:"side"`
OrderType string `json:"orderType"`
Quantity string `json:"quantity"`
Price string `json:"price,omitempty"`
TimeInForce string `json:"timeInForce,omitempty"`
ReduceOnly bool `json:"reduceOnly,omitempty"`
ClientID uint32 `json:"clientId,omitempty"`
}
type DepthEvent ¶
type FundingRate ¶
type MarketFilters ¶
type MarketFilters struct {
Price PriceFilter `json:"price"`
Quantity QuantityFilter `json:"quantity"`
}
type Order ¶
type Order struct {
OrderType string `json:"orderType"`
ID string `json:"id"`
ClientID uint32 `json:"clientId"`
CreatedAt int64 `json:"createdAt"`
ExecutedQuantity string `json:"executedQuantity"`
ExecutedQuoteQuantity string `json:"executedQuoteQuantity"`
Quantity string `json:"quantity"`
QuoteQuantity string `json:"quoteQuantity"`
Price string `json:"price"`
ReduceOnly bool `json:"reduceOnly"`
TimeInForce string `json:"timeInForce"`
Side string `json:"side"`
Status string `json:"status"`
Symbol string `json:"symbol"`
}
type OrderUpdateEvent ¶
type OrderUpdateEvent struct {
EventType string `json:"e"`
EventTime int64 `json:"E"`
Symbol string `json:"s"`
ClientID StringValue `json:"c"`
Side string `json:"S"`
OrderType string `json:"o"`
TimeInForce string `json:"f"`
Quantity string `json:"q"`
QuoteQuantity string `json:"Q"`
Price string `json:"p"`
OrderState string `json:"X"`
OrderID string `json:"i"`
TradeID StringValue `json:"t"`
FillQuantity string `json:"l"`
ExecutedQuantity string `json:"z"`
ExecutedQuoteQuantity string `json:"Z"`
FillPrice string `json:"L"`
IsMaker bool `json:"m"`
Fee string `json:"n"`
FeeSymbol string `json:"N"`
EngineTimestamp int64 `json:"T"`
PostOnly bool `json:"y"`
}
type Position ¶
type Position struct {
BreakEvenPrice string `json:"breakEvenPrice"`
EntryPrice string `json:"entryPrice"`
EstLiquidationPrice string `json:"estLiquidationPrice"`
NetCost string `json:"netCost"`
NetQuantity string `json:"netQuantity"`
NetExposureQuantity string `json:"netExposureQuantity"`
NetExposureNotional string `json:"netExposureNotional"`
PnlRealized string `json:"pnlRealized"`
PnlUnrealized string `json:"pnlUnrealized"`
Symbol string `json:"symbol"`
PositionID string `json:"positionId"`
}
type PositionUpdateEvent ¶
type PositionUpdateEvent struct {
EventType string `json:"e"`
EventTime int64 `json:"E"`
Symbol string `json:"s"`
BreakEvenPrice StringValue `json:"b"`
EntryPrice StringValue `json:"B"`
MarkPrice StringValue `json:"M"`
NetQuantity StringValue `json:"q"`
ExposureQuantity StringValue `json:"Q"`
ExposureNotional StringValue `json:"n"`
PositionID string `json:"i"`
PnlRealized StringValue `json:"p"`
PnlUnrealized StringValue `json:"P"`
EngineTimestamp int64 `json:"T"`
}
type PriceFilter ¶
type QuantityFilter ¶
type StreamEnvelope ¶
type StreamEnvelope struct {
Stream string `json:"stream"`
Data json.RawMessage `json:"data"`
}
type StringValue ¶
type StringValue string
func (StringValue) String ¶
func (v StringValue) String() string
func (*StringValue) UnmarshalJSON ¶
func (v *StringValue) UnmarshalJSON(data []byte) error
type Ticker ¶
type Ticker struct {
Symbol string `json:"symbol"`
FirstPrice string `json:"firstPrice"`
LastPrice string `json:"lastPrice"`
PriceChange string `json:"priceChange"`
PriceChangePercent string `json:"priceChangePercent"`
High string `json:"high"`
Low string `json:"low"`
Volume string `json:"volume"`
QuoteVolume string `json:"quoteVolume"`
Trades string `json:"trades"`
}
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
func NewWSClient ¶
func NewWSClient() *WSClient
func (*WSClient) Unsubscribe ¶
func (*WSClient) WithCredentials ¶
Click to show internal directories.
Click to hide internal directories.