Versions in this module Expand all Collapse all v0 v0.2.4 Mar 26, 2026 v0.2.3 Mar 26, 2026 v0.2.2 Mar 26, 2026 v0.2.1 Mar 26, 2026 v0.2.0 Mar 25, 2026 v0.1.4 Mar 13, 2026 v0.1.3 Mar 13, 2026 v0.1.2 Mar 13, 2026 v0.1.1 Mar 13, 2026 v0.1.0 Mar 13, 2026 Changes in this version + const CancelAllTifAbort + const CancelAllTifImmediate + const CancelAllTifScheduled + const CrossMarginMode + const Default10MinAuthExpiry + const Default28DayOrderExpiry + const DefaultIocExpiry + const IsolatedMarginMode + const MainnetAPIURL + const MainnetChainID + const MainnetWSURL + const Minute + const NilTriggerPrice + const OrderTimeInForceGoodTillTime + const OrderTimeInForceImmediateOrCancel + const OrderTimeInForcePostOnly + const OrderTypeLimit + const OrderTypeMarket + const OrderTypeStopLoss + const OrderTypeStopLossLimit + const OrderTypeTakeProfit + const OrderTypeTakeProfitLimit + const OrderTypeTwap + const TxTypeBurnShares + const TxTypeCancelAllOrders + const TxTypeCancelOrder + const TxTypeChangePubKey + const TxTypeCreateOrder + const TxTypeCreatePublicPool + const TxTypeCreateSubAccount + const TxTypeL2CreateGroupedOrders + const TxTypeL2UpdateMargin + const TxTypeMintShares + const TxTypeModifyOrder + const TxTypeTransfer + const TxTypeUpdateLeverage + const TxTypeUpdatePublicPool + const TxTypeWithdraw + var ErrInvalidSignature = fmt.Errorf("invalid signature") + var ErrOrderNotFound = fmt.Errorf("order not found") + func HashCancelAllOrders(lighterChainId uint32, info *CancelAllOrdersInfo) ([]byte, error) + func HashCancelOrder(lighterChainId uint32, info *CancelOrderInfo) ([]byte, error) + func HashCreateOrder(lighterChainId uint32, info *CreateOrderInfo) ([]byte, error) + func HashModifyOrder(lighterChainId uint32, info *ModifyOrderInfo) ([]byte, error) + func HashUpdateLeverage(lighterChainId uint32, info *UpdateLeverageInfo) ([]byte, error) + type APIError struct + Code int + Message string + func (e *APIError) Error() string + type Account struct + AccountIndex int64 + AccountType int8 + Assets []*SpotAsset + AvailableBalance string + CanInvite bool + CancelAllTime int64 + Code int32 + Collateral string + CrossAssetValue string + Description string + Index int64 + L1Address string + Msg string + Name string + PendingOrderCount int64 + PoolInfo *PoolInfo + Positions []*Position + ReferralPointsPercentage string + Shares []*Share + Status uint8 + TotalAssetValue string + TotalIsolatedOrderCount int64 + TotalOrderCount int64 + type AccountActiveOrdersResponse struct + Code int32 + Msg string + NextCursor string + Orders []*Order + type AccountInactiveOrdersResponse struct + Code int32 + Msg string + NextCursor string + Orders []*Order + type AccountInfo struct + AccountIndex int64 + L1Address string + type AccountLimitsResponse struct + CanCreatePublicPool bool + Code int32 + CurrentMakerFeeTick int32 + CurrentTakerFeeTick int32 + MaxLlpPercentage int32 + Msg string + UserTier string + type AccountMetadata struct + AccountIndex int64 + CanInvite bool + Description string + Name string + ReferralPointsPercentage string + type AccountMetadataResponse struct + AccountMetadatas []*AccountMetadata + Code int32 + Msg string + type AccountResponse struct + Accounts []*Account + Code int32 + Msg string + type AccountStats struct + AvailableBalance string + BuyingPower string + Collateral string + Leverage string + MarginUsage string + PortfolioValue string + type AccountTxsResponse struct + Code int32 + Msg string + Txs []Tx + type AccountsByL1AddressResponse struct + Accounts []*Account + Code int32 + Msg string + type Announcement struct + Content string + Id int64 + Timestamp int64 + Title string + type AnnouncementResponse struct + Announcements []Announcement + Code int32 + Msg string + type ApiKey struct + CreatedAt int64 + Index uint32 + Name string + PublicKey string + type ApiKeysResponse struct + ApiKeys []ApiKey + Code int32 + Msg string + type Ask struct + InitialBaseAmount string + OrderExpiry int64 + OrderId string + OrderIndex int64 + OwnerAccountIndex int64 + Price string + RemainingBaseAmount string + type Asset struct + AssetIndex int16 + Decimals uint8 + ExtensionMultiplier int64 + IndexPrice uint32 + L1Address string + L1Decimals uint8 + MarginMode uint8 + MinTransferAmount int64 + MinWithdrawalAmount int64 + Symbol string + TickSize string + type AssetDetailsResponse struct + Assets []*Asset + Code int + Msg string + type Bid struct + InitialBaseAmount string + OrderExpiry int64 + OrderId string + OrderIndex int64 + OwnerAccountIndex int64 + Price string + RemainingBaseAmount string + type Callback func([]byte) + type CancelAllOrdersInfo struct + AccountIndex int64 + ApiKeyIndex uint32 + ExpiredAt int64 + Nonce int64 + Sig []byte + SignedHash string + Time int64 + TimeInForce uint32 + type CancelAllOrdersRequest struct + CancelAllTif uint32 + MarketId int + type CancelOrderInfo struct + AccountIndex int64 + ApiKeyIndex uint32 + ExpiredAt int64 + Index int64 + MarketIndex uint32 + Nonce int64 + Sig []byte + SignedHash string + type CancelOrderRequest struct + MarketId int + OrderId int64 + type CancelOrderResponse struct + Code int32 + Message string + PredictedExecutionTimeMs int64 + TxHash string + type Candlestick struct + Close string + High string + Low string + Open string + QuoteVolume string + Timestamp int64 + Volume string + type CandlesticksResponse struct + Candlesticks []Candlestick + Code int32 + Msg string + type ChangeAccountTierResponse struct + Code int32 + Msg string + type Client struct + AccountIndex int64 + BaseURL string + ChainId uint32 + HTTPClient *http.Client + KeyIndex uint8 + KeyManager common.KeyManager + Logger *zap.SugaredLogger + PrivateKey string + func NewClient() *Client + func (c *Client) CancelOrder(ctx context.Context, req CancelOrderRequest) (*CancelOrderResponse, error) + func (c *Client) ChangeAccountTier(ctx context.Context, newTier string) (*ChangeAccountTierResponse, error) + func (c *Client) CreateAuthToken(deadline time.Time) (string, error) + func (c *Client) CreateToken(ctx context.Context, name, permission string, expiration int64) (string, error) + func (c *Client) GetAccount(ctx context.Context) (*AccountResponse, error) + func (c *Client) GetAccountActiveOrders(ctx context.Context, marketId int) (*AccountActiveOrdersResponse, error) + func (c *Client) GetAccountLimits(ctx context.Context) (*AccountLimitsResponse, error) + func (c *Client) GetAccountMetadata(ctx context.Context) (*AccountMetadataResponse, error) + func (c *Client) GetAccountTxs(ctx context.Context, limit int64) (*AccountTxsResponse, error) + func (c *Client) GetAccountsByL1Address(ctx context.Context, l1Address string) (*AccountsByL1AddressResponse, error) + func (c *Client) GetAllFundingRates(ctx context.Context) ([]FundingRateData, error) + func (c *Client) GetAnnouncements(ctx context.Context) (*AnnouncementResponse, error) + func (c *Client) GetApiKeys(ctx context.Context) (*ApiKeysResponse, error) + func (c *Client) GetAssetDetails(ctx context.Context, assetIndex *int16) (*AssetDetailsResponse, error) + func (c *Client) GetBlockHeight(ctx context.Context) (int64, error) + func (c *Client) GetCandlesticks(ctx context.Context, marketId int, resolution string, ...) (*CandlesticksResponse, error) + func (c *Client) GetExchangeStats(ctx context.Context) (*ExchangeStatsResponse, error) + func (c *Client) GetFundingHistory(ctx context.Context, marketId *int, limit int64) (*FundingHistoryResponse, error) + func (c *Client) GetFundingRate(ctx context.Context, marketId int) (*FundingRateData, error) + func (c *Client) GetFundingRates(ctx context.Context) (*FundingRatesResponse, error) + func (c *Client) GetInactiveOrders(ctx context.Context, marketId *int, limit int64) (*AccountInactiveOrdersResponse, error) + func (c *Client) GetL1Metadata(ctx context.Context) (*L1MetadataResponse, error) + func (c *Client) GetNextNonce(ctx context.Context) (int64, error) + func (c *Client) GetOrderBookDetails(ctx context.Context, marketId *int, filter *string) (*OrderBookDetailsResponse, error) + func (c *Client) GetOrderBookOrders(ctx context.Context, marketId int, limit int64) (*OrderBookOrdersResponse, error) + func (c *Client) GetOrderBooks(ctx context.Context, marketId *int) (*OrderBooksResponse, error) + func (c *Client) GetPnL(ctx context.Context, startTimestamp, endTimestamp int64) (*PnlResponse, error) + func (c *Client) GetPositionFunding(ctx context.Context, marketId *int, limit int64, side *string) (*PositionFundingResponse, error) + func (c *Client) GetPublicPoolsMetadata(ctx context.Context) (*PublicPoolsMetadataResponse, error) + func (c *Client) GetRecentTrades(ctx context.Context, marketId int, limit int64) (*RecentTradesResponse, error) + func (c *Client) GetReferralPoints(ctx context.Context) (*ReferralPointsResponse, error) + func (c *Client) GetTokens(ctx context.Context) ([]Token, error) + func (c *Client) GetTransferFeeInfo(ctx context.Context) (*TransferFeeInfoResponse, error) + func (c *Client) GetWithdrawalDelay(ctx context.Context) (*WithdrawalDelayResponse, error) + func (c *Client) ModifyOrder(ctx context.Context, req ModifyOrderRequest) (*ModifyOrderResponse, error) + func (c *Client) PlaceOrder(ctx context.Context, req CreateOrderRequest) (*CreateOrderResponse, error) + func (c *Client) Post(ctx context.Context, path string, payload any, auth bool) ([]byte, error) + func (c *Client) PostForm(ctx context.Context, path string, params map[string]string, auth bool) ([]byte, error) + func (c *Client) RevokeToken(ctx context.Context, tokenId int64) error + func (c *Client) SendTxBatch(ctx context.Context, txs []map[string]string) (*SendTxBatchResponse, error) + func (c *Client) UpdateLeverage(ctx context.Context, marketId int, leverage uint16, marginMode uint8) (*UpdateLeverageResponse, error) + func (c *Client) WithCredentials(privateKey string, accountIndex int64, keyIndex uint8) *Client + type CreateOrderInfo struct + AccountIndex int64 + ApiKeyIndex uint32 + BaseAmount int64 + ClientOrderIndex int64 + ExpiredAt int64 + IsAsk uint32 + MarketIndex uint32 + Nonce int64 + OrderExpiry int64 + Price uint32 + ReduceOnly uint32 + Sig []byte + SignedHash string + TimeInForce uint32 + TriggerPrice uint32 + Type uint32 + type CreateOrderRequest struct + BaseAmount int64 + ClientOrderId int64 + IsAsk uint32 + MarketId int + OrderExpiry int64 + OrderType uint32 + Price uint32 + ReduceOnly uint32 + TimeInForce uint32 + TriggerPrice uint32 + type CreateOrderResponse struct + Code int32 + Message string + PredictedExecutionTimeMs int64 + TxHash string + type CreateTokenRequest struct + AccountIndex int64 + Expiry int64 + Name string + Scopes string + SubAccountAccess bool + type CreateTokenResponse struct + AccountIndex int64 + ApiToken string + Code int + Expiry int64 + Msg string + Name string + Scopes string + SubAccountAccess bool + TokenId int64 + type CrossRiskParameters struct + CloseOutMarginReq string + Collateral string + InitialMarginReq string + MaintenanceMarginReq string + MarketId int + TotalAccountValue string + type DailyReturn struct + DailyReturn float64 + Timestamp int64 + type Deposit struct + Amount string + Status string + Timestamp int64 + TxHash string + type DepositHistoryResponse struct + Code int32 + Deposits []Deposit + Msg string + type ExchangeStatsResponse struct + Code int32 + DailyTradesCount int64 + DailyUsdVolume float64 + Msg string + OrderBookStats []*OrderBookStat + Total int64 + type FundingHistory struct + Change string + FundingId int64 + MarketId uint8 + PositionSide string + PositionSize string + Rate string + Timestamp int64 + type FundingHistoryResponse struct + Code int32 + Fundings []FundingRateHistory + Msg string + type FundingRate struct + Exchange string + MarketId int + Rate float64 + Symbol string + type FundingRateData struct + Exchange string + FundingIntervalHours int64 + FundingRate string + FundingTime int64 + MarketId int + NextFundingTime int64 + Symbol string + type FundingRateHistory struct + MarketId int + Price string + Rate string + Timestamp int64 + type FundingRatesResponse struct + Code int32 + FundingRate []*FundingRate + Msg string + type IsolatedRiskParameters struct + CloseOutMarginReq string + Collateral string + InitialMarginReq string + MaintenanceMarginReq string + MarketId int + TotalAccountValue string + type L1Metadata struct + BlockNum uint64 + ChainId uint32 + Timestamp uint64 + type L1MetadataResponse struct + Code int32 + L1Metadata L1Metadata + Msg string + type L2CreateGroupedOrdersTxInfo struct + AccountIndex int64 + ApiKeyIndex uint8 + ExpiredAt int64 + GroupingType uint8 + Nonce int64 + Orders []*CreateOrderInfo + Sig []byte + SignedHash string + func (txInfo *L2CreateGroupedOrdersTxInfo) Hash(lighterChainId uint32, extra ...g.Element) (msgHash []byte, err error) + type L2UpdateMarginTxInfo struct + AccountIndex int64 + ApiKeyIndex uint8 + Direction uint8 + ExpiredAt int64 + MarketIndex int16 + Nonce int64 + Sig []byte + SignedHash string + USDCAmount int64 + func (txInfo *L2UpdateMarginTxInfo) Hash(lighterChainId uint32, extra ...g.Element) (msgHash []byte, err error) + type LiqInfo struct + Position Position + RiskInfoAfter RiskInfo + RiskInfoBefore RiskInfo + type LiqTrade struct + MakerFee string + Price string + Size string + TakerFee string + type Liquidation struct + Id int64 + Info LiqInfo + MarketId int + Trade LiqTrade + Type string + type LiquidationsResponse struct + Code int32 + Liquidations []Liquidation + Msg string + type MarketType string + const MarketTypePerp + const MarketTypeSpot + type ModifyOrderInfo struct + AccountIndex int64 + ApiKeyIndex uint32 + BaseAmount int64 + ExpiredAt int64 + Index int64 + MarketIndex uint32 + Nonce int64 + Price uint32 + Sig []byte + SignedHash string + TriggerPrice uint32 + type ModifyOrderRequest struct + BaseAmount int64 + MarketId int + OrderIndex int64 + Price uint32 + TriggerPrice uint32 + type ModifyOrderResponse struct + Code int32 + Message string + PredictedExecutionTimeMs int64 + TxHash string + type MsgDispatcher interface + Dispatch func(subscribers map[string]*Subscriber, msg []byte) error + type Notification struct + AccountIndex int64 + Ack bool + AckedAt *string + Content NotificationContent + CreatedAt string + Id string + Kind string + UpdatedAt string + type NotificationContent map[string]interface + type Order struct + BasePrice int64 + BaseSize int64 + BlockHeight int64 + ClientOrderId string + ClientOrderIndex int64 + CreatedAt int64 + FilledBaseAmount string + FilledQuoteAmount string + InitialBaseAmount string + IsAsk bool + MarketIndex int + Nonce int64 + OrderExpiry int64 + OrderId string + OrderIndex int64 + OrderType OrderTypeResp + OwnerAccountIndex int + ParentOrderId string + ParentOrderIndex int64 + Price string + ReduceOnly bool + RemainingBaseAmount string + Side string + Status OrderStatus + TimeInForce string + Timestamp int64 + ToCancelOrderId0 string + ToTriggerOrderId0 string + ToTriggerOrderId1 string + ToTriggerOrderId2 string + TriggerPrice string + TriggerStatus string + TriggerTime int64 + UpdatedAt int64 + type OrderBook struct + BaseAssetId int16 + LiquidationFee string + MakerFee string + MarketId int + MarketType MarketType + MinBaseAmount string + MinQuoteAmount string + OrderQuoteLimit string + QuoteAssetId int16 + Status string + SupportedPriceDecimals uint8 + SupportedQuoteDecimals uint8 + SupportedSizeDecimals uint8 + Symbol string + TakerFee string + type OrderBookDetail struct + BaseAssetId int + CloseoutMarginFraction int + DailyBaseTokenVolume float64 + DailyPriceChange float64 + DailyPriceHigh float64 + DailyPriceLow float64 + DailyQuoteTokenVolume float64 + DailyTradesCount int64 + DefaultInitialMarginFraction int + LastTradePrice float64 + LiquidationFee string + MaintenanceMarginFraction int + MakerFee string + MarketId int + MarketType string + MinBaseAmount string + MinInitialMarginFraction int + MinQuoteAmount string + OpenInterest float64 + PriceDecimals uint8 + QuoteAssetId int + QuoteMultiplier int64 + SizeDecimals uint8 + Status string + SupportedPriceDecimals uint8 + SupportedQuoteDecimals uint8 + SupportedSizeDecimals uint8 + Symbol string + TakerFee string + type OrderBookDetailsResponse struct + Code int32 + Msg string + OrderBookDetails []*OrderBookDetail + SpotOrderBookDetails []*OrderBookDetail + type OrderBookLevel struct + Price string + Size string + type OrderBookOrdersResponse struct + Asks []Ask + Bids []Bid + Code int32 + Msg string + TotalAsks int64 + TotalBids int64 + type OrderBookStat struct + DailyBaseTokenVolume float64 + DailyPriceChange float64 + DailyQuoteTokenVolume float64 + DailyTradesCount int64 + LastTradePrice float64 + Symbol string + type OrderBooksResponse struct + Code int32 + Msg string + OrderBooks []OrderBook + type OrderStatus string + const OrderStatusCanceled + const OrderStatusCanceledChild + const OrderStatusCanceledExpired + const OrderStatusCanceledLiquidation + const OrderStatusCanceledMarginNotAllowed + const OrderStatusCanceledNotEnoughLiquidity + const OrderStatusCanceledOco + const OrderStatusCanceledPositionNotAllowed + const OrderStatusCanceledPostOnly + const OrderStatusCanceledReduceOnly + const OrderStatusCanceledSelfTrade + const OrderStatusCanceledTooMuchSlippage + const OrderStatusFilled + const OrderStatusInProgress + const OrderStatusOpen + const OrderStatusPartiallyFilled + const OrderStatusPending + const OrderStatusRejected + type OrderTypeResp string + const OrderTypeRespLimit + const OrderTypeRespLiquidation + const OrderTypeRespMarket + const OrderTypeRespStopLoss + const OrderTypeRespStopLossLimit + const OrderTypeRespTakeProfit + const OrderTypeRespTakeProfitLimit + const OrderTypeRespTwap + const OrderTypeRespTwapSub + type Pnl struct + Inflow float64 + Outflow float64 + PoolInflow float64 + PoolOutflow float64 + PoolPnl float64 + PoolTotalShares float64 + Timestamp int64 + TradePnl float64 + type PnlResponse struct + Code int32 + Msg string + Pnl []Pnl + Resolution string + type PoolInfo struct + AnnualPercentageYield float64 + DailyReturn *DailyReturn + MinOperatorShareRate string + OperatorFee string + OperatorShares int64 + SharePrices []*SharePrice + Status uint8 + TotalShares int64 + type Position struct + AllocatedMargin string + AvgEntryPrice string + InitialMarginFraction string + LiquidationPrice string + MarginMode int32 + MarketId int + OpenOrderCount int64 + PendingOrderCount int64 + Position string + PositionTiedOrderCount int64 + PositionValue string + RealizedPnl string + Sign int32 + Symbol string + TotalFundingPaidOut string + UnrealizedPnl string + type PositionFunding struct + Change string + FundingId int64 + MarketId int + PositionSide string + PositionSize string + Rate string + Timestamp int64 + type PositionFundingResponse struct + Code int32 + Msg string + PositionFundings []*PositionFunding + type PublicPoolMetadata struct + Description string + Index int64 + Name string + type PublicPoolsMetadataResponse struct + Code int32 + Msg string + PublicPoolsMetadata []PublicPoolMetadata + type RecentTradesResponse struct + Code int32 + Msg string + Trades []Trade + type ReferralPoints struct + Points string + Rank int64 + TotalPoints string + type ReferralPointsResponse struct + Code int32 + Msg string + ReferralPoints ReferralPoints + type RevokeTokenRequest struct + AccountIndex int64 + TokenId int64 + type RevokeTokenResponse struct + Code int + Msg string + Revoked bool + TokenId int64 + type RiskInfo struct + CrossRiskParameters CrossRiskParameters + IsolatedRiskParameters IsolatedRiskParameters + type SendTxBatchResponse struct + Code int32 + Msg string + Result []string + type Share struct + EntryUsdc string + PublicPoolIndex int64 + SharesAmount int64 + type SharePrice struct + SharePrice float64 + Timestamp int64 + type SpotAsset struct + AssetId int + Balance string + LockedBalance string + Symbol string + type SubscribeRequest struct + Auth *string + Channel string + Type string + type Subscriber struct + Callbacks []Callback + Channel string + func (s *Subscriber) Dispatch(data []byte) + type Token struct + AccountIndex int64 + ApiToken string + Expiry int64 + Name string + Revoked bool + Scopes string + SubAccountAccess bool + TokenID int64 + type TokenListResponse struct + ApiTokens []Token + Code int + Msg string + type Trade struct + AskAccountId int64 + AskId int64 + BidAccountId int64 + BidId int64 + BlockHeight int64 + IsMakerAsk bool + MakerEntryQuoteBefore string + MakerFee int32 + MakerInitialMarginFractionBefore int + MakerPositionSignChanged bool + MakerPositionSizeBefore string + MarketId int + Price string + Size string + TakerEntryQuoteBefore string + TakerFee int32 + TakerInitialMarginFractionBefore int + TakerPositionSignChanged bool + TakerPositionSizeBefore string + Timestamp int64 + TradeId int64 + TradeType string + TxHash string + UsdAmount string + type TradesResponse struct + Code int32 + Msg string + Trades []Trade + type Transfer struct + Amount string + Status string + Timestamp int64 + ToAccount int64 + TxHash string + type TransferFeeInfoResponse struct + Code int32 + Fee string + Msg string + type TransferHistoryResponse struct + Code int32 + Msg string + Transfers []Transfer + type Tx struct + AccountIndex int64 + BlockHeight int64 + EventInfo string + ExpireAt int64 + Hash string + Info string + L1Address string + Nonce int64 + ParentHash string + QueuedAt int64 + SequenceIndex int64 + Status int64 + TransactionIndex int64 + TxType uint8 + type TxError struct + Code int + Message string + type TxResponse struct + Code int + Data json.RawMessage + ID string + Message string + PredictedExecutionTimeMs int64 + TxError *TxError + TxHash string + Type string + func (r *TxResponse) Error() string + func (r *TxResponse) IsSuccess() bool + type UpdateLeverageInfo struct + AccountIndex int64 + ApiKeyIndex uint32 + ExpiredAt int64 + InitialMarginFraction uint16 + MarginMode uint8 + MarketIndex uint32 + Nonce int64 + Sig []byte + SignedHash string + type UpdateLeveragePayload struct + Sig []byte + SignedHash string + type UpdateLeverageRequest struct + InitialMarginFraction uint16 + MarginMode uint8 + MarketId int + type UpdateLeverageResponse struct + Code int32 + Msg string + PredictedExecutionTimeMs int64 + TxHash string + type WebsocketClient struct + Conn *websocket.Conn + Logger *zap.SugaredLogger + Mu sync.RWMutex + OnError func(error) + PendingRequests map[string]chan *TxResponse + ReconnectWait time.Duration + Subscriptions map[string]*subscription + URL string + WriteMu sync.Mutex + func NewWebsocketClient(ctx context.Context) *WebsocketClient + func (c *WebsocketClient) CancelAllOrders(ctx context.Context, client *Client, req CancelAllOrdersRequest) (string, error) + func (c *WebsocketClient) CancelOrder(ctx context.Context, client *Client, req CancelOrderRequest) (string, error) + func (c *WebsocketClient) Close() + func (c *WebsocketClient) Connect() error + func (c *WebsocketClient) HandleMessage(message []byte) + func (c *WebsocketClient) ModifyOrder(ctx context.Context, client *Client, req ModifyOrderRequest) (string, error) + func (c *WebsocketClient) PlaceOrder(ctx context.Context, client *Client, req CreateOrderRequest) (string, error) + func (c *WebsocketClient) RegisterPendingRequest(id string) chan *TxResponse + func (c *WebsocketClient) Send(v any) error + func (c *WebsocketClient) Subscribe(channel string, authToken *string, handler func([]byte)) error + func (c *WebsocketClient) SubscribeAccountAll(accountId int64, authToken string, cb func([]byte)) error + func (c *WebsocketClient) SubscribeAccountAllOrders(accountId int64, authToken string, cb func([]byte)) error + func (c *WebsocketClient) SubscribeAccountAllPositions(accountId int64, authToken string, cb func([]byte)) error + func (c *WebsocketClient) SubscribeAccountAllTrades(accountId int64, authToken string, cb func([]byte)) error + func (c *WebsocketClient) SubscribeAccountMarket(marketId int, accountId int64, authToken string, cb func([]byte)) error + func (c *WebsocketClient) SubscribeAccountOrders(marketId int, accountId int64, authToken string, cb func([]byte)) error + func (c *WebsocketClient) SubscribeAccountTx(accountId int64, authToken string, cb func([]byte)) error + func (c *WebsocketClient) SubscribeAllMarketStats(cb func([]byte)) error + func (c *WebsocketClient) SubscribeHeight(cb func([]byte)) error + func (c *WebsocketClient) SubscribeMarketStats(marketId int, cb func([]byte)) error + func (c *WebsocketClient) SubscribeNotification(accountId int64, authToken string, cb func([]byte)) error + func (c *WebsocketClient) SubscribeOrderBook(marketId int, cb func([]byte)) error + func (c *WebsocketClient) SubscribeTrades(marketId int, cb func([]byte)) error + func (c *WebsocketClient) SubscribeUserStats(accountId int64, authToken string, cb func([]byte)) error + func (c *WebsocketClient) UnregisterPendingRequest(id string) + func (c *WebsocketClient) Unsubscribe(channel string) error + func (c *WebsocketClient) UnsubscribeOrderBook(marketId int) error + func (c *WebsocketClient) UnsubscribeTrades(marketId int) error + type Withdraw struct + Amount string + Status string + Timestamp int64 + TxHash string + type WithdrawHistoryResponse struct + Code int32 + Msg string + Withdraws []Withdraw + type WithdrawalDelayResponse struct + Code int32 + Delay int64 + Msg string + type WsAccountAllEvent struct + Account int64 + Channel string + DailyTradesCount int64 + DailyVolume float64 + FundingHistories map[string][]FundingHistory + MonthlyTradesCount int64 + MonthlyVolume float64 + Positions map[string]*Position + Shares []Share + TotalTradesCount int64 + TotalVolume float64 + Trades map[string][]Trade + Type string + WeeklyTradesCount int64 + WeeklyVolume float64 + type WsAccountAllOrdersEvent struct + Channel string + Orders map[string][]*Order + Type string + type WsAccountAllPositionsEvent struct + Channel string + Positions map[string]*Position + Type string + type WsAccountAllTradesEvent struct + Channel string + Trades map[string][]Trade + Type string + type WsAccountMarketEvent struct + Account int64 + Channel string + Orders []*Order + Position *Position + Trades []Trade + Type string + type WsAccountOrdersEvent struct + Account int64 + Channel string + Nonce int64 + Orders map[string][]*Order + Type string + type WsAccountTxEvent struct + Channel string + Txs []Tx + Type string + type WsHeightEvent struct + Channel string + Height int64 + Type string + type WsMarketStatsEvent struct + Channel string + MarketStats struct{ ... } + Type string + type WsNotificationEvent struct + Channel string + Notifs []Notification + Type string + type WsOrderBookEvent struct + Channel string + Offset int64 + OrderBook struct{ ... } + Type string + type WsTradeEvent struct + Channel string + Trades []Trade + Type string + type WsUserStatsEvent struct + Channel string + Stats struct{ ... } + Type string