Versions in this module Expand all Collapse all v0 v0.1.2 Jul 29, 2026 v0.1.1 Jul 29, 2026 Changes in this version + func MetaUniverseCount(ctx context.Context, baseURL string) (int, error) v0.1.0 Jul 29, 2026 Changes in this version + const ChannelActiveAssetCtx + const ChannelAllMids + const ChannelBbo + const ChannelCandle + const ChannelClearinghouseState + const ChannelL2Book + const ChannelNotification + const ChannelOpenOrders + const ChannelOrderUpdates + const ChannelPong + const ChannelSubResponse + const ChannelTrades + const ChannelTwapStates + const ChannelUserFills + const ChannelWebData2 + const ChannelWebData3 + const DefaultSlippage + const LocalAPIURL + const MainnetAPIURL + const TestnetAPIURL + func FloatToUsdInt(value float64) int + func GetTimestampMs() int64 + func IsWalletDoesNotExistError(err error) bool + func MetaUniverseLen(m *Meta) int + func NewMsgDispatcher[T subscriptable](channel string) msgDispatcher + func NewNoopDispatcher() msgDispatcher + func NewPongDispatcher() msgDispatcher + type APIError struct + Code int + Data any + Message string + func (e APIError) Error() string + type APIResponse struct + Data T + Err string + Ok bool + Status string + Type string + func (r *APIResponse[T]) UnmarshalJSON(data []byte) error + type AccountHistory struct + AccountValueHistory []MixedArray + PnlHistory []MixedArray + Vlm string + type ActiveAssetCtx struct + Coin string + Ctx SharedAssetCtx + func (a ActiveAssetCtx) Key() string + type ActiveAssetCtxSubscriptionParams struct + Coin string + type AgentApprovalResponse struct + Error string + Status string + TxHash string + type AgentSigner interface + SignAgent func(ctx context.Context, agentAddress, agentName string, nonce int64, ...) (SignatureResult, error) + func ECDSAAgentSigner(pk *ecdsa.PrivateKey) AgentSigner + type AllMids struct + Mids map[string]string + func (a AllMids) Key() string + type AllMidsSubscriptionParams struct + Dex *string + type ApprovalResponse struct + Error string + Status string + TxHash string + type ApproveAgentAction struct + AgentAddress string + AgentName *string + HyperliquidChain string + Nonce int64 + SignatureChainId string + Type string + type ApproveBuilderFeeAction struct + Builder string + MaxFeeRate string + Nonce int64 + Type string + type AssetCtx struct + DayBaseVlm string + DayNtlVlm string + Funding string + ImpactPxs []string + MarkPx string + MidPx string + OpenInterest string + OraclePx string + Premium string + PrevDayPx string + type AssetInfo struct + IsDelisted bool + MarginTableId int + MaxLeverage int + Name string + OnlyIsolated bool + SzDecimals int + type AssetPosition struct + Position Position + Type string + type AssetRequest struct + Coin string + MarginTableID int + OnlyIsolated bool + OraclePx string + SzDecimals int + type AssetRequest2 struct + Coin string + MarginMode string + MarginTableID int + OraclePx string + SzDecimals int + type BatchModifyAction struct + Dex string + Modifies []ModifyAction + Type string + type Bbo struct + Bbo []Level + Coin string + Time int64 + func (w Bbo) Key() string + type BboSubscriptionParams struct + Coin string + type BuilderInfo struct + Builder string + Fee int + type BulkCancelResponse struct + Data []OpenOrder + Error string + Status string + type BulkOrderResponse struct + Data []OrderStatus + Error string + Status string + type CancelAction struct + Cancels []CancelOrderWire + Dex string + Type string + type CancelByCloidAction struct + Cancels []CancelByCloidWire + Dex string + Type string + type CancelByCloidRequest struct + Cloid string + Coin string + type CancelByCloidWire struct + Asset int + ClientID string + type CancelOrderRequest struct + Coin string + OrderID int64 + type CancelOrderRequestByCloid struct + Cloid string + Coin string + type CancelOrderResponse struct + Statuses MixedArray + type CancelOrderWire struct + Asset int + OrderID int64 + type CancelRequest struct + Coin string + Oid int64 + type CancelResponse struct + Data *OpenOrder + Error string + Status string + type Candle struct + Close string + High string + Interval string + Low string + Open string + Symbol string + TimeClose int64 + TimeOpen int64 + TradesCount int + Volume string + func (c Candle) Key() string + type CandlesSubscriptionParams struct + Coin string + Interval string + type ClearinghouseState struct + AssetPositions []AssetPosition + CrossMaintenanceMarginUsed string + CrossMarginSummary *MarginSummary + MarginSummary *MarginSummary + Time int64 + Withdrawable string + func (c ClearinghouseState) Key() string + type ClearinghouseStateMessage struct + ClearinghouseState ClearinghouseState + Dex string + User string + func (c ClearinghouseStateMessage) Key() string + type ClearinghouseStateSubscriptionParams struct + Dex *string + User string + type ClientOpt = Opt[client] + func ClientOptHTTPClient(httpClient *http.Client) ClientOpt + type Cloid struct + Value string + func (c Cloid) ToRaw() string + type ConvertToMultiSigUserAction struct + Nonce int64 + Signers string + Type string + type CreateOrderRequest struct + ClientOrderID *string + Coin string + IsBuy bool + OrderType OrderType + Price float64 + ReduceOnly bool + Size float64 + func (s *CreateOrderRequest) String() string + type CreateSubAccountAction struct + Name string + Type string + type CreateSubAccountResponse struct + Data *SubAccount + Error string + Status string + type CreateVaultAction struct + Description string + InitialUsd int + Name string + Type string + type CreateVaultResponse struct + Data string + Error string + Status string + type CumFunding struct + AllTime string + SinceChange string + SinceOpen string + type Delta struct + Coin string + FundingRate string + Size string + Type string + USDC string + type EvmContract struct + Address string + EvmExtraWeiDecimals int + type Exchange struct + func NewExchange(ctx context.Context, privateKey *ecdsa.PrivateKey, baseURL string, meta *Meta, ...) *Exchange + func NewExchangeGoop(ctx context.Context, privateKey *ecdsa.PrivateKey, baseURL string, ...) *Exchange + func (e *Exchange) ApproveAgent(ctx context.Context, name *string) (*AgentApprovalResponse, string, error) + func (e *Exchange) ApproveBuilderFee(ctx context.Context, builder string, maxFeeRate string) (*ApprovalResponse, error) + func (e *Exchange) BulkCancel(ctx context.Context, requests []CancelOrderRequest) (res *APIResponse[CancelOrderResponse], err error) + func (e *Exchange) BulkCancelByCloids(ctx context.Context, requests []CancelOrderRequestByCloid) (res *APIResponse[CancelOrderResponse], err error) + func (e *Exchange) BulkModifyOrders(ctx context.Context, modifyRequests []ModifyOrderRequest) ([]OrderStatus, error) + func (e *Exchange) BulkOrders(ctx context.Context, orders []CreateOrderRequest, builder *BuilderInfo) (result *APIResponse[OrderResponse], err error) + func (e *Exchange) CSignerInner(ctx context.Context, innerAction map[string]any) (*ValidatorResponse, error) + func (e *Exchange) CSignerJailSelf(ctx context.Context) (*ValidatorResponse, error) + func (e *Exchange) CSignerUnjailSelf(ctx context.Context) (*ValidatorResponse, error) + func (e *Exchange) CValidatorChangeProfile(ctx context.Context, newProfile map[string]any) (*ValidatorResponse, error) + func (e *Exchange) CValidatorRegister(ctx context.Context, validatorProfile map[string]any) (*ValidatorResponse, error) + func (e *Exchange) CValidatorUnregister(ctx context.Context) (*ValidatorResponse, error) + func (e *Exchange) Cancel(ctx context.Context, coin string, oid int64) (res *APIResponse[CancelOrderResponse], err error) + func (e *Exchange) CancelByCloid(ctx context.Context, coin, cloid string) (res *APIResponse[CancelOrderResponse], err error) + func (e *Exchange) ConvertToMultiSigUser(ctx context.Context, authorizedUsers []string, threshold int) (*MultiSigConversionResponse, error) + func (e *Exchange) CreateSubAccount(ctx context.Context, name string) (*CreateSubAccountResponse, error) + func (e *Exchange) CreateVault(ctx context.Context, name string, description string, initialUsd int) (*CreateVaultResponse, error) + func (e *Exchange) Info() *Info + func (e *Exchange) MarketClose(ctx context.Context, coin string, sz *float64, px *float64, slippage float64, ...) (OrderStatus, error) + func (e *Exchange) MarketOpen(ctx context.Context, name string, isBuy bool, sz float64, px *float64, ...) (res OrderStatus, err error) + func (e *Exchange) ModifyOrder(ctx context.Context, req ModifyOrderRequest) (result OrderStatus, err error) + func (e *Exchange) MultiSig(ctx context.Context, action map[string]any, signers []string, ...) (*MultiSigResponse, error) + func (e *Exchange) Order(ctx context.Context, req CreateOrderRequest, builder *BuilderInfo) (result OrderStatus, err error) + func (e *Exchange) PerpDeployHaltTrading(ctx context.Context, coin string, isHalted bool) (*PerpDeployResponse, error) + func (e *Exchange) PerpDeployRegisterAsset(ctx context.Context, dex string, maxGas *int, assetRequest AssetRequest, ...) (*PerpDeployResponse, error) + func (e *Exchange) PerpDeployRegisterAsset2(ctx context.Context, dex string, maxGas *int, assetRequest AssetRequest2, ...) (*PerpDeployResponse, error) + func (e *Exchange) PerpDeploySetOracle(ctx context.Context, dex string, oraclePxs map[string]string, ...) (*PerpDeployResponse, error) + func (e *Exchange) PerpDex() string + func (e *Exchange) PerpDexClassTransfer(ctx context.Context, dex, token string, amount float64, toPerp bool) (*TransferResponse, error) + func (e *Exchange) Reserve(ctx context.Context, weight int) (*ReserveRequestWeightResponse, error) + func (e *Exchange) ScheduleCancel(ctx context.Context, scheduleTime *int64) (*ScheduleCancelResponse, error) + func (e *Exchange) SendAsset(ctx context.Context, destination string, sourceDex string, ...) (*ReserveRequestWeightResponse, error) + func (e *Exchange) SetExpiresAfter(expiresAfter *int64) + func (e *Exchange) SetLastNonce(n int64) + func (e *Exchange) SetReferrer(ctx context.Context, code string) (*SetReferrerResponse, error) + func (e *Exchange) SlippagePrice(ctx context.Context, name string, isBuy bool, slippage float64, px *float64) (float64, error) + func (e *Exchange) SpotDeployEnableFreezePrivilege(ctx context.Context) (*SpotDeployResponse, error) + func (e *Exchange) SpotDeployFreezeUser(ctx context.Context, userAddress string) (*SpotDeployResponse, error) + func (e *Exchange) SpotDeployGenesis(ctx context.Context, deployer string, dexName string) (*SpotDeployResponse, error) + func (e *Exchange) SpotDeployRegisterHyperliquidity(ctx context.Context, name string, tokens []string) (*SpotDeployResponse, error) + func (e *Exchange) SpotDeployRegisterSpot(ctx context.Context, baseToken string, quoteToken string) (*SpotDeployResponse, error) + func (e *Exchange) SpotDeployRegisterToken(ctx context.Context, tokenName string, szDecimals int, weiDecimals int, ...) (*SpotDeployResponse, error) + func (e *Exchange) SpotDeployRevokeFreezePrivilege(ctx context.Context) (*SpotDeployResponse, error) + func (e *Exchange) SpotDeploySetDeployerTradingFeeShare(ctx context.Context, feeShare float64) (*SpotDeployResponse, error) + func (e *Exchange) SpotDeployUserGenesis(ctx context.Context, balances map[string]float64) (*SpotDeployResponse, error) + func (e *Exchange) SpotTransfer(ctx context.Context, amount float64, destination, token string) (*TransferResponse, error) + func (e *Exchange) SubAccountSpotTransfer(ctx context.Context, subAccountUser string, isDeposit bool, token string, ...) (*TransferResponse, error) + func (e *Exchange) SubAccountTransfer(ctx context.Context, subAccountUser string, isDeposit bool, usd int) (*TransferResponse, error) + func (e *Exchange) TokenDelegate(ctx context.Context, validator string, wei int, isUndelegate bool) (*TransferResponse, error) + func (e *Exchange) UpdateIsolatedMargin(ctx context.Context, amount float64, name string) (*UserState, error) + func (e *Exchange) UpdateLeverage(ctx context.Context, leverage int, name string, isCross bool) (*UserState, error) + func (e *Exchange) UsdClassTransfer(ctx context.Context, amount float64, toPerp bool) (*TransferResponse, error) + func (e *Exchange) UsdTransfer(ctx context.Context, amount float64, destination string) (*TransferResponse, error) + func (e *Exchange) UseBigBlocks(ctx context.Context, enable bool) (*ApprovalResponse, error) + func (e *Exchange) UserDexAbstraction(ctx context.Context, user string, enabled bool) (*ReserveRequestWeightResponse, error) + func (e *Exchange) UserSetAbstraction(ctx context.Context, user string, abstraction string) (*ReserveRequestWeightResponse, error) + func (e *Exchange) VaultDistribute(ctx context.Context, vaultAddress string, usd int) (*TransferResponse, error) + func (e *Exchange) VaultModify(ctx context.Context, vaultAddress string, allowDeposits bool, ...) (*TransferResponse, error) + func (e *Exchange) VaultUsdTransfer(ctx context.Context, vaultAddress string, isDeposit bool, usd int) (*TransferResponse, error) + func (e *Exchange) WithdrawFromBridge(ctx context.Context, amount float64, destination string) (*TransferResponse, error) + type ExchangeOpt = Opt[Exchange] + func ExchangeOptAgentSigner(s AgentSigner) ExchangeOpt + func ExchangeOptClientOptions(opts ...ClientOpt) ExchangeOpt + func ExchangeOptDebugMode() ExchangeOpt + func ExchangeOptInfoOptions(opts ...InfoOpt) ExchangeOpt + func ExchangeOptL1Signer(s L1ActionSigner) ExchangeOpt + func ExchangeOptPerpDex(dex string) ExchangeOpt + func ExchangeOptUserSignedSigner(s UserSignedActionSigner) ExchangeOpt + type FeeSchedule struct + Add string + Cross string + ReferralDiscount string + Tiers Tiers + type Fill struct + BuilderFee string + ClosedPnl string + Coin string + Crossed bool + Dir string + Fee string + FeeToken string + Hash string + Oid int64 + Price string + Side string + Size string + StartPosition string + Tid int64 + Time int64 + type FillLiquidation struct + LiquidatedUser *string + MarkPx string + Method string + type FrontendOpenOrder struct + Coin string + IsPositionTpSl bool + IsTrigger bool + LimitPx float64 + Oid int64 + OrderType string + OrigSz float64 + ReduceOnly bool + Side OrderSide + Sz float64 + Timestamp int64 + TriggerCondition string + TriggerPx float64 + type FundingHistory struct + Coin string + FundingRate string + Premium string + Time int64 + type Grouping string + const GroupingNA + const GroupingNormalTpsl + const GroupingPositionTpls + type HaltTrading struct + Coin string + IsHalted bool + type Handler func(wsMessage) (T, error) + type Info struct + func NewInfo(ctx context.Context, baseURL string, skipWS bool, meta *Meta, ...) *Info + func NewInfoGoop(ctx context.Context, baseURL string) *Info + func NewInfoGoopDebug(ctx context.Context, baseURL string) *Info + func (i *Info) AllMids(ctx context.Context, dex ...string) (map[string]string, error) + func (i *Info) AllMidsGoop(ctx context.Context) (map[string]string, error) + func (i *Info) AllPerpMetas(ctx context.Context) ([]*Meta, error) + func (i *Info) CandlesSnapshot(ctx context.Context, name, interval string, startTime, endTime int64) ([]Candle, error) + func (i *Info) CoinToAsset(coin string) (int, bool) + func (i *Info) FrontendOpenOrders(ctx context.Context, address string, dex ...string) ([]FrontendOpenOrder, error) + func (i *Info) FundingHistory(ctx context.Context, name string, startTime int64, endTime *int64) ([]FundingHistory, error) + func (i *Info) HistoricalOrders(ctx context.Context, address string) ([]OrderQueryResponse, error) + func (i *Info) L2Snapshot(ctx context.Context, name string) (*L2Book, error) + func (i *Info) Meta(ctx context.Context, dex ...string) (*Meta, error) + func (i *Info) MetaAndAssetCtxs(ctx context.Context, params MetaAndAssetCtxsParams) (*MetaAndAssetCtxs, error) + func (i *Info) MetaGoop(ctx context.Context) (*Meta, error) + func (i *Info) OpenOrders(ctx context.Context, address string, dex ...string) ([]OpenOrder, error) + func (i *Info) PerpDeployAuctionStatus(ctx context.Context) (*PerpDeployAuctionStatus, error) + func (i *Info) PerpDexLimits(ctx context.Context, dex string) (*PerpDexLimits, error) + func (i *Info) PerpDexStatus(ctx context.Context, dex string) (*PerpDexStatus, error) + func (i *Info) PerpDexs(ctx context.Context) (MixedArray, error) + func (i *Info) Portfolio(ctx context.Context, user string) ([]Portfolio, error) + func (i *Info) QueryOrderByCloid(ctx context.Context, user, cloid string) (*OrderQueryResult, error) + func (i *Info) QueryOrderByOid(ctx context.Context, user string, oid int64) (*OrderQueryResult, error) + func (i *Info) QueryReferralState(ctx context.Context, user string) (*ReferralState, error) + func (i *Info) QuerySubAccounts(ctx context.Context, user string) ([]SubAccount, error) + func (i *Info) QueryUserAbstractionState(ctx context.Context, user string) (string, error) + func (i *Info) QueryUserDexAbstractionState(ctx context.Context, user string) (string, error) + func (i *Info) QueryUserToMultiSigSigners(ctx context.Context, multiSigUser string) ([]MultiSigSigner, error) + func (i *Info) QueryUserVaultEquities(ctx context.Context, user string) ([]VaultEquity, error) + func (i *Info) QueryVaultDetails(ctx context.Context, VaultAddress string, user string) (*VaultDetails, error) + func (i *Info) SpotMeta(ctx context.Context) (*SpotMeta, error) + func (i *Info) SpotMetaAndAssetCtxs(ctx context.Context) (*SpotMetaAndAssetCtxs, error) + func (i *Info) SpotUserState(ctx context.Context, address string) (*SpotUserState, error) + func (i *Info) TokenDetails(ctx context.Context, tokenId string) (*TokenDetail, error) + func (i *Info) UserActiveAssetData(ctx context.Context, address string, coin string) (*UserActiveAssetData, error) + func (i *Info) UserFees(ctx context.Context, address string) (*UserFees, error) + func (i *Info) UserFills(ctx context.Context, params UserFillsParams) ([]Fill, error) + func (i *Info) UserFillsByTime(ctx context.Context, address string, startTime int64, endTime *int64, ...) ([]Fill, error) + func (i *Info) UserFundingHistory(ctx context.Context, user string, startTime int64, endTime *int64) ([]UserFundingHistory, error) + func (i *Info) UserNonFundingLedgerUpdates(ctx context.Context, user string, startTime int64, endTime *int64) ([]UserNonFundingLedgerUpdates, error) + func (i *Info) UserStakingDelegations(ctx context.Context, address string) ([]StakingDelegation, error) + func (i *Info) UserStakingRewards(ctx context.Context, address string) ([]StakingReward, error) + func (i *Info) UserStakingSummary(ctx context.Context, address string) (*StakingSummary, error) + func (i *Info) UserState(ctx context.Context, address string, dex ...string) (*UserState, error) + type InfoOpt = Opt[Info] + func InfoOptClientOptions(opts ...ClientOpt) InfoOpt + func InfoOptDebugMode() InfoOpt + func InfoOptPerpDexName(dex string) InfoOpt + type L1ActionSigner interface + SignL1Action func(ctx context.Context, action any, vaultAddress string, timestamp int64, ...) (SignatureResult, error) + func ECDSAL1Signer(pk *ecdsa.PrivateKey) L1ActionSigner + type L2Book struct + Coin string + Levels [][]Level + Time int64 + func (c L2Book) Key() string + type L2BookSubscriptionParams struct + Coin string + Fast bool + Mantissa int + NSigFigs int + type LeadingVault struct + Address string + Name string + type LedgerDelta struct + Destination string + DestinationDex string + Fee string + SourceDex string + Token string + Type string + USDC string + UsdcValue string + User string + type Level struct + N int + Px float64 + Sz float64 + type Leverage struct + RawUsd *string + Type string + Value int + type LimitOrderType struct + Tif Tif + type MMTier struct + Add string + MakerFractionCutoff string + type MarginSummary struct + AccountValue string + TotalMarginUsed string + TotalNtlPos string + TotalRawUsd string + type MarginTable struct + Description string + ID int + MarginTiers []MarginTier + type MarginTier struct + LowerBound string + MaxLeverage int + type Meta struct + CollateralToken int + MarginTables []MarginTable + Universe []AssetInfo + type MetaAndAssetCtxs struct + Ctxs []AssetCtx + type MetaAndAssetCtxsParams struct + Dex *string + type MixedArray []MixedValue + func (ma *MixedArray) UnmarshalJSON(data []byte) error + func (ma MixedArray) FirstError() error + type MixedValue json.RawMessage + func (mv *MixedValue) Array() ([]json.RawMessage, bool) + func (mv *MixedValue) Object() (map[string]any, bool) + func (mv *MixedValue) Parse(v any) error + func (mv *MixedValue) String() (string, bool) + func (mv *MixedValue) Type() string + func (mv *MixedValue) UnmarshalJSON(data []byte) error + func (mv MixedValue) MarshalJSON() ([]byte, error) + type ModifyAction struct + Dex string + Oid any + Order OrderWire + Type string + type ModifyOrderRequest struct + Cloid *Cloid + Oid *int64 + Order CreateOrderRequest + type ModifyResponse struct + Data []OrderStatus + Error string + Status string + type MultiSigAction struct + Action map[string]any + Signatures []string + Signers []string + Type string + type MultiSigConversionResponse struct + Error string + Status string + TxHash string + type MultiSigResponse struct + Error string + Status string + TxHash string + type MultiSigSigner struct + Threshold int + User string + type Notification struct + Notification string + func (n Notification) Key() string + type NotificationSubscriptionParams struct + User string + type OpenOrder struct + Cloid *string + Coin string + LimitPx float64 + Oid int64 + OrigSz float64 + Side string + Size float64 + Timestamp int64 + type OpenOrders struct + Dex string + Orders []WsBasicOrder + User string + func (o OpenOrders) Key() string + type OpenOrdersSubscriptionParams struct + Dex *string + User string + type Opt func(*T) + func (o Opt[T]) Apply(opt *T) + type OrderAction struct + Builder *BuilderInfo + Dex string + Grouping string + Orders []OrderWire + Type string + type OrderFillsSubscriptionParams struct + User string + type OrderQueryResponse struct + Order QueriedOrder + Status OrderStatusValue + StatusTimestamp int64 + type OrderQueryResult struct + Order OrderQueryResponse + Status OrderQueryStatus + type OrderQueryStatus string + const OrderQueryStatusError + const OrderQueryStatusSuccess + type OrderResponse struct + Statuses []OrderStatus + type OrderSide string + const OrderSideAsk + const OrderSideBid + type OrderStatus struct + Error *string + Filled *OrderStatusFilled + Resting *OrderStatusResting + func (s *OrderStatus) String() string + type OrderStatusFilled struct + AvgPx string + Oid int + TotalSz string + type OrderStatusResting struct + ClientID *string + Oid int64 + Status string + type OrderStatusValue string + const OrderStatusValueBadAloPxRejected + const OrderStatusValueBadTriggerPxRejected + const OrderStatusValueCanceled + const OrderStatusValueDelistedCanceled + const OrderStatusValueFilled + const OrderStatusValueInsufficientSpotBalanceRejected + const OrderStatusValueIocCancelRejected + const OrderStatusValueLiquidatedCanceled + const OrderStatusValueMarginCanceled + const OrderStatusValueMarketOrderNoLiquidityRejected + const OrderStatusValueMinTradeNtlRejected + const OrderStatusValueOpen + const OrderStatusValueOpenInterestCapCanceled + const OrderStatusValueOpenInterestIncreaseRejected + const OrderStatusValueOracleRejected + const OrderStatusValuePerpMarginRejected + const OrderStatusValuePerpMaxPositionRejected + const OrderStatusValuePositionFlipAtOpenInterestCapRejected + const OrderStatusValuePositionIncreaseAtOpenInterestCapRejected + const OrderStatusValueReduceOnlyCanceled + const OrderStatusValueReduceOnlyRejected + const OrderStatusValueRejected + const OrderStatusValueScheduledCancel + const OrderStatusValueSelfTradeCanceled + const OrderStatusValueSiblingFilledCanceled + const OrderStatusValueTickRejected + const OrderStatusValueTooAggressiveAtOpenInterestCapRejected + const OrderStatusValueTriggered + const OrderStatusValueVaultWithdrawalCanceled + type OrderType struct + Limit *LimitOrderType + Trigger *TriggerOrderType + type OrderUpdatesSubscriptionParams struct + User string + type OrderWire struct + Asset int + Cloid *string + IsBuy bool + LimitPx string + OrderType OrderWireType + ReduceOnly bool + Size string + type OrderWireType struct + Limit *OrderWireTypeLimit + Trigger *OrderWireTypeTrigger + type OrderWireTypeLimit struct + Tif Tif + type OrderWireTypeTrigger struct + IsMarket bool + Tpsl Tpsl + TriggerPx string + type PerpDeployAuctionStatus struct + CurrentGas string + DurationSeconds int64 + EndGas *string + StartGas string + StartTimeSeconds int64 + type PerpDeployHaltTradingAction struct + HaltTrading HaltTrading + Type string + type PerpDeployRegisterAsset2Action struct + RegisterAsset2 RegisterAsset2 + Type string + type PerpDeployRegisterAssetAction struct + RegisterAsset RegisterAsset + Type string + type PerpDeployResponse struct + Data struct{ ... } + Response json.RawMessage + Status string + type PerpDeploySetOracleAction struct + SetOracle SetOracle + Type string + type PerpDex struct + AssetToFundingMultiplier [][]string + AssetToStreamingOiCap [][]string + Deployer string + FeeRecipient *string + FullName string + Name string + OracleUpdater *string + type PerpDexClassTransferAction struct + Amount float64 + Dex string + ToPerp bool + Token string + Type string + type PerpDexLimits struct + CoinToOiCap [][]string + MaxTransferNtl string + OiSzCapPerPerp string + TotalOiCap string + type PerpDexSchemaInput struct + CollateralToken int + FullName string + OracleUpdater *string + type PerpDexState struct + LeadingVaults *[]LeadingVault + PerpsAtOpenInterestCap *[]string + TotalVaultEquity float64 + type PerpDexStatus struct + TotalNetDeposit string + type Portfolio []MixedValue + type Position struct + Coin string + CumFunding *CumFunding + EntryPx *string + Leverage Leverage + LiquidationPx *string + MarginUsed string + PositionValue string + ReturnOnEquity string + Szi string + UnrealizedPnl string + type QueriedOrder struct + Children []QueriedOrder + Cloid *string + Coin string + IsPositionTpsl bool + IsTrigger bool + LimitPx string + Oid int64 + OrderType string + OrigSz string + ReduceOnly bool + Side OrderSide + Sz string + Tif Tif + Timestamp int64 + TriggerCondition string + TriggerPx string + type ReferralState struct + ReferralCode string + Referred []string + Referrer string + type RegisterAsset struct + AssetRequest AssetRequest + Dex string + MaxGas *int + Schema *RegisterAssetSchema + type RegisterAsset2 struct + AssetRequest AssetRequest2 + Dex string + MaxGas *int + Schema *RegisterAssetSchema + type RegisterAssetSchema struct + CollateralToken int + FullName string + OracleUpdater *string + type ReserveRequestWeightAction struct + Type string + Weight int + type ReserveRequestWeightResponse struct + Error string + Response *ReserveResponseData + Status string + type ReserveResponseData struct + Type string + type ScheduleCancelAction struct + Time *int64 + Type string + type ScheduleCancelResponse struct + Error string + Status string + type SetOracle struct + Dex string + ExternalPerpPxs [][]string + MarkPxs [][][]string + OraclePxs [][]string + type SetReferrerAction struct + Code string + Type string + type SetReferrerResponse struct + Error string + Status string + type SharedAssetCtx struct + CirculatingSupply float64 + DayNtlVlm float64 + Funding float64 + MarkPx float64 + MidPx float64 + OpenInterest float64 + OraclePx float64 + PrevDayPx float64 + type Side string + const SideAsk + const SideBid + type SignatureResult struct + R string + S string + V int + func SignAgent(privateKey *ecdsa.PrivateKey, agentAddress, agentName string, nonce int64, ...) (SignatureResult, error) + func SignApproveBuilderFee(privateKey *ecdsa.PrivateKey, builderAddress string, maxFeeRate float64, ...) (SignatureResult, error) + func SignConvertToMultiSigUserAction(privateKey *ecdsa.PrivateKey, signers []string, threshold int, timestamp int64, ...) (SignatureResult, error) + func SignL1Action(privateKey *ecdsa.PrivateKey, action any, vaultAddress string, timestamp int64, ...) (SignatureResult, error) + func SignMultiSigAction(privateKey *ecdsa.PrivateKey, innerAction map[string]any, signers []string, ...) (SignatureResult, error) + func SignPerpDexClassTransferAction(privateKey *ecdsa.PrivateKey, dex, token string, amount float64, toPerp bool, ...) (SignatureResult, error) + func SignSpotTransferAction(privateKey *ecdsa.PrivateKey, amount float64, destination, token string, ...) (SignatureResult, error) + func SignTokenDelegateAction(privateKey *ecdsa.PrivateKey, token string, amount float64, ...) (SignatureResult, error) + func SignUsdClassTransferAction(privateKey *ecdsa.PrivateKey, amount float64, toPerp bool, timestamp int64, ...) (SignatureResult, error) + func SignUsdTransferAction(privateKey *ecdsa.PrivateKey, amount float64, destination string, ...) (SignatureResult, error) + func SignUserSignedAction(privateKey *ecdsa.PrivateKey, action map[string]any, ...) (SignatureResult, error) + func SignWithdrawFromBridgeAction(privateKey *ecdsa.PrivateKey, destination string, amount, fee float64, ...) (SignatureResult, error) + type SpotAssetCtx struct + CirculatingSupply string + Coin string + DayNtlVlm string + MarkPx string + MidPx *string + PrevDayPx string + type SpotAssetInfo struct + Index int + IsCanonical bool + Name string + Tokens []int + type SpotBalance struct + Coin string + EntryNtl string + Hold string + Token int + Total string + type SpotDeployResponse struct + Error string + Status string + TxHash string + type SpotMeta struct + Tokens []SpotTokenInfo + Universe []SpotAssetInfo + type SpotMetaAndAssetCtxs struct + Ctxs []SpotAssetCtx + Meta SpotMeta + type SpotState struct + Balances []SpotBalance + type SpotTokenInfo struct + EvmContract *EvmContract + FullName *string + Index int + IsCanonical bool + Name string + SzDecimals int + TokenID string + WeiDecimals int + type SpotTransferAction struct + Amount string + Destination string + Time int64 + Token string + Type string + type SpotUserState struct + Balances []SpotBalance + type StakingDelegation struct + Amount string + LockedUntilTimestamp int64 + Validator string + type StakingReward struct + Source string + Time int64 + TotalAmount string + type StakingSummary struct + Delegated string + NPendingWithdrawals int + TotalPendingWithdrawal string + Undelegated string + type SubAccount struct + Name string + Permissions []string + User string + type SubAccountSpotTransferAction struct + Amount float64 + IsDeposit bool + SubAccountUser string + Token string + Type string + type SubAccountTransferAction struct + IsDeposit bool + SubAccountUser string + Type string + Usd int + type Subscription struct + Close func() + ID string + Payload any + type Tiers struct + MM []MMTier + VIP []VIPTier + type Tif string + const TifAlo + const TifGtc + const TifIoc + type TokenDelegateAction struct + IsUndelegate bool + Nonce int64 + Type string + Validator string + Wei int + type TokenDetail struct + CirculatingSupply string + DeployGas *string + DeployTime *string + Deployer *string + FutureEmissions string + Genesis *TokenDetailGenesis + MarkPx string + MaxSupply string + MidPx string + Name string + NonCirculatingUserBalances [][]string + PrevDayPx string + SeededUsdc string + SzDecimals int + TotalSupply string + WeiDecimals int + type TokenDetailGenesis struct + ExistingTokenBalances []MixedArray + UserBalances [][]string + type Tpsl string + const StopLoss + const TakeProfit + type Trade struct + Coin string + Hash string + Px string + Side string + Sz string + Tid int64 + Time int64 + Users []string + type Trades []Trade + func (t Trades) Key() string + type TradesSubscriptionParams struct + Coin string + type TransferResponse struct + Error string + Status string + TxHash string + type TriggerOrderType struct + IsMarket bool + Tpsl Tpsl + TriggerPx float64 + type Tuple2 struct + First E1 + Second E2 + func (t *Tuple2[E1, E2]) UnmarshalJSON(data []byte) error + func (t Tuple2[E1, E2]) MarshalJSON() ([]byte, error) + type TwapState struct + Coin string + ExecutedNtl float64 + ExecutedSz float64 + Minutes int + Randomize bool + ReduceOnly bool + Side string + Sz float64 + Timestamp int64 + User string + type TwapStates struct + Dex string + States []Tuple2[int, TwapState] + User string + func (t TwapStates) Key() string + type TwapStatesSubscriptionParams struct + Dex *string + User string + type TxStatus struct + Coin string + Status string + type UpdateIsolatedMarginAction struct + Asset int + IsBuy bool + Ntli float64 + Type string + type UpdateLeverageAction struct + Asset int + IsCross bool + Leverage int + Type string + type UsdClassTransferAction struct + Amount string + Nonce int64 + ToPerp bool + Type string + type UsdTransferAction struct + Amount string + Destination string + Time int64 + Type string + type UseBigBlocksAction struct + Type string + UsingBigBlocks bool + type UserActiveAssetData struct + AvailableToTrade []string + Coin string + Leverage Leverage + MarkPx string + MaxTradeSzs []string + User string + type UserFees struct + ActiveReferralDiscount string + DailyUserVolume []UserVolume + FeeSchedule FeeSchedule + UserAddRate string + UserCrossRate string + UserSpotAddRate string + UserSpotCrossRate string + type UserFillsParams struct + Address string + AggregateByTime *bool + type UserFundingHistory struct + Delta Delta + Hash string + Time int64 + type UserNonFundingLedgerUpdates struct + Delta LedgerDelta + Hash string + Time int64 + type UserSignedActionSigner interface + SignUserSignedAction func(ctx context.Context, action map[string]any, payloadTypes []apitypes.Type, ...) (SignatureResult, error) + func ECDSAUserSignedSigner(pk *ecdsa.PrivateKey) UserSignedActionSigner + type UserState struct + AssetPositions []AssetPosition + CrossMarginSummary MarginSummary + MarginSummary MarginSummary + Withdrawable string + type UserVolume struct + Date string + Exchange string + UserAdd string + UserCross string + type VIPTier struct + Add string + Cross string + NtlCutoff string + type ValidationError struct + Field string + Message string + func (e ValidationError) Error() string + type ValidatorResponse struct + Error string + Status string + TxHash string + type VaultDetails struct + AllowDeposits bool + AlwaysCloseOnWithdraw bool + Apr float64 + Description string + FollowerState json.RawMessage + Followers []VaultFollower + IsClosed bool + Leader string + LeaderCommission float64 + LeaderFraction float64 + MaxDistributable float64 + MaxWithdrawable float64 + Name string + Portfolio Portfolio + Relationship *VaultRelationship + VaultAddress string + type VaultDistributeAction struct + Type string + Usd int + VaultAddress string + type VaultEquity struct + Equity string + LockedUntilTimestamp int64 + VaultAddress string + type VaultFollower struct + AllTimePnl string + DaysFollowing int + LockupUntil int64 + Pnl string + User string + VaultEntryTime int64 + VaultEquity string + type VaultModifyAction struct + AllowDeposits bool + AlwaysCloseOnWithdraw bool + Type string + VaultAddress string + type VaultRelationship struct + Data struct{ ... } + Type string + type VaultUsdTransferAction struct + IsDeposit bool + Type string + Usd int + VaultAddress string + type WebData2 struct + AgentAddress *string + AgentValidUntil *int64 + AssetCtxs []AssetCtx + ClearinghouseState *ClearinghouseState + CumLedger string + IsVault bool + LeadingVaults []any + Meta *WebData2Meta + OpenOrders []WsBasicOrder + PerpsAtOpenInterestCap []string + ServerTime int64 + SpotAssetCtxs []SpotAssetCtx + SpotState *SpotState + TotalVaultEquity string + TwapStates []any + User string + func (w WebData2) Key() string + type WebData2AssetInfo struct + IsDelisted bool + MarginTableID int + MaxLeverage int + Name string + OnlyIsolated bool + SzDecimals int + type WebData2MarginTable struct + Description string + MarginTiers []WebData2MarginTier + type WebData2MarginTier struct + LowerBound string + MaxLeverage int + type WebData2Meta struct + MarginTables []Tuple2[int, WebData2MarginTable] + Universe []WebData2AssetInfo + type WebData2SubscriptionParams struct + User string + type WebData3 struct + PerpDexStates []PerpDexState + UserState WebData3UserState + func (w WebData3) Key() string + type WebData3SubscriptionParams struct + Dex *string + User string + type WebData3UserState struct + AgentAddress *string + AgentValidUntil *int64 + CumLedger float64 + DexAbstractionEnabled *bool + IsVault bool + OptOutOfSpotDusting *bool + ServerTime int64 + User string + type WebsocketClient struct + func NewWebsocketClient(baseURL string, opts ...WsOpt) *WebsocketClient + func NewWebsocketClientGoop(baseURL string) *WebsocketClient + func (w *WebsocketClient) ActiveAssetCtx(params ActiveAssetCtxSubscriptionParams, callback func(ActiveAssetCtx, error)) (*Subscription, error) + func (w *WebsocketClient) AllMids(params AllMidsSubscriptionParams, callback func(AllMids, error)) (*Subscription, error) + func (w *WebsocketClient) Bbo(params BboSubscriptionParams, callback func(Bbo, error)) (*Subscription, error) + func (w *WebsocketClient) Candles(params CandlesSubscriptionParams, callback func(Candle, error)) (*Subscription, error) + func (w *WebsocketClient) ClearinghouseState(params ClearinghouseStateSubscriptionParams, ...) (*Subscription, error) + func (w *WebsocketClient) Close() error + func (w *WebsocketClient) Connect(ctx context.Context) error + func (w *WebsocketClient) L2Book(params L2BookSubscriptionParams, callback func(L2Book, error)) (*Subscription, error) + func (w *WebsocketClient) Notification(params NotificationSubscriptionParams, callback func(Notification, error)) (*Subscription, error) + func (w *WebsocketClient) OpenOrders(params OpenOrdersSubscriptionParams, callback func(OpenOrders, error)) (*Subscription, error) + func (w *WebsocketClient) OrderFills(params OrderFillsSubscriptionParams, callback func(WsOrderFills, error)) (*Subscription, error) + func (w *WebsocketClient) OrderUpdates(params OrderUpdatesSubscriptionParams, callback func([]WsOrder, error)) (*Subscription, error) + func (w *WebsocketClient) Trades(params TradesSubscriptionParams, callback func([]Trade, error)) (*Subscription, error) + func (w *WebsocketClient) TwapStates(params TwapStatesSubscriptionParams, callback func(TwapStates, error)) (*Subscription, error) + func (w *WebsocketClient) WebData2(params WebData2SubscriptionParams, callback func(WebData2, error)) (*Subscription, error) + func (w *WebsocketClient) WebData3(params WebData3SubscriptionParams, callback func(WebData3, error)) (*Subscription, error) + type WithdrawFromBridgeAction struct + Amount string + Destination string + Time int64 + Type string + type WsBasicOrder struct + Cloid *string + Coin string + LimitPx string + Oid int64 + OrigSz string + Side string + Sz string + Timestamp int64 + type WsMsg struct + Channel string + Data map[string]any + type WsOpt = Opt[WebsocketClient] + func WsOptDebugMode() WsOpt + func WsOptDialer(dialer *websocket.Dialer) WsOpt + func WsOptReadTimeout(timeout time.Duration) WsOpt + type WsOrder struct + Order WsBasicOrder + Status OrderStatusValue + StatusTimestamp int64 + type WsOrderFill struct + BuilderFee *string + ClosedPnl string + Coin string + Crossed bool + Dir string + Fee string + FeeToken string + Hash string + Liquidation *FillLiquidation + Oid int64 + Px string + Side string + StartPosition string + Sz string + Tid int64 + Time int64 + type WsOrderFills struct + Fills []WsOrderFill + IsSnapshot bool + User string + func (w WsOrderFills) Key() string + type WsOrders []WsOrder + func (w WsOrders) Key() string