{"modulePath":"github.com/QuantProcessing/exchanges","version":"v0.2.20","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package standx\n\n## Constants\n\n```go\nconst (\n\tBaseURL     = \"https://perps.standx.com\"\n\tAuthBaseURL = \"https://api.standx.com\" // Auth endpoints use a different base URL\n)\n```\n\n```go\nconst (\n\tOrderStatusOpen        = \"open\"\n\tOrderStatusNew         = \"new\"\n\tOrderStatusFilled      = \"filled\"\n\tOrderStatusCancelled   = \"cancelled\"\n\tOrderStatusCanceled    = \"canceled\" // Alternative spelling\n\tOrderStatusRejected    = \"rejected\"\n\tOrderStatusUntriggered = \"untriggered\"\n)\n```\nOrder Status Constants\n\n```go\nconst (\n\tMarketStreamURL = \"wss://perps.standx.com/ws-stream/v1\"\n\tAPIStreamURL    = \"wss://perps.standx.com/ws-api/v1\"\n)\n```\n\n## Functions\n\n```go\nfunc GenRequestID() string\n```\n\n```go\nfunc GenSessionID() string\n```\n\n## Types\n\n```go\ntype APIResponse struct {\n\tCode      int             `json:\"code\"`\n\tMessage   string          `json:\"message\"`\n\tRequestID string          `json:\"request_id\"`\n\tData      json.RawMessage `json:\"data,omitempty\"` // For flexible parsing\n}\n```\nBase Response\n\n```go\ntype Balance struct {\n\tIsolatedBalance string `json:\"isolated_balance\"`\n\tIsolatedUpnl    string `json:\"isolated_upnl\"`\n\tCrossBalance    string `json:\"cross_balance\"`\n\tCrossMargin     string `json:\"cross_margin\"`\n\tCrossUpnl       string `json:\"cross_upnl\"`\n\tLocked          string `json:\"locked\"`\n\tCrossAvailable  string `json:\"cross_available\"`\n\tBalance         string `json:\"balance\"` // Total assets\n\tUpnl            string `json:\"upnl\"`    // Total unrealized\n\tEquity          string `json:\"equity\"`\n}\n```\nBalance (Unified snapshot)\n\n```go\ntype CancelOrderRequest struct {\n\tOrderID interface{} `json:\"order_id,omitempty\"` // int64 or string, API doc says order_id in example is int\n\tClOrdID string      `json:\"cl_ord_id,omitempty\"`\n\tSymbol  string      `json:\"symbol,omitempty\"` // Sometimes required\n}\n```\nCancelOrderRequest - POST /api/cancel\\_order\n\n```go\ntype CancelOrdersRequest struct {\n\tOrderIDs []interface{} `json:\"order_id_list,omitempty\"`\n\tClOrdIDs []string      `json:\"cl_ord_id_list,omitempty\"`\n\tSymbol   string        `json:\"symbol,omitempty\"` // Usually not needed for bulk but check docs\n}\n```\nCancelOrdersRequest - POST /api/cancel\\_orders\n\n```go\ntype ChangeLeverageRequest struct {\n\tSymbol   string `json:\"symbol\"`\n\tLeverage int    `json:\"leverage\"`\n}\n```\nChangeLeverageRequest - POST /api/change\\_leverage\n\n```go\ntype ChangeMarginModeRequest struct {\n\tSymbol     string `json:\"symbol\"`\n\tMarginMode string `json:\"margin_mode\"` // \"cross\" or \"isolated\"\n}\n```\nChangeMarginModeRequest - POST /api/change\\_margin\\_mode\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient handles Standx API communication\n\n```go\nfunc NewClient() *Client\n```\nNewClient creates a new Standx API client\n\n```go\nfunc (c *Client) CancelMultipleOrders(ctx context.Context, req CancelOrdersRequest) ([]interface{}, error)\n```\nCancelMultipleOrders cancels multiple orders POST /api/cancel\\_orders\n\n```go\nfunc (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*APIResponse, error)\n```\nCancelOrder cancels an existing order POST /api/cancel\\_order\n\n```go\nfunc (c *Client) ChangeLeverage(ctx context.Context, req ChangeLeverageRequest) (*APIResponse, error)\n```\nChangeLeverage updates leverage for a symbol POST /api/change\\_leverage\n\n```go\nfunc (c *Client) ChangeMarginMode(ctx context.Context, req ChangeMarginModeRequest) (*APIResponse, error)\n```\nChangeMarginMode updates margin mode for a symbol POST /api/change\\_margin\\_mode\n\n```go\nfunc (c *Client) CreateOrder(ctx context.Context, req CreateOrderRequest, extraHeaders map[string]string) (*APIResponse, error)\n```\nCreateOrder places a new order POST /api/new\\_order\n\n```go\nfunc (c *Client) DoPrivate(ctx context.Context, method, endpoint string, payload interface{}, result interface{}, signBody bool, extraHeaders map[string]string) error\n```\nDoPrivate handles authenticated requests\n\n```go\nfunc (c *Client) DoPublic(ctx context.Context, method, endpoint string, params url.Values, result interface{}) error\n```\nDoRequest handles requests to the Perps API (perps.standx.com)\n\n```go\nfunc (c *Client) GetSigner() *Signer\n```\n\n```go\nfunc (c *Client) GetToken(ctx context.Context) (string, error)\n```\n\n```go\nfunc (c *Client) InvalidateToken()\n```\nInvalidateToken clears the cached token, forcing a new login on next GetToken\n\n```go\nfunc (c *Client) Login(ctx context.Context) error\n```\nLogin performs the full authentication flow\n\n```go\nfunc (c *Client) QueryBalances(ctx context.Context) (*Balance, error)\n```\nQueryBalances returns user balances\n\n```go\nfunc (c *Client) QueryDepthBook(ctx context.Context, symbol string, limit int) (DepthBook, error)\n```\nQueryDepthBook returns the order book GET /api/query\\_depth\\_book\n\n```go\nfunc (c *Client) QueryFundingRates(ctx context.Context, symbol string, start, end int64) ([]FundingRate, error)\n```\nQueryFundingRates returns funding rate history GET /api/query\\_funding\\_rates\n\n```go\nfunc (c *Client) QueryPositions(ctx context.Context, symbol string) ([]Position, error)\n```\nQueryPositions returns user positions\n\n```go\nfunc (c *Client) QueryRecentTrades(ctx context.Context, symbol string, limit int) ([]RecentTrade, error)\n```\nQueryRecentTrades returns recent public trades GET /api/query\\_recent\\_trades\n\n```go\nfunc (c *Client) QuerySymbolInfo(ctx context.Context, symbol string) ([]SymbolInfo, error)\n```\nQuerySymbolInfo returns instrument details GET /api/query\\_symbol\\_info\n\n```go\nfunc (c *Client) QuerySymbolMarket(ctx context.Context, symbol string) (SymbolMarket, error)\n```\nQuerySymbolMarket returns 24h market stats GET /api/query\\_symbol\\_market\n\n```go\nfunc (c *Client) QuerySymbolPrice(ctx context.Context, symbol string) (SymbolPrice, error)\n```\nQuerySymbolPrice returns detailed price info GET /api/query\\_symbol\\_price\n\n```go\nfunc (c *Client) QueryUserAllOpenOrders(ctx context.Context, symbol string) ([]Order, error)\n```\nQueryUserAllOpenOrders returns all open orders GET /api/query\\_open\\_orders\n\n```go\nfunc (c *Client) QueryUserOrders(ctx context.Context, symbol string) ([]Order, error)\n```\nQueryUserOrders returns active orders\n\n```go\nfunc (c *Client) QueryUserTrades(ctx context.Context, symbol string, lastID int64, limit int) ([]Trade, error)\n```\nQueryUserTrades returns user trades using /api/query\\_trades\n\n```go\nfunc (c *Client) WithCredentials(evmPrivateKeyHex string) (*Client, error)\n```\nWithCredentials sets the EVM private key for authentication\n\n```go\ntype CreateOrderRequest struct {\n\tSymbol      string      `json:\"symbol\"`\n\tSide        OrderSide   `json:\"side\"`                    // buy, sell\n\tOrderType   OrderType   `json:\"order_type\"`              // limit, market\n\tQty         string      `json:\"qty\"`                     // string decimal\n\tPrice       string      `json:\"price,omitempty\"`         // string decimal (optional for market)\n\tTimeInForce TimeInForce `json:\"time_in_force,omitempty\"` // gtc, ioc, alo\n\tReduceOnly  bool        `json:\"reduce_only\"`\n\tClientOrdID string      `json:\"cl_ord_id,omitempty\"` // Optional client ID\n}\n```\nCreateOrderRequest - POST /api/new\\_order\n\n```go\ntype DepthBook struct {\n\tAsks   [][]string `json:\"asks\"` // [price, qty]\n\tBids   [][]string `json:\"bids\"` // [price, qty]\n\tSymbol string     `json:\"symbol\"`\n}\n```\n\n```go\ntype Error struct {\n\tCode    int    `json:\"code\"`\n\tMessage string `json:\"message\"`\n}\n```\n\n```go\nfunc (e *Error) Error() string\n```\n\n```go\ntype FundingRate struct {\n\tID          int    `json:\"id\"`\n\tSymbol      string `json:\"symbol\"`\n\tFundingRate string `json:\"funding_rate\"`\n\tIndexPrice  string `json:\"index_price\"`\n\tMarkPrice   string `json:\"mark_price\"`\n\tPremium     string `json:\"premium\"`\n\tTime        string `json:\"time\"`\n\tCreatedAt   string `json:\"created_at\"`\n\tUpdatedAt   string `json:\"updated_at\"`\n}\n```\n\n```go\ntype LoginRequest struct {\n\tSignature      string `json:\"signature\"` // EVM Wallet Signature\n\tSignedData     string `json:\"signedData\"`\n\tExpiresSeconds int    `json:\"expiresSeconds\"`\n}\n```\nLoginRequest - POST /v1/offchain/login\n\n```go\ntype LoginResponse struct {\n\tToken      string `json:\"token\"`\n\tAddress    string `json:\"address\"`\n\tAlias      string `json:\"alias\"`\n\tChain      string `json:\"chain\"`\n\tPerpsAlpha bool   `json:\"perpsAlpha\"`\n}\n```\n\n```go\ntype Order struct {\n\tAvailLocked  string `json:\"avail_locked\"`\n\tClOrdID      string `json:\"cl_ord_id\"`\n\tClosedBlock  int    `json:\"closed_block\"`\n\tCreatedAt    string `json:\"created_at\"`\n\tCreatedBlock int    `json:\"created_block\"`\n\tFillAvgPrice string `json:\"fill_avg_price\"`\n\tFillQty      string `json:\"fill_qty\"`\n\tID           int    `json:\"id\"`\n\tLeverage     string `json:\"leverage\"`\n\tLiqID        int    `json:\"liq_id\"`\n\tMargin       string `json:\"margin\"`\n\tOrderType    string `json:\"order_type\"`\n\tPayload      string `json:\"payload\"`\n\tPositionID   int    `json:\"position_id\"`\n\tPrice        string `json:\"price\"`\n\tQty          string `json:\"qty\"`\n\tReduceOnly   bool   `json:\"reduce_only\"`\n\tRemark       string `json:\"remark\"`\n\tSide         string `json:\"side\"`\n\tSource       string `json:\"source\"`\n\tStatus       string `json:\"status\"`\n\tSymbol       string `json:\"symbol\"`\n\tTimeInForce  string `json:\"time_in_force\"`\n\tUpdatedAt    string `json:\"updated_at\"`\n\tUser         string `json:\"user\"`\n}\n```\n\n```go\ntype OrderSide string\n```\nOrder Constants\n\n```go\nconst (\n\tSideBuy  OrderSide = \"buy\"\n\tSideSell OrderSide = \"sell\"\n)\n```\n\n```go\ntype OrderType string\n```\n\n```go\nconst (\n\tOrderTypeLimit  OrderType = \"limit\"\n\tOrderTypeMarket OrderType = \"market\"\n)\n```\n\n```go\ntype Position struct {\n\tBankruptcyPrice string `json:\"bankruptcy_price\"`\n\tCreatedAt       string `json:\"created_at\"`\n\tEntryPrice      string `json:\"entry_price\"`\n\tEntryValue      string `json:\"entry_value\"`\n\tHoldingMargin   string `json:\"holding_margin\"`\n\tID              int    `json:\"id\"`\n\tInitialMargin   string `json:\"initial_margin\"`\n\tLeverage        string `json:\"leverage\"`\n\tLiqPrice        string `json:\"liq_price\"`\n\tMaintMargin     string `json:\"maint_margin\"`\n\tMarginAsset     string `json:\"margin_asset\"`\n\tMarginMode      string `json:\"margin_mode\"`\n\tMarkPrice       string `json:\"mark_price\"`\n\tMMR             string `json:\"mmr\"`\n\tPositionValue   string `json:\"position_value\"`\n\tQty             string `json:\"qty\"`\n\tRealizedPnL     string `json:\"realized_pnl\"`\n\tStatus          string `json:\"status\"`\n\tSymbol          string `json:\"symbol\"`\n\tTime            string `json:\"time\"`\n\tUpdatedAt       string `json:\"updated_at\"`\n\tUpnl            string `json:\"upnl\"`\n\tUser            string `json:\"user\"`\n}\n```\n\n```go\ntype PrepareSignInRequest struct {\n\tAddress   string `json:\"address\"`\n\tRequestID string `json:\"requestId\"` // Base58 encoded Ed25519 Public Key\n}\n```\nPrepareSignInRequest - POST /v1/offchain/prepare-signin\n\n```go\ntype PrepareSignInResponse struct {\n\tSuccess    bool   `json:\"success\"`\n\tSignedData string `json:\"signedData\"` // JWT\n}\n```\n\n```go\ntype RecentTrade struct {\n\tIsBuyerTaker bool   `json:\"is_buyer_taker\"`\n\tPrice        string `json:\"price\"`\n\tQty          string `json:\"qty\"`\n\tQuoteQty     string `json:\"quote_qty\"`\n\tSymbol       string `json:\"symbol\"`\n\tTime         string `json:\"time\"`\n}\n```\n\n```go\ntype SignedDataPayload struct {\n\tDomain    string `json:\"domain\"`\n\tURI       string `json:\"uri\"`\n\tStatement string `json:\"statement\"`\n\tVersion   string `json:\"version\"`\n\tChainID   int    `json:\"chainId\"`\n\tNonce     string `json:\"nonce\"`\n\tAddress   string `json:\"address\"`\n\tRequestID string `json:\"requestId\"`\n\tIssuedAt  string `json:\"issuedAt\"`\n\tMessage   string `json:\"message\"` // Message to sign with EVM wallet\n\tExp       int64  `json:\"exp\"`\n\tIat       int64  `json:\"iat\"`\n}\n```\nSignedDataJWT Payload (JWT Claims)\n\n```go\ntype Signer struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewSigner(evmPrivateKeyHex string) (*Signer, error)\n```\n\n```go\nfunc (s *Signer) GetEVMAddress() string\n```\n\n```go\nfunc (s *Signer) GetRequestID() string\n```\nGetRequestID returns the Base58 encoded Ed25519 public key\n\n```go\nfunc (s *Signer) SignEVMPersonal(msg string) (string, error)\n```\nSignEVMPersonal signs a message with the EVM private key using Ethereum Personal Sign format.\n\n```go\nfunc (s *Signer) SignRequest(payload string, timestamp int64, requestIDOverride string) map[string]string\n```\nSignRequest generates headers for authenticated requests (REST \u0026 WS) Header format: x-request-sign-version: v1 x-request-id: \\\u003crequestId (Base58)\u003e x-request-timestamp: \\\u003ctimestamp\u003e x-request-signature: Base64(Ed25519Sign(message)) Message format: \"v1,\\\u003crequestId\u003e,\\\u003ctimestamp\u003e,\\\u003cpayload\u003e\"\n\n```go\ntype SubscribeAuthChannel struct {\n\tChannel string `json:\"channel\"`\n}\n```\n\n```go\ntype SubscribeAuthParams struct {\n\tToken   string                 `json:\"token\"`\n\tStreams []SubscribeAuthChannel `json:\"streams\"`\n}\n```\n\n```go\ntype SubscribeParams struct {\n\tChannel string `json:\"channel\"`\n\tSymbol  string `json:\"symbol,omitempty\"`\n}\n```\n\n```go\ntype SubscriptionAuthRequest struct {\n\tAuth SubscribeAuthParams `json:\"auth\"`\n}\n```\n\n```go\ntype SubscriptionRequest struct {\n\tSubscribe SubscribeParams `json:\"subscribe\"`\n}\n```\nSubscriptionRequest { \"subscribe\": { \"channel\": \"depth\\_book\", \"symbol\": \"BTC-USD\" } }\n\n```go\ntype SymbolInfo struct {\n\tBaseAsset         string `json:\"base_asset\"`\n\tBaseDecimals      int    `json:\"base_decimals\"`\n\tCreatedAt         string `json:\"created_at\"`\n\tDefLeverage       string `json:\"def_leverage\"`\n\tDepthTicks        string `json:\"depth_ticks\"`\n\tEnabled           bool   `json:\"enabled\"`\n\tMakerFee          string `json:\"maker_fee\"`\n\tMaxLeverage       string `json:\"max_leverage\"`\n\tMaxOpenOrders     string `json:\"max_open_orders\"`\n\tMaxOrderQty       string `json:\"max_order_qty\"`\n\tMaxPositionSize   string `json:\"max_position_size\"`\n\tMinOrderQty       string `json:\"min_order_qty\"`\n\tPriceCapRatio     string `json:\"price_cap_ratio\"`\n\tPriceFloorRatio   string `json:\"price_floor_ratio\"`\n\tPriceTickDecimals int    `json:\"price_tick_decimals\"`\n\tQtyTickDecimals   int    `json:\"qty_tick_decimals\"`\n\tQuoteAsset        string `json:\"quote_asset\"`\n\tQuoteDecimals     int    `json:\"quote_decimals\"`\n\tSymbol            string `json:\"symbol\"`\n\tTakerFee          string `json:\"taker_fee\"`\n\tUpdatedAt         string `json:\"updated_at\"`\n}\n```\n\n```go\ntype SymbolMarket struct {\n\tBid1                 string   `json:\"bid1\"`\n\tBase                 string   `json:\"base\"`\n\tAsk1                 string   `json:\"ask1\"`\n\tFundingRate          string   `json:\"funding_rate\"`\n\tHighPrice24h         float64  `json:\"high_price_24h\"`\n\tIndexPrice           string   `json:\"index_price\"`\n\tLastPrice            string   `json:\"last_price\"`\n\tLowPrice24h          float64  `json:\"low_price_24h\"`\n\tMarkPrice            string   `json:\"mark_price\"`\n\tMidPrice             string   `json:\"mid_price\"`\n\tNextFundingTime      string   `json:\"next_funding_time\"`\n\tOpenInterest         string   `json:\"open_interest\"`\n\tOpenInterestNotional string   `json:\"open_interest_notional\"`\n\tQuote                string   `json:\"quote\"`\n\tSpread               []string `json:\"spread\"` // [bid, ask]\n\tSymbol               string   `json:\"symbol\"`\n\tTime                 string   `json:\"time\"`\n\tVolume24h            float64  `json:\"volume_24h\"`\n\tVolumeQuote24h       float64  `json:\"volume_quote_24h\"`\n}\n```\n\n```go\ntype SymbolPrice struct {\n\tBase       string `json:\"base\"`\n\tIndexPrice string `json:\"index_price\"`\n\tLastPrice  string `json:\"last_price\"`\n\tMarkPrice  string `json:\"mark_price\"`\n\tMidPrice   string `json:\"mid_price\"`\n\tQuote      string `json:\"quote\"`\n\tSpreadAsk  string `json:\"spread_ask\"`\n\tSpreadBid  string `json:\"spread_bid\"`\n\tSymbol     string `json:\"symbol\"`\n\tTime       string `json:\"time\"`\n}\n```\n\n```go\ntype TimeInForce string\n```\n\n```go\nconst (\n\tTimeInForceGTC TimeInForce = \"gtc\"\n\tTimeInForceIOC TimeInForce = \"ioc\"\n\tTimeInForceFOK TimeInForce = \"fok\"\n\tTimeInForceALO TimeInForce = \"alo\"\n)\n```\n\n```go\ntype Trade struct {\n\tCreatedAt string `json:\"created_at\"`\n\tFeeAsset  string `json:\"fee_asset\"`\n\tFeeQty    string `json:\"fee_qty\"`\n\tID        int    `json:\"id\"`\n\tOrderID   int    `json:\"order_id\"`\n\tPnl       string `json:\"pnl\"`\n\tPrice     string `json:\"price\"`\n\tQty       string `json:\"qty\"`\n\tSide      string `json:\"side\"`\n\tSymbol    string `json:\"symbol\"`\n\tUpdatedAt string `json:\"updated_at\"`\n\tUser      string `json:\"user\"`\n\tValue     string `json:\"value\"`\n}\n```\n\n```go\ntype UserOrdersResponse struct {\n\tPageSize int             `json:\"page_size\"`\n\tResult   json.RawMessage `json:\"result\"` // []Order\n\tTotal    int             `json:\"total\"`\n}\n```\n\n```go\ntype UserTradesResponse struct {\n\tPageSize int             `json:\"page_size\"`\n\tResult   json.RawMessage `json:\"result\"` // []Trade\n\tTotal    int             `json:\"total\"`\n}\n```\n\n```go\ntype WSClient struct {\n\tHandleMsg func([]byte)\n\n\t// Reconnect Hook\n\tOnReconnect func() error\n\t// contains filtered or unexported fields\n}\n```\nWSClient is the base WebSocket client.\n\n```go\nfunc NewWSClient(ctx context.Context, url string, logger *zap.SugaredLogger) *WSClient\n```\n\n```go\nfunc NewWsClient(ctx context.Context, url string, logger *zap.SugaredLogger) *WSClient\n```\n\n```go\nfunc (c *WSClient) Close()\n```\n\n```go\nfunc (c *WSClient) Connect() error\n```\n\n```go\nfunc (c *WSClient) IsConnected() bool\n```\n\n```go\nfunc (c *WSClient) SetCredentials(signer *Signer, token string)\n```\n\n```go\nfunc (c *WSClient) SetHandler(handler func([]byte))\n```\n\n```go\nfunc (c *WSClient) WriteJSON(v interface{}) error\n```\n\n```go\ntype WSDepthData struct {\n\tAsks   [][]string `json:\"asks\"`\n\tBids   [][]string `json:\"bids\"`\n\tSymbol string     `json:\"symbol\"`\n}\n```\n\n```go\ntype WSOrderUpdate struct {\n}\n```\n\n```go\ntype WSPositionUpdate struct {\n}\n```\n\n```go\ntype WSPriceData struct {\n\tBase       string    `json:\"base\"`\n\tIndexPrice string    `json:\"index_price\"`\n\tLastPrice  string    `json:\"last_price\"`\n\tMarkPrice  string    `json:\"mark_price\"`\n\tMidPrice   string    `json:\"mid_price\"`\n\tSpread     [2]string `json:\"spread\"`\n\tQuote      string    `json:\"quote\"`\n\tSymbol     string    `json:\"symbol\"`\n\tTime       string    `json:\"time\"`\n}\n```\n\n```go\ntype WSRequest struct {\n\tSessionID string            `json:\"session_id,omitempty\"` // For order correlation\n\tRequestID string            `json:\"request_id,omitempty\"`\n\tMethod    string            `json:\"method,omitempty\"` // auth:login, order:new, subscribe\n\tHeader    map[string]string `json:\"header,omitempty\"` // x-request-*\n\tParams    interface{}       `json:\"params,omitempty\"` // Can be JSON string or object depending on usage\n}\n```\nWSRequest Standard structure\n\n```go\ntype WSResponse struct {\n\tSeq       int             `json:\"seq,omitempty\"`\n\tChannel   string          `json:\"channel,omitempty\"`\n\tSymbol    string          `json:\"symbol,omitempty\"`\n\tData      json.RawMessage `json:\"data,omitempty\"`   // Payload\n\tMethod    string          `json:\"method,omitempty\"` // For auth response\n\tCode      int             `json:\"code,omitempty\"`\n\tMessage   string          `json:\"message,omitempty\"`\n\tRequestID string          `json:\"request_id,omitempty\"`\n}\n```\nWSResponse Standard structure\n\n```go\ntype WSTradeData struct {\n}\n```\n\n```go\ntype WsAccountClient struct {\n\tIsAuth bool\n\n\tLogger *zap.SugaredLogger\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewWsAccountClient(ctx context.Context, client *Client) *WsAccountClient\n```\n\n```go\nfunc (c *WsAccountClient) Auth() error\n```\n\n```go\nfunc (c *WsAccountClient) Close()\n```\n\n```go\nfunc (c *WsAccountClient) Connect() error\n```\n\n```go\nfunc (c *WsAccountClient) HandleMsg(data []byte)\n```\n\n```go\nfunc (c *WsAccountClient) Subscribe(channel string, handler func([]byte)) error\n```\n\n```go\nfunc (c *WsAccountClient) SubscribeBalanceUpdate(handler func(*Balance)) error\n```\n\n```go\nfunc (c *WsAccountClient) SubscribeOrderUpdate(handler func(*Order)) error\n```\n\n```go\nfunc (c *WsAccountClient) SubscribePositionUpdate(handler func(*Position)) error\n```\n\n```go\nfunc (c *WsAccountClient) SubscribeTradeUpdate(handler func(*Trade)) error\n```\n\n```go\ntype WsApiClient struct {\n\tLoginRequestID string\n\tLogger         *zap.SugaredLogger\n\n\tIsAuth bool\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewWsApiClient(ctx context.Context, client *Client) *WsApiClient\n```\n\n```go\nfunc (c *WsApiClient) Auth() error\n```\n\n```go\nfunc (c *WsApiClient) CancelOrder(ctx context.Context, cancelReq *CancelOrderRequest) (*WsApiResponse, error)\n```\n\n```go\nfunc (c *WsApiClient) Close()\n```\n\n```go\nfunc (c *WsApiClient) Connect() error\n```\n\n```go\nfunc (c *WsApiClient) CreateOrder(ctx context.Context, orderReq *CreateOrderRequest) (*WsApiResponse, error)\n```\n\n```go\nfunc (c *WsApiClient) HandleMsg(data []byte)\n```\n\n```go\nfunc (c *WsApiClient) RegisterRequestHandler(requestID string, handler func([]byte) error)\n```\n\n```go\nfunc (c *WsApiClient) UnregisterRequestHandler(requestID string)\n```\n\n```go\ntype WsApiResponse struct {\n\tCode      int    `json:\"code\"`\n\tMessage   string `json:\"message\"`\n\tRequestID string `json:\"request_id\"`\n}\n```\n\n```go\ntype WsAuthResponse struct {\n\tCode int    `json:\"code,omitempty\"`\n\tMsg  string `json:\"msg,omitempty\"`\n}\n```\n\n```go\ntype WsClient = WSClient\n```\nWsClient is kept as a compatibility alias for older callers.\n\n```go\ntype WsMarketClient struct {\n\tWsClient *WSClient\n\tIsAuth   bool\n\n\tLogger *zap.SugaredLogger\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewWsMarketClient(ctx context.Context) *WsMarketClient\n```\n\n```go\nfunc (c *WsMarketClient) Close()\n```\n\n```go\nfunc (c *WsMarketClient) Connect() error\n```\n\n```go\nfunc (c *WsMarketClient) HandleMsg(data []byte)\n```\n\n```go\nfunc (c *WsMarketClient) Subscribe(channel string, symbol string, handler func([]byte) error) error\n```\n\n```go\nfunc (c *WsMarketClient) SubscribeDepthBook(symbol string, handler func([]byte) error) error\n```\n\n```go\nfunc (c *WsMarketClient) SubscribePrice(symbol string, handler func([]byte) error) error\n```\n\n```go\nfunc (c *WsMarketClient) SubscribePublicTrade(symbol string, handler func([]byte) error) error\n```\n\n","path":"github.com/QuantProcessing/exchanges/standx/sdk","name":"standx","synopsis":"","isRedistributable":true}
