Versions in this module Expand all Collapse all v0 v0.1.4 Mar 13, 2026 v0.1.3 Mar 13, 2026 v0.1.2 Mar 13, 2026 v0.1.1 Mar 13, 2026 Changes in this version + const BaseURL + const LimitOrderWithFeeType + const WSBaseURL + var ErrInvalidParam = errors.New("invalid param") + func CalcLimitOrderHash(assetIdSynthetic, assetIdCollateral, assetIdFee string, isBuyingSynthetic bool, ...) []byte + func CalcNonce(src string) int64 + func GenerateSignature(privateKeyHex string, timestamp int64, method, path string, body string, ...) (string, error) + func GenerateSignatureForWS(privateKeyHex string, timestamp int64) (string, error) + func GetRandomClientId() string + func GetValue(data interface{}) string + func HexToBigInteger(hex string) (*big.Int, error) + func ToBigInt(number string) *big.Int + type APIResponse struct + Code string + Data json.RawMessage + Message string + type Account struct + ClientAccountId string + ContractIdToTradeSetting map[string]TradeSetting + CreateOrderDelayMillis int + CreateOrderPerMinuteLimit int + CreatedTime string + DefaultTradeSetting TradeSetting + EthAddress string + ExtraDataJson string + ExtraType string + Id string + IsLiquidating bool + IsSystemAccount bool + L2Key string + L2KeyYCoordinate string + MaxLeverageLimit string + Status string + UpdatedTime string + UserId string + type AccountAsset struct + Account AccountInfo + CollateralAssetModelList []CollateralAssetModel + CollateralList []Collateral + OraclePriceList []interface{} + PositionAssetList []PositionAsset + PositionList []PositionInfo + Version string + type AccountEventData struct + Account []AccountInfo + Collateral []Collateral + CollateralTransaction []CollateralTransaction + Deposit []json.RawMessage + Order []Order + OrderFillTransaction []OrderFillTransaction + Position []PositionInfo + PositionTransaction []PositionTransaction + TransferIn []TransferIn + TransferOut []TransferOut + Withdraw []Withdraw + type AccountInfo struct + ClientAccountId string + ContractIdToTradeSetting map[string]TradeSetting + CreateOrderDelayMillis int + CreateOrderPerMinuteLimit int + CreatedTime string + DefaultTradeSetting TradeSetting + EthAddress string + ExtraDataJson string + ExtraType string + Id string + IsLiquidating bool + IsSystemAccount bool + L2Key string + L2KeyYCoordinate string + MaxLeverageLimit string + Status string + UpdatedTime string + UserId string + type AccountState struct + Accounts map[string]AccountInfo + Collaterals map[string]Collateral + LastEventVersion int64 + LastUpdateTime int64 + Orders map[string]Order + Positions map[string]PositionInfo + type ActiveOrders struct + DataList []Order + type Asks struct + Price string + Size string + type Bids struct + Price string + Size string + type CancelOrderData struct + CancelResultMap map[string]interface{} + type CancelReason string + const CancelReasonAdminCanceled + const CancelReasonCouldNotFill + const CancelReasonExpireCanceled + const CancelReasonInternalFailed + const CancelReasonLiquidateCanceled + const CancelReasonMarginNotEnough + const CancelReasonReduceOnlyCanceled + const CancelReasonSystemLimitEvicted + const CancelReasonUnknownOrderCancelReason + const CancelReasonUnrecognized + const CancelReasonUserCanceled + type Chain struct + AllowAaDeposit bool + AllowAaWithdraw bool + AppRpcUrl string + BlockTime string + Chain string + ChainIconUrl string + ChainId string + ContractAddress string + DepositGasFeeLess bool + FeeLess bool + FeeRate string + GasLess bool + GasToken string + MinFee string + RpcUrl string + TokenList []Token + TxConfirm string + WebTxUrl string + WithdrawGasFeeLess bool + type Client struct + AccountID string + BaseURL string + HTTPClient *http.Client + Logger *zap.SugaredLogger + func NewClient() *Client + func (c *Client) CancelAllOrders(ctx context.Context) error + func (c *Client) CancelOrder(ctx context.Context, orderId string) (*CancelOrderData, error) + func (c *Client) GetAccount(ctx context.Context) (*Account, error) + func (c *Client) GetAccountAsset(ctx context.Context) (*AccountAsset, error) + func (c *Client) GetAllFundingRates(ctx context.Context) ([]FundingRateData, error) + func (c *Client) GetExchangeInfo(ctx context.Context) (*ExchangeInfo, error) + func (c *Client) GetExchangeLongShortRatio(ctx context.Context, rang, filterContractIdList, filterExchangeList *string) (*ExchangeLongShortRatio, error) + func (c *Client) GetFundingRate(ctx context.Context, contractId string) (*FundingRateData, error) + func (c *Client) GetKline(ctx context.Context, contractId, priceType, klineType string, size int, ...) (*GetKlineResponse, error) + func (c *Client) GetOpenOrders(ctx context.Context, contractId *string) ([]Order, error) + func (c *Client) GetOrderBook(ctx context.Context, contractId string, level int) (*OrderBook, error) + func (c *Client) GetOrdersByIds(ctx context.Context, orderIds []string) ([]Order, error) + func (c *Client) GetPositionTransactions(ctx context.Context, ids []string) ([]PositionTransaction, error) + func (c *Client) GetTicker(ctx context.Context, contractId string) (*Ticker, error) + func (c *Client) PlaceOrder(ctx context.Context, params PlaceOrderParams, contract *Contract, ...) (*CreateOrderData, error) + func (c *Client) UpdateLeverageSetting(ctx context.Context, contractId string, leverage int) error + func (c *Client) WithCredentials(starkPrivateKey, accountID string) *Client + type Coin struct + CoinId string + CoinName string + IconUrl string + ShowStepSize string + StarkExAssetId string + StarkExResolution string + StepSize string + type Collateral struct + AccountId string + Amount string + CoinId string + CreatedTime string + CumDepositAmount string + CumFillFeeAmount string + CumFillFeeIncomeAmount string + CumFundingFeeAmount string + CumPositionBuyAmount string + CumPositionSellAmount string + CumTransferInAmount string + CumTransferOutAmount string + CumWithdrawAmount string + LegacyAmount string + UpdatedTime string + UserId string + type CollateralAssetModel struct + AccountId string + AvailableAmount string + CoinId string + InitialMarginRequirement string + OrderFrozenAmount string + PendingTransferOutAmount string + PendingWithdrawAmount string + StarkExRiskValue string + TotalEquity string + TotalPositionValueAbs string + UserId string + type CollateralTransaction struct + AccountId string + BeforeAmount string + BeforeLegacyAmount string + CensorFailCode string + CensorFailReason string + CensorStatus string + CensorTime string + CensorTxId string + CoinId string + CreatedTime string + DeltaAmount string + DeltaLegacyAmount string + DepositId string + ExtraDataJson string + ExtraType string + FillCloseFee string + FillCloseSize string + FillCloseValue string + FillOpenFee string + FillOpenSize string + FillOpenValue string + FillPrice string + ForceTradeId string + ForceWithdrawId string + FundingIndexPrice string + FundingOraclePrice string + FundingPositionSize string + FundingRate string + FundingTime string + Id string + IsDeleverage bool + IsLiquidate bool + L2ApprovedTime string + L2RejectCode string + L2RejectReason string + L2RejectTime string + L2TxId string + LiquidateFee string + OrderAccountId string + OrderFillTransactionId string + OrderId string + PositionContractId string + PositionTransactionId string + RealizePnl string + TransferInId string + TransferOutId string + TransferReason string + Type string + UpdatedTime string + UserId string + WithdrawId string + type Contract struct + BaseCoinId string + ContractId string + ContractName string + DefaultLeverage string + DefaultMakerFeeRate string + DefaultTakerFeeRate string + DisplayDigitMerge string + DisplayHotIcon bool + DisplayMaxLeverage string + DisplayMinLeverage string + DisplayNewIcon bool + EnableDisplay bool + EnableOpenPosition bool + EnableTrade bool + FundingImpactMarginNotional string + FundingInterestRate string + FundingMaxRate string + FundingMinRate string + FundingRateIntervalMin string + LiquidateFeeRate string + MatchServerName string + MaxOrderBuyPriceRatio string + MaxOrderSize string + MaxPositionSize string + MinOrderSellPriceRatio string + MinOrderSize string + QuoteCoinId string + RiskTierList []RiskTier + StarkExOraclePriceQuorum string + StarkExOraclePriceSignedAssetId []string + StarkExOraclePriceSigner []string + StarkExResolution string + StarkExSyntheticAssetId string + StepSize string + TickSize string + type CreateOrderData struct + OrderId string + type DepthDispatcher struct + Callback func(event *WsDepthEvent) + func (d *DepthDispatcher) Dispatch(data []byte) error + type EventHandler func(data AccountEventData) + type EventType string + const EventAccountUpdate + const EventDepositUpdate + const EventFinishLiquidating + const EventForceTrade + const EventForceWithdraw + const EventFundingSettle + const EventOrderFillFee + const EventOrderUpdate + const EventSnapshot + const EventStartLiquidating + const EventTransferInUpdate + const EventTransferOutUpdate + const EventUnrecognized + const EventWithdrawUpdate + type ExchangeInfo struct + CoinList []Coin + ContractList []Contract + Global Global + MultiChain MultiChain + type ExchangeLongShortRatio struct + BuyRatio string + BuyVolUsd string + ContractId string + CreatedTime string + Exchange string + Range string + SellRatio string + SellVolUsd string + UpdatedTime string + type FundingRateData struct + AvgPremiumIndex string + ContractId string + ForecastFundingRate string + FundingRate string + FundingRateIntervalMin string + FundingTime string + FundingTimestamp string + ImpactAskPrice string + ImpactBidPrice string + ImpactMarginNotional string + IndexPrice string + InterestRate string + IsSettlement bool + NextFundingTime string + OraclePrice string + PredictedFundingRate string + PremiumIndex string + PremiumIndexTimestamp string + PreviousFundingRate string + PreviousFundingTimestamp string + StarkExFundingIndex string + type GetExchangeLongShortRatioResponse struct + AllRangeList []string + ExchangeLongShortRatioList []ExchangeLongShortRatio + type GetKlineResponse struct + DataList []Kline + NextPageOffsetData string + type Global struct + AppEnv string + AppName string + AppOnlySignOn string + FastWithdrawAccountId string + FastWithdrawAccountL2Key string + FastWithdrawMaxAmount string + FastWithdrawRegistryAddress string + FeeAccountId string + FeeAccountL2Key string + MaintenanceReason string + PoolAccountId string + PoolAccountL2Key string + StarkExChainId string + StarkExCollateralCoin Coin + StarkExContractAddress string + StarkExFundingValidityPeriod int + StarkExMaxFundingRate int + StarkExOrdersTreeHeight int + StarkExPositionsTreeHeight int + StarkExPriceValidityPeriod int + type Kline struct + Close string + ContractId string + ContractName string + High string + KlineId string + KlineTime string + KlineType KlineType + Low string + MakerBuySize string + MakerBuyValue string + Open string + PriceType PriceType + Size string + Trades string + Value string + type KlineDispatcher struct + Callback func(event *WsKlineEvent) + func (d *KlineDispatcher) Dispatch(data []byte) error + type KlineInterval string + const KlineInterval12h + const KlineInterval15m + const KlineInterval1M + const KlineInterval1d + const KlineInterval1h + const KlineInterval1m + const KlineInterval1w + const KlineInterval2h + const KlineInterval30m + const KlineInterval4h + const KlineInterval5m + const KlineInterval6h + const KlineInterval8h + type KlineType string + const KlineTypeDay1 + const KlineTypeHour1 + const KlineTypeHour12 + const KlineTypeHour2 + const KlineTypeHour4 + const KlineTypeHour6 + const KlineTypeHour8 + const KlineTypeMinute1 + const KlineTypeMinute15 + const KlineTypeMinute30 + const KlineTypeMinute5 + const KlineTypeMonth1 + const KlineTypeUnknownKlineType + const KlineTypeUnrecognized + const KlineTypeWeek1 + type L2Signature struct + R string + S string + V string + func SignL2(privateKeyHex string, msgHash []byte) (*L2Signature, error) + type Level struct + Price string + Size string + type MetadataDispatcher struct + Callback func(event *WsMetadataEvent) + func (d *MetadataDispatcher) Dispatch(data []byte) error + type MsgDispatcher interface + Dispatch func(data []byte) error + type MsgDispatcherRegistry struct + func NewMsgDispatcherRegistry() *MsgDispatcherRegistry + func (r *MsgDispatcherRegistry) Dispatch(channel string, data []byte) error + func (r *MsgDispatcherRegistry) Register(channel string, d MsgDispatcher) + type MultiChain struct + ChainList []Chain + CoinId string + MaxWithdraw string + MinDeposit string + MinWithdraw string + type Order struct + AccountId string + CancelReason string + ClientOrderId string + CoinId string + ContractId string + CreatedTime string + CumApprovedFee string + CumApprovedSize string + CumApprovedValue string + CumFailFee string + CumFailSize string + CumFailValue string + CumFillFee string + CumFillSize string + CumFillValue string + CumLiquidateFee string + CumMatchFee string + CumMatchSize string + CumMatchValue string + CumRealizePnl string + ExpireTime string + ExtraDataJson string + ExtraType string + Id string + IsDeleverage bool + IsLiquidate bool + IsPositionTpsl bool + IsSetOpenSl bool + IsSetOpenTp bool + IsWithoutMatch bool + L2ExpireTime string + L2LimitFee string + L2Nonce string + L2Signature L2Signature + L2Size string + L2Value string + LiquidateFeeRate string + MakerFeeRate string + MarketLimitPrice string + MarketLimitValue string + MatchSequenceId string + MaxFillPrice string + MaxLeverage string + MinFillPrice string + OpenSl Tpsl + OpenTp Tpsl + OpenTpslParentOrderId string + Price string + ReduceOnly bool + Side Side + Size string + SourceKey string + Status OrderStatus + TakerFeeRate string + TimeInForce string + TriggerPrice string + TriggerPriceTime string + TriggerPriceType TriggerPriceType + TriggerPriceValue string + TriggerTime string + Type OrderType + UpdatedTime string + UserId string + WithoutMatchFillSize string + WithoutMatchFillValue string + WithoutMatchPeerAccountId string + WithoutMatchPeerOrderId string + type OrderBook struct + Asks []Level + Bids []Level + ContractId string + ContractName string + EndVersion string + Level int + StartVersion string + type OrderBookDepth int + const OrderBookDepth15 + const OrderBookDepth200 + type OrderFillTransaction struct + AccountId string + CensorFailCode string + CensorFailReason string + CensorStatus string + CensorTime string + CensorTxId string + CoinId string + CollateralTransactionId string + ContractId string + CreatedTime string + Direction string + ExtraDataJson string + ExtraType string + FillFee string + FillPrice string + FillSize string + FillValue string + Id string + IsDeleverage bool + IsLiquidate bool + IsPositionTpsl bool + IsWithoutMatch bool + L2ApprovedTime string + L2RejectCode string + L2RejectReason string + L2RejectTime string + L2TxId string + LiquidateFee string + MatchAccountId string + MatchFillId string + MatchIndex int + MatchOrderId string + MatchSequenceId string + MatchTime string + OrderId string + OrderSide string + PositionTransactionId string + RealizePnl string + UpdatedTime string + UserId string + type OrderStatus string + const OrderStatusCanceled + const OrderStatusCanceling + const OrderStatusFilled + const OrderStatusOpen + const OrderStatusPending + const OrderStatusUnknown + const OrderStatusUnrecognized + const OrderStatusUntriggered + func (os OrderStatus) String() string + type OrderType string + const OrderTypeLimit + const OrderTypeMarket + const OrderTypeStopLimit + const OrderTypeStopMarket + const OrderTypeTakeProfitLimit + const OrderTypeTakeProfitMarket + const OrderTypeUnknownOrderType + const OrderTypeUnrecognized + type PlaceOrderParams struct + ClientOrderId string + ContractId string + ExpireTime int64 + Price string + Quantity string + ReduceOnly bool + Side string + TimeInForce string + Type string + type PositionAsset struct + AccountId string + AvgEntryPrice string + BankruptPrice string + CoinId string + ContractId string + InitialMarginRequirement string + LiquidatePrice string + MaxLeverage string + PositionValue string + StarkExRiskRate string + StarkExRiskValue string + TermRealizePnl string + TotalRealizePnl string + UnrealizePnl string + UserId string + WorstClosePrice string + type PositionInfo struct + AccountId string + CoinId string + ContractId string + CreatedTime string + FundingFee string + LongTermCount int + LongTermCreatedTime string + LongTermStat PositionStat + LongTermUpdatedTime string + LongTotalStat PositionStat + OpenFee string + OpenSize string + OpenValue string + ShortTermCount int + ShortTermCreatedTime string + ShortTermStat PositionStat + ShortTermUpdatedTime string + ShortTotalStat PositionStat + UpdatedTime string + UserId string + type PositionStat struct + CumCloseFee string + CumCloseSize string + CumCloseValue string + CumFundingFee string + CumLiquidateFee string + CumOpenFee string + CumOpenSize string + CumOpenValue string + type PositionTerm struct + AccountId string + CoinId string + ContractId string + CreatedTime string + CumCloseFee string + CumCloseSize string + CumCloseValue string + CumFundingFee string + CumLiquidateFee string + CumOpenFee string + CumOpenSize string + CumOpenValue string + CurrentLeverage string + TermCount int + UpdatedTime string + UserId string + type PositionTransaction struct + AccountId string + BeforeFundingFee string + BeforeOpenFee string + BeforeOpenSize string + BeforeOpenValue string + CensorFailCode string + CensorFailReason string + CensorStatus string + CensorTime string + CensorTxId string + CoinId string + CollateralTransactionId string + ContractId string + CreatedTime string + DeltaFundingFee string + DeltaOpenFee string + DeltaOpenSize string + DeltaOpenValue string + ExtraDataJson string + ExtraType string + FillCloseFee string + FillCloseSize string + FillCloseValue string + FillOpenFee string + FillOpenSize string + FillOpenValue string + FillPrice string + ForceTradeId string + FundingIndexPrice string + FundingOraclePrice string + FundingPositionSize string + FundingRate string + FundingTime string + Id string + IsDeleverage bool + IsLiquidate bool + L2ApprovedTime string + L2RejectCode string + L2RejectReason string + L2RejectTime string + L2TxId string + LiquidateFee string + OrderFillTransactionId string + OrderId string + RealizePnl string + Type string + UpdatedTime string + UserId string + type PositionTransactionResponse struct + DataList []PositionTransaction + NextPageOffsetData string + type PriceType string + const PriceTypeAsk1Price + const PriceTypeBid1Price + const PriceTypeIndexPrice + const PriceTypeLastPrice + const PriceTypeOpenInterest + const PriceTypeOraclePrice + const PriceTypeUnknownPriceType + const PriceTypeUnrecognized + type ResultCreateOrder struct + Code string + Data *CreateOrderData + ErrorMsg string + ErrorParam interface{} + type RiskTier struct + MaintenanceMarginRate string + MaxLeverage string + PositionValueUpperBound string + StarkExRisk string + StarkExUpperBound string + Tier int + type Side string + const SideBuy + const SideSell + const SideUnknownSide + const SideUnrecognized + type Ticker struct + Close string + ContractId string + ContractName string + EndTime string + FundingRate string + FundingTime string + High string + HighTime string + IndexPrice string + LastPrice string + Low string + LowTime string + NextFundingTime string + Open string + OpenInterest string + OraclePrice string + PriceChange string + PriceChangePercent string + Size string + StartTime string + Trades string + Value string + type TickerDispatcher struct + Callback func(event *WsTickerEvent) + func (d *TickerDispatcher) Dispatch(data []byte) error + type TimeInForce string + const TimeInForceFillOrKill + const TimeInForceGoodTilCancel + const TimeInForceImmediateOrCancel + const TimeInForcePostOnly + const TimeInForceUnknown + const TimeInForceUnrecognized + type Token struct + Decimals string + FixedRate string + IconUrl string + PullOff bool + Token string + TokenAddress string + UseFixedRate bool + WithdrawEnable bool + type Tpsl struct + ClientOrderId string + ExpireTime string + L2ExpireTime string + L2LimitFee string + L2Nonce string + L2Signature L2Signature + L2Size string + L2Value string + Price string + Side string + Size string + TriggerPrice string + TriggerPriceType string + type TradeDispatcher struct + Callback func(event *WsTradeEvent) + func (d *TradeDispatcher) Dispatch(data []byte) error + type TradeEvent struct + Data AccountEventData + Event EventType + Time int64 + Version int64 + type TradeSetting struct + IsSetFeeDiscount bool + IsSetFeeRate bool + IsSetMaxLeverage bool + MakerFeeDiscount string + MakerFeeRate string + MaxLeverage string + TakerFeeDiscount string + TakerFeeRate string + type TransferIn struct + AccountId string + Amount string + CensorFailCode string + CensorFailReason string + CensorTime string + CensorTxId string + ClientTransferId string + CoinId string + CollateralTransactionId string + ConditionFact string + ConditionFactAmount string + ConditionFactErc20Address string + ConditionFactRegistryAddress string + CreatedTime string + ExtraDataJson string + ExtraType string + Id string + IsConditionTransfer bool + L2ApprovedTime string + L2RejectCode string + L2RejectReason string + L2RejectTime string + L2TxId string + SenderAccountId string + SenderL2Key string + SenderTransferOutId string + Status string + TransferReason string + UpdatedTime string + UserId string + type TransferOut struct + AccountId string + Amount string + CensorFailCode string + CensorFailReason string + CensorTime string + CensorTxId string + ClientTransferId string + CoinId string + CollateralTransactionId string + ConditionFact string + ConditionFactAmount string + ConditionFactErc20Address string + ConditionFactRegistryAddress string + CreatedTime string + ExtraDataJson string + ExtraType string + Id string + IsConditionTransfer bool + L2ApprovedTime string + L2ExpireTime string + L2Nonce string + L2RejectCode string + L2RejectReason string + L2RejectTime string + L2Signature L2Signature + L2TxId string + ReceiverAccountId string + ReceiverL2Key string + ReceiverTransferInId string + Status string + TransferReason string + UpdatedTime string + UserId string + type TriggerPriceType string + const TriggerPriceTypeAsk1Price + const TriggerPriceTypeBid1Price + const TriggerPriceTypeIndexPrice + const TriggerPriceTypeLastPrice + const TriggerPriceTypeOpenInterest + const TriggerPriceTypeOraclePrice + const TriggerPriceTypeUnknown + const TriggerPriceTypeUnrecognized + type UpdateLeverageSettingResponse struct + type WSMessage struct + Content json.RawMessage + Time string + Type string + type Withdraw struct + AccountId string + Amount string + CensorFailCode string + CensorFailReason string + CensorTime string + CensorTxId string + ClientWithdrawId string + CoinId string + CollateralTransactionId string + CreatedTime string + Erc20Address string + EthAddress string + ExtraDataJson string + ExtraType string + Id string + L2ApprovedTime string + L2ExpireTime string + L2Nonce string + L2RejectCode string + L2RejectReason string + L2RejectTime string + L2Signature L2Signature + L2TxId string + RiskSignature L2Signature + Status string + UpdatedTime string + UserId string + type WsAccountClient struct + AccountID string + BaseURL string + Conn *websocket.Conn + Logger *zap.SugaredLogger + StarkPrivateKey string + func NewWsAccountClient(ctx context.Context, starkPrivateKey, accountID string) *WsAccountClient + func (c *WsAccountClient) Close() + func (c *WsAccountClient) Connect() error + func (c *WsAccountClient) Subscribe(eventType EventType, callback EventHandler) + func (c *WsAccountClient) SubscribeBalanceUpdate(handler func(balance []Collateral)) + func (c *WsAccountClient) SubscribeOrderUpdate(handler func(orders []Order)) + func (c *WsAccountClient) SubscribePositionUpdate(handler func(positions []PositionInfo)) + func (c *WsAccountClient) Unsubscribe(eventType EventType) + type WsDepthEvent struct + Channel string + Content struct{ ... } + Type string + type WsKlineEvent struct + Channel string + Content struct{ ... } + Type string + type WsMarketClient struct + Conn *websocket.Conn + Done chan struct{} + Logger *zap.SugaredLogger + Mu sync.RWMutex + ReconnectWait time.Duration + URL string + WriteMu sync.Mutex + func NewWsMarketClient(ctx context.Context) *WsMarketClient + func (c *WsMarketClient) Close() + func (c *WsMarketClient) Connect() error + func (c *WsMarketClient) Subscribe(channel string, callback func([]byte) error) error + func (c *WsMarketClient) SubscribeAllTickers(callback func(*WsTickerEvent)) error + func (c *WsMarketClient) SubscribeKline(contractId string, priceType PriceType, interval KlineInterval, ...) error + func (c *WsMarketClient) SubscribeMetadata(callback func(*WsMetadataEvent)) error + func (c *WsMarketClient) SubscribeOrderBook(contractId string, depth OrderBookDepth, callback func(*WsDepthEvent)) error + func (c *WsMarketClient) SubscribeTicker(contractId string, callback func(*WsTickerEvent)) error + func (c *WsMarketClient) SubscribeTrades(contractId string, callback func(*WsTradeEvent)) error + func (c *WsMarketClient) Unsubscribe(channel string) error + func (c *WsMarketClient) UnsubscribeAllTickers() error + func (c *WsMarketClient) UnsubscribeKline(contractId string, priceType PriceType, interval KlineInterval) error + func (c *WsMarketClient) UnsubscribeMetadata() error + func (c *WsMarketClient) UnsubscribeOrderBook(contractId string, depth OrderBookDepth) error + func (c *WsMarketClient) UnsubscribeTicker(contractId string) error + func (c *WsMarketClient) UnsubscribeTrades(contractId string) error + type WsMetadataEvent struct + Channel string + Content struct{ ... } + Type string + type WsTickerEvent struct + Channel string + Content struct{ ... } + Type string + type WsTradeEvent struct + Channel string + Content struct{ ... } + Type string + type WsUserDataEvent struct + Content struct{ ... } + Type string