Versions in this module Expand all Collapse all v0 v0.0.1 May 4, 2024 Changes in this version + const KCS + var ErrMissingSequence = errors.New("sequence is missing") + type Exchange struct + func New(key, secret, passphrase string) *Exchange + func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) (errs error) + func (e *Exchange) IsSupportedInterval(interval types.Interval) bool + func (e *Exchange) Name() types.ExchangeName + func (e *Exchange) NewStream() types.Stream + func (e *Exchange) PlatformFeeCurrency() string + func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error) + func (e *Exchange) QueryAccountBalances(ctx context.Context) (types.BalanceMap, error) + func (e *Exchange) QueryClosedOrders(ctx context.Context, symbol string, since, until time.Time, lastOrderID uint64) (orders []types.Order, err error) + func (e *Exchange) QueryDepth(ctx context.Context, symbol string) (types.SliceOrderBook, int64, error) + func (e *Exchange) QueryKLines(ctx context.Context, symbol string, interval types.Interval, ...) ([]types.KLine, error) + func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error) + func (e *Exchange) QueryOpenOrders(ctx context.Context, symbol string) (orders []types.Order, err error) + func (e *Exchange) QueryTicker(ctx context.Context, symbol string) (*types.Ticker, error) + func (e *Exchange) QueryTickers(ctx context.Context, symbols ...string) (map[string]types.Ticker, error) + func (e *Exchange) QueryTrades(ctx context.Context, symbol string, options *types.TradeQueryOptions) (trades []types.Trade, err error) + func (e *Exchange) SubmitOrder(ctx context.Context, order types.SubmitOrder) (createdOrder *types.Order, err error) + func (e *Exchange) SupportedInterval() map[types.Interval]int + type Stream struct + func NewStream(client *kucoinapi.RestClient, ex *Exchange) *Stream + func (s *Stream) EmitAccountBalanceEvent(e *WebSocketAccountBalanceEvent) + func (s *Stream) EmitCandleEvent(candle *WebSocketCandleEvent, e *WebSocketEvent) + func (s *Stream) EmitOrderBookL2Event(e *WebSocketOrderBookL2Event) + func (s *Stream) EmitPrivateOrderEvent(e *WebSocketPrivateOrderEvent) + func (s *Stream) EmitTickerEvent(e *WebSocketTickerEvent) + func (s *Stream) OnAccountBalanceEvent(cb func(e *WebSocketAccountBalanceEvent)) + func (s *Stream) OnCandleEvent(cb func(candle *WebSocketCandleEvent, e *WebSocketEvent)) + func (s *Stream) OnOrderBookL2Event(cb func(e *WebSocketOrderBookL2Event)) + func (s *Stream) OnPrivateOrderEvent(cb func(e *WebSocketPrivateOrderEvent)) + func (s *Stream) OnTickerEvent(cb func(e *WebSocketTickerEvent)) + type StreamEventHub interface + OnAccountBalanceEvent func(cb func(e *WebSocketAccountBalanceEvent)) + OnCandleEvent func(cb func(candle *WebSocketCandleEvent, e *WebSocketEvent)) + OnOrderBookL2Event func(cb func(e *WebSocketOrderBookL2Event)) + OnPrivateOrderEvent func(cb func(e *WebSocketPrivateOrderEvent)) + OnTickerEvent func(cb func(e *WebSocketTickerEvent)) + type WebSocketAccountBalanceEvent struct + Available fixedpoint.Value + AvailableChange fixedpoint.Value + Currency string + Hold fixedpoint.Value + HoldChange fixedpoint.Value + RelationContext struct{ ... } + RelationEvent string + RelationEventId string + Time string + Total fixedpoint.Value + type WebSocketCandleEvent struct + Add bool + Candles []string + Interval types.Interval + Symbol string + Time types.MillisecondTimestamp + func (e *WebSocketCandleEvent) KLine() types.KLine + type WebSocketCommand struct + Id int64 + PrivateChannel bool + Response bool + Topic string + Type WebSocketMessageType + func (c *WebSocketCommand) JSON() ([]byte, error) + type WebSocketConnector interface + Conn func() *websocket.Conn + Reconnect func() + type WebSocketEvent struct + Code int + Data json.RawMessage + Object interface{} + Subject WebSocketSubject + Topic string + Type WebSocketMessageType + type WebSocketMessageType string + const WebSocketMessageTypeAck + const WebSocketMessageTypeError + const WebSocketMessageTypeMessage + const WebSocketMessageTypePing + const WebSocketMessageTypePong + const WebSocketMessageTypeSubscribe + const WebSocketMessageTypeUnsubscribe + const WebSocketMessageTypeWelcome + type WebSocketOrderBookL2Event struct + Changes struct{ ... } + SequenceEnd int64 + SequenceStart int64 + Symbol string + Time types.MillisecondTimestamp + type WebSocketPrivateOrderEvent struct + ClientOid string + FilledSize fixedpoint.Value + Liquidity string + MatchPrice fixedpoint.Value + MatchSize fixedpoint.Value + OrderId string + OrderTime types.NanosecondTimestamp + OrderType string + Price fixedpoint.Value + RemainSize fixedpoint.Value + Side string + Size fixedpoint.Value + Status string + Symbol string + TradeId string + Ts types.MillisecondTimestamp + Type string + type WebSocketSubject string + const WebSocketSubjectAccountBalance + const WebSocketSubjectLevel2 + const WebSocketSubjectOrderChange + const WebSocketSubjectStopOrder + const WebSocketSubjectTradeCandlesAdd + const WebSocketSubjectTradeCandlesUpdate + const WebSocketSubjectTradeL2Update + const WebSocketSubjectTradeSnapshot + const WebSocketSubjectTradeTicker + type WebSocketTickerEvent struct + BestAsk fixedpoint.Value + BestAskSize fixedpoint.Value + BestBid fixedpoint.Value + BestBidSize fixedpoint.Value + Price fixedpoint.Value + Sequence string + Size fixedpoint.Value