options

package
v2.0.0-...-4d006de Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SideTypeBuy  SideType = "BUY"
	SideTypeSell SideType = "SELL"

	PositionSideTypeBoth  PositionSideType = "BOTH"
	PositionSideTypeLong  PositionSideType = "LONG"
	PositionSideTypeShort PositionSideType = "SHORT"

	OptionSideTypeCall OptionSideType = "CALL"
	OptionSideTypePut  OptionSideType = "PUT"

	OrderTypeLimit              OrderType = "LIMIT"
	OrderTypeMarket             OrderType = "MARKET"
	OrderTypeStop               OrderType = "STOP"
	OrderTypeStopMarket         OrderType = "STOP_MARKET"
	OrderTypeTakeProfit         OrderType = "TAKE_PROFIT"
	OrderTypeTakeProfitMarket   OrderType = "TAKE_PROFIT_MARKET"
	OrderTypeTrailingStopMarket OrderType = "TRAILING_STOP_MARKET"

	TimeInForceTypeGTC TimeInForceType = "GTC" // Good Till Cancel
	TimeInForceTypeIOC TimeInForceType = "IOC" // Immediate or Cancel
	TimeInForceTypeFOK TimeInForceType = "FOK" // Fill or Kill
	TimeInForceTypeGTX TimeInForceType = "GTX" // Good Till Crossing (Post Only)

	NewOrderRespTypeACK    NewOrderRespType = "ACK"
	NewOrderRespTypeRESULT NewOrderRespType = "RESULT"

	OrderExecutionTypeNew         OrderExecutionType = "NEW"
	OrderExecutionTypePartialFill OrderExecutionType = "PARTIAL_FILL"
	OrderExecutionTypeFill        OrderExecutionType = "FILL"
	OrderExecutionTypeCanceled    OrderExecutionType = "CANCELED"
	OrderExecutionTypeCalculated  OrderExecutionType = "CALCULATED"
	OrderExecutionTypeExpired     OrderExecutionType = "EXPIRED"
	OrderExecutionTypeTrade       OrderExecutionType = "TRADE"

	OrderStatusTypeNew             OrderStatusType = "NEW"
	OrderStatusTypePartiallyFilled OrderStatusType = "PARTIALLY_FILLED"
	OrderStatusTypeFilled          OrderStatusType = "FILLED"
	OrderStatusTypeCanceled        OrderStatusType = "CANCELED"
	OrderStatusTypeRejected        OrderStatusType = "REJECTED"
	OrderStatusTypeExpired         OrderStatusType = "EXPIRED"
	OrderStatusTypeNewInsurance    OrderStatusType = "NEW_INSURANCE"
	OrderStatusTypeNewADL          OrderStatusType = "NEW_ADL"
	OrderStatusTypeAccepted        OrderStatusType = "ACCEPTED"

	SymbolTypeFuture SymbolType = "FUTURE"

	WorkingTypeMarkPrice     WorkingType = "MARK_PRICE"
	WorkingTypeContractPrice WorkingType = "CONTRACT_PRICE"

	SymbolStatusTypePreTrading   SymbolStatusType = "PRE_TRADING"
	SymbolStatusTypeTrading      SymbolStatusType = "TRADING"
	SymbolStatusTypePostTrading  SymbolStatusType = "POST_TRADING"
	SymbolStatusTypeEndOfDay     SymbolStatusType = "END_OF_DAY"
	SymbolStatusTypeHalt         SymbolStatusType = "HALT"
	SymbolStatusTypeAuctionMatch SymbolStatusType = "AUCTION_MATCH"
	SymbolStatusTypeBreak        SymbolStatusType = "BREAK"

	SymbolFilterTypeLotSize          SymbolFilterType = "LOT_SIZE"
	SymbolFilterTypePrice            SymbolFilterType = "PRICE_FILTER"
	SymbolFilterTypePercentPrice     SymbolFilterType = "PERCENT_PRICE"
	SymbolFilterTypeMarketLotSize    SymbolFilterType = "MARKET_LOT_SIZE"
	SymbolFilterTypeMaxNumOrders     SymbolFilterType = "MAX_NUM_ORDERS"
	SymbolFilterTypeMaxNumAlgoOrders SymbolFilterType = "MAX_NUM_ALGO_ORDERS"
	SymbolFilterTypeMinNotional      SymbolFilterType = "MIN_NOTIONAL"

	SideEffectTypeNoSideEffect SideEffectType = "NO_SIDE_EFFECT"
	SideEffectTypeMarginBuy    SideEffectType = "MARGIN_BUY"
	SideEffectTypeAutoRepay    SideEffectType = "AUTO_REPAY"

	MarginTypeIsolated MarginType = "ISOLATED"
	MarginTypeCrossed  MarginType = "CROSSED"

	ContractTypePerpetual ContractType = "PERPETUAL"

	UserDataEventTypeListenKeyExpired    UserDataEventType = "listenKeyExpired"
	UserDataEventTypeMarginCall          UserDataEventType = "MARGIN_CALL"
	UserDataEventTypeAccountUpdate       UserDataEventType = "ACCOUNT_UPDATE"
	UserDataEventTypeOrderTradeUpdate    UserDataEventType = "ORDER_TRADE_UPDATE"
	UserDataEventTypeAccountConfigUpdate UserDataEventType = "ACCOUNT_CONFIG_UPDATE"

	UserDataEventReasonTypeDeposit             UserDataEventReasonType = "DEPOSIT"
	UserDataEventReasonTypeWithdraw            UserDataEventReasonType = "WITHDRAW"
	UserDataEventReasonTypeOrder               UserDataEventReasonType = "ORDER"
	UserDataEventReasonTypeFundingFee          UserDataEventReasonType = "FUNDING_FEE"
	UserDataEventReasonTypeWithdrawReject      UserDataEventReasonType = "WITHDRAW_REJECT"
	UserDataEventReasonTypeAdjustment          UserDataEventReasonType = "ADJUSTMENT"
	UserDataEventReasonTypeInsuranceClear      UserDataEventReasonType = "INSURANCE_CLEAR"
	UserDataEventReasonTypeAdminDeposit        UserDataEventReasonType = "ADMIN_DEPOSIT"
	UserDataEventReasonTypeAdminWithdraw       UserDataEventReasonType = "ADMIN_WITHDRAW"
	UserDataEventReasonTypeMarginTransfer      UserDataEventReasonType = "MARGIN_TRANSFER"
	UserDataEventReasonTypeMarginTypeChange    UserDataEventReasonType = "MARGIN_TYPE_CHANGE"
	UserDataEventReasonTypeAssetTransfer       UserDataEventReasonType = "ASSET_TRANSFER"
	UserDataEventReasonTypeOptionsPremiumFee   UserDataEventReasonType = "OPTIONS_PREMIUM_FEE"
	UserDataEventReasonTypeOptionsSettleProfit UserDataEventReasonType = "OPTIONS_SETTLE_PROFIT"

	ForceOrderCloseTypeLiquidation ForceOrderCloseType = "LIQUIDATION"
	ForceOrderCloseTypeADL         ForceOrderCloseType = "ADL"
)

Global enums

Variables

This section is empty.

Functions

This section is empty.

Types

type Ask

type Ask = common.PriceLevel

Ask is a type alias for PriceLevel.

type Bid

type Bid = common.PriceLevel

Bid is a type alias for PriceLevel.

type CancelAllOpenOrdersService

type CancelAllOpenOrdersService struct {
	// contains filtered or unexported fields
}

CancelAllOpenOrdersService cancel all open orders

func (*CancelAllOpenOrdersService) Do

func (s *CancelAllOpenOrdersService) Do(ctx context.Context, opts ...RequestOption) (err error)

Do send request

func (*CancelAllOpenOrdersService) Symbol

Symbol set symbol

type CancelMultiplesOrdersService

type CancelMultiplesOrdersService struct {
	// contains filtered or unexported fields
}

CancelMultiplesOrdersService cancel a list of orders

func (*CancelMultiplesOrdersService) ClientOrderIDList

func (s *CancelMultiplesOrdersService) ClientOrderIDList(clientOrderIDList []string) *CancelMultiplesOrdersService

ClientOrderIDList set clientOrderIDList

func (*CancelMultiplesOrdersService) Do

Do send request

func (*CancelMultiplesOrdersService) OrderIDList

func (s *CancelMultiplesOrdersService) OrderIDList(orderIDList []int64) *CancelMultiplesOrdersService

OrderID set orderID

func (*CancelMultiplesOrdersService) Symbol

Symbol set symbol

type CancelOrderResponse

type CancelOrderResponse struct {
	OrderID       int64           `json:"orderId"`
	Symbol        string          `json:"symbol"`
	Price         string          `json:"price"`
	Quantity      string          `json:"quantity"`
	ExecutedQty   string          `json:"executedQty"`
	Fee           string          `json:"fee"`
	Side          SideType        `json:"side"`
	Type          OrderType       `json:"type"`
	TimeInForce   TimeInForceType `json:"timeInForce"`
	ReduceOnly    bool            `json:"reduceOnly"`
	PostOnly      bool            `json:"postOnly"`
	CreateTime    int64           `json:"createTime"`
	UpdateTime    int64           `json:"updateTime"`
	Status        OrderStatusType `json:"status"`
	AvgPrice      string          `json:"avgPrice"`
	Source        string          `json:"source"`
	ClientOrderID string          `json:"clientOrderId"`
	PriceScale    int             `json:"priceScale"`
	QuantityScale int             `json:"quantityScale"`
	OptionSide    OptionSideType  `json:"optionSide"`
	QuoteAsset    string          `json:"quoteAsset"`
	Mmp           bool            `json:"mmp"`
}

CancelOrderResponse define response of canceling order

type CancelOrderService

type CancelOrderService struct {
	// contains filtered or unexported fields
}

CancelOrderService cancel an order

func (*CancelOrderService) ClientOrderID

func (s *CancelOrderService) ClientOrderID(clientOrderID string) *CancelOrderService

ClientOrderID set clientOrderID

func (*CancelOrderService) Do

func (s *CancelOrderService) Do(ctx context.Context, opts ...RequestOption) (res *CancelOrderResponse, err error)

Do send request

func (*CancelOrderService) OrderID

func (s *CancelOrderService) OrderID(orderID int64) *CancelOrderService

OrderID set orderID

func (*CancelOrderService) Symbol

func (s *CancelOrderService) Symbol(symbol string) *CancelOrderService

Symbol set symbol

type CancelSingleOrderResponse

type CancelSingleOrderResponse struct {
	OrderID       int64           `json:"orderId"`
	Symbol        string          `json:"symbol"`
	Price         string          `json:"price"`
	Quantity      string          `json:"quantity"`
	ExecutedQty   string          `json:"executedQty"`
	Fee           string          `json:"fee"`
	Side          SideType        `json:"side"`
	Type          OrderType       `json:"type"`
	TimeInForce   TimeInForceType `json:"timeInForce"`
	CreateTime    int64           `json:"createTime"`
	Status        OrderStatusType `json:"status"`
	AvgPrice      string          `json:"avgPrice"`
	ReduceOnly    bool            `json:"reduceOnly"`
	ClientOrderID string          `json:"clientOrderId"`
	UpdateTime    int64           `json:"updateTime"`
}

CancelSingleOrderResponse define element of response of canceling multiple order

type Client

type Client struct {
	APIKey     string
	SecretKey  string
	BaseURL    string
	UserAgent  string
	HTTPClient *http.Client
	Debug      bool
	Logger     *log.Logger
	TimeOffset int64
	// contains filtered or unexported fields
}

Client define API client

func NewClient

func NewClient(apiKey, secretKey string) *Client

NewClient initialize an API client instance with API key and secret key. You should always call this function before using this SDK. Services will be created by the form client.NewXXXService().

func NewProxiedClient

func NewProxiedClient(apiKey, secretKey, proxyUrl string) *Client

NewProxiedClient passing a proxy url

func (*Client) NewCancelAllOpenOrdersService

func (c *Client) NewCancelAllOpenOrdersService() *CancelAllOpenOrdersService

NewCancelAllOpenOrdersService init cancel all open orders service

func (*Client) NewCancelMultipleOrdersService

func (c *Client) NewCancelMultipleOrdersService() *CancelMultiplesOrdersService

NewCancelMultipleOrdersService init cancel multiple orders service

func (*Client) NewCancelOrderService

func (c *Client) NewCancelOrderService() *CancelOrderService

NewCancelOrderService init cancel order service

func (*Client) NewCreateBatchOrdersService

func (c *Client) NewCreateBatchOrdersService() *CreateBatchOrdersService

NewCreateBatchOrdersService init creating batch order service

func (*Client) NewCreateOrderService

func (c *Client) NewCreateOrderService() *CreateOrderService

NewCreateOrderService init creating order service

func (*Client) NewDepthService

func (c *Client) NewDepthService() *DepthService

NewDepthService init depth service

func (*Client) NewExchangeInfoService

func (c *Client) NewExchangeInfoService() *ExchangeInfoService

NewExchangeInfoService init exchange info service

func (*Client) NewGetOrderService

func (c *Client) NewGetOrderService() *GetOrderService

NewGetOrderService init get order service

func (*Client) NewKlinesService

func (c *Client) NewKlinesService() *KlinesService

NewKlinesService init klines service

func (*Client) NewListOpenOrdersService

func (c *Client) NewListOpenOrdersService() *ListOpenOrdersService

NewListOpenOrdersService init list open orders service

func (*Client) SetApiEndpoint

func (c *Client) SetApiEndpoint(url string) *Client

SetApiEndpoint set api Endpoint

type ContractType

type ContractType string

ContractType define contract type

type CreateBatchOrdersResponse

type CreateBatchOrdersResponse struct {
	Orders []*SingleOrder
}

type CreateBatchOrdersService

type CreateBatchOrdersService struct {
	// contains filtered or unexported fields
}

func (*CreateBatchOrdersService) Do

func (*CreateBatchOrdersService) OrderList

type CreateOrderResponse

type CreateOrderResponse struct {
	OrderID           int64           `json:"orderId"`
	Symbol            string          `json:"symbol"`
	Price             string          `json:"price"`
	Quantity          string          `json:"quantity"`
	ExecutedQty       string          `json:"executedQty"`
	Fee               string          `json:"fee"`
	Side              SideType        `json:"side"`
	Type              OrderType       `json:"type"`
	TimeInForce       TimeInForceType `json:"timeInForce"`
	ReduceOnly        bool            `json:"reduceOnly"`
	PostOnly          bool            `json:"postOnly"`
	CreateTime        int64           `json:"createTime"`
	UpdateTime        int64           `json:"updateTime"`
	Status            OrderStatusType `json:"status"`
	AvgPrice          string          `json:"avgPrice"`
	ClientOrderID     string          `json:"clientOrderId"`
	PriceScale        int             `json:"priceScale"`
	QuantityScale     int             `json:"quantityScale"`
	OptionSide        OptionSideType  `json:"optionSide"`
	QuoteAsset        string          `json:"quoteAsset"`
	Mmp               bool            `json:"mmp"`
	RateLimitOrder10s string          `json:"rateLimitOrder10s,omitempty"`
	RateLimitOrder1m  string          `json:"rateLimitOrder1m,omitempty"`
}

CreateOrderResponse define create order response

type CreateOrderService

type CreateOrderService struct {
	// contains filtered or unexported fields
}

CreateOrderService create order

func (*CreateOrderService) ClientOrderID

func (s *CreateOrderService) ClientOrderID(ClientOrderID string) *CreateOrderService

ClientOrderID set clientOrderID

func (*CreateOrderService) Do

func (s *CreateOrderService) Do(ctx context.Context, opts ...RequestOption) (res *CreateOrderResponse, err error)

Do send request

func (*CreateOrderService) IsMmp

func (s *CreateOrderService) IsMmp(isMmp bool) *CreateOrderService

IsMmp set isMmp

func (*CreateOrderService) NewOrderResponseType

func (s *CreateOrderService) NewOrderResponseType(newOrderResponseType NewOrderRespType) *CreateOrderService

NewOrderResponseType set newOrderResponseType

func (*CreateOrderService) PostOnly

func (s *CreateOrderService) PostOnly(postOnly bool) *CreateOrderService

PostOnly set postOnly

func (*CreateOrderService) Price

func (s *CreateOrderService) Price(price string) *CreateOrderService

Price set price

func (*CreateOrderService) Quantity

func (s *CreateOrderService) Quantity(quantity string) *CreateOrderService

Quantity set quantity

func (*CreateOrderService) ReduceOnly

func (s *CreateOrderService) ReduceOnly(reduceOnly bool) *CreateOrderService

ReduceOnly set reduceOnly

func (*CreateOrderService) Side

Side set side

func (*CreateOrderService) Symbol

func (s *CreateOrderService) Symbol(symbol string) *CreateOrderService

Symbol set symbol

func (*CreateOrderService) TimeInForce

func (s *CreateOrderService) TimeInForce(timeInForce TimeInForceType) *CreateOrderService

TimeInForce set timeInForce

func (*CreateOrderService) Type

func (s *CreateOrderService) Type(orderType OrderType) *CreateOrderService

Type set type

type DepthResponse

type DepthResponse struct {
	TradeTime int64 `json:"T"`
	UpdateID  int64 `json:"u"`
	Bids      []Bid `json:"bids"`
	Asks      []Ask `json:"asks"`
}

DepthResponse define depth info with bids and asks

type DepthService

type DepthService struct {
	// contains filtered or unexported fields
}

DepthService show depth info

func (*DepthService) Do

func (s *DepthService) Do(ctx context.Context, opts ...RequestOption) (res *DepthResponse, err error)

Do send request

func (*DepthService) Limit

func (s *DepthService) Limit(limit int) *DepthService

Limit set limit

func (*DepthService) Symbol

func (s *DepthService) Symbol(symbol string) *DepthService

Symbol set symbol

type ExchangeInfo

type ExchangeInfo struct {
	Timezone        string           `json:"timezone"`
	ServerTime      int64            `json:"serverTime"`
	OptionContracts []OptionContract `json:"optionContracts"`
	OptionAssets    []OptionAsset    `json:"optionAssets"`
	OptionSymbols   []OptionSymbol   `json:"optionSymbols"`
	RateLimits      []RateLimit      `json:"rateLimits"`
}

ExchangeInfo exchange info

type ExchangeInfoService

type ExchangeInfoService struct {
	// contains filtered or unexported fields
}

ExchangeInfoService exchange info service

func (*ExchangeInfoService) Do

func (s *ExchangeInfoService) Do(ctx context.Context, opts ...RequestOption) (res *ExchangeInfo, err error)

Do send request

type ForceOrderCloseType

type ForceOrderCloseType string

ForceOrderCloseType define reason type for force order

type GetOrderService

type GetOrderService struct {
	// contains filtered or unexported fields
}

GetOrderService get an order

func (*GetOrderService) ClientOrderID

func (s *GetOrderService) ClientOrderID(clientOrderID string) *GetOrderService

ClientOrderID set clientOrderID

func (*GetOrderService) Do

func (s *GetOrderService) Do(ctx context.Context, opts ...RequestOption) (res *Order, err error)

Do send request

func (*GetOrderService) OrderID

func (s *GetOrderService) OrderID(orderID int64) *GetOrderService

OrderID set orderID

func (*GetOrderService) Symbol

func (s *GetOrderService) Symbol(symbol string) *GetOrderService

Symbol set symbol

type Kline

type Kline struct {
	OpenTime    int64  `json:"openTime"`
	Open        string `json:"open"`
	High        string `json:"high"`
	Low         string `json:"low"`
	Close       string `json:"close"`
	CloseTime   int64  `json:"closeTime"`
	Amount      string `json:"amount"`
	TakerAmount string `json:"takerAmount"`
	Volume      string `json:"volume"`
	TakerVolume string `json:"takerVolume"`
	Interval    string `json:"interval"`
	TradeCount  int64  `json:"tradeCount"`
}

Kline define kline info

type KlinesService

type KlinesService struct {
	// contains filtered or unexported fields
}

KlinesService list klines

func (*KlinesService) Do

func (s *KlinesService) Do(ctx context.Context, opts ...RequestOption) (res []*Kline, err error)

Do send request

func (*KlinesService) EndTime

func (s *KlinesService) EndTime(endTime int64) *KlinesService

EndTime set endTime

func (*KlinesService) Interval

func (s *KlinesService) Interval(interval string) *KlinesService

Interval set interval

func (*KlinesService) Limit

func (s *KlinesService) Limit(limit int) *KlinesService

Limit set limit

func (*KlinesService) StartTime

func (s *KlinesService) StartTime(startTime int64) *KlinesService

StartTime set startTime

func (*KlinesService) Symbol

func (s *KlinesService) Symbol(symbol string) *KlinesService

Symbol set symbol

type ListOpenOrdersService

type ListOpenOrdersService struct {
	// contains filtered or unexported fields
}

ListOpenOrdersService list opened orders

func (*ListOpenOrdersService) Do

func (s *ListOpenOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*Order, err error)

Do send request

func (*ListOpenOrdersService) EndTime

func (s *ListOpenOrdersService) EndTime(endTime int64) *ListOpenOrdersService

EndTime set endTime

func (*ListOpenOrdersService) Limit

Limit set limit

func (*ListOpenOrdersService) OrderId

func (s *ListOpenOrdersService) OrderId(orderId int64) *ListOpenOrdersService

OrderId set orderId

func (*ListOpenOrdersService) StartTime

func (s *ListOpenOrdersService) StartTime(startTime int64) *ListOpenOrdersService

StartTime set startTime

func (*ListOpenOrdersService) Symbol

Symbol set symbol

type LotSizeFilter

type LotSizeFilter struct {
	MaxQuantity string `json:"maxQty"`
	MinQuantity string `json:"minQty"`
	StepSize    string `json:"stepSize"`
}

LotSizeFilter define lot size filter of symbol

type MarginType

type MarginType string

MarginType define margin type

type NewOrderRespType

type NewOrderRespType string

NewOrderRespType define response JSON verbosity

type OptionAsset

type OptionAsset struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

Option Asset

type OptionContract

type OptionContract struct {
	Id          int64  `json:"id"`
	BaseAsset   string `json:"baseAsset"`
	QuoteAsset  string `json:"quoteAsset"`
	Underlying  string `json:"underlying"`
	SettleAsset string `json:"settleAsset"`
}

Option Contract

type OptionSideType

type OptionSideType string

OptionSideType define option side type of order

type OptionSymbol

type OptionSymbol struct {
	ContractId           int64                    `json:"contractId"`
	ExpiryDate           int64                    `json:"expiryDate"`
	Filters              []map[string]interface{} `json:"filters"`
	Id                   int64                    `json:"id"`
	Symbol               string                   `json:"symbol"`
	Side                 string                   `json:"side"`
	StrikePrice          string                   `json:"strikePrice"`
	Underlying           string                   `json:"underlying"`
	Unit                 int64                    `json:"unit"`
	MakerFeeRate         string                   `json:"makerFeeRate"`
	TakerFeeRate         string                   `json:"takerFeeRate"`
	MinQty               string                   `json:"minQty"`
	MaxQty               string                   `json:"maxQty"`
	InitialMargin        string                   `json:"initialMargin"`
	MaintenanceMargin    string                   `json:"maintenanceMargin"`
	MinInitialMargin     string                   `json:"minInitialMargin"`
	MinMaintenanceMargin string                   `json:"minMaintenanceMargin"`
	PriceScale           int                      `json:"priceScale"`
	QuantityScale        int                      `json:"quantityScale"`
	QuoteAsset           string                   `json:"quoteAsset"`
}

Option Symbol

func (*OptionSymbol) LotSizeFilter

func (s *OptionSymbol) LotSizeFilter() *LotSizeFilter

LotSizeFilter return lot size filter of symbol

func (*OptionSymbol) PriceFilter

func (s *OptionSymbol) PriceFilter() *PriceFilter

PriceFilter return price filter of symbol

type Order

type Order struct {
	OrderID       int64           `json:"orderId"`
	Symbol        string          `json:"symbol"`
	Price         string          `json:"price"`
	Quantity      string          `json:"quantity"`
	ExecutedQty   string          `json:"executedQty"`
	Fee           string          `json:"fee"`
	Side          SideType        `json:"side"`
	Type          OrderType       `json:"type"`
	TimeInForce   TimeInForceType `json:"timeInForce"`
	ReduceOnly    bool            `json:"reduceOnly"`
	PostOnly      bool            `json:"postOnly"`
	CreateTime    int64           `json:"createTime"`
	UpdateTime    int64           `json:"updateTime"`
	Status        OrderStatusType `json:"status"`
	AvgPrice      string          `json:"avgPrice"`
	Source        string          `json:"source"`
	ClientOrderID string          `json:"clientOrderId"`
	PriceScale    int             `json:"priceScale"`
	QuantityScale int             `json:"quantityScale"`
	OptionSide    OptionSideType  `json:"optionSide"`
	QuoteAsset    string          `json:"quoteAsset"`
	Mmp           bool            `json:"mmp"`
}

Order define order info

type OrderExecutionType

type OrderExecutionType string

OrderExecutionType define order execution type

type OrderStatusType

type OrderStatusType string

OrderStatusType define order status type

type OrderType

type OrderType string

OrderType define order type

type PositionSideType

type PositionSideType string

PositionSideType define position side type of order

type PriceFilter

type PriceFilter struct {
	MaxPrice string `json:"maxPrice"`
	MinPrice string `json:"minPrice"`
	TickSize string `json:"tickSize"`
}

PriceFilter define price filter of symbol

type RateLimit

type RateLimit struct {
	RateLimitType string `json:"rateLimitType"`
	Interval      string `json:"interval"`
	IntervalNum   int64  `json:"intervalNum"`
	Limit         int64  `json:"limit"`
}

RateLimit struct

type RequestOption

type RequestOption func(*request)

RequestOption define option type for request

func WithHeader

func WithHeader(key, value string, replace bool) RequestOption

WithHeader set or add a header value to the request

func WithHeaders

func WithHeaders(header http.Header) RequestOption

WithHeaders set or replace the headers of the request

func WithRecvWindow

func WithRecvWindow(recvWindow int64) RequestOption

WithRecvWindow set recvWindow param for the request

type SideEffectType

type SideEffectType string

SideEffectType define side effect type for orders

type SideType

type SideType string

SideType define side type of order

type SingleOrder

type SingleOrder struct {
	OrderID       int64     `json:"orderId"`
	Symbol        string    `json:"symbol"`
	Price         string    `json:"price"`
	Quantity      string    `json:"quantity"`
	Side          SideType  `json:"side"`
	Type          OrderType `json:"type"`
	ReduceOnly    bool      `json:"reduceOnly"`
	PostOnly      bool      `json:"postOnly"`
	ClientOrderID string    `json:"clientOrderId"`
	Mmp           bool      `json:"mmp"`
}

SingleOrder define single order info returned by batch create request

type SymbolFilterType

type SymbolFilterType string

SymbolFilterType define symbol filter type

type SymbolStatusType

type SymbolStatusType string

SymbolStatusType define symbol status type

type SymbolType

type SymbolType string

SymbolType define symbol type

type TimeInForceType

type TimeInForceType string

TimeInForceType define time in force type of order

type UserDataEventReasonType

type UserDataEventReasonType string

UserDataEventReasonType define reason type for user data event

type UserDataEventType

type UserDataEventType string

UserDataEventType define user data event type

type WorkingType

type WorkingType string

WorkingType define working type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL