Documentation ¶
Index ¶
- type Balance
- type CodeC
- type Fill
- type FillNotify
- type FutureInfo
- type FuturesSymbol
- type Market
- type Order
- type OrderBook
- type OrderBookData
- type OrderReq
- type Position
- type RestClient
- func (rc *RestClient) Balances(ctx context.Context) ([]Balance, error)
- func (rc *RestClient) Future(ctx context.Context, sym string) (*FutureInfo, error)
- func (rc *RestClient) Futures(ctx context.Context) ([]FutureInfo, error)
- func (rc *RestClient) Init(ctx context.Context) error
- func (rc *RestClient) Markets(ctx context.Context) ([]Market, error)
- func (rc *RestClient) NewAuthWSClient(ctx context.Context, data chan interface{}) (*WSClient, error)
- func (rc *RestClient) NewWSClient(data chan interface{}) *WSClient
- func (rc *RestClient) OrderCancel(ctx context.Context, order *exchange.Order) error
- func (rc *RestClient) OrderFetch(ctx context.Context, order *exchange.Order) (*exchange.Order, error)
- func (rc *RestClient) OrderNew(ctx context.Context, req *exchange.OrderRequest, ...) (*exchange.Order, error)
- func (rc *RestClient) Orders(ctx context.Context, symbol exchange.Symbol) ([]*exchange.Order, error)
- func (rc *RestClient) ParseFutureSymbol(symbol string) (exchange.FuturesSymbol, error)
- func (rc *RestClient) ParseSwapSymbol(symbol string) (exchange.SwapSymbol, error)
- func (rc *RestClient) ParseSymbol(symbol string) (exchange.Symbol, error)
- func (client *RestClient) Positions(ctx context.Context) ([]Position, error)
- type SpotSymbol
- type SwapSymbol
- type WSClient
- func (ws *WSClient) Auth(ctx context.Context, key string, secret string) error
- func (ws *WSClient) Handle(ctx context.Context, notify *rpc.Notify)
- func (ws *WSClient) Run(ctx context.Context) error
- func (ws *WSClient) Subscribe(ctx context.Context, typ exchange.SubType, syms ...exchange.Symbol) error
- type Wrap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FillNotify ¶
type FillNotify struct { Fee decimal.Decimal `json:"fee"` FeeRate decimal.Decimal `json:"feeRate"` Future string `json:"future"` ID int64 `json:"id"` Liquidity string `json:"liquidity"` Market string `json:"market"` OrderID int64 `json:"orderId"` TradeID int64 `json:"tradeId"` Price decimal.Decimal `json:"price"` Side string `json:"side"` Size decimal.Decimal `json:"size"` Time string `json:"time"` Type string `json:"type"` }
type FutureInfo ¶
type FutureInfo struct { Ask float64 `json:"ask"` Bid float64 `json:"bid"` Change1H float64 `json:"change1h"` Change24H float64 `json:"change24h"` ChangeBod float64 `json:"changeBod"` VolumeUsd24h float64 `json:"volumeUsd24h"` Volume float64 `json:"volume"` Description string `json:"description"` Enabled bool `json:"enabled"` Expired bool `json:"expired"` Expiry string `json:"expiry"` Index float64 `json:"index"` ImfFactor float64 `json:"imfFactor"` Last float64 `json:"last"` LowerBound float64 `json:"lowerBound"` Mark float64 `json:"mark"` Name string `json:"name"` Perpetual bool `json:"perpetual"` PositionLimitWtight float64 `json:"positionLimitWeight"` PostOnly bool `json:"postOnly"` PriceIncrement float64 `json:"priceIncrement"` SizeIncrement float64 `json:"sizeIncrement"` Underlying string `json:"underlying"` UpperBound float64 `json:"upperBound"` Type string `json:"type"` }
type FuturesSymbol ¶
type FuturesSymbol struct {
*exchange.BaseFutureSymbol
}
func (*FuturesSymbol) String ¶
func (fs *FuturesSymbol) String() string
type Market ¶
type Market struct { Name string `json:"name"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` Type string `json:"type"` Underlying string `json:"underlying"` Enabled bool `json:"enabled"` Ask float64 `json:"ask"` Bid float64 `json:"bid"` Last float64 `json:"last"` PostOnly bool `json:"postOnly"` PriceIncrement float64 `json:"priceIncrement"` SizeIncrement float64 `json:"sizeIncrement"` Restricted bool `json:"restricted"` }
type Order ¶
type Order struct { CreatedAt string `json:"createdAt"` FilledSize decimal.Decimal `json:"filledSize"` Future string `json:"future"` ID int64 `json:"id"` Market string `json:"market"` Price decimal.Decimal `json:"price"` AvgFillPrice decimal.Decimal `json:"avgFillPrice"` RemainingSize decimal.Decimal `json:"remainingSize"` Side string `json:"side"` Size decimal.Decimal `json:"size"` Status string `json:"status"` Type string `json:"type"` ReduceOnly bool `json:"reduceOnly"` IOC bool `json:"ioc"` PostOnly bool `json:"postOnly"` ClientID string `json:"clientId"` }
type OrderBook ¶
type OrderBook struct { *exchange.OrderBookDS // contains filtered or unexported fields }
func NewOrderBook ¶
type OrderBookData ¶
type OrderBookData struct { Action string `json:"action"` Bids [][2]float64 `json:"bids"` Asks [][2]float64 `json:"asks"` Timestamp int64 `json:"timestamp"` }
func (*OrderBookData) Transfer ¶
func (obd *OrderBookData) Transfer(sym exchange.Symbol) *exchange.OrderBookNotify
type RestClient ¶
type RestClient struct {
// contains filtered or unexported fields
}
func NewRestClient ¶
func NewRestClient(key, secret string) *RestClient
func (*RestClient) Balances ¶
func (rc *RestClient) Balances(ctx context.Context) ([]Balance, error)
func (*RestClient) Future ¶
func (rc *RestClient) Future(ctx context.Context, sym string) (*FutureInfo, error)
func (*RestClient) Futures ¶
func (rc *RestClient) Futures(ctx context.Context) ([]FutureInfo, error)
func (*RestClient) NewAuthWSClient ¶
func (rc *RestClient) NewAuthWSClient(ctx context.Context, data chan interface{}) (*WSClient, error)
func (*RestClient) NewWSClient ¶
func (rc *RestClient) NewWSClient(data chan interface{}) *WSClient
func (*RestClient) OrderCancel ¶
OrderCancel only ID field is required
func (*RestClient) OrderFetch ¶
func (rc *RestClient) OrderFetch(ctx context.Context, order *exchange.Order) (*exchange.Order, error)
OrderFetch only ID field is required
func (*RestClient) OrderNew ¶
func (rc *RestClient) OrderNew(ctx context.Context, req *exchange.OrderRequest, options ...exchange.OrderReqOption) (*exchange.Order, error)
func (*RestClient) Orders ¶
func (rc *RestClient) Orders(ctx context.Context, symbol exchange.Symbol) ([]*exchange.Order, error)
Orders return open orders
func (*RestClient) ParseFutureSymbol ¶
func (rc *RestClient) ParseFutureSymbol(symbol string) (exchange.FuturesSymbol, error)
func (*RestClient) ParseSwapSymbol ¶
func (rc *RestClient) ParseSwapSymbol(symbol string) (exchange.SwapSymbol, error)
func (*RestClient) ParseSymbol ¶
func (rc *RestClient) ParseSymbol(symbol string) (exchange.Symbol, error)
type SpotSymbol ¶
type SpotSymbol struct {
*exchange.BaseSpotSymbol
}
func (*SpotSymbol) String ¶
func (ss *SpotSymbol) String() string
type SwapSymbol ¶
type SwapSymbol struct {
*exchange.BaseSwapSymbol
}
func (*SwapSymbol) String ¶
func (fs *SwapSymbol) String() string
Click to show internal directories.
Click to hide internal directories.