Documentation ¶
Index ¶
- type Client
- type Config
- type CreateOrderRespMsg
- type ExchangeInfo
- type ExchangeInfoFilter
- type ExchangeInfoMsg
- type HmacSigner
- type OrderFill
- type Signer
- type SpotApi
- func (spot *SpotApi) CancelOrderById(symbol string, orderId string) (*http.Response, error)
- func (spot *SpotApi) CancelOrdersBySymbol(symbol string) (*http.Response, error)
- func (spot *SpotApi) CreateLimitOrder(symbol string, side string, quantity string, price string, timeInForce string) (*CreateOrderRespMsg, error)
- func (spot *SpotApi) CreateMarketBaseQuantityOrder(symbol string, side string, quantity string) (*CreateOrderRespMsg, error)
- func (spot *SpotApi) CreateMarketQuoteQuantityOrder(symbol string, side string, quoteOrderQty string) (*CreateOrderRespMsg, error)
- func (spot *SpotApi) GetExchangeInfo() (*ExchangeInfoMsg, error)
- func (spot *SpotApi) Ping() (*http.Response, error)
- func (spot *SpotApi) QueryAllOpenOrders() (*http.Response, error)
- func (spot *SpotApi) QueryOpenOrdersBySymbol(symbol string) (*http.Response, error)
- func (spot *SpotApi) QueryOrderById(symbol string, orderId string) (*http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateOrderRespMsg ¶
type CreateOrderRespMsg struct { Symbol string `json:"symbol"` OrderId int64 `json:"orderId"` OrderListId int64 `json:"orderListId"` ClientOrderId string `json:"clientOrderId"` TransactTime int64 `json:"transactTime"` // ACK response does not contain the following fields Price float64 `json:"price,string,omitempty"` OrigQty float64 `json:"origQty,string,omitempty"` ExecutedQty float64 `json:"executedQty,string,omitempty"` CummulativeQuoteQty float64 `json:"cummulativeQuoteQty,string,omitempty"` Status string `json:"status,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` Type string `json:"type,omitempty"` Side string `json:"side,omitempty"` // the following fields are only for FULL response Fills []*OrderFill `json:"fills,omitempty"` }
response type: ACK RESULT FULL
type ExchangeInfo ¶
type ExchangeInfo struct { Symbol string `json:"symbol"` Status string `json:"status"` BaseAsset string `json:"baseAsset"` BaseAssetPrecision int `json:"baseAssetPrecision"` QuoteAsset string `json:"quoteAsset"` QuotePrecision int `json:"quotePrecision"` QuoteAssetPrecision int `json:"quoteAssetPrecision"` BaseCommissionPrecision int `json:"baseCommissionPrecision"` QuoteCommissionPrecision int `json:"quoteCommissionPrecision"` OrderTypes []string `json:"orderTypes"` IcebergAllowed bool `json:"icebergAllowed"` OcoAllowed bool `json:"ocoAllowed"` QuoteOrderQtyMarketAllowed bool `json:"quoteOrderQtyMarketAllowed"` AllowTrailingStop bool `json:"allowTrailingStop"` IsSpotTradingAllowed bool `json:"isSpotTradingAllowed"` IsMarginTradingAllowed bool `json:"isMarginTradingAllowed"` Filters []*ExchangeInfoFilter `json:"filters"` Permissions []string `json:"permissions"` }
type ExchangeInfoFilter ¶
type ExchangeInfoFilter struct { FilterType string `json:"filterType"` // for PRICE_FILTER MinPrice float64 `json:"minPrice,string,omitempty"` MaxPrice float64 `json:"maxPrice,string,omitempty"` TickSize float64 `json:"tickSize,string,omitempty"` // for PERCENT_PRICE MultiplierUp float64 `json:"multiplierUp,string,omitempty"` MultiplierDown float64 `json:"multiplierDown,string,omitempty"` AvgPriceMins int `json:"avgPriceMins,omitempty"` // also for MIN_NOTIONAL // for LOT_SIZE and MARKET_LOT_SIZE MinQty float64 `json:"minQty,string,omitempty"` MaxQty float64 `json:"maxQty,string,omitempty"` StepSize float64 `json:"stepSize,string,omitempty"` // for MIN_NOTIONAL MinNotional float64 `json:"minNotional,string,omitempty"` ApplyToMarket bool `json:"applyToMarket,omitempty"` // for ICEBERG_PARTS Limit int `json:"limit,omitempty"` // for MAX_NUM_ORDERS MaxNumOrders int `json:"maxNumOrders,omitempty"` // for MAX_NUM_ALGO_ORDERS MaxNumAlgoOrders int `json:"maxNumAlgoOrders,omitempty"` }
type ExchangeInfoMsg ¶
type ExchangeInfoMsg struct { // other fields are not used, wait for later complemention ExchangeInfoList []*ExchangeInfo `json:"symbols"` }
type HmacSigner ¶
type HmacSigner struct {
Key []byte
}
HmacSigner uses HMAC SHA256 for signing payloads.
func (*HmacSigner) Sign ¶
func (hs *HmacSigner) Sign(payload []byte) string
Sign signs provided payload and returns encoded string sum.
type Signer ¶
type Signer interface { // Sign signs provided payload and returns encoded string sum. Sign(payload []byte) string }
Signer signs provided payloads.
type SpotApi ¶
type SpotApi Client
func (*SpotApi) CancelOrderById ¶
func (*SpotApi) CancelOrdersBySymbol ¶
func (*SpotApi) CreateLimitOrder ¶
func (*SpotApi) CreateMarketBaseQuantityOrder ¶
func (*SpotApi) CreateMarketQuoteQuantityOrder ¶
func (*SpotApi) GetExchangeInfo ¶
func (spot *SpotApi) GetExchangeInfo() (*ExchangeInfoMsg, error)
func (*SpotApi) QueryAllOpenOrders ¶
func (*SpotApi) QueryOpenOrdersBySymbol ¶
Click to show internal directories.
Click to hide internal directories.