Documentation
¶
Index ¶
- Constants
- func GenRequestID() string
- func GenSessionID() string
- type APIResponse
- type Balance
- type CancelOrderRequest
- type CancelOrdersRequest
- type ChangeLeverageRequest
- type ChangeMarginModeRequest
- type Client
- func (c *Client) CancelMultipleOrders(ctx context.Context, req CancelOrdersRequest) ([]interface{}, error)
- func (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*APIResponse, error)
- func (c *Client) ChangeLeverage(ctx context.Context, req ChangeLeverageRequest) (*APIResponse, error)
- func (c *Client) ChangeMarginMode(ctx context.Context, req ChangeMarginModeRequest) (*APIResponse, error)
- func (c *Client) CreateOrder(ctx context.Context, req CreateOrderRequest, extraHeaders map[string]string) (*APIResponse, error)
- func (c *Client) DoPrivate(ctx context.Context, method, endpoint string, payload interface{}, ...) error
- func (c *Client) DoPublic(ctx context.Context, method, endpoint string, params url.Values, ...) error
- func (c *Client) GetSigner() *Signer
- func (c *Client) GetToken(ctx context.Context) (string, error)
- func (c *Client) InvalidateToken()
- func (c *Client) Login(ctx context.Context) error
- func (c *Client) QueryBalances(ctx context.Context) (*Balance, error)
- func (c *Client) QueryDepthBook(ctx context.Context, symbol string, limit int) (DepthBook, error)
- func (c *Client) QueryFundingRates(ctx context.Context, symbol string, start, end int64) ([]FundingRate, error)
- func (c *Client) QueryPositions(ctx context.Context, symbol string) ([]Position, error)
- func (c *Client) QueryRecentTrades(ctx context.Context, symbol string, limit int) ([]RecentTrade, error)
- func (c *Client) QuerySymbolInfo(ctx context.Context, symbol string) ([]SymbolInfo, error)
- func (c *Client) QuerySymbolMarket(ctx context.Context, symbol string) (SymbolMarket, error)
- func (c *Client) QuerySymbolPrice(ctx context.Context, symbol string) (SymbolPrice, error)
- func (c *Client) QueryUserAllOpenOrders(ctx context.Context, symbol string) ([]Order, error)
- func (c *Client) QueryUserOrders(ctx context.Context, symbol string) ([]Order, error)
- func (c *Client) QueryUserTrades(ctx context.Context, symbol string, lastID int64, limit int) ([]Trade, error)
- func (c *Client) WithCredentials(evmPrivateKeyHex string) (*Client, error)
- type CreateOrderRequest
- type DepthBook
- type Error
- type FundingRate
- type LoginRequest
- type LoginResponse
- type Order
- type OrderSide
- type OrderType
- type Position
- type PrepareSignInRequest
- type PrepareSignInResponse
- type RecentTrade
- type SignedDataPayload
- type Signer
- type SubscribeAuthChannel
- type SubscribeAuthParams
- type SubscribeParams
- type SubscriptionAuthRequest
- type SubscriptionRequest
- type SymbolInfo
- type SymbolMarket
- type SymbolPrice
- type TimeInForce
- type Trade
- type UserOrdersResponse
- type UserTradesResponse
- type WSDepthData
- type WSOrderUpdate
- type WSPositionUpdate
- type WSPriceData
- type WSRequest
- type WSResponse
- type WSTradeData
- type WsAccountClient
- func (c *WsAccountClient) Auth() error
- func (c *WsAccountClient) Close()
- func (c *WsAccountClient) Connect() error
- func (c *WsAccountClient) HandleMsg(data []byte)
- func (c *WsAccountClient) Subscribe(channel string, handler func([]byte)) error
- func (c *WsAccountClient) SubscribeBalanceUpdate(handler func(*Balance)) error
- func (c *WsAccountClient) SubscribeOrderUpdate(handler func(*Order)) error
- func (c *WsAccountClient) SubscribePositionUpdate(handler func(*Position)) error
- func (c *WsAccountClient) SubscribeTradeUpdate(handler func(*Trade)) error
- type WsApiClient
- func (c *WsApiClient) Auth() error
- func (c *WsApiClient) CancelOrder(ctx context.Context, cancelReq *CancelOrderRequest) (*WsApiResponse, error)
- func (c *WsApiClient) Close()
- func (c *WsApiClient) Connect() error
- func (c *WsApiClient) CreateOrder(ctx context.Context, orderReq *CreateOrderRequest) (*WsApiResponse, error)
- func (c *WsApiClient) HandleMsg(data []byte)
- func (c *WsApiClient) RegisterRequestHandler(requestID string, handler func([]byte) error)
- func (c *WsApiClient) UnregisterRequestHandler(requestID string)
- type WsApiResponse
- type WsAuthResponse
- type WsClient
- type WsMarketClient
- func (c *WsMarketClient) Close()
- func (c *WsMarketClient) Connect() error
- func (c *WsMarketClient) HandleMsg(data []byte)
- func (c *WsMarketClient) Subscribe(channel string, symbol string, handler func([]byte) error) error
- func (c *WsMarketClient) SubscribeDepthBook(symbol string, handler func([]byte) error) error
- func (c *WsMarketClient) SubscribePrice(symbol string, handler func([]byte) error) error
- func (c *WsMarketClient) SubscribePublicTrade(symbol string, handler func([]byte) error) error
Constants ¶
const ( BaseURL = "https://perps.standx.com" AuthBaseURL = "https://api.standx.com" // Auth endpoints use a different base URL )
const ( OrderStatusOpen = "open" OrderStatusNew = "new" OrderStatusFilled = "filled" OrderStatusCancelled = "cancelled" OrderStatusCanceled = "canceled" // Alternative spelling OrderStatusRejected = "rejected" OrderStatusUntriggered = "untriggered" )
Order Status Constants
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 ¶
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 (*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) InvalidateToken ¶
func (c *Client) InvalidateToken()
InvalidateToken clears the cached token, forcing a new login on next GetToken
func (*Client) QueryBalances ¶
QueryBalances returns user balances
func (*Client) QueryDepthBook ¶
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 ¶
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 ¶
QuerySymbolInfo returns instrument details GET /api/query_symbol_info
func (*Client) QuerySymbolMarket ¶
QuerySymbolMarket returns 24h market stats GET /api/query_symbol_market
func (*Client) QuerySymbolPrice ¶
QuerySymbolPrice returns detailed price info GET /api/query_symbol_price
func (*Client) QueryUserAllOpenOrders ¶
QueryUserAllOpenOrders returns all open orders GET /api/query_open_orders
func (*Client) QueryUserOrders ¶
QueryUserOrders returns active orders
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 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 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 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 RecentTrade ¶
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 (*Signer) GetEVMAddress ¶
func (*Signer) GetRequestID ¶
GetRequestID returns the Base58 encoded Ed25519 public key
func (*Signer) SignEVMPersonal ¶
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 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 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 WsAuthResponse ¶
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 (*WsClient) IsConnected ¶
func (*WsClient) SetCredentials ¶
func (*WsClient) SetHandler ¶
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) 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