standx

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	BaseURL     = "https://perps.standx.com"
	AuthBaseURL = "https://api.standx.com" // Auth endpoints use a different base URL
)
View Source
const (
	OrderStatusOpen        = "open"
	OrderStatusNew         = "new"
	OrderStatusFilled      = "filled"
	OrderStatusCancelled   = "cancelled"
	OrderStatusCanceled    = "canceled" // Alternative spelling
	OrderStatusRejected    = "rejected"
	OrderStatusUntriggered = "untriggered"
)

Order Status Constants

View Source
const (
	MarketStreamURL = "wss://perps.standx.com/ws-stream/v1"
	APIStreamURL    = "wss://perps.standx.com/ws-api/v1"
)

Variables

This section is empty.

Functions

func GenRequestID

func GenRequestID() string

func GenSessionID

func GenSessionID() string

Types

type APIResponse

type APIResponse struct {
	Code      int             `json:"code"`
	Message   string          `json:"message"`
	RequestID string          `json:"request_id"`
	Data      json.RawMessage `json:"data,omitempty"` // For flexible parsing
}

Base Response

type Balance

type Balance struct {
	IsolatedBalance string `json:"isolated_balance"`
	IsolatedUpnl    string `json:"isolated_upnl"`
	CrossBalance    string `json:"cross_balance"`
	CrossMargin     string `json:"cross_margin"`
	CrossUpnl       string `json:"cross_upnl"`
	Locked          string `json:"locked"`
	CrossAvailable  string `json:"cross_available"`
	Balance         string `json:"balance"` // Total assets
	Upnl            string `json:"upnl"`    // Total unrealized
	Equity          string `json:"equity"`
}

Balance (Unified snapshot)

type CancelOrderRequest

type CancelOrderRequest struct {
	OrderID interface{} `json:"order_id,omitempty"` // int64 or string, API doc says order_id in example is int
	ClOrdID string      `json:"cl_ord_id,omitempty"`
	Symbol  string      `json:"symbol,omitempty"` // Sometimes required
}

CancelOrderRequest - POST /api/cancel_order

type CancelOrdersRequest

type CancelOrdersRequest struct {
	OrderIDs []interface{} `json:"order_id_list,omitempty"`
	ClOrdIDs []string      `json:"cl_ord_id_list,omitempty"`
	Symbol   string        `json:"symbol,omitempty"` // Usually not needed for bulk but check docs
}

CancelOrdersRequest - POST /api/cancel_orders

type ChangeLeverageRequest

type ChangeLeverageRequest struct {
	Symbol   string `json:"symbol"`
	Leverage int    `json:"leverage"`
}

ChangeLeverageRequest - POST /api/change_leverage

type ChangeMarginModeRequest

type ChangeMarginModeRequest struct {
	Symbol     string `json:"symbol"`
	MarginMode string `json:"margin_mode"` // "cross" or "isolated"
}

ChangeMarginModeRequest - POST /api/change_margin_mode

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles Standx API communication

func NewClient

func NewClient() *Client

NewClient creates a new Standx API client

func (*Client) CancelMultipleOrders

func (c *Client) CancelMultipleOrders(ctx context.Context, req CancelOrdersRequest) ([]interface{}, error)

CancelMultipleOrders cancels multiple orders POST /api/cancel_orders

func (*Client) CancelOrder

func (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*APIResponse, error)

CancelOrder cancels an existing order POST /api/cancel_order

func (*Client) ChangeLeverage

func (c *Client) ChangeLeverage(ctx context.Context, req ChangeLeverageRequest) (*APIResponse, error)

ChangeLeverage updates leverage for a symbol POST /api/change_leverage

func (*Client) ChangeMarginMode

func (c *Client) ChangeMarginMode(ctx context.Context, req ChangeMarginModeRequest) (*APIResponse, error)

ChangeMarginMode updates margin mode for a symbol POST /api/change_margin_mode

func (*Client) CreateOrder

func (c *Client) CreateOrder(ctx context.Context, req CreateOrderRequest, extraHeaders map[string]string) (*APIResponse, error)

CreateOrder places a new order POST /api/new_order

func (*Client) DoPrivate

func (c *Client) DoPrivate(ctx context.Context, method, endpoint string, payload interface{}, result interface{}, signBody bool, extraHeaders map[string]string) error

DoPrivate handles authenticated requests

func (*Client) DoPublic

func (c *Client) DoPublic(ctx context.Context, method, endpoint string, params url.Values, result interface{}) error

DoRequest handles requests to the Perps API (perps.standx.com)

func (*Client) GetSigner

func (c *Client) GetSigner() *Signer

func (*Client) GetToken

func (c *Client) GetToken(ctx context.Context) (string, error)

func (*Client) InvalidateToken

func (c *Client) InvalidateToken()

InvalidateToken clears the cached token, forcing a new login on next GetToken

func (*Client) Login

func (c *Client) Login(ctx context.Context) error

Login performs the full authentication flow

func (*Client) QueryBalances

func (c *Client) QueryBalances(ctx context.Context) (*Balance, error)

QueryBalances returns user balances

func (*Client) QueryDepthBook

func (c *Client) QueryDepthBook(ctx context.Context, symbol string, limit int) (DepthBook, error)

QueryDepthBook returns the order book GET /api/query_depth_book

func (*Client) QueryFundingRates

func (c *Client) QueryFundingRates(ctx context.Context, symbol string, start, end int64) ([]FundingRate, error)

QueryFundingRates returns funding rate history GET /api/query_funding_rates

func (*Client) QueryPositions

func (c *Client) QueryPositions(ctx context.Context, symbol string) ([]Position, error)

QueryPositions returns user positions

func (*Client) QueryRecentTrades

func (c *Client) QueryRecentTrades(ctx context.Context, symbol string, limit int) ([]RecentTrade, error)

QueryRecentTrades returns recent public trades GET /api/query_recent_trades

func (*Client) QuerySymbolInfo

func (c *Client) QuerySymbolInfo(ctx context.Context, symbol string) ([]SymbolInfo, error)

QuerySymbolInfo returns instrument details GET /api/query_symbol_info

func (*Client) QuerySymbolMarket

func (c *Client) QuerySymbolMarket(ctx context.Context, symbol string) (SymbolMarket, error)

QuerySymbolMarket returns 24h market stats GET /api/query_symbol_market

func (*Client) QuerySymbolPrice

func (c *Client) QuerySymbolPrice(ctx context.Context, symbol string) (SymbolPrice, error)

QuerySymbolPrice returns detailed price info GET /api/query_symbol_price

func (*Client) QueryUserAllOpenOrders

func (c *Client) QueryUserAllOpenOrders(ctx context.Context, symbol string) ([]Order, error)

QueryUserAllOpenOrders returns all open orders GET /api/query_open_orders

func (*Client) QueryUserOrders

func (c *Client) QueryUserOrders(ctx context.Context, symbol string) ([]Order, error)

QueryUserOrders returns active orders

func (*Client) QueryUserTrades

func (c *Client) QueryUserTrades(ctx context.Context, symbol string, lastID int64, limit int) ([]Trade, error)

QueryUserTrades returns user trades using /api/query_trades

func (*Client) WithCredentials

func (c *Client) WithCredentials(evmPrivateKeyHex string) (*Client, error)

WithCredentials sets the EVM private key for authentication

type CreateOrderRequest

type CreateOrderRequest struct {
	Symbol      string      `json:"symbol"`
	Side        OrderSide   `json:"side"`                    // buy, sell
	OrderType   OrderType   `json:"order_type"`              // limit, market
	Qty         string      `json:"qty"`                     // string decimal
	Price       string      `json:"price,omitempty"`         // string decimal (optional for market)
	TimeInForce TimeInForce `json:"time_in_force,omitempty"` // gtc, ioc, alo
	ReduceOnly  bool        `json:"reduce_only"`
	ClientOrdID string      `json:"cl_ord_id,omitempty"` // Optional client ID
}

CreateOrderRequest - POST /api/new_order

type DepthBook

type DepthBook struct {
	Asks   [][]string `json:"asks"` // [price, qty]
	Bids   [][]string `json:"bids"` // [price, qty]
	Symbol string     `json:"symbol"`
}

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func (*Error) Error

func (e *Error) Error() string

type FundingRate

type FundingRate struct {
	ID          int    `json:"id"`
	Symbol      string `json:"symbol"`
	FundingRate string `json:"funding_rate"`
	IndexPrice  string `json:"index_price"`
	MarkPrice   string `json:"mark_price"`
	Premium     string `json:"premium"`
	Time        string `json:"time"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
}

type LoginRequest

type LoginRequest struct {
	Signature      string `json:"signature"` // EVM Wallet Signature
	SignedData     string `json:"signedData"`
	ExpiresSeconds int    `json:"expiresSeconds"`
}

LoginRequest - POST /v1/offchain/login

type LoginResponse

type LoginResponse struct {
	Token      string `json:"token"`
	Address    string `json:"address"`
	Alias      string `json:"alias"`
	Chain      string `json:"chain"`
	PerpsAlpha bool   `json:"perpsAlpha"`
}

type Order

type Order struct {
	AvailLocked  string `json:"avail_locked"`
	ClOrdID      string `json:"cl_ord_id"`
	ClosedBlock  int    `json:"closed_block"`
	CreatedAt    string `json:"created_at"`
	CreatedBlock int    `json:"created_block"`
	FillAvgPrice string `json:"fill_avg_price"`
	FillQty      string `json:"fill_qty"`
	ID           int    `json:"id"`
	Leverage     string `json:"leverage"`
	LiqID        int    `json:"liq_id"`
	Margin       string `json:"margin"`
	OrderType    string `json:"order_type"`
	Payload      string `json:"payload"`
	PositionID   int    `json:"position_id"`
	Price        string `json:"price"`
	Qty          string `json:"qty"`
	ReduceOnly   bool   `json:"reduce_only"`
	Remark       string `json:"remark"`
	Side         string `json:"side"`
	Source       string `json:"source"`
	Status       string `json:"status"`
	Symbol       string `json:"symbol"`
	TimeInForce  string `json:"time_in_force"`
	UpdatedAt    string `json:"updated_at"`
	User         string `json:"user"`
}

type OrderSide

type OrderSide string

Order Constants

const (
	SideBuy  OrderSide = "buy"
	SideSell OrderSide = "sell"
)

type OrderType

type OrderType string
const (
	OrderTypeLimit  OrderType = "limit"
	OrderTypeMarket OrderType = "market"
)

type Position

type Position struct {
	BankruptcyPrice string `json:"bankruptcy_price"`
	CreatedAt       string `json:"created_at"`
	EntryPrice      string `json:"entry_price"`
	EntryValue      string `json:"entry_value"`
	HoldingMargin   string `json:"holding_margin"`
	ID              int    `json:"id"`
	InitialMargin   string `json:"initial_margin"`
	Leverage        string `json:"leverage"`
	LiqPrice        string `json:"liq_price"`
	MaintMargin     string `json:"maint_margin"`
	MarginAsset     string `json:"margin_asset"`
	MarginMode      string `json:"margin_mode"`
	MarkPrice       string `json:"mark_price"`
	MMR             string `json:"mmr"`
	PositionValue   string `json:"position_value"`
	Qty             string `json:"qty"`
	RealizedPnL     string `json:"realized_pnl"`
	Status          string `json:"status"`
	Symbol          string `json:"symbol"`
	Time            string `json:"time"`
	UpdatedAt       string `json:"updated_at"`
	Upnl            string `json:"upnl"`
	User            string `json:"user"`
}

type PrepareSignInRequest

type PrepareSignInRequest struct {
	Address   string `json:"address"`
	RequestID string `json:"requestId"` // Base58 encoded Ed25519 Public Key
}

PrepareSignInRequest - POST /v1/offchain/prepare-signin

type PrepareSignInResponse

type PrepareSignInResponse struct {
	Success    bool   `json:"success"`
	SignedData string `json:"signedData"` // JWT
}

type RecentTrade

type RecentTrade struct {
	IsBuyerTaker bool   `json:"is_buyer_taker"`
	Price        string `json:"price"`
	Qty          string `json:"qty"`
	QuoteQty     string `json:"quote_qty"`
	Symbol       string `json:"symbol"`
	Time         string `json:"time"`
}

type SignedDataPayload

type SignedDataPayload struct {
	Domain    string `json:"domain"`
	URI       string `json:"uri"`
	Statement string `json:"statement"`
	Version   string `json:"version"`
	ChainID   int    `json:"chainId"`
	Nonce     string `json:"nonce"`
	Address   string `json:"address"`
	RequestID string `json:"requestId"`
	IssuedAt  string `json:"issuedAt"`
	Message   string `json:"message"` // Message to sign with EVM wallet
	Exp       int64  `json:"exp"`
	Iat       int64  `json:"iat"`
}

SignedDataJWT Payload (JWT Claims)

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

func NewSigner

func NewSigner(evmPrivateKeyHex string) (*Signer, error)

func (*Signer) GetEVMAddress

func (s *Signer) GetEVMAddress() string

func (*Signer) GetRequestID

func (s *Signer) GetRequestID() string

GetRequestID returns the Base58 encoded Ed25519 public key

func (*Signer) SignEVMPersonal

func (s *Signer) SignEVMPersonal(msg string) (string, error)

SignEVMPersonal signs a message with the EVM private key using Ethereum Personal Sign format.

func (*Signer) SignRequest

func (s *Signer) SignRequest(payload string, timestamp int64, requestIDOverride string) map[string]string

SignRequest generates headers for authenticated requests (REST & WS) Header format: x-request-sign-version: v1 x-request-id: <requestId (Base58)> x-request-timestamp: <timestamp> x-request-signature: Base64(Ed25519Sign(message)) Message format: "v1,<requestId>,<timestamp>,<payload>"

type SubscribeAuthChannel

type SubscribeAuthChannel struct {
	Channel string `json:"channel"`
}

type SubscribeAuthParams

type SubscribeAuthParams struct {
	Token   string                 `json:"token"`
	Streams []SubscribeAuthChannel `json:"streams"`
}

type SubscribeParams

type SubscribeParams struct {
	Channel string `json:"channel"`
	Symbol  string `json:"symbol,omitempty"`
}

type SubscriptionAuthRequest

type SubscriptionAuthRequest struct {
	Auth SubscribeAuthParams `json:"auth"`
}

type SubscriptionRequest

type SubscriptionRequest struct {
	Subscribe SubscribeParams `json:"subscribe"`
}

SubscriptionRequest { "subscribe": { "channel": "depth_book", "symbol": "BTC-USD" } }

type SymbolInfo

type SymbolInfo struct {
	BaseAsset         string `json:"base_asset"`
	BaseDecimals      int    `json:"base_decimals"`
	CreatedAt         string `json:"created_at"`
	DefLeverage       string `json:"def_leverage"`
	DepthTicks        string `json:"depth_ticks"`
	Enabled           bool   `json:"enabled"`
	MakerFee          string `json:"maker_fee"`
	MaxLeverage       string `json:"max_leverage"`
	MaxOpenOrders     string `json:"max_open_orders"`
	MaxOrderQty       string `json:"max_order_qty"`
	MaxPositionSize   string `json:"max_position_size"`
	MinOrderQty       string `json:"min_order_qty"`
	PriceCapRatio     string `json:"price_cap_ratio"`
	PriceFloorRatio   string `json:"price_floor_ratio"`
	PriceTickDecimals int    `json:"price_tick_decimals"`
	QtyTickDecimals   int    `json:"qty_tick_decimals"`
	QuoteAsset        string `json:"quote_asset"`
	QuoteDecimals     int    `json:"quote_decimals"`
	Symbol            string `json:"symbol"`
	TakerFee          string `json:"taker_fee"`
	UpdatedAt         string `json:"updated_at"`
}

type SymbolMarket

type SymbolMarket struct {
	Bid1                 string   `json:"bid1"`
	Base                 string   `json:"base"`
	Ask1                 string   `json:"ask1"`
	FundingRate          string   `json:"funding_rate"`
	HighPrice24h         float64  `json:"high_price_24h"`
	IndexPrice           string   `json:"index_price"`
	LastPrice            string   `json:"last_price"`
	LowPrice24h          float64  `json:"low_price_24h"`
	MarkPrice            string   `json:"mark_price"`
	MidPrice             string   `json:"mid_price"`
	NextFundingTime      string   `json:"next_funding_time"`
	OpenInterest         string   `json:"open_interest"`
	OpenInterestNotional string   `json:"open_interest_notional"`
	Quote                string   `json:"quote"`
	Spread               []string `json:"spread"` // [bid, ask]
	Symbol               string   `json:"symbol"`
	Time                 string   `json:"time"`
	Volume24h            float64  `json:"volume_24h"`
	VolumeQuote24h       float64  `json:"volume_quote_24h"`
}

type SymbolPrice

type SymbolPrice struct {
	Base       string `json:"base"`
	IndexPrice string `json:"index_price"`
	LastPrice  string `json:"last_price"`
	MarkPrice  string `json:"mark_price"`
	MidPrice   string `json:"mid_price"`
	Quote      string `json:"quote"`
	SpreadAsk  string `json:"spread_ask"`
	SpreadBid  string `json:"spread_bid"`
	Symbol     string `json:"symbol"`
	Time       string `json:"time"`
}

type TimeInForce

type TimeInForce string
const (
	TimeInForceGTC TimeInForce = "gtc"
	TimeInForceIOC TimeInForce = "ioc"
	TimeInForceFOK TimeInForce = "fok"
	TimeInForceALO TimeInForce = "alo"
)

type Trade

type Trade struct {
	CreatedAt string `json:"created_at"`
	FeeAsset  string `json:"fee_asset"`
	FeeQty    string `json:"fee_qty"`
	ID        int    `json:"id"`
	OrderID   int    `json:"order_id"`
	Pnl       string `json:"pnl"`
	Price     string `json:"price"`
	Qty       string `json:"qty"`
	Side      string `json:"side"`
	Symbol    string `json:"symbol"`
	UpdatedAt string `json:"updated_at"`
	User      string `json:"user"`
	Value     string `json:"value"`
}

type UserOrdersResponse

type UserOrdersResponse struct {
	PageSize int             `json:"page_size"`
	Result   json.RawMessage `json:"result"` // []Order
	Total    int             `json:"total"`
}

type UserTradesResponse

type UserTradesResponse struct {
	PageSize int             `json:"page_size"`
	Result   json.RawMessage `json:"result"` // []Trade
	Total    int             `json:"total"`
}

type WSDepthData

type WSDepthData struct {
	Asks   [][]string `json:"asks"`
	Bids   [][]string `json:"bids"`
	Symbol string     `json:"symbol"`
}

type WSOrderUpdate

type WSOrderUpdate struct {
}

type WSPositionUpdate

type WSPositionUpdate struct {
}

type WSPriceData

type WSPriceData struct {
	Base       string    `json:"base"`
	IndexPrice string    `json:"index_price"`
	LastPrice  string    `json:"last_price"`
	MarkPrice  string    `json:"mark_price"`
	MidPrice   string    `json:"mid_price"`
	Spread     [2]string `json:"spread"`
	Quote      string    `json:"quote"`
	Symbol     string    `json:"symbol"`
	Time       string    `json:"time"`
}

type WSRequest

type WSRequest struct {
	SessionID string            `json:"session_id,omitempty"` // For order correlation
	RequestID string            `json:"request_id,omitempty"`
	Method    string            `json:"method,omitempty"` // auth:login, order:new, subscribe
	Header    map[string]string `json:"header,omitempty"` // x-request-*
	Params    interface{}       `json:"params,omitempty"` // Can be JSON string or object depending on usage
}

WSRequest Standard structure

type WSResponse

type WSResponse struct {
	Seq       int             `json:"seq,omitempty"`
	Channel   string          `json:"channel,omitempty"`
	Symbol    string          `json:"symbol,omitempty"`
	Data      json.RawMessage `json:"data,omitempty"`   // Payload
	Method    string          `json:"method,omitempty"` // For auth response
	Code      int             `json:"code,omitempty"`
	Message   string          `json:"message,omitempty"`
	RequestID string          `json:"request_id,omitempty"`
}

WSResponse Standard structure

type WSTradeData

type WSTradeData struct {
}

type WsAccountClient

type WsAccountClient struct {
	IsAuth bool

	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewWsAccountClient

func NewWsAccountClient(ctx context.Context, client *Client) *WsAccountClient

func (*WsAccountClient) Auth

func (c *WsAccountClient) Auth() error

func (*WsAccountClient) Close

func (c *WsAccountClient) Close()

func (*WsAccountClient) Connect

func (c *WsAccountClient) Connect() error

func (*WsAccountClient) HandleMsg

func (c *WsAccountClient) HandleMsg(data []byte)

func (*WsAccountClient) Subscribe

func (c *WsAccountClient) Subscribe(channel string, handler func([]byte)) error

func (*WsAccountClient) SubscribeBalanceUpdate

func (c *WsAccountClient) SubscribeBalanceUpdate(handler func(*Balance)) error

func (*WsAccountClient) SubscribeOrderUpdate

func (c *WsAccountClient) SubscribeOrderUpdate(handler func(*Order)) error

func (*WsAccountClient) SubscribePositionUpdate

func (c *WsAccountClient) SubscribePositionUpdate(handler func(*Position)) error

func (*WsAccountClient) SubscribeTradeUpdate

func (c *WsAccountClient) SubscribeTradeUpdate(handler func(*Trade)) error

type WsApiClient

type WsApiClient struct {
	LoginRequestID string
	Logger         *zap.SugaredLogger

	IsAuth bool
	// contains filtered or unexported fields
}

func NewWsApiClient

func NewWsApiClient(ctx context.Context, client *Client) *WsApiClient

func (*WsApiClient) Auth

func (c *WsApiClient) Auth() error

func (*WsApiClient) CancelOrder

func (c *WsApiClient) CancelOrder(ctx context.Context, cancelReq *CancelOrderRequest) (*WsApiResponse, error)

func (*WsApiClient) Close

func (c *WsApiClient) Close()

func (*WsApiClient) Connect

func (c *WsApiClient) Connect() error

func (*WsApiClient) CreateOrder

func (c *WsApiClient) CreateOrder(ctx context.Context, orderReq *CreateOrderRequest) (*WsApiResponse, error)

func (*WsApiClient) HandleMsg

func (c *WsApiClient) HandleMsg(data []byte)

func (*WsApiClient) RegisterRequestHandler

func (c *WsApiClient) RegisterRequestHandler(requestID string, handler func([]byte) error)

func (*WsApiClient) UnregisterRequestHandler

func (c *WsApiClient) UnregisterRequestHandler(requestID string)

type WsApiResponse

type WsApiResponse struct {
	Code      int    `json:"code"`
	Message   string `json:"message"`
	RequestID string `json:"request_id"`
}

type WsAuthResponse

type WsAuthResponse struct {
	Code int    `json:"code,omitempty"`
	Msg  string `json:"msg,omitempty"`
}

type WsClient

type WsClient struct {
	HandleMsg func([]byte)

	// Reconnect Hook
	OnReconnect func() error
	// contains filtered or unexported fields
}

WsClient Base WebSocket client

func NewWsClient

func NewWsClient(ctx context.Context, url string, logger *zap.SugaredLogger) *WsClient

func (*WsClient) Close

func (c *WsClient) Close()

func (*WsClient) Connect

func (c *WsClient) Connect() error

func (*WsClient) IsConnected

func (c *WsClient) IsConnected() bool

func (*WsClient) SetCredentials

func (c *WsClient) SetCredentials(signer *Signer, token string)

func (*WsClient) SetHandler

func (c *WsClient) SetHandler(handler func([]byte))

func (*WsClient) WriteJSON

func (c *WsClient) WriteJSON(v interface{}) error

type WsMarketClient

type WsMarketClient struct {
	WsClient *WsClient
	IsAuth   bool

	Logger *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewWsMarketClient

func NewWsMarketClient(ctx context.Context) *WsMarketClient

func (*WsMarketClient) Close

func (c *WsMarketClient) Close()

func (*WsMarketClient) Connect

func (c *WsMarketClient) Connect() error

func (*WsMarketClient) HandleMsg

func (c *WsMarketClient) HandleMsg(data []byte)

func (*WsMarketClient) Subscribe

func (c *WsMarketClient) Subscribe(channel string, symbol string, handler func([]byte) error) error

func (*WsMarketClient) SubscribeDepthBook

func (c *WsMarketClient) SubscribeDepthBook(symbol string, handler func([]byte) error) error

func (*WsMarketClient) SubscribePrice

func (c *WsMarketClient) SubscribePrice(symbol string, handler func([]byte) error) error

func (*WsMarketClient) SubscribePublicTrade

func (c *WsMarketClient) SubscribePublicTrade(symbol string, handler func([]byte) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL