Versions in this module Expand all Collapse all v1 v1.0.2 May 8, 2024 v1.0.1 May 7, 2024 v1.0.0 May 6, 2024 Changes in this version + const PRIVATE_PATH + const PUBLIC_PATH + const SUB_UNSUB_ERROR + const SUB_UNSUB_SUCCESS + var ErrNotLoggedIn = errors.New("not logged in") + var WebsocketKeepalive = false + var WebsocketTimeout = time.Second * 60 + type Base string + const MAINET + const TESTNET + type Config struct + type ErrHandler func(err error) + type ErrJSONUnmarshal struct + Err error + Msg string + func (e *ErrJSONUnmarshal) Error() string + type ErrSubUnsub struct + Err error + Msg string + func (e *ErrSubUnsub) Error() string + type ErrWsReadMessage struct + Err error + Msg string + func (e *ErrWsReadMessage) Error() string + type EventHandler func(message []byte) + type KlineEvent map[string][]float64 + type KlineEventHandler func(event *KlineEvent) + type KlinePeriod string + const PERIOD_12H + const PERIOD_15M + const PERIOD_1D + const PERIOD_1H + const PERIOD_1M + const PERIOD_1W + const PERIOD_2H + const PERIOD_30M + const PERIOD_3D + const PERIOD_4H + const PERIOD_5M + const PERIOD_6H + type OrderbookData struct + Asks []string + Bids []string + Sequence int64 + type OrderbookEvent map[string]OrderbookData + type OrderbookEventHandler func(event *OrderbookEvent) + type PrivateEvent struct + Order PrivateOrder + Trade PrivateTrade + type PrivateEventHandler func(event *PrivateEvent) + type PrivateOrder struct + At int64 + AvgPrice string + CreatedAt int64 + ExecutedVolume string + ID int64 + Kind string + Market string + OrdType string + OriginVolume string + Price string + RemainingVolume string + Side string + State string + TradesCount int64 + UpdatedAt int64 + type PrivateTrade struct + Market string + OrderID int64 + Total string + type SubUnsub string + const SUBSCRIBE + const UNSUBSCRIBE + type SubUnsubEvent struct + Success Success + type SubUnsubEventHandler func(event *SubUnsubEvent) + type SubUnsubRequest struct + Event SubUnsub + Streams []string + func SubUnsubKlineTopics(subUnsub SubUnsub, symbol map[string]KlinePeriod) SubUnsubRequest + func SubUnsubOrderbookTopics(subUnsub SubUnsub, symbol []string) SubUnsubRequest + func SubUnsubPrivateTopics(subUnsub SubUnsub, streams []string) SubUnsubRequest + func SubUnsubTradeTopics(subUnsub SubUnsub, symbol []string) SubUnsubRequest + type Success struct + Message string + Streams []string + type Trade struct + Amount string + Date int64 + Price string + TakerType string + Tid int64 + type TradeEvent map[string]Trades + type TradeEventHandler func(event *TradeEvent) + type Trades struct + Trades []Trade + type Wsclient struct + func New(baseURL Base) *Wsclient + func (c *Wsclient) Kline(symbol map[string]KlinePeriod, klineEventHandler KlineEventHandler, ...) (doneCh, stopCh chan struct{}, subUnsubCh chan SubUnsubRequest, err error) + func (c *Wsclient) Orderbook(symbol []string, orderbookEventHandler OrderbookEventHandler, ...) (doneCh, stopCh chan struct{}, subUnsubCh chan SubUnsubRequest, err error) + func (c *Wsclient) PrivateTrade(symbol []string, privateEventHandler PrivateEventHandler, ...) (doneCh, stopCh chan struct{}, subUnsubCh chan SubUnsubRequest, err error) + func (c *Wsclient) SetJwt(jwtToken string, refreshToken string) + func (c *Wsclient) Trade(symbol []string, tradeEventHandler TradeEventHandler, ...) (doneCh, stopCh chan struct{}, subUnsubCh chan SubUnsubRequest, err error) v1.0.0-alpha Apr 11, 2024