Versions in this module Expand all Collapse all v1 v1.0.0 Oct 25, 2026 Changes in this version + const CodeAPIKeyNotFound + const CodeClientOrderIndexExists + const CodeInactiveCancel + const CodeInactiveOrder + const CodeInvalidNonce + const CodeInvalidOrderIndex + const CodeInvalidSignature + const CodeNonIncreasingNonce + const CodeNotEnoughOrderMargin + const CodeTooManyRequests + const MainnetChainID + const RateLimitCategoryAmend + const RateLimitCategoryCancel + const RateLimitCategoryMarket + const RateLimitCategoryOther + const RateLimitCategoryPlace + const RateLimitCategoryQuery + const TestnetChainID + var MainnetRestURL string = "https://mainnet.zklighter.elliot.ai" + var MainnetWsURL string = "wss://mainnet.zklighter.elliot.ai/stream" + var TestnetRestURL string = "https://testnet.zklighter.elliot.ai" + var TestnetWsURL string = "wss://testnet.zklighter.elliot.ai/stream" + func CodeOf(err error) int + func EndpointWeight(endpoint string) int64 + func IsAuth(err error) bool + func IsCode(err error, code int) bool + func IsExchange(err error) bool + func IsInvalidRequest(err error) bool + func IsMissingOrder(err error) bool + func IsNetwork(err error) bool + func IsNonceError(err error) bool + func IsRateLimit(err error) bool + type APIKeyConfig struct + Index uint8 + PrivateKey string + type Client struct + func NewClient(cfg Config) (*Client, error) + func (c *Client) APIKeyIndexes() []uint8 + func (c *Client) AccountIndex() int64 + func (c *Client) AuthToken() (string, error) + func (c *Client) CanSign() bool + func (c *Client) Close() error + func (c *Client) Config() Config + func (c *Client) Engine() *engine.Engine + func (c *Client) IsTestnet() bool + func (c *Client) LifeContext() context.Context + func (c *Client) Logger() Logger + func (c *Client) Metrics() CounterFactory + func (c *Client) PostConn() *ws.Conn + func (c *Client) PublicKeyHex(apiKeyIndex uint8) string + func (c *Client) RateLimits() RateLimitSnapshot + func (c *Client) StreamConn() *ws.Conn + func (c *Client) StreamConnected() bool + func (c *Client) WarmUpPost(ctx context.Context) error + func (c *Client) WarmUpStream(ctx context.Context) error + type Config struct + APIKeyIndex uint8 + AccountIndex int64 + AuthTokenLifetime time.Duration + ChainID uint32 + ExtraKeys []APIKeyConfig + Logger Logger + MarketRefreshInterval time.Duration + Metrics CounterFactory + NonceMode NonceMode + PrivateKey string + REST RestConfig + RateLimit RateLimitConfig + RateLimitEventObserver func(RateLimitEvent) + Testnet bool + TxExpiry time.Duration + UserAgent string + WS WsConfig + func DefaultConfig() Config + type Counter = ltmet.Counter + type CounterFactory = ltmet.CounterFactory + func NoopMetrics() CounterFactory + type Error = lterr.Error + func NewError(kind ErrorKind, msg string, cause error) *Error + type ErrorKind = lterr.ErrorKind + const ErrorKindAuth + const ErrorKindExchange + const ErrorKindInvalidRequest + const ErrorKindNetwork + const ErrorKindRateLimit + const ErrorKindUnknown + type Field = ltlog.Field + func Bool(key string, value bool) Field + func Err(err error) Field + func Float(key string, value float64) Field + func Int(key string, value int64) Field + func Str(key, value string) Field + type FieldKind = ltlog.FieldKind + const FieldKindBool + const FieldKindError + const FieldKindFloat + const FieldKindInt + const FieldKindString + type Logger = ltlog.Logger + func NoopLogger() Logger + type NonceMode = nonce.Mode + const NonceModeSequential + const NonceModeSkip + type RateLimitBudget struct + RequestsPerMinute int64 + SendTxPerMinute int64 + WeightedPerMinute int64 + func TierBudget(tier RateLimitTier, stakedLIT int64) RateLimitBudget + type RateLimitConfig struct + DefaultTxTypeLimit int64 + RejectWhenRateLimited bool + StakedLIT int64 + Tier string + type RateLimitEvent = ratelimit.Event + type RateLimitSnapshot = ratelimit.Snapshot + type RateLimitTier = ratelimit.Tier + const RateLimitTierBuilder + const RateLimitTierPlus + const RateLimitTierPremium + const RateLimitTierStandard + func TierFromName(name string) (RateLimitTier, bool) + type RestConfig struct + BaseURL string + HTTPClient *http.Client + IdleConnTimeout time.Duration + MaxIdleConns int + MaxIdleConnsPerHost int + Proxy func(*http.Request) (*url.URL, error) + RequestTimeout time.Duration + type Transport = ratelimit.Transport + const TransportREST + const TransportWS + type TxTracker struct + func NewTxTracker(maxEntries int) *TxTracker + func (t *TxTracker) Await(ctx context.Context, hash string) (types.TxOutcome, error) + func (t *TxTracker) Lookup(hash string) (types.TxOutcome, bool) + func (t *TxTracker) Observe(outcome *types.TxOutcome) + type WsConfig struct + EnableCompression bool + HandshakeTimeout time.Duration + PingInterval time.Duration + PostTimeout time.Duration + Proxy func(*http.Request) (*url.URL, error) + ReadBufferSize int + ReadTimeout time.Duration + ReconnectInitialBackoff time.Duration + ReconnectJitter float64 + ReconnectMaxBackoff time.Duration + URL string + WriteBufferSize int + WriteTimeout time.Duration