Documentation ¶
Index ¶
- Constants
- func Init(ctx context.Context) error
- func NewFillChannel(sym exchange.Symbol) exchange.Channel
- func NewMarketsChannel(sym exchange.Symbol) exchange.Channel
- func NewOrderBookChannel(sym exchange.Symbol) exchange.Channel
- func NewOrderChannel(sym exchange.Symbol) exchange.Channel
- func NewOrederbookGroupedChannel(sym exchange.Symbol) exchange.Channel
- func NewTickersChannel(sym exchange.Symbol) exchange.Channel
- func NewTradesChannel(sym exchange.Symbol) exchange.Channel
- func ParseSymbol(symbol string) (exchange.Symbol, error)
- type Balance
- type BookReq
- type Candle
- type CandleReq
- type CodeC
- type Depth
- type Fill
- type FillChannel
- type FillNotify
- type FutureInfo
- type FuturesSymbol
- type Market
- type MarketChannel
- type Markets
- type Order
- type OrderBook
- type OrderBookChannel
- type OrderBookData
- type OrderChannel
- type OrderReq
- type OrderbookGrouped
- type OrderbookGroupedChannel
- type OrdersHistoryReq
- type Position
- type RestClient
- func (rc *RestClient) Balances(ctx context.Context) ([]Balance, error)
- func (rc *RestClient) Books(ctx context.Context, req *BookReq) (*Depth, error)
- func (rc *RestClient) Candles(ctx context.Context, cr *CandleReq) ([]Candle, error)
- func (rc *RestClient) Future(ctx context.Context, sym string) (*FutureInfo, error)
- func (rc *RestClient) Futures(ctx context.Context) ([]FutureInfo, error)
- func (rc *RestClient) Klines(ctx context.Context, kr *exchange.KlineReq) ([]exchange.Kline, error)
- func (rc *RestClient) Markets(ctx context.Context) ([]Market, error)
- 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) OrdersHistory(ctx context.Context, param *OrdersHistoryReq) ([]*Order, error)
- func (client *RestClient) Positions(ctx context.Context) ([]Position, error)
- type SpotSymbol
- type SwapSymbol
- type Ticker
- type TickerChannel
- type Trade
- type TradeChannel
- type TradeNotify
- type WSClient
- func (ws *WSClient) Auth(ctx context.Context) 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, channels ...exchange.Channel) error
- func (ws *WSClient) UnSubscribe(ctx context.Context, channels ...exchange.Channel) error
- type Wrap
Constants ¶
View Source
const (
CandlesLimit = 1000
)
Variables ¶
This section is empty.
Functions ¶
func NewMarketsChannel ¶ added in v0.5.4
func NewOrderBookChannel ¶ added in v0.5.1
func NewOrederbookGroupedChannel ¶ added in v0.5.4
func NewTickersChannel ¶ added in v0.5.4
Types ¶
type BookReq ¶ added in v0.5.4
func NewBookReq ¶ added in v0.5.4
type Candle ¶ added in v0.5.1
type CandleReq ¶ added in v0.5.1
type CandleReq struct {
// contains filtered or unexported fields
}
func NewCandelReq ¶ added in v0.5.1
type FillChannel ¶ added in v0.5.1
type FillChannel struct {
// contains filtered or unexported fields
}
func (*FillChannel) String ¶ added in v0.5.1
func (fc *FillChannel) String() string
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"` MinProvideSize float64 `json:"minProvideSize"` Restricted bool `json:"restricted"` }
type MarketChannel ¶ added in v0.5.4
type MarketChannel struct {
// contains filtered or unexported fields
}
func (*MarketChannel) String ¶ added in v0.5.4
func (m *MarketChannel) String() string
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 OrderBookChannel ¶ added in v0.5.1
type OrderBookChannel struct {
// contains filtered or unexported fields
}
func (*OrderBookChannel) String ¶ added in v0.5.1
func (obc *OrderBookChannel) String() string
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 OrderChannel ¶ added in v0.5.1
type OrderChannel struct {
// contains filtered or unexported fields
}
func (*OrderChannel) String ¶ added in v0.5.1
func (oc *OrderChannel) String() string
type OrderbookGrouped ¶ added in v0.5.4
type OrderbookGrouped struct{}
type OrderbookGroupedChannel ¶ added in v0.5.4
type OrderbookGroupedChannel struct {
// contains filtered or unexported fields
}
func (*OrderbookGroupedChannel) String ¶ added in v0.5.4
func (o *OrderbookGroupedChannel) String() string
type OrdersHistoryReq ¶ added in v0.5.4
type OrdersHistoryReq struct { Market string `json:"market"` Side string `json:"side"` OrderType string `json:"orderType"` StartTime int `json:"startTime"` EndTime int `json:"endTime"` }
func NewOrderHistoryReq ¶ added in v0.5.4
func NewOrderHistoryReq(market, side, orderType string, startTime, endTime int) *OrdersHistoryReq
type RestClient ¶
type RestClient struct {
// contains filtered or unexported fields
}
func NewClientWithSubAccount ¶ added in v0.5.4
func NewClientWithSubAccount(key, secret, subAccount string) *RestClient
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) 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) OrdersHistory ¶ added in v0.5.4
func (rc *RestClient) OrdersHistory(ctx context.Context, param *OrdersHistoryReq) ([]*Order, 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
type TickerChannel ¶ added in v0.5.4
type TickerChannel struct {
// contains filtered or unexported fields
}
func (*TickerChannel) String ¶ added in v0.5.4
func (t *TickerChannel) String() string
type TradeChannel ¶ added in v0.5.4
type TradeChannel struct {
// contains filtered or unexported fields
}
func (*TradeChannel) String ¶ added in v0.5.4
func (t *TradeChannel) String() string
type TradeNotify ¶ added in v0.5.4
Click to show internal directories.
Click to hide internal directories.