Documentation
¶
Index ¶
- type AmendOrderRequest
- type CancelAllOrdersRequest
- type CancelOrderRequest
- type Candle
- type Client
- func (c *Client) AmendOrder(ctx context.Context, req AmendOrderRequest) (*OrderActionResponse, error)
- func (c *Client) CancelAllOrders(ctx context.Context, req CancelAllOrdersRequest) error
- func (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*OrderActionResponse, error)
- func (c *Client) GetFeeRates(ctx context.Context, category, symbol string) ([]FeeRateRecord, error)
- func (c *Client) GetInstruments(ctx context.Context, category string) ([]Instrument, error)
- func (c *Client) GetKlines(ctx context.Context, category, symbol, interval string, start, end int64, ...) ([]Candle, error)
- func (c *Client) GetOpenOrders(ctx context.Context, category, symbol string) ([]OrderRecord, error)
- func (c *Client) GetOrderBook(ctx context.Context, category, symbol string, limit int) (*OrderBook, error)
- func (c *Client) GetOrderHistory(ctx context.Context, category, symbol string) ([]OrderRecord, error)
- func (c *Client) GetOrderHistoryFiltered(ctx context.Context, category, symbol, orderID, orderLinkID string) ([]OrderRecord, error)
- func (c *Client) GetPositions(ctx context.Context, category, symbol, settleCoin string) ([]PositionRecord, error)
- func (c *Client) GetRealtimeOrders(ctx context.Context, category, symbol, settleCoin, orderID, orderLinkID string, ...) ([]OrderRecord, error)
- func (c *Client) GetRecentTrades(ctx context.Context, category, symbol string, limit int) ([]PublicTrade, error)
- func (c *Client) GetTicker(ctx context.Context, category, symbol string) (*Ticker, error)
- func (c *Client) GetWalletBalance(ctx context.Context, accountType, coin string) (*WalletBalanceResult, error)
- func (c *Client) HasCredentials() bool
- func (c *Client) PlaceOrder(ctx context.Context, req PlaceOrderRequest) (*OrderActionResponse, error)
- func (c *Client) SetLeverage(ctx context.Context, req SetLeverageRequest) error
- func (c *Client) WithBaseURL(baseURL string) *Client
- func (c *Client) WithCredentials(apiKey, secretKey string) *Client
- func (c *Client) WithHTTPClient(httpClient *http.Client) *Client
- type ExecutionRecord
- type FeeRateRecord
- type FeeRatesResult
- type Instrument
- type InstrumentsResult
- type KlinesResult
- type LotSizeFilter
- type NumberString
- type OrderActionResponse
- type OrderBook
- type OrderRecord
- type OrdersResult
- type PlaceOrderRequest
- type PositionRecord
- type PositionsResult
- type PriceFilter
- type PrivateWSClient
- func (c *PrivateWSClient) Close() error
- func (c *PrivateWSClient) Connect(ctx context.Context) error
- func (c *PrivateWSClient) Subscribe(ctx context.Context, topic string, handler func(json.RawMessage)) error
- func (c *PrivateWSClient) Unsubscribe(ctx context.Context, topic string) error
- func (c *PrivateWSClient) WithCredentials(apiKey, secretKey string) *PrivateWSClient
- type PublicTrade
- type PublicTradesResult
- type PublicWSClient
- type SetLeverageRequest
- type Ticker
- type TickersResult
- type TradeWSClient
- func (c *TradeWSClient) AmendOrder(ctx context.Context, req AmendOrderRequest) error
- func (c *TradeWSClient) CancelOrder(ctx context.Context, req CancelOrderRequest) error
- func (c *TradeWSClient) Close() error
- func (c *TradeWSClient) Connect(ctx context.Context) error
- func (c *TradeWSClient) PlaceOrder(ctx context.Context, req PlaceOrderRequest) error
- func (c *TradeWSClient) WithCredentials(apiKey, secretKey string) *TradeWSClient
- type WSEnvelope
- type WSExecutionMessage
- type WSOrderBookData
- type WSOrderBookMessage
- type WSOrderMessage
- type WSPositionMessage
- type WalletAccount
- type WalletBalanceResult
- type WalletCoin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmendOrderRequest ¶
type CancelAllOrdersRequest ¶
type CancelOrderRequest ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AmendOrder ¶
func (c *Client) AmendOrder(ctx context.Context, req AmendOrderRequest) (*OrderActionResponse, error)
func (*Client) CancelAllOrders ¶
func (c *Client) CancelAllOrders(ctx context.Context, req CancelAllOrdersRequest) error
func (*Client) CancelOrder ¶
func (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*OrderActionResponse, error)
func (*Client) GetFeeRates ¶
func (*Client) GetInstruments ¶
func (*Client) GetOpenOrders ¶
func (*Client) GetOrderBook ¶
func (*Client) GetOrderHistory ¶
func (*Client) GetOrderHistoryFiltered ¶
func (*Client) GetPositions ¶
func (*Client) GetRealtimeOrders ¶
func (*Client) GetRecentTrades ¶
func (*Client) GetWalletBalance ¶
func (*Client) HasCredentials ¶
func (*Client) PlaceOrder ¶
func (c *Client) PlaceOrder(ctx context.Context, req PlaceOrderRequest) (*OrderActionResponse, error)
func (*Client) SetLeverage ¶
func (c *Client) SetLeverage(ctx context.Context, req SetLeverageRequest) error
func (*Client) WithBaseURL ¶
func (*Client) WithCredentials ¶
type ExecutionRecord ¶
type ExecutionRecord struct {
ExecID string `json:"execId"`
OrderID string `json:"orderId"`
OrderLinkID string `json:"orderLinkId"`
Symbol string `json:"symbol"`
Side string `json:"side"`
ExecPrice string `json:"execPrice"`
ExecQty string `json:"execQty"`
ExecFee string `json:"execFee"`
FeeCurrency string `json:"feeCurrency"`
IsMaker bool `json:"isMaker"`
ExecTime string `json:"execTime"`
}
type FeeRateRecord ¶
type FeeRatesResult ¶
type FeeRatesResult struct {
List []FeeRateRecord `json:"list"`
}
type Instrument ¶
type Instrument struct {
Symbol string `json:"symbol"`
BaseCoin string `json:"baseCoin"`
QuoteCoin string `json:"quoteCoin"`
Status string `json:"status"`
PriceScale string `json:"priceScale"`
PriceFilter PriceFilter `json:"priceFilter"`
LotSizeFilter LotSizeFilter `json:"lotSizeFilter"`
}
type InstrumentsResult ¶
type InstrumentsResult struct {
Category string `json:"category"`
List []Instrument `json:"list"`
NextPageCursor string `json:"nextPageCursor"`
}
type KlinesResult ¶
type LotSizeFilter ¶
type NumberString ¶
type NumberString string
func (*NumberString) UnmarshalJSON ¶
func (n *NumberString) UnmarshalJSON(data []byte) error
type OrderActionResponse ¶
type OrderBook ¶
type OrderBook struct {
Symbol string `json:"s"`
Bids [][]NumberString `json:"b"`
Asks [][]NumberString `json:"a"`
TS int64 `json:"ts"`
U int64 `json:"u"`
}
type OrderRecord ¶
type OrderRecord struct {
OrderID string `json:"orderId"`
OrderLinkID string `json:"orderLinkId"`
Symbol string `json:"symbol"`
Side string `json:"side"`
OrderType string `json:"orderType"`
TimeInForce string `json:"timeInForce"`
Price string `json:"price"`
Qty string `json:"qty"`
CumExecQty string `json:"cumExecQty"`
AvgPrice string `json:"avgPrice"`
OrderStatus string `json:"orderStatus"`
ReduceOnly bool `json:"reduceOnly"`
CreatedTime string `json:"createdTime"`
UpdatedTime string `json:"updatedTime"`
CumExecFee string `json:"cumExecFee"`
ClosedPnl string `json:"closedPnl"`
TriggerPrice string `json:"triggerPrice"`
LastPriceOnCreated string `json:"lastPriceOnCreated"`
}
type OrdersResult ¶
type OrdersResult struct {
List []OrderRecord `json:"list"`
NextPageCursor string `json:"nextPageCursor"`
}
type PlaceOrderRequest ¶
type PlaceOrderRequest struct {
Category string `json:"category"`
Symbol string `json:"symbol"`
Side string `json:"side"`
OrderType string `json:"orderType"`
Qty string `json:"qty"`
Price string `json:"price,omitempty"`
TimeInForce string `json:"timeInForce,omitempty"`
ReduceOnly bool `json:"reduceOnly,omitempty"`
OrderLinkID string `json:"orderLinkId,omitempty"`
MarketUnit string `json:"marketUnit,omitempty"`
SlippageToleranceType string `json:"slippageToleranceType,omitempty"`
SlippageTolerance string `json:"slippageTolerance,omitempty"`
}
type PositionRecord ¶
type PositionRecord struct {
Symbol string `json:"symbol"`
Side string `json:"side"`
Size string `json:"size"`
AvgPrice string `json:"avgPrice"`
Leverage string `json:"leverage"`
UnrealisedPnl string `json:"unrealisedPnl"`
CumRealisedPnl string `json:"cumRealisedPnl"`
LiqPrice string `json:"liqPrice"`
}
type PositionsResult ¶
type PositionsResult struct {
NextPageCursor string `json:"nextPageCursor"`
List []PositionRecord `json:"list"`
}
type PriceFilter ¶
type PriceFilter struct {
TickSize string `json:"tickSize"`
}
type PrivateWSClient ¶
type PrivateWSClient struct {
// contains filtered or unexported fields
}
func NewPrivateWSClient ¶
func NewPrivateWSClient() *PrivateWSClient
func (*PrivateWSClient) Close ¶
func (c *PrivateWSClient) Close() error
func (*PrivateWSClient) Subscribe ¶
func (c *PrivateWSClient) Subscribe(ctx context.Context, topic string, handler func(json.RawMessage)) error
func (*PrivateWSClient) Unsubscribe ¶
func (c *PrivateWSClient) Unsubscribe(ctx context.Context, topic string) error
func (*PrivateWSClient) WithCredentials ¶
func (c *PrivateWSClient) WithCredentials(apiKey, secretKey string) *PrivateWSClient
type PublicTrade ¶
type PublicTradesResult ¶
type PublicTradesResult struct {
Category string `json:"category"`
List []PublicTrade `json:"list"`
}
type PublicWSClient ¶
type PublicWSClient struct {
// contains filtered or unexported fields
}
func NewPublicWSClient ¶
func NewPublicWSClient(category string) *PublicWSClient
func (*PublicWSClient) Close ¶
func (c *PublicWSClient) Close() error
func (*PublicWSClient) Subscribe ¶
func (c *PublicWSClient) Subscribe(ctx context.Context, topic string, handler func(json.RawMessage)) error
func (*PublicWSClient) Unsubscribe ¶
func (c *PublicWSClient) Unsubscribe(ctx context.Context, topic string) error
type SetLeverageRequest ¶
type Ticker ¶
type Ticker struct {
Symbol string `json:"symbol"`
LastPrice string `json:"lastPrice"`
Bid1Price string `json:"bid1Price"`
Ask1Price string `json:"ask1Price"`
Volume24h string `json:"volume24h"`
Turnover24h string `json:"turnover24h"`
HighPrice24h string `json:"highPrice24h"`
LowPrice24h string `json:"lowPrice24h"`
IndexPrice string `json:"indexPrice"`
MarkPrice string `json:"markPrice"`
Time string `json:"time"`
TS string `json:"ts"`
}
type TickersResult ¶
type TradeWSClient ¶
type TradeWSClient struct {
// contains filtered or unexported fields
}
func NewTradeWSClient ¶
func NewTradeWSClient() *TradeWSClient
func (*TradeWSClient) AmendOrder ¶
func (c *TradeWSClient) AmendOrder(ctx context.Context, req AmendOrderRequest) error
func (*TradeWSClient) CancelOrder ¶
func (c *TradeWSClient) CancelOrder(ctx context.Context, req CancelOrderRequest) error
func (*TradeWSClient) Close ¶
func (c *TradeWSClient) Close() error
func (*TradeWSClient) PlaceOrder ¶
func (c *TradeWSClient) PlaceOrder(ctx context.Context, req PlaceOrderRequest) error
func (*TradeWSClient) WithCredentials ¶
func (c *TradeWSClient) WithCredentials(apiKey, secretKey string) *TradeWSClient
type WSEnvelope ¶
type WSEnvelope struct {
Topic string `json:"topic"`
Type string `json:"type"`
TS int64 `json:"ts"`
Data json.RawMessage `json:"data"`
}
type WSExecutionMessage ¶
type WSExecutionMessage struct {
Topic string `json:"topic"`
Data []ExecutionRecord `json:"data"`
}
func DecodeExecutionMessage ¶
func DecodeExecutionMessage(payload []byte) (*WSExecutionMessage, error)
type WSOrderBookData ¶
type WSOrderBookData struct {
Symbol string `json:"s"`
Bids [][]NumberString `json:"b"`
Asks [][]NumberString `json:"a"`
UpdateID int64 `json:"u"`
Seq int64 `json:"seq"`
CTS int64 `json:"cts"`
}
type WSOrderBookMessage ¶
type WSOrderBookMessage struct {
Topic string `json:"topic"`
Type string `json:"type"`
TS int64 `json:"ts"`
Data WSOrderBookData `json:"data"`
}
func DecodeOrderBookMessage ¶
func DecodeOrderBookMessage(payload []byte) (*WSOrderBookMessage, error)
type WSOrderMessage ¶
type WSOrderMessage struct {
Topic string `json:"topic"`
Data []OrderRecord `json:"data"`
}
func DecodeOrderMessage ¶
func DecodeOrderMessage(payload []byte) (*WSOrderMessage, error)
type WSPositionMessage ¶
type WSPositionMessage struct {
Topic string `json:"topic"`
Data []PositionRecord `json:"data"`
}
func DecodePositionMessage ¶
func DecodePositionMessage(payload []byte) (*WSPositionMessage, error)
type WalletAccount ¶
type WalletBalanceResult ¶
type WalletBalanceResult struct {
List []WalletAccount `json:"list"`
}
Click to show internal directories.
Click to hide internal directories.