Documentation
¶
Overview ¶
Package hyperliquid provides a Go client library for the Hyperliquid exchange API. It includes support for both REST API and WebSocket connections, allowing users to access market data, manage orders, and handle user account operations.
Index ¶
- Constants
- func FloatToUsdInt(value float64) int
- func GetTimestampMs() int64
- func IsWalletDoesNotExistError(err error) bool
- func NewMsgDispatcher[T subscriptable](channel string) msgDispatcher
- func NewNoopDispatcher() msgDispatcher
- func NewPongDispatcher() msgDispatcher
- type APIError
- type APIResponse
- type ActiveAssetCtx
- type ActiveAssetCtxSubscriptionParams
- type AgentApprovalResponse
- type AllMids
- type AllMidsSubscriptionParams
- type ApprovalResponse
- type ApproveAgentAction
- type ApproveBuilderFeeAction
- type AssetCtx
- type AssetInfo
- type AssetPosition
- type BatchModifyAction
- type Bbo
- type BboSubscriptionParams
- type BuilderInfo
- type BulkCancelResponse
- type BulkOrderResponse
- type CancelAction
- type CancelByCloidAction
- type CancelByCloidRequest
- type CancelByCloidWire
- type CancelOrderRequest
- type CancelOrderRequestByCloid
- type CancelOrderResponse
- type CancelOrderWire
- type CancelRequest
- type CancelResponse
- type Candle
- type CandlesSubscriptionParams
- type ClearinghouseState
- type ClientOpt
- type Cloid
- type ConvertToMultiSigUserAction
- type CreateOrderRequest
- type CreateSubAccountAction
- type CreateSubAccountResponse
- type CreateVaultAction
- type CreateVaultResponse
- type EvmContract
- type 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) PerpDeployRegisterAsset(ctx context.Context, asset string, perpDexInput PerpDexSchemaInput) (*PerpDeployResponse, error)
- func (e *Exchange) PerpDeploySetOracle(ctx context.Context, asset string, oracleAddress string) (*SpotDeployResponse, error)
- func (e *Exchange) PerpDexClassTransfer(ctx context.Context, dex, token string, amount float64, toPerp bool) (*TransferResponse, error)
- func (e *Exchange) ScheduleCancel(ctx context.Context, scheduleTime *int64) (*ScheduleCancelResponse, 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) 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
- type FeeSchedule
- type Fill
- type FillLiquidation
- type FrontendOpenOrder
- type FundingHistory
- type Grouping
- type Handler
- type Info
- func (i *Info) AllMids(ctx context.Context) (map[string]string, error)
- func (i *Info) CandlesSnapshot(ctx context.Context, name, interval string, startTime, endTime int64) ([]Candle, error)
- func (i *Info) FrontendOpenOrders(ctx context.Context, address 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) (*Meta, error)
- func (i *Info) MetaAndAssetCtxs(ctx context.Context) (*MetaAndAssetCtxs, error)
- func (i *Info) NameToAsset(name string) int
- func (i *Info) OpenOrders(ctx context.Context, address string) ([]OpenOrder, error)
- func (i *Info) PerpDexs(ctx context.Context) ([]string, 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) QueryUserToMultiSigSigners(ctx context.Context, multiSigUser string) ([]MultiSigSigner, 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) 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, address string) ([]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) 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) (*UserState, error)
- type InfoOpt
- type L2Book
- type L2BookSubscriptionParams
- type Level
- type Leverage
- type LimitOrderType
- type MMTier
- type MarginSummary
- type MarginTable
- type MarginTier
- type Meta
- type MetaAndAssetCtxs
- type MixedArray
- type MixedValue
- func (mv *MixedValue) Array() ([]json.RawMessage, bool)
- func (mv MixedValue) MarshalJSON() ([]byte, error)
- 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
- type ModifyAction
- type ModifyOrderRequest
- type ModifyResponse
- type MultiSigAction
- type MultiSigConversionResponse
- type MultiSigResponse
- type MultiSigSigner
- type Notification
- type NotificationSubscriptionParams
- type OpenOrder
- type Opt
- type OrderAction
- type OrderFillsSubscriptionParams
- type OrderQueryResponse
- type OrderQueryResult
- type OrderQueryStatus
- type OrderResponse
- type OrderSide
- type OrderStatus
- type OrderStatusFilled
- type OrderStatusResting
- type OrderStatusValue
- type OrderType
- type OrderUpdatesSubscriptionParams
- type OrderWire
- type OrderWireType
- type OrderWireTypeLimit
- type OrderWireTypeTrigger
- type PerpDeployResponse
- type PerpDexClassTransferAction
- type PerpDexSchemaInput
- type Position
- type QueriedOrder
- type ReferralState
- type ScheduleCancelAction
- type ScheduleCancelResponse
- type SetReferrerAction
- type SetReferrerResponse
- type SharedAssetCtx
- type Side
- type SignatureResult
- 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
- type SpotAssetInfo
- type SpotBalance
- type SpotDeployResponse
- type SpotMeta
- type SpotMetaAndAssetCtxs
- type SpotState
- type SpotTokenInfo
- type SpotTransferAction
- type SpotUserState
- type StakingDelegation
- type StakingReward
- type StakingSummary
- type SubAccount
- type SubAccountSpotTransferAction
- type SubAccountTransferAction
- type Subscription
- type Tiers
- type Tif
- type TokenDelegateAction
- type Tpsl
- type Trade
- type Trades
- type TradesSubscriptionParams
- type TransferResponse
- type TriggerOrderType
- type Tuple2
- type TxStatus
- type UpdateIsolatedMarginAction
- type UpdateLeverageAction
- type UsdClassTransferAction
- type UsdTransferAction
- type UseBigBlocksAction
- type UserActiveAssetData
- type UserFees
- type UserFundingHistory
- type UserState
- type UserVolume
- type VIPTier
- type ValidationError
- type ValidatorResponse
- type VaultDistributeAction
- type VaultModifyAction
- type VaultUsdTransferAction
- type WebData2
- type WebData2AssetInfo
- type WebData2MarginTable
- type WebData2MarginTier
- type WebData2Meta
- type WebData2SubscriptionParams
- type 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) 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) 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) WebData2(params WebData2SubscriptionParams, callback func(WebData2, error)) (*Subscription, error)
- type WithdrawFromBridgeAction
- type WsBasicOrder
- type WsMsg
- type WsOpt
- type WsOrder
- type WsOrderFill
- type WsOrderFills
- type WsOrders
Constants ¶
const ( MainnetAPIURL = "https://api.hyperliquid.xyz" TestnetAPIURL = "https://api.hyperliquid-testnet.xyz" LocalAPIURL = "http://localhost:3001" )
const ( ChannelPong string = "pong" ChannelTrades string = "trades" ChannelActiveAssetCtx string = "activeAssetCtx" ChannelL2Book string = "l2Book" ChannelCandle string = "candle" ChannelAllMids string = "allMids" ChannelNotification string = "notification" ChannelOrderUpdates string = "orderUpdates" ChannelUserFills string = "userFills" ChannelWebData2 string = "webData2" ChannelBbo string = "bbo" ChannelSubResponse string = "subscriptionResponse" )
const (
DefaultSlippage = 0.05 // 5%
)
Constants for default values
Variables ¶
This section is empty.
Functions ¶
func FloatToUsdInt ¶
FloatToUsdInt converts float to USD integer representation
func GetTimestampMs ¶
func GetTimestampMs() int64
GetTimestampMs returns current timestamp in milliseconds
func IsWalletDoesNotExistError ¶
IsWalletDoesNotExistError checks if the error is a "wallet does not exist" error from the API
func NewMsgDispatcher ¶
func NewMsgDispatcher[T subscriptable](channel string) msgDispatcher
func NewNoopDispatcher ¶
func NewNoopDispatcher() msgDispatcher
func NewPongDispatcher ¶
func NewPongDispatcher() msgDispatcher
Types ¶
type APIError ¶
type APIError struct {
Code int `json:"code"`
Message string `json:"msg"`
Data any `json:"data,omitempty"`
}
func (APIError) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (APIError) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*APIError) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*APIError) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type APIResponse ¶
func (*APIResponse[T]) UnmarshalJSON ¶
func (r *APIResponse[T]) UnmarshalJSON(data []byte) error
type ActiveAssetCtx ¶
type ActiveAssetCtx struct {
Coin string `json:"coin"`
Ctx SharedAssetCtx `json:"ctx"`
}
func (ActiveAssetCtx) Key ¶
func (a ActiveAssetCtx) Key() string
func (ActiveAssetCtx) MarshalEasyJSON ¶
func (v ActiveAssetCtx) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ActiveAssetCtx) MarshalJSON ¶
func (v ActiveAssetCtx) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ActiveAssetCtx) UnmarshalEasyJSON ¶
func (v *ActiveAssetCtx) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ActiveAssetCtx) UnmarshalJSON ¶
func (v *ActiveAssetCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ActiveAssetCtxSubscriptionParams ¶
type ActiveAssetCtxSubscriptionParams struct {
Coin string
}
type AgentApprovalResponse ¶
type AgentApprovalResponse struct {
Status string `json:"status"`
TxHash string `json:"txHash,omitempty"`
Error string `json:"error,omitempty"`
}
func (AgentApprovalResponse) MarshalEasyJSON ¶
func (v AgentApprovalResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AgentApprovalResponse) MarshalJSON ¶
func (v AgentApprovalResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AgentApprovalResponse) UnmarshalEasyJSON ¶
func (v *AgentApprovalResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AgentApprovalResponse) UnmarshalJSON ¶
func (v *AgentApprovalResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AllMids ¶
func (AllMids) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (AllMids) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*AllMids) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AllMids) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type AllMidsSubscriptionParams ¶
type AllMidsSubscriptionParams struct {
Dex *string
}
type ApprovalResponse ¶
type ApprovalResponse struct {
Status string `json:"status"`
TxHash string `json:"txHash,omitempty"`
Error string `json:"error,omitempty"`
}
func (ApprovalResponse) MarshalEasyJSON ¶
func (v ApprovalResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ApprovalResponse) MarshalJSON ¶
func (v ApprovalResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ApprovalResponse) UnmarshalEasyJSON ¶
func (v *ApprovalResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ApprovalResponse) UnmarshalJSON ¶
func (v *ApprovalResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ApproveAgentAction ¶
type ApproveAgentAction struct {
Type string `json:"type" msgpack:"type"`
SignatureChainId string `json:"signatureChainId" msgpack:"signatureChainId"`
HyperliquidChain string `json:"hyperliquidChain" msgpack:"hyperliquidChain"`
AgentAddress string `json:"agentAddress" msgpack:"agentAddress"`
AgentName *string `json:"agentName,omitempty" msgpack:"agentName,omitempty"`
Nonce int64 `json:"nonce" msgpack:"nonce"`
}
ApproveAgentAction represents approve agent action
func (ApproveAgentAction) MarshalEasyJSON ¶
func (v ApproveAgentAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ApproveAgentAction) MarshalJSON ¶
func (v ApproveAgentAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ApproveAgentAction) UnmarshalEasyJSON ¶
func (v *ApproveAgentAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ApproveAgentAction) UnmarshalJSON ¶
func (v *ApproveAgentAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ApproveBuilderFeeAction ¶
type ApproveBuilderFeeAction struct {
Type string `json:"type" msgpack:"type"`
Builder string `json:"builder" msgpack:"builder"`
MaxFeeRate string `json:"maxFeeRate" msgpack:"maxFeeRate"`
Nonce int64 `json:"nonce" msgpack:"nonce"`
}
ApproveBuilderFeeAction represents approve builder fee action
func (ApproveBuilderFeeAction) MarshalEasyJSON ¶
func (v ApproveBuilderFeeAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ApproveBuilderFeeAction) MarshalJSON ¶
func (v ApproveBuilderFeeAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ApproveBuilderFeeAction) UnmarshalEasyJSON ¶
func (v *ApproveBuilderFeeAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ApproveBuilderFeeAction) UnmarshalJSON ¶
func (v *ApproveBuilderFeeAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AssetCtx ¶
type AssetCtx struct {
Funding string `json:"funding"`
OpenInterest string `json:"openInterest"`
PrevDayPx string `json:"prevDayPx"`
DayNtlVlm string `json:"dayNtlVlm"`
Premium string `json:"premium"`
OraclePx string `json:"oraclePx"`
MarkPx string `json:"markPx"`
MidPx string `json:"midPx,omitempty"`
ImpactPxs []string `json:"impactPxs"`
DayBaseVlm string `json:"dayBaseVlm,omitempty"`
}
func (AssetCtx) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (AssetCtx) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*AssetCtx) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AssetCtx) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type AssetInfo ¶
type AssetInfo struct {
Name string `json:"name"`
SzDecimals int `json:"szDecimals"`
MaxLeverage int `json:"maxLeverage"`
MarginTableId int `json:"marginTableId"`
OnlyIsolated bool `json:"onlyIsolated"`
IsDelisted bool `json:"isDelisted"`
}
func (AssetInfo) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (AssetInfo) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*AssetInfo) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AssetInfo) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type AssetPosition ¶
func (AssetPosition) MarshalEasyJSON ¶
func (v AssetPosition) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AssetPosition) MarshalJSON ¶
func (v AssetPosition) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AssetPosition) UnmarshalEasyJSON ¶
func (v *AssetPosition) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AssetPosition) UnmarshalJSON ¶
func (v *AssetPosition) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BatchModifyAction ¶
type BatchModifyAction struct {
Type string `json:"type" msgpack:"type"`
Modifies []ModifyAction `json:"modifies" msgpack:"modifies"`
}
BatchModifyAction represents multiple order modifications
func (BatchModifyAction) MarshalEasyJSON ¶
func (v BatchModifyAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BatchModifyAction) MarshalJSON ¶
func (v BatchModifyAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BatchModifyAction) UnmarshalEasyJSON ¶
func (v *BatchModifyAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BatchModifyAction) UnmarshalJSON ¶
func (v *BatchModifyAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Bbo ¶
func (Bbo) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Bbo) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Bbo) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Bbo) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type BboSubscriptionParams ¶
type BboSubscriptionParams struct {
Coin string
}
type BuilderInfo ¶
func (BuilderInfo) MarshalEasyJSON ¶
func (v BuilderInfo) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BuilderInfo) MarshalJSON ¶
func (v BuilderInfo) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BuilderInfo) UnmarshalEasyJSON ¶
func (v *BuilderInfo) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BuilderInfo) UnmarshalJSON ¶
func (v *BuilderInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BulkCancelResponse ¶
type BulkCancelResponse struct {
Status string `json:"status"`
Data []OpenOrder `json:"data,omitempty"`
Error string `json:"error,omitempty"`
}
func (BulkCancelResponse) MarshalEasyJSON ¶
func (v BulkCancelResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BulkCancelResponse) MarshalJSON ¶
func (v BulkCancelResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BulkCancelResponse) UnmarshalEasyJSON ¶
func (v *BulkCancelResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BulkCancelResponse) UnmarshalJSON ¶
func (v *BulkCancelResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BulkOrderResponse ¶
type BulkOrderResponse struct {
Status string `json:"status"`
Data []OrderStatus `json:"data,omitempty"`
Error string `json:"error,omitempty"`
}
func (BulkOrderResponse) MarshalEasyJSON ¶
func (v BulkOrderResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BulkOrderResponse) MarshalJSON ¶
func (v BulkOrderResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BulkOrderResponse) UnmarshalEasyJSON ¶
func (v *BulkOrderResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BulkOrderResponse) UnmarshalJSON ¶
func (v *BulkOrderResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CancelAction ¶
type CancelAction struct {
Type string `json:"type" msgpack:"type"`
Cancels []CancelOrderWire `json:"cancels" msgpack:"cancels"`
}
CancelAction represents the cancel action
func (CancelAction) MarshalEasyJSON ¶
func (v CancelAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelAction) MarshalJSON ¶
func (v CancelAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelAction) UnmarshalEasyJSON ¶
func (v *CancelAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelAction) UnmarshalJSON ¶
func (v *CancelAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CancelByCloidAction ¶
type CancelByCloidAction struct {
Type string `json:"type" msgpack:"type"`
Cancels []CancelByCloidWire `json:"cancels" msgpack:"cancels"`
}
CancelByCloidAction represents the cancel by cloid action
func (CancelByCloidAction) MarshalEasyJSON ¶
func (v CancelByCloidAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelByCloidAction) MarshalJSON ¶
func (v CancelByCloidAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelByCloidAction) UnmarshalEasyJSON ¶
func (v *CancelByCloidAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelByCloidAction) UnmarshalJSON ¶
func (v *CancelByCloidAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CancelByCloidRequest ¶
func (CancelByCloidRequest) MarshalEasyJSON ¶
func (v CancelByCloidRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelByCloidRequest) MarshalJSON ¶
func (v CancelByCloidRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelByCloidRequest) UnmarshalEasyJSON ¶
func (v *CancelByCloidRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelByCloidRequest) UnmarshalJSON ¶
func (v *CancelByCloidRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CancelByCloidWire ¶
type CancelByCloidWire struct {
Asset int `json:"asset" msgpack:"asset"`
ClientID string `json:"cloid" msgpack:"cloid"`
}
CancelByCloidWire represents cancel by cloid item wire format NB: the CancelByCloidWire MUST have `asset` and not `o` like CancelOrderWire has See: https://github.com/hyperliquid-dex/hyperliquid-python-sdk/blob/f19056ca1b65cc15a019d92dffa9ada887b3d808/hyperliquid/exchange.py#L305-L310
func (CancelByCloidWire) MarshalEasyJSON ¶
func (v CancelByCloidWire) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelByCloidWire) MarshalJSON ¶
func (v CancelByCloidWire) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelByCloidWire) UnmarshalEasyJSON ¶
func (v *CancelByCloidWire) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelByCloidWire) UnmarshalJSON ¶
func (v *CancelByCloidWire) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CancelOrderRequest ¶
type CancelOrderResponse ¶
type CancelOrderResponse struct {
Statuses MixedArray
}
type CancelOrderWire ¶
type CancelOrderWire struct {
Asset int `json:"a" msgpack:"a"`
OrderID int64 `json:"o" msgpack:"o"`
}
CancelOrderWire represents cancel order item wire format
func (CancelOrderWire) MarshalEasyJSON ¶
func (v CancelOrderWire) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelOrderWire) MarshalJSON ¶
func (v CancelOrderWire) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelOrderWire) UnmarshalEasyJSON ¶
func (v *CancelOrderWire) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelOrderWire) UnmarshalJSON ¶
func (v *CancelOrderWire) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CancelRequest ¶
func (CancelRequest) MarshalEasyJSON ¶
func (v CancelRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelRequest) MarshalJSON ¶
func (v CancelRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelRequest) UnmarshalEasyJSON ¶
func (v *CancelRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelRequest) UnmarshalJSON ¶
func (v *CancelRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CancelResponse ¶
type CancelResponse struct {
Status string `json:"status"`
Data *OpenOrder `json:"data,omitempty"`
Error string `json:"error,omitempty"`
}
func (CancelResponse) MarshalEasyJSON ¶
func (v CancelResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelResponse) MarshalJSON ¶
func (v CancelResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelResponse) UnmarshalEasyJSON ¶
func (v *CancelResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelResponse) UnmarshalJSON ¶
func (v *CancelResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Candle ¶
type Candle struct {
TimeOpen int64 `json:"t"` // open millis
TimeClose int64 `json:"T"` // close millis
Interval string `json:"i"` // interval
TradesCount int `json:"n"` // number of trades
Open string `json:"o"` // open price
High string `json:"h"` // high price
Low string `json:"l"` // low price
Close string `json:"c"` // close price
Symbol string `json:"s"` // coin
Volume string `json:"v"` // volume (base unit)
}
func (Candle) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Candle) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Candle) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Candle) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type ClearinghouseState ¶
type ClearinghouseState struct {
MarginSummary *MarginSummary `json:"marginSummary,omitempty"`
CrossMarginSummary *MarginSummary `json:"crossMarginSummary,omitempty"`
CrossMaintenanceMarginUsed string `json:"crossMaintenanceMarginUsed,omitempty"`
Withdrawable string `json:"withdrawable,omitempty"`
AssetPositions []AssetPosition `json:"assetPositions,omitempty"`
Time int64 `json:"time,omitempty"`
}
func (ClearinghouseState) MarshalEasyJSON ¶
func (v ClearinghouseState) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ClearinghouseState) MarshalJSON ¶
func (v ClearinghouseState) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ClearinghouseState) UnmarshalEasyJSON ¶
func (v *ClearinghouseState) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ClearinghouseState) UnmarshalJSON ¶
func (v *ClearinghouseState) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Cloid ¶
type Cloid struct {
Value string
}
func (Cloid) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Cloid) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Cloid) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Cloid) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type ConvertToMultiSigUserAction ¶
type ConvertToMultiSigUserAction struct {
Type string `json:"type" msgpack:"type"`
Signers string `json:"signers" msgpack:"signers"`
Nonce int64 `json:"nonce" msgpack:"nonce"`
}
ConvertToMultiSigUserAction represents convert to multi-sig user action
func (ConvertToMultiSigUserAction) MarshalEasyJSON ¶
func (v ConvertToMultiSigUserAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ConvertToMultiSigUserAction) MarshalJSON ¶
func (v ConvertToMultiSigUserAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ConvertToMultiSigUserAction) UnmarshalEasyJSON ¶
func (v *ConvertToMultiSigUserAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ConvertToMultiSigUserAction) UnmarshalJSON ¶
func (v *ConvertToMultiSigUserAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CreateOrderRequest ¶
type CreateOrderRequest struct {
Coin string
IsBuy bool
Price float64
Size float64
ReduceOnly bool
OrderType OrderType
ClientOrderID *string
}
func (*CreateOrderRequest) String ¶
func (s *CreateOrderRequest) String() string
type CreateSubAccountAction ¶
type CreateSubAccountAction struct {
Type string `json:"type" msgpack:"type"`
Name string `json:"name" msgpack:"name"`
}
CreateSubAccountAction represents create sub-account action
func (CreateSubAccountAction) MarshalEasyJSON ¶
func (v CreateSubAccountAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateSubAccountAction) MarshalJSON ¶
func (v CreateSubAccountAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateSubAccountAction) UnmarshalEasyJSON ¶
func (v *CreateSubAccountAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateSubAccountAction) UnmarshalJSON ¶
func (v *CreateSubAccountAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CreateSubAccountResponse ¶
type CreateSubAccountResponse struct {
Status string `json:"status"`
Data *SubAccount `json:"data,omitempty"`
Error string `json:"error,omitempty"`
}
func (CreateSubAccountResponse) MarshalEasyJSON ¶
func (v CreateSubAccountResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateSubAccountResponse) MarshalJSON ¶
func (v CreateSubAccountResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateSubAccountResponse) UnmarshalEasyJSON ¶
func (v *CreateSubAccountResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateSubAccountResponse) UnmarshalJSON ¶
func (v *CreateSubAccountResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CreateVaultAction ¶
type CreateVaultAction struct {
Type string `json:"type" msgpack:"type"`
Name string `json:"name" msgpack:"name"`
Description string `json:"description" msgpack:"description"`
InitialUsd int `json:"initialUsd" msgpack:"initialUsd"`
}
CreateVaultAction represents create vault action
func (CreateVaultAction) MarshalEasyJSON ¶
func (v CreateVaultAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateVaultAction) MarshalJSON ¶
func (v CreateVaultAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateVaultAction) UnmarshalEasyJSON ¶
func (v *CreateVaultAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateVaultAction) UnmarshalJSON ¶
func (v *CreateVaultAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CreateVaultResponse ¶
type CreateVaultResponse struct {
Status string `json:"status"`
Data string `json:"data,omitempty"`
Error string `json:"error,omitempty"`
}
func (CreateVaultResponse) MarshalEasyJSON ¶
func (v CreateVaultResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateVaultResponse) MarshalJSON ¶
func (v CreateVaultResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateVaultResponse) UnmarshalEasyJSON ¶
func (v *CreateVaultResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateVaultResponse) UnmarshalJSON ¶
func (v *CreateVaultResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type EvmContract ¶
type EvmContract struct {
Address string `json:"address"`
EvmExtraWeiDecimals int `json:"evm_extra_wei_decimals"`
}
func (EvmContract) MarshalEasyJSON ¶
func (v EvmContract) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (EvmContract) MarshalJSON ¶
func (v EvmContract) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*EvmContract) UnmarshalEasyJSON ¶
func (v *EvmContract) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EvmContract) UnmarshalJSON ¶
func (v *EvmContract) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Exchange ¶
type Exchange struct {
// contains filtered or unexported fields
}
func NewExchange ¶
func NewExchange( ctx context.Context, privateKey *ecdsa.PrivateKey, baseURL string, meta *Meta, vaultAddr, accountAddr string, spotMeta *SpotMeta, opts ...ExchangeOpt, ) *Exchange
func (*Exchange) ApproveAgent ¶
func (e *Exchange) ApproveAgent( ctx context.Context, name *string, ) (*AgentApprovalResponse, string, error)
ApproveAgent approves an agent to trade on behalf of the user Returns the result and the generated agent private key
func (*Exchange) ApproveBuilderFee ¶
func (e *Exchange) ApproveBuilderFee( ctx context.Context, builder string, maxFeeRate string, ) (*ApprovalResponse, error)
ApproveBuilderFee approves builder fee payment
func (*Exchange) BulkCancel ¶
func (e *Exchange) BulkCancel( ctx context.Context, requests []CancelOrderRequest, ) (res *APIResponse[CancelOrderResponse], err error)
func (*Exchange) BulkCancelByCloids ¶
func (e *Exchange) BulkCancelByCloids( ctx context.Context, requests []CancelOrderRequestByCloid, ) (res *APIResponse[CancelOrderResponse], err error)
func (*Exchange) BulkModifyOrders ¶
func (e *Exchange) BulkModifyOrders( ctx context.Context, modifyRequests []ModifyOrderRequest, ) ([]OrderStatus, error)
BulkModifyOrders modifies multiple orders
func (*Exchange) BulkOrders ¶
func (e *Exchange) BulkOrders( ctx context.Context, orders []CreateOrderRequest, builder *BuilderInfo, ) (result *APIResponse[OrderResponse], err error)
func (*Exchange) CSignerInner ¶
func (e *Exchange) CSignerInner( ctx context.Context, innerAction map[string]any, ) (*ValidatorResponse, error)
CSignerInner executes inner consensus signer action
func (*Exchange) CSignerJailSelf ¶
func (e *Exchange) CSignerJailSelf(ctx context.Context) (*ValidatorResponse, error)
CSignerJailSelf jails self as consensus signer
func (*Exchange) CSignerUnjailSelf ¶
func (e *Exchange) CSignerUnjailSelf(ctx context.Context) (*ValidatorResponse, error)
CSignerUnjailSelf unjails self as consensus signer
func (*Exchange) CValidatorChangeProfile ¶
func (e *Exchange) CValidatorChangeProfile( ctx context.Context, newProfile map[string]any, ) (*ValidatorResponse, error)
CValidatorChangeProfile changes validator profile
func (*Exchange) CValidatorRegister ¶
func (e *Exchange) CValidatorRegister( ctx context.Context, validatorProfile map[string]any, ) (*ValidatorResponse, error)
CValidatorRegister registers as consensus validator
func (*Exchange) CValidatorUnregister ¶
func (e *Exchange) CValidatorUnregister(ctx context.Context) (*ValidatorResponse, error)
CValidatorUnregister unregisters as consensus validator
func (*Exchange) Cancel ¶
func (e *Exchange) Cancel( ctx context.Context, coin string, oid int64, ) (res *APIResponse[CancelOrderResponse], err error)
func (*Exchange) CancelByCloid ¶
func (e *Exchange) CancelByCloid( ctx context.Context, coin, cloid string, ) (res *APIResponse[CancelOrderResponse], err error)
func (*Exchange) ConvertToMultiSigUser ¶
func (e *Exchange) ConvertToMultiSigUser( ctx context.Context, authorizedUsers []string, threshold int, ) (*MultiSigConversionResponse, error)
ConvertToMultiSigUser converts account to multi-signature user
func (*Exchange) CreateSubAccount ¶
func (e *Exchange) CreateSubAccount( ctx context.Context, name string, ) (*CreateSubAccountResponse, error)
CreateSubAccount creates a new sub-account
func (*Exchange) CreateVault ¶
func (e *Exchange) CreateVault( ctx context.Context, name string, description string, initialUsd int, ) (*CreateVaultResponse, error)
CreateVault creates a new vault
func (*Exchange) MarketClose ¶
func (e *Exchange) MarketClose( ctx context.Context, coin string, sz *float64, px *float64, slippage float64, cloid *string, builder *BuilderInfo, ) (OrderStatus, error)
MarketClose closes a position
func (*Exchange) MarketOpen ¶
func (e *Exchange) MarketOpen( ctx context.Context, name string, isBuy bool, sz float64, px *float64, slippage float64, cloid *string, builder *BuilderInfo, ) (res OrderStatus, err error)
MarketOpen opens a market position
func (*Exchange) ModifyOrder ¶
func (e *Exchange) ModifyOrder( ctx context.Context, req ModifyOrderRequest, ) (result OrderStatus, err error)
ModifyOrder modifies an existing order
func (*Exchange) Order ¶
func (e *Exchange) Order( ctx context.Context, req CreateOrderRequest, builder *BuilderInfo, ) (result OrderStatus, err error)
func (*Exchange) PerpDeployRegisterAsset ¶
func (e *Exchange) PerpDeployRegisterAsset( ctx context.Context, asset string, perpDexInput PerpDexSchemaInput, ) (*PerpDeployResponse, error)
PerpDeployRegisterAsset registers a new perpetual asset
func (*Exchange) PerpDeploySetOracle ¶
func (e *Exchange) PerpDeploySetOracle( ctx context.Context, asset string, oracleAddress string, ) (*SpotDeployResponse, error)
PerpDeploySetOracle sets oracle for perpetual asset
func (*Exchange) PerpDexClassTransfer ¶
func (e *Exchange) PerpDexClassTransfer( ctx context.Context, dex, token string, amount float64, toPerp bool, ) (*TransferResponse, error)
PerpDexClassTransfer transfers tokens between perp dex classes
func (*Exchange) ScheduleCancel ¶
func (e *Exchange) ScheduleCancel( ctx context.Context, scheduleTime *int64, ) (*ScheduleCancelResponse, error)
ScheduleCancel schedules cancellation of all open orders
func (*Exchange) SetExpiresAfter ¶
SetExpiresAfter sets the expiration time for actions If expiresAfter is nil, actions will not have an expiration time If expiresAfter is set, actions will include this expiration nonce
func (*Exchange) SetLastNonce ¶
SetLastNonce allows for resuming from a persisted nonce, e.g. the nonce was stored before a restart Only useful if a lot of increments happen for unique nonces. Most users do not need this.
func (*Exchange) SetReferrer ¶
SetReferrer sets a referral code
func (*Exchange) SlippagePrice ¶
func (e *Exchange) SlippagePrice( ctx context.Context, name string, isBuy bool, slippage float64, px *float64, ) (float64, error)
SlippagePrice calculates the slippage price for market orders
func (*Exchange) SpotDeployEnableFreezePrivilege ¶
func (e *Exchange) SpotDeployEnableFreezePrivilege( ctx context.Context, ) (*SpotDeployResponse, error)
SpotDeployEnableFreezePrivilege enables freeze privilege for spot deployer
func (*Exchange) SpotDeployFreezeUser ¶
func (e *Exchange) SpotDeployFreezeUser( ctx context.Context, userAddress string, ) (*SpotDeployResponse, error)
SpotDeployFreezeUser freezes a user in spot trading
func (*Exchange) SpotDeployGenesis ¶
func (e *Exchange) SpotDeployGenesis( ctx context.Context, deployer string, dexName string, ) (*SpotDeployResponse, error)
SpotDeployGenesis initializes spot genesis
func (*Exchange) SpotDeployRegisterHyperliquidity ¶
func (e *Exchange) SpotDeployRegisterHyperliquidity( ctx context.Context, name string, tokens []string, ) (*SpotDeployResponse, error)
SpotDeployRegisterHyperliquidity registers hyperliquidity spot
func (*Exchange) SpotDeployRegisterSpot ¶
func (e *Exchange) SpotDeployRegisterSpot( ctx context.Context, baseToken string, quoteToken string, ) (*SpotDeployResponse, error)
SpotDeployRegisterSpot registers spot market
func (*Exchange) SpotDeployRegisterToken ¶
func (e *Exchange) SpotDeployRegisterToken( ctx context.Context, tokenName string, szDecimals int, weiDecimals int, maxGas int, fullName string, ) (*SpotDeployResponse, error)
SpotDeployRegisterToken registers a new spot token
func (*Exchange) SpotDeployRevokeFreezePrivilege ¶
func (e *Exchange) SpotDeployRevokeFreezePrivilege( ctx context.Context, ) (*SpotDeployResponse, error)
SpotDeployRevokeFreezePrivilege revokes freeze privilege for spot deployer
func (*Exchange) SpotDeploySetDeployerTradingFeeShare ¶
func (e *Exchange) SpotDeploySetDeployerTradingFeeShare( ctx context.Context, feeShare float64, ) (*SpotDeployResponse, error)
SpotDeploySetDeployerTradingFeeShare sets deployer trading fee share
func (*Exchange) SpotDeployUserGenesis ¶
func (e *Exchange) SpotDeployUserGenesis( ctx context.Context, balances map[string]float64, ) (*SpotDeployResponse, error)
SpotDeployUserGenesis initializes user genesis for spot trading
func (*Exchange) SpotTransfer ¶
func (e *Exchange) SpotTransfer( ctx context.Context, amount float64, destination, token string, ) (*TransferResponse, error)
SpotTransfer transfers spot tokens to another address
func (*Exchange) SubAccountSpotTransfer ¶
func (e *Exchange) SubAccountSpotTransfer( ctx context.Context, subAccountUser string, isDeposit bool, token string, amount float64, ) (*TransferResponse, error)
SubAccountSpotTransfer transfers spot tokens to/from sub-account
func (*Exchange) SubAccountTransfer ¶
func (e *Exchange) SubAccountTransfer( ctx context.Context, subAccountUser string, isDeposit bool, usd int, ) (*TransferResponse, error)
SubAccountTransfer transfers funds to/from sub-account
func (*Exchange) TokenDelegate ¶
func (e *Exchange) TokenDelegate( ctx context.Context, validator string, wei int, isUndelegate bool, ) (*TransferResponse, error)
TokenDelegate delegates tokens for staking
func (*Exchange) UpdateIsolatedMargin ¶
func (*Exchange) UpdateLeverage ¶
func (*Exchange) UsdClassTransfer ¶
func (e *Exchange) UsdClassTransfer( ctx context.Context, amount float64, toPerp bool, ) (*TransferResponse, error)
UsdClassTransfer transfers between USD classes
func (*Exchange) UsdTransfer ¶
func (e *Exchange) UsdTransfer( ctx context.Context, amount float64, destination string, ) (*TransferResponse, error)
UsdTransfer transfers USD to another address
func (*Exchange) UseBigBlocks ¶
UseBigBlocks enables or disables big blocks
func (*Exchange) VaultDistribute ¶
func (*Exchange) VaultModify ¶
func (*Exchange) VaultUsdTransfer ¶
func (e *Exchange) VaultUsdTransfer( ctx context.Context, vaultAddress string, isDeposit bool, usd int, ) (*TransferResponse, error)
VaultUsdTransfer transfers to/from vault
func (*Exchange) WithdrawFromBridge ¶
func (e *Exchange) WithdrawFromBridge( ctx context.Context, amount float64, destination string, ) (*TransferResponse, error)
WithdrawFromBridge withdraws tokens from bridge
type ExchangeOpt ¶
func ExchangeOptClientOptions ¶
func ExchangeOptClientOptions(opts ...ClientOpt) ExchangeOpt
ExchangeOptClientOptions allows passing of ClientOpt to Client
func ExchangeOptDebugMode ¶
func ExchangeOptDebugMode() ExchangeOpt
func ExchangeOptInfoOptions ¶
func ExchangeOptInfoOptions(opts ...InfoOpt) ExchangeOpt
ExchangeOptInfoOptions allows passing of InfoOpt to Info
type FeeSchedule ¶
type FeeSchedule struct {
Add string `json:"add"`
Cross string `json:"cross"`
ReferralDiscount string `json:"referralDiscount"`
Tiers Tiers `json:"tiers"`
}
func (FeeSchedule) MarshalEasyJSON ¶
func (v FeeSchedule) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FeeSchedule) MarshalJSON ¶
func (v FeeSchedule) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FeeSchedule) UnmarshalEasyJSON ¶
func (v *FeeSchedule) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FeeSchedule) UnmarshalJSON ¶
func (v *FeeSchedule) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Fill ¶
type Fill struct {
ClosedPnl string `json:"closedPnl"`
Coin string `json:"coin"`
Crossed bool `json:"crossed"`
Dir string `json:"dir"`
Hash string `json:"hash"`
Oid int64 `json:"oid"`
Price string `json:"px"`
Side string `json:"side"`
StartPosition string `json:"startPosition"`
Size string `json:"sz"`
Time int64 `json:"time"`
Fee string `json:"fee"`
FeeToken string `json:"feeToken"`
BuilderFee string `json:"builderFee,omitempty"`
Tid int64 `json:"tid"`
}
func (Fill) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Fill) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Fill) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Fill) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type FillLiquidation ¶
type FillLiquidation struct {
LiquidatedUser *string `json:"liquidatedUser,omitempty"`
MarkPx string `json:"markPx"`
Method string `json:"method"`
}
func (FillLiquidation) MarshalEasyJSON ¶
func (v FillLiquidation) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FillLiquidation) MarshalJSON ¶
func (v FillLiquidation) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FillLiquidation) UnmarshalEasyJSON ¶
func (v *FillLiquidation) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FillLiquidation) UnmarshalJSON ¶
func (v *FillLiquidation) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type FrontendOpenOrder ¶
type FrontendOpenOrder struct {
Coin string `json:"coin"`
IsPositionTpSl bool `json:"isPositionTpsl"`
IsTrigger bool `json:"isTrigger"`
LimitPx float64 `json:"limitPx,string"`
Oid int64 `json:"oid"`
OrderType string `json:"orderType"`
OrigSz float64 `json:"origSz,string"`
ReduceOnly bool `json:"reduceOnly"`
Side OrderSide `json:"side"`
Sz float64 `json:"sz,string"`
Timestamp int64 `json:"timestamp"`
TriggerCondition string `json:"triggerCondition"`
TriggerPx float64 `json:"triggerPx,string"`
}
func (FrontendOpenOrder) MarshalEasyJSON ¶
func (v FrontendOpenOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FrontendOpenOrder) MarshalJSON ¶
func (v FrontendOpenOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FrontendOpenOrder) UnmarshalEasyJSON ¶
func (v *FrontendOpenOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FrontendOpenOrder) UnmarshalJSON ¶
func (v *FrontendOpenOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type FundingHistory ¶
type FundingHistory struct {
Coin string `json:"coin"`
FundingRate string `json:"fundingRate"`
Premium string `json:"premium"`
Time int64 `json:"time"`
}
func (FundingHistory) MarshalEasyJSON ¶
func (v FundingHistory) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FundingHistory) MarshalJSON ¶
func (v FundingHistory) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FundingHistory) UnmarshalEasyJSON ¶
func (v *FundingHistory) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FundingHistory) UnmarshalJSON ¶
func (v *FundingHistory) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Info ¶
type Info struct {
// contains filtered or unexported fields
}
func (*Info) CandlesSnapshot ¶
func (*Info) FrontendOpenOrders ¶
func (*Info) FundingHistory ¶
func (*Info) HistoricalOrders ¶
func (*Info) L2Snapshot ¶
func (*Info) MetaAndAssetCtxs ¶
func (i *Info) MetaAndAssetCtxs(ctx context.Context) (*MetaAndAssetCtxs, error)
func (*Info) NameToAsset ¶
func (*Info) OpenOrders ¶
func (*Info) QueryOrderByCloid ¶
func (*Info) QueryOrderByOid ¶
func (*Info) QueryReferralState ¶
func (*Info) QuerySubAccounts ¶
func (*Info) QueryUserToMultiSigSigners ¶
func (*Info) SpotMetaAndAssetCtxs ¶
func (i *Info) SpotMetaAndAssetCtxs(ctx context.Context) (*SpotMetaAndAssetCtxs, error)
func (*Info) SpotUserState ¶
func (*Info) UserActiveAssetData ¶
func (*Info) UserFillsByTime ¶
func (*Info) UserFundingHistory ¶
func (*Info) UserStakingDelegations ¶
func (*Info) UserStakingRewards ¶
func (*Info) UserStakingSummary ¶
type InfoOpt ¶
func InfoOptClientOptions ¶
InfoOptClientOptions allows passing of ClientOpt to Info
func InfoOptDebugMode ¶
func InfoOptDebugMode() InfoOpt
type L2Book ¶
type L2Book struct {
Coin string `json:"coin"`
Levels [][]Level `json:"levels"`
Time int64 `json:"time"`
}
func (L2Book) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (L2Book) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*L2Book) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*L2Book) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Level ¶
func (Level) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Level) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Level) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Level) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Leverage ¶
type Leverage struct {
Type string `json:"type"`
Value int `json:"value"`
RawUsd *string `json:"rawUsd,omitempty"`
}
func (Leverage) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Leverage) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Leverage) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Leverage) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type LimitOrderType ¶
type LimitOrderType struct {
Tif Tif `json:"tif"` // TifAlo, TifIoc, TifGtc
}
func (LimitOrderType) MarshalEasyJSON ¶
func (v LimitOrderType) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LimitOrderType) MarshalJSON ¶
func (v LimitOrderType) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LimitOrderType) UnmarshalEasyJSON ¶
func (v *LimitOrderType) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LimitOrderType) UnmarshalJSON ¶
func (v *LimitOrderType) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MMTier ¶
type MMTier struct {
Add string `json:"add"`
MakerFractionCutoff string `json:"makerFractionCutoff"`
}
func (MMTier) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (MMTier) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*MMTier) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MMTier) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type MarginSummary ¶
type MarginSummary struct {
AccountValue string `json:"accountValue"`
TotalMarginUsed string `json:"totalMarginUsed"`
TotalNtlPos string `json:"totalNtlPos"`
TotalRawUsd string `json:"totalRawUsd"`
}
func (MarginSummary) MarshalEasyJSON ¶
func (v MarginSummary) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarginSummary) MarshalJSON ¶
func (v MarginSummary) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarginSummary) UnmarshalEasyJSON ¶
func (v *MarginSummary) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarginSummary) UnmarshalJSON ¶
func (v *MarginSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarginTable ¶
type MarginTable struct {
ID int
Description string `json:"description"`
MarginTiers []MarginTier `json:"marginTiers"`
}
func (MarginTable) MarshalEasyJSON ¶
func (v MarginTable) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarginTable) MarshalJSON ¶
func (v MarginTable) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarginTable) UnmarshalEasyJSON ¶
func (v *MarginTable) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarginTable) UnmarshalJSON ¶
func (v *MarginTable) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarginTier ¶
type MarginTier struct {
LowerBound string `json:"lowerBound"`
MaxLeverage int `json:"maxLeverage"`
}
func (MarginTier) MarshalEasyJSON ¶
func (v MarginTier) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarginTier) MarshalJSON ¶
func (v MarginTier) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarginTier) UnmarshalEasyJSON ¶
func (v *MarginTier) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarginTier) UnmarshalJSON ¶
func (v *MarginTier) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Meta ¶
type Meta struct {
Universe []AssetInfo `json:"universe"`
MarginTables []MarginTable `json:"marginTables"`
}
func (Meta) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Meta) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Meta) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Meta) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type MetaAndAssetCtxs ¶
This type has no JSON annotation because it cannot be directly unmarshalled from the response
func (MetaAndAssetCtxs) MarshalEasyJSON ¶
func (v MetaAndAssetCtxs) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MetaAndAssetCtxs) MarshalJSON ¶
func (v MetaAndAssetCtxs) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MetaAndAssetCtxs) UnmarshalEasyJSON ¶
func (v *MetaAndAssetCtxs) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MetaAndAssetCtxs) UnmarshalJSON ¶
func (v *MetaAndAssetCtxs) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MixedArray ¶
type MixedArray []MixedValue
func (MixedArray) FirstError ¶
func (ma MixedArray) FirstError() error
func (*MixedArray) UnmarshalJSON ¶
func (ma *MixedArray) UnmarshalJSON(data []byte) error
type MixedValue ¶
type MixedValue json.RawMessage
func (*MixedValue) Array ¶
func (mv *MixedValue) Array() ([]json.RawMessage, bool)
func (MixedValue) MarshalJSON ¶
func (mv MixedValue) MarshalJSON() ([]byte, error)
func (*MixedValue) Parse ¶
func (mv *MixedValue) Parse(v any) error
func (*MixedValue) String ¶
func (mv *MixedValue) String() (string, bool)
func (*MixedValue) Type ¶
func (mv *MixedValue) Type() string
func (*MixedValue) UnmarshalJSON ¶
func (mv *MixedValue) UnmarshalJSON(data []byte) error
type ModifyAction ¶
type ModifyAction struct {
Type string `json:"type,omitempty" msgpack:"type,omitempty"`
Oid any `json:"oid" msgpack:"oid"`
Order OrderWire `json:"order" msgpack:"order"`
}
ModifyAction represents a single order modification
func (ModifyAction) MarshalEasyJSON ¶
func (v ModifyAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ModifyAction) MarshalJSON ¶
func (v ModifyAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ModifyAction) UnmarshalEasyJSON ¶
func (v *ModifyAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ModifyAction) UnmarshalJSON ¶
func (v *ModifyAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ModifyOrderRequest ¶
type ModifyOrderRequest struct {
Oid *int64
Cloid *Cloid
Order CreateOrderRequest
}
ModifyOrderRequest identifies an order by either exchange-provided Oid or client-provided Cloid. Exactly one of Oid or Cloid must be non-nil.
type ModifyResponse ¶
type ModifyResponse struct {
Status string `json:"status"`
Data []OrderStatus `json:"data,omitempty"`
Error string `json:"error,omitempty"`
}
func (ModifyResponse) MarshalEasyJSON ¶
func (v ModifyResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ModifyResponse) MarshalJSON ¶
func (v ModifyResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ModifyResponse) UnmarshalEasyJSON ¶
func (v *ModifyResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ModifyResponse) UnmarshalJSON ¶
func (v *ModifyResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MultiSigAction ¶
type MultiSigAction struct {
Type string `json:"type" msgpack:"type"`
Action map[string]any `json:"action" msgpack:"action"`
Signers []string `json:"signers" msgpack:"signers"`
Signatures []string `json:"signatures" msgpack:"signatures"`
}
MultiSigAction represents multi-signature action
func (MultiSigAction) MarshalEasyJSON ¶
func (v MultiSigAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MultiSigAction) MarshalJSON ¶
func (v MultiSigAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MultiSigAction) UnmarshalEasyJSON ¶
func (v *MultiSigAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MultiSigAction) UnmarshalJSON ¶
func (v *MultiSigAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MultiSigConversionResponse ¶
type MultiSigConversionResponse struct {
Status string `json:"status"`
TxHash string `json:"txHash,omitempty"`
Error string `json:"error,omitempty"`
}
func (MultiSigConversionResponse) MarshalEasyJSON ¶
func (v MultiSigConversionResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MultiSigConversionResponse) MarshalJSON ¶
func (v MultiSigConversionResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MultiSigConversionResponse) UnmarshalEasyJSON ¶
func (v *MultiSigConversionResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MultiSigConversionResponse) UnmarshalJSON ¶
func (v *MultiSigConversionResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MultiSigResponse ¶
type MultiSigResponse struct {
Status string `json:"status"`
TxHash string `json:"txHash,omitempty"`
Error string `json:"error,omitempty"`
}
func (MultiSigResponse) MarshalEasyJSON ¶
func (v MultiSigResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MultiSigResponse) MarshalJSON ¶
func (v MultiSigResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MultiSigResponse) UnmarshalEasyJSON ¶
func (v *MultiSigResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MultiSigResponse) UnmarshalJSON ¶
func (v *MultiSigResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MultiSigSigner ¶
func (MultiSigSigner) MarshalEasyJSON ¶
func (v MultiSigSigner) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MultiSigSigner) MarshalJSON ¶
func (v MultiSigSigner) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MultiSigSigner) UnmarshalEasyJSON ¶
func (v *MultiSigSigner) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MultiSigSigner) UnmarshalJSON ¶
func (v *MultiSigSigner) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Notification ¶
type Notification struct {
Notification string `json:"notification"`
}
func (Notification) Key ¶
func (n Notification) Key() string
func (Notification) MarshalEasyJSON ¶
func (v Notification) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Notification) MarshalJSON ¶
func (v Notification) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Notification) UnmarshalEasyJSON ¶
func (v *Notification) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Notification) UnmarshalJSON ¶
func (v *Notification) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type NotificationSubscriptionParams ¶
type NotificationSubscriptionParams struct {
User string
}
type OpenOrder ¶
type OpenOrder struct {
Coin string `json:"coin"`
LimitPx float64 `json:"limitPx,string"`
Oid int64 `json:"oid"`
Side string `json:"side"`
Size float64 `json:"sz,string"`
Timestamp int64 `json:"timestamp"`
}
func (OpenOrder) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (OpenOrder) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*OpenOrder) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OpenOrder) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type OrderAction ¶
type OrderAction struct {
Type string `json:"type" msgpack:"type"`
Orders []OrderWire `json:"orders" msgpack:"orders"`
Grouping string `json:"grouping" msgpack:"grouping"`
Builder *BuilderInfo `json:"builder,omitempty" msgpack:"builder,omitempty"`
}
OrderAction represents the order action with deterministic field ordering CRITICAL: Field order MUST match Python SDK insertion order for msgpack hash consistency
func (OrderAction) MarshalEasyJSON ¶
func (v OrderAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderAction) MarshalJSON ¶
func (v OrderAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderAction) UnmarshalEasyJSON ¶
func (v *OrderAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderAction) UnmarshalJSON ¶
func (v *OrderAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderFillsSubscriptionParams ¶
type OrderFillsSubscriptionParams struct {
User string
}
type OrderQueryResponse ¶
type OrderQueryResponse struct {
Order QueriedOrder `json:"order"`
Status OrderStatusValue `json:"status"`
StatusTimestamp int64 `json:"statusTimestamp"`
}
func (OrderQueryResponse) MarshalEasyJSON ¶
func (v OrderQueryResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderQueryResponse) MarshalJSON ¶
func (v OrderQueryResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderQueryResponse) UnmarshalEasyJSON ¶
func (v *OrderQueryResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderQueryResponse) UnmarshalJSON ¶
func (v *OrderQueryResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderQueryResult ¶
type OrderQueryResult struct {
Status OrderQueryStatus `json:"status"`
Order OrderQueryResponse `json:"order,omitempty"`
}
func (OrderQueryResult) MarshalEasyJSON ¶
func (v OrderQueryResult) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderQueryResult) MarshalJSON ¶
func (v OrderQueryResult) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderQueryResult) UnmarshalEasyJSON ¶
func (v *OrderQueryResult) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderQueryResult) UnmarshalJSON ¶
func (v *OrderQueryResult) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderQueryStatus ¶
type OrderQueryStatus string
const ( OrderQueryStatusSuccess OrderQueryStatus = "order" OrderQueryStatusError OrderQueryStatus = "unknownOid" )
type OrderResponse ¶
type OrderResponse struct {
Statuses []OrderStatus
}
type OrderStatus ¶
type OrderStatus struct {
Resting *OrderStatusResting `json:"resting,omitempty"`
Filled *OrderStatusFilled `json:"filled,omitempty"`
Error *string `json:"error,omitempty"`
}
func (*OrderStatus) String ¶
func (s *OrderStatus) String() string
type OrderStatusFilled ¶
type OrderStatusResting ¶
type OrderStatusValue ¶
type OrderStatusValue string
const ( // Placed successfully OrderStatusValueOpen OrderStatusValue = "open" // Filled OrderStatusValueFilled OrderStatusValue = "filled" // Canceled by user OrderStatusValueCanceled OrderStatusValue = "canceled" // Trigger order triggered OrderStatusValueTriggered OrderStatusValue = "triggered" // Rejected at time of placement OrderStatusValueRejected OrderStatusValue = "rejected" // Canceled because insufficient margin to fill OrderStatusValueMarginCanceled OrderStatusValue = "marginCanceled" // Vaults only. Canceled due to a user's withdrawal from vault OrderStatusValueVaultWithdrawalCanceled OrderStatusValue = "vaultWithdrawalCanceled" // Canceled due to order being too aggressive when open interest was at cap OrderStatusValueOpenInterestCapCanceled OrderStatusValue = "openInterestCapCanceled" // Canceled due to self-trade prevention OrderStatusValueSelfTradeCanceled OrderStatusValue = "selfTradeCanceled" // Canceled reduced-only order that does not reduce position OrderStatusValueReduceOnlyCanceled OrderStatusValue = "reduceOnlyCanceled" // TP/SL only. Canceled due to sibling ordering being filled OrderStatusValueSiblingFilledCanceled OrderStatusValue = "siblingFilledCanceled" // Canceled due to asset delisting OrderStatusValueDelistedCanceled OrderStatusValue = "delistedCanceled" // Canceled due to liquidation OrderStatusValueLiquidatedCanceled OrderStatusValue = "liquidatedCanceled" // API only. Canceled due to exceeding scheduled cancel deadline (dead man's switch) OrderStatusValueScheduledCancel OrderStatusValue = "scheduledCancel" // Rejected due to invalid tick price OrderStatusValueTickRejected OrderStatusValue = "tickRejected" // Rejected due to order notional below minimum OrderStatusValueMinTradeNtlRejected OrderStatusValue = "minTradeNtlRejected" // Rejected due to insufficient margin OrderStatusValuePerpMarginRejected OrderStatusValue = "perpMarginRejected" // Rejected due to reduce only OrderStatusValueReduceOnlyRejected OrderStatusValue = "reduceOnlyRejected" // Rejected due to post-only immediate match OrderStatusValueBadAloPxRejected OrderStatusValue = "badAloPxRejected" // Rejected due to IOC not able to match OrderStatusValueIocCancelRejected OrderStatusValue = "iocCancelRejected" // Rejected due to invalid TP/SL price OrderStatusValueBadTriggerPxRejected OrderStatusValue = "badTriggerPxRejected" // Rejected due to lack of liquidity for market order OrderStatusValueMarketOrderNoLiquidityRejected OrderStatusValue = "marketOrderNoLiquidityRejected" // Rejected due to open interest cap OrderStatusValuePositionIncreaseAtOpenInterestCapRejected OrderStatusValue = "positionIncreaseAtOpenInterestCapRejected" // Rejected due to open interest cap OrderStatusValuePositionFlipAtOpenInterestCapRejected OrderStatusValue = "positionFlipAtOpenInterestCapRejected" // Rejected due to price too aggressive at open interest cap OrderStatusValueTooAggressiveAtOpenInterestCapRejected OrderStatusValue = "tooAggressiveAtOpenInterestCapRejected" // Rejected due to open interest cap OrderStatusValueOpenInterestIncreaseRejected OrderStatusValue = "openInterestIncreaseRejected" // Rejected due to insufficient spot balance OrderStatusValueInsufficientSpotBalanceRejected OrderStatusValue = "insufficientSpotBalanceRejected" // Rejected due to price too far from oracle OrderStatusValueOracleRejected OrderStatusValue = "oracleRejected" // Rejected due to exceeding margin tier limit at current leverage OrderStatusValuePerpMaxPositionRejected OrderStatusValue = "perpMaxPositionRejected" )
type OrderType ¶
type OrderType struct {
Limit *LimitOrderType `json:"limit,omitempty"`
Trigger *TriggerOrderType `json:"trigger,omitempty"`
}
func (OrderType) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderType) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*OrderType) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderType) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type OrderUpdatesSubscriptionParams ¶
type OrderUpdatesSubscriptionParams struct {
User string
}
type OrderWire ¶
type OrderWire struct {
Asset int `json:"a" msgpack:"a"` // 1st
IsBuy bool `json:"b" msgpack:"b"` // 2nd
LimitPx string `json:"p" msgpack:"p"` // 3rd
Size string `json:"s" msgpack:"s"` // 4th
ReduceOnly bool `json:"r" msgpack:"r"` // 5th
OrderType OrderWireType `json:"t" msgpack:"t"` // 6th
Cloid *string `json:"c,omitempty" msgpack:"c,omitempty"` // 7th (optional)
}
OrderWire represents the wire format for orders with deterministic field ordering CRITICAL: Field order MUST exactly match Python SDK insertion order: a, b, p, s, r, t, c See hyperliquid-python-sdk/hyperliquid/utils/signing.py:order_request_to_order_wire
func (OrderWire) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderWire) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*OrderWire) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderWire) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type OrderWireType ¶
type OrderWireType struct {
Limit *OrderWireTypeLimit `json:"limit,omitempty" msgpack:"limit,omitempty"`
Trigger *OrderWireTypeTrigger `json:"trigger,omitempty" msgpack:"trigger,omitempty"`
}
OrderWireType represents the type of order (limit or trigger).
func (OrderWireType) MarshalEasyJSON ¶
func (v OrderWireType) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderWireType) MarshalJSON ¶
func (v OrderWireType) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderWireType) UnmarshalEasyJSON ¶
func (v *OrderWireType) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderWireType) UnmarshalJSON ¶
func (v *OrderWireType) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderWireTypeLimit ¶
type OrderWireTypeLimit struct {
Tif Tif `json:"tif,string" msgpack:"tif"`
}
OrderWireTypeLimit represents a limit order with time-in-force.
func (OrderWireTypeLimit) MarshalEasyJSON ¶
func (v OrderWireTypeLimit) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderWireTypeLimit) MarshalJSON ¶
func (v OrderWireTypeLimit) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderWireTypeLimit) UnmarshalEasyJSON ¶
func (v *OrderWireTypeLimit) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderWireTypeLimit) UnmarshalJSON ¶
func (v *OrderWireTypeLimit) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderWireTypeTrigger ¶
type OrderWireTypeTrigger struct {
// CRITICAL: Field order MUST match Python SDK insertion order: isMarket, triggerPx, tpsl
// See hyperliquid-python-sdk/hyperliquid/utils/signing.py:order_type_to_wire (lines 151-154)
IsMarket bool `json:"isMarket" msgpack:"isMarket"` // 1st
TriggerPx string `json:"triggerPx" msgpack:"triggerPx"` // 2nd - Must be string for msgpack serialization
Tpsl Tpsl `json:"tpsl" msgpack:"tpsl"` // 3rd - "tp" or "sl"
}
OrderWireTypeTrigger represents a trigger order (stop-loss/take-profit).
func (OrderWireTypeTrigger) MarshalEasyJSON ¶
func (v OrderWireTypeTrigger) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderWireTypeTrigger) MarshalJSON ¶
func (v OrderWireTypeTrigger) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderWireTypeTrigger) UnmarshalEasyJSON ¶
func (v *OrderWireTypeTrigger) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderWireTypeTrigger) UnmarshalJSON ¶
func (v *OrderWireTypeTrigger) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PerpDeployResponse ¶
type PerpDeployResponse struct {
Status string `json:"status"`
Data struct {
Statuses []TxStatus `json:"statuses"`
} `json:"data"`
}
func (PerpDeployResponse) MarshalEasyJSON ¶
func (v PerpDeployResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PerpDeployResponse) MarshalJSON ¶
func (v PerpDeployResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PerpDeployResponse) UnmarshalEasyJSON ¶
func (v *PerpDeployResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PerpDeployResponse) UnmarshalJSON ¶
func (v *PerpDeployResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PerpDexClassTransferAction ¶
type PerpDexClassTransferAction struct {
Type string `json:"type" msgpack:"type"`
Dex string `json:"dex" msgpack:"dex"`
Token string `json:"token" msgpack:"token"`
Amount float64 `json:"amount" msgpack:"amount"`
ToPerp bool `json:"toPerp" msgpack:"toPerp"`
}
PerpDexClassTransferAction represents perp dex class transfer
func (PerpDexClassTransferAction) MarshalEasyJSON ¶
func (v PerpDexClassTransferAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PerpDexClassTransferAction) MarshalJSON ¶
func (v PerpDexClassTransferAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PerpDexClassTransferAction) UnmarshalEasyJSON ¶
func (v *PerpDexClassTransferAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PerpDexClassTransferAction) UnmarshalJSON ¶
func (v *PerpDexClassTransferAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PerpDexSchemaInput ¶
type PerpDexSchemaInput struct {
FullName string `json:"fullName"`
CollateralToken int `json:"collateralToken"`
OracleUpdater *string `json:"oracleUpdater"`
}
func (PerpDexSchemaInput) MarshalEasyJSON ¶
func (v PerpDexSchemaInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PerpDexSchemaInput) MarshalJSON ¶
func (v PerpDexSchemaInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PerpDexSchemaInput) UnmarshalEasyJSON ¶
func (v *PerpDexSchemaInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PerpDexSchemaInput) UnmarshalJSON ¶
func (v *PerpDexSchemaInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Position ¶
type Position struct {
Coin string `json:"coin"`
EntryPx *string `json:"entryPx"`
Leverage Leverage `json:"leverage"`
LiquidationPx *string `json:"liquidationPx"`
MarginUsed string `json:"marginUsed"`
PositionValue string `json:"positionValue"`
ReturnOnEquity string `json:"returnOnEquity"`
Szi string `json:"szi"`
UnrealizedPnl string `json:"unrealizedPnl"`
}
func (Position) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Position) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Position) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Position) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type QueriedOrder ¶
type QueriedOrder struct {
Coin string `json:"coin"`
Side OrderSide `json:"side"`
LimitPx string `json:"limitPx"`
Sz string `json:"sz"`
Oid int64 `json:"oid"`
Timestamp int64 `json:"timestamp"`
TriggerCondition string `json:"triggerCondition"`
IsTrigger bool `json:"isTrigger"`
TriggerPx string `json:"triggerPx"`
Children []QueriedOrder `json:"children"`
IsPositionTpsl bool `json:"isPositionTpsl"`
ReduceOnly bool `json:"reduceOnly"`
OrderType string `json:"orderType"`
OrigSz string `json:"origSz"`
Tif Tif `json:"tif"`
Cloid *string `json:"cloid"`
}
func (QueriedOrder) MarshalEasyJSON ¶
func (v QueriedOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (QueriedOrder) MarshalJSON ¶
func (v QueriedOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*QueriedOrder) UnmarshalEasyJSON ¶
func (v *QueriedOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*QueriedOrder) UnmarshalJSON ¶
func (v *QueriedOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ReferralState ¶
type ReferralState struct {
ReferralCode string `json:"referralCode"`
Referrer string `json:"referrer"`
Referred []string `json:"referred"`
}
func (ReferralState) MarshalEasyJSON ¶
func (v ReferralState) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ReferralState) MarshalJSON ¶
func (v ReferralState) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ReferralState) UnmarshalEasyJSON ¶
func (v *ReferralState) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ReferralState) UnmarshalJSON ¶
func (v *ReferralState) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ScheduleCancelAction ¶
type ScheduleCancelAction struct {
Type string `json:"type" msgpack:"type"`
Time *int64 `json:"time,omitempty" msgpack:"time,omitempty"`
}
ScheduleCancelAction represents schedule cancel action
func (ScheduleCancelAction) MarshalEasyJSON ¶
func (v ScheduleCancelAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ScheduleCancelAction) MarshalJSON ¶
func (v ScheduleCancelAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ScheduleCancelAction) UnmarshalEasyJSON ¶
func (v *ScheduleCancelAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ScheduleCancelAction) UnmarshalJSON ¶
func (v *ScheduleCancelAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ScheduleCancelResponse ¶
type ScheduleCancelResponse struct {
Status string `json:"status"`
Error string `json:"error,omitempty"`
}
func (ScheduleCancelResponse) MarshalEasyJSON ¶
func (v ScheduleCancelResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ScheduleCancelResponse) MarshalJSON ¶
func (v ScheduleCancelResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ScheduleCancelResponse) UnmarshalEasyJSON ¶
func (v *ScheduleCancelResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ScheduleCancelResponse) UnmarshalJSON ¶
func (v *ScheduleCancelResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SetReferrerAction ¶
type SetReferrerAction struct {
Type string `json:"type" msgpack:"type"`
Code string `json:"code" msgpack:"code"`
}
SetReferrerAction represents set referrer action
func (SetReferrerAction) MarshalEasyJSON ¶
func (v SetReferrerAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SetReferrerAction) MarshalJSON ¶
func (v SetReferrerAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SetReferrerAction) UnmarshalEasyJSON ¶
func (v *SetReferrerAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SetReferrerAction) UnmarshalJSON ¶
func (v *SetReferrerAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SetReferrerResponse ¶
type SetReferrerResponse struct {
Status string `json:"status"`
Error string `json:"error,omitempty"`
}
func (SetReferrerResponse) MarshalEasyJSON ¶
func (v SetReferrerResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SetReferrerResponse) MarshalJSON ¶
func (v SetReferrerResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SetReferrerResponse) UnmarshalEasyJSON ¶
func (v *SetReferrerResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SetReferrerResponse) UnmarshalJSON ¶
func (v *SetReferrerResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SharedAssetCtx ¶
type SharedAssetCtx struct {
// PerpsAssetCtx
CirculatingSupply float64 `json:"circulatingSupply,string,omitempty"`
}
func (SharedAssetCtx) MarshalEasyJSON ¶
func (v SharedAssetCtx) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SharedAssetCtx) MarshalJSON ¶
func (v SharedAssetCtx) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SharedAssetCtx) UnmarshalEasyJSON ¶
func (v *SharedAssetCtx) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SharedAssetCtx) UnmarshalJSON ¶
func (v *SharedAssetCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SignatureResult ¶
SignatureResult represents the structured signature result
func SignAgent ¶
func SignAgent( privateKey *ecdsa.PrivateKey, agentAddress, agentName string, nonce int64, isMainnet bool, ) (SignatureResult, error)
SignAgent signs agent approval action using EIP-712 direct signing
func SignApproveBuilderFee ¶
func SignApproveBuilderFee( privateKey *ecdsa.PrivateKey, builderAddress string, maxFeeRate float64, timestamp int64, isMainnet bool, ) (SignatureResult, error)
SignApproveBuilderFee signs approve builder fee action
func SignConvertToMultiSigUserAction ¶
func SignConvertToMultiSigUserAction( privateKey *ecdsa.PrivateKey, signers []string, threshold int, timestamp int64, isMainnet bool, ) (SignatureResult, error)
SignConvertToMultiSigUserAction signs convert to multi-sig user action
func SignL1Action ¶
func SignL1Action( privateKey *ecdsa.PrivateKey, action any, vaultAddress string, timestamp int64, expiresAfter *int64, isMainnet bool, ) (SignatureResult, error)
func SignMultiSigAction ¶
func SignMultiSigAction( privateKey *ecdsa.PrivateKey, innerAction map[string]any, signers []string, signatures []string, timestamp int64, isMainnet bool, ) (SignatureResult, error)
SignMultiSigAction signs multi-signature action
func SignPerpDexClassTransferAction ¶
func SignPerpDexClassTransferAction( privateKey *ecdsa.PrivateKey, dex, token string, amount float64, toPerp bool, timestamp int64, isMainnet bool, ) (SignatureResult, error)
SignPerpDexClassTransferAction signs perp dex class transfer action
func SignSpotTransferAction ¶
func SignSpotTransferAction( privateKey *ecdsa.PrivateKey, amount float64, destination, token string, timestamp int64, isMainnet bool, ) (SignatureResult, error)
SignSpotTransferAction signs spot transfer action
func SignTokenDelegateAction ¶
func SignTokenDelegateAction( privateKey *ecdsa.PrivateKey, token string, amount float64, validatorAddress string, timestamp int64, isMainnet bool, ) (SignatureResult, error)
SignTokenDelegateAction signs token delegate action
func SignUsdClassTransferAction ¶
func SignUsdClassTransferAction( privateKey *ecdsa.PrivateKey, amount float64, toPerp bool, timestamp int64, isMainnet bool, ) (SignatureResult, error)
SignUsdClassTransferAction signs USD class transfer action
func SignUsdTransferAction ¶
func SignUsdTransferAction( privateKey *ecdsa.PrivateKey, amount float64, destination string, timestamp int64, isMainnet bool, ) (SignatureResult, error)
SignUsdTransferAction signs USD transfer action
func SignUserSignedAction ¶
func SignUserSignedAction( privateKey *ecdsa.PrivateKey, action map[string]any, payloadTypes []apitypes.Type, primaryType string, isMainnet bool, ) (SignatureResult, error)
SignUserSignedAction signs actions that require direct EIP-712 signing (e.g., approveAgent, approveBuilderFee, convertToMultiSigUser)
IMPORTANT: The message will contain MORE fields than declared in payloadTypes to avoid the error "422 Failed to deserialize the JSON body" and "User or API Wallet 0x123... does not exist". This matches Python SDK behavior where the field order doesn't matter and extra fields (type, signatureChainId) are present in the message but ignored during EIP-712 hashing via hashStructLenient.
func SignWithdrawFromBridgeAction ¶
func SignWithdrawFromBridgeAction( privateKey *ecdsa.PrivateKey, destination string, amount, fee float64, timestamp int64, isMainnet bool, ) (SignatureResult, error)
SignWithdrawFromBridgeAction signs withdraw from bridge action
type SpotAssetCtx ¶
type SpotAssetCtx struct {
DayNtlVlm string `json:"dayNtlVlm"`
MarkPx string `json:"markPx"`
MidPx *string `json:"midPx"`
PrevDayPx string `json:"prevDayPx"`
CirculatingSupply string `json:"circulatingSupply"`
Coin string `json:"coin"`
}
func (SpotAssetCtx) MarshalEasyJSON ¶
func (v SpotAssetCtx) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SpotAssetCtx) MarshalJSON ¶
func (v SpotAssetCtx) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SpotAssetCtx) UnmarshalEasyJSON ¶
func (v *SpotAssetCtx) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SpotAssetCtx) UnmarshalJSON ¶
func (v *SpotAssetCtx) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SpotAssetInfo ¶
type SpotAssetInfo struct {
Name string `json:"name"`
Tokens []int `json:"tokens"`
Index int `json:"index"`
IsCanonical bool `json:"isCanonical"`
}
func (SpotAssetInfo) MarshalEasyJSON ¶
func (v SpotAssetInfo) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SpotAssetInfo) MarshalJSON ¶
func (v SpotAssetInfo) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SpotAssetInfo) UnmarshalEasyJSON ¶
func (v *SpotAssetInfo) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SpotAssetInfo) UnmarshalJSON ¶
func (v *SpotAssetInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SpotBalance ¶
type SpotBalance struct {
Coin string `json:"coin"`
Token int `json:"token"`
Hold string `json:"hold"`
Total string `json:"total"`
EntryNtl string `json:"entryNtl"`
}
func (SpotBalance) MarshalEasyJSON ¶
func (v SpotBalance) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SpotBalance) MarshalJSON ¶
func (v SpotBalance) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SpotBalance) UnmarshalEasyJSON ¶
func (v *SpotBalance) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SpotBalance) UnmarshalJSON ¶
func (v *SpotBalance) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SpotDeployResponse ¶
type SpotDeployResponse struct {
Status string `json:"status"`
TxHash string `json:"txHash,omitempty"`
Error string `json:"error,omitempty"`
}
func (SpotDeployResponse) MarshalEasyJSON ¶
func (v SpotDeployResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SpotDeployResponse) MarshalJSON ¶
func (v SpotDeployResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SpotDeployResponse) UnmarshalEasyJSON ¶
func (v *SpotDeployResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SpotDeployResponse) UnmarshalJSON ¶
func (v *SpotDeployResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SpotMeta ¶
type SpotMeta struct {
Universe []SpotAssetInfo `json:"universe"`
Tokens []SpotTokenInfo `json:"tokens"`
}
func (SpotMeta) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (SpotMeta) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*SpotMeta) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SpotMeta) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type SpotMetaAndAssetCtxs ¶
type SpotMetaAndAssetCtxs struct {
Meta SpotMeta
Ctxs []SpotAssetCtx
}
This type has no JSON annotation because it cannot be directly unmarshalled from the response
func (SpotMetaAndAssetCtxs) MarshalEasyJSON ¶
func (v SpotMetaAndAssetCtxs) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SpotMetaAndAssetCtxs) MarshalJSON ¶
func (v SpotMetaAndAssetCtxs) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SpotMetaAndAssetCtxs) UnmarshalEasyJSON ¶
func (v *SpotMetaAndAssetCtxs) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SpotMetaAndAssetCtxs) UnmarshalJSON ¶
func (v *SpotMetaAndAssetCtxs) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SpotState ¶
type SpotState struct {
Balances []SpotBalance `json:"balances,omitempty"`
}
func (SpotState) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (SpotState) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*SpotState) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SpotState) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type SpotTokenInfo ¶
type SpotTokenInfo struct {
Name string `json:"name"`
SzDecimals int `json:"szDecimals"`
WeiDecimals int `json:"weiDecimals"`
Index int `json:"index"`
TokenID string `json:"tokenId"`
IsCanonical bool `json:"isCanonical"`
EvmContract *EvmContract `json:"evmContract"`
FullName *string `json:"fullName"`
}
func (SpotTokenInfo) MarshalEasyJSON ¶
func (v SpotTokenInfo) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SpotTokenInfo) MarshalJSON ¶
func (v SpotTokenInfo) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SpotTokenInfo) UnmarshalEasyJSON ¶
func (v *SpotTokenInfo) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SpotTokenInfo) UnmarshalJSON ¶
func (v *SpotTokenInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SpotTransferAction ¶
type SpotTransferAction struct {
Type string `json:"type" msgpack:"type"`
Destination string `json:"destination" msgpack:"destination"`
Amount string `json:"amount" msgpack:"amount"`
Token string `json:"token" msgpack:"token"`
Time int64 `json:"time" msgpack:"time"`
}
SpotTransferAction represents spot transfer
func (SpotTransferAction) MarshalEasyJSON ¶
func (v SpotTransferAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SpotTransferAction) MarshalJSON ¶
func (v SpotTransferAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SpotTransferAction) UnmarshalEasyJSON ¶
func (v *SpotTransferAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SpotTransferAction) UnmarshalJSON ¶
func (v *SpotTransferAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SpotUserState ¶
type SpotUserState struct {
Balances []SpotBalance `json:"balances"`
}
func (SpotUserState) MarshalEasyJSON ¶
func (v SpotUserState) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SpotUserState) MarshalJSON ¶
func (v SpotUserState) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SpotUserState) UnmarshalEasyJSON ¶
func (v *SpotUserState) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SpotUserState) UnmarshalJSON ¶
func (v *SpotUserState) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StakingDelegation ¶
type StakingDelegation struct {
Validator string `json:"validator"`
Amount string `json:"amount"`
LockedUntilTimestamp int64 `json:"lockedUntilTimestamp"`
}
func (StakingDelegation) MarshalEasyJSON ¶
func (v StakingDelegation) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StakingDelegation) MarshalJSON ¶
func (v StakingDelegation) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StakingDelegation) UnmarshalEasyJSON ¶
func (v *StakingDelegation) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StakingDelegation) UnmarshalJSON ¶
func (v *StakingDelegation) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StakingReward ¶
type StakingReward struct {
Time int64 `json:"time"`
Source string `json:"source"`
TotalAmount string `json:"totalAmount"`
}
func (StakingReward) MarshalEasyJSON ¶
func (v StakingReward) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StakingReward) MarshalJSON ¶
func (v StakingReward) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StakingReward) UnmarshalEasyJSON ¶
func (v *StakingReward) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StakingReward) UnmarshalJSON ¶
func (v *StakingReward) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StakingSummary ¶
type StakingSummary struct {
Delegated string `json:"delegated"`
Undelegated string `json:"undelegated"`
TotalPendingWithdrawal string `json:"totalPendingWithdrawal"`
NPendingWithdrawals int `json:"nPendingWithdrawals"`
}
func (StakingSummary) MarshalEasyJSON ¶
func (v StakingSummary) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StakingSummary) MarshalJSON ¶
func (v StakingSummary) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StakingSummary) UnmarshalEasyJSON ¶
func (v *StakingSummary) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StakingSummary) UnmarshalJSON ¶
func (v *StakingSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SubAccount ¶
type SubAccount struct {
Name string `json:"name"`
User string `json:"user"`
Permissions []string `json:"permissions"`
}
func (SubAccount) MarshalEasyJSON ¶
func (v SubAccount) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SubAccount) MarshalJSON ¶
func (v SubAccount) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SubAccount) UnmarshalEasyJSON ¶
func (v *SubAccount) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SubAccount) UnmarshalJSON ¶
func (v *SubAccount) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SubAccountSpotTransferAction ¶
type SubAccountSpotTransferAction struct {
Type string `json:"type" msgpack:"type"`
SubAccountUser string `json:"subAccountUser" msgpack:"subAccountUser"`
IsDeposit bool `json:"isDeposit" msgpack:"isDeposit"`
Token string `json:"token" msgpack:"token"`
Amount float64 `json:"amount" msgpack:"amount"`
}
SubAccountSpotTransferAction represents sub-account spot transfer
func (SubAccountSpotTransferAction) MarshalEasyJSON ¶
func (v SubAccountSpotTransferAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SubAccountSpotTransferAction) MarshalJSON ¶
func (v SubAccountSpotTransferAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SubAccountSpotTransferAction) UnmarshalEasyJSON ¶
func (v *SubAccountSpotTransferAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SubAccountSpotTransferAction) UnmarshalJSON ¶
func (v *SubAccountSpotTransferAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SubAccountTransferAction ¶
type SubAccountTransferAction struct {
Type string `json:"type" msgpack:"type"`
SubAccountUser string `json:"subAccountUser" msgpack:"subAccountUser"`
IsDeposit bool `json:"isDeposit" msgpack:"isDeposit"`
Usd int `json:"usd" msgpack:"usd"`
}
SubAccountTransferAction represents sub-account transfer
func (SubAccountTransferAction) MarshalEasyJSON ¶
func (v SubAccountTransferAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SubAccountTransferAction) MarshalJSON ¶
func (v SubAccountTransferAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SubAccountTransferAction) UnmarshalEasyJSON ¶
func (v *SubAccountTransferAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SubAccountTransferAction) UnmarshalJSON ¶
func (v *SubAccountTransferAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Subscription ¶
type Tiers ¶
func (Tiers) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Tiers) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Tiers) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Tiers) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type TokenDelegateAction ¶
type TokenDelegateAction struct {
Type string `json:"type" msgpack:"type"`
Validator string `json:"validator" msgpack:"validator"`
Wei int `json:"wei" msgpack:"wei"`
IsUndelegate bool `json:"isUndelegate" msgpack:"isUndelegate"`
Nonce int64 `json:"nonce" msgpack:"nonce"`
}
TokenDelegateAction represents token delegate action
func (TokenDelegateAction) MarshalEasyJSON ¶
func (v TokenDelegateAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TokenDelegateAction) MarshalJSON ¶
func (v TokenDelegateAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TokenDelegateAction) UnmarshalEasyJSON ¶
func (v *TokenDelegateAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TokenDelegateAction) UnmarshalJSON ¶
func (v *TokenDelegateAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Trade ¶
type Trade struct {
Coin string `json:"coin"`
Side string `json:"side"`
Px string `json:"px"`
Sz string `json:"sz"`
Time int64 `json:"time"`
Hash string `json:"hash"`
Tid int64 `json:"tid"`
Users []string `json:"users"`
}
func (Trade) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Trade) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Trade) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Trade) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type TradesSubscriptionParams ¶
type TradesSubscriptionParams struct {
Coin string
}
type TransferResponse ¶
type TransferResponse struct {
Status string `json:"status"`
TxHash string `json:"txHash,omitempty"`
Error string `json:"error,omitempty"`
}
func (TransferResponse) MarshalEasyJSON ¶
func (v TransferResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransferResponse) MarshalJSON ¶
func (v TransferResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransferResponse) UnmarshalEasyJSON ¶
func (v *TransferResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransferResponse) UnmarshalJSON ¶
func (v *TransferResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TriggerOrderType ¶
type TriggerOrderType struct {
TriggerPx float64 `json:"triggerPx" msgpack:"triggerPx"`
IsMarket bool `json:"isMarket" msgpack:"isMarket"`
Tpsl Tpsl `json:"tpsl" msgpack:"tpsl"` // "tp" or "sl"
}
func (TriggerOrderType) MarshalEasyJSON ¶
func (v TriggerOrderType) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TriggerOrderType) MarshalJSON ¶
func (v TriggerOrderType) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TriggerOrderType) UnmarshalEasyJSON ¶
func (v *TriggerOrderType) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TriggerOrderType) UnmarshalJSON ¶
func (v *TriggerOrderType) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TxStatus ¶
func (TxStatus) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (TxStatus) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*TxStatus) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TxStatus) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type UpdateIsolatedMarginAction ¶
type UpdateIsolatedMarginAction struct {
Type string `json:"type" msgpack:"type"`
Asset int `json:"asset" msgpack:"asset"`
IsBuy bool `json:"isBuy" msgpack:"isBuy"`
Ntli float64 `json:"ntli" msgpack:"ntli"`
}
UpdateIsolatedMarginAction represents isolated margin update
func (UpdateIsolatedMarginAction) MarshalEasyJSON ¶
func (v UpdateIsolatedMarginAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UpdateIsolatedMarginAction) MarshalJSON ¶
func (v UpdateIsolatedMarginAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UpdateIsolatedMarginAction) UnmarshalEasyJSON ¶
func (v *UpdateIsolatedMarginAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UpdateIsolatedMarginAction) UnmarshalJSON ¶
func (v *UpdateIsolatedMarginAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UpdateLeverageAction ¶
type UpdateLeverageAction struct {
Type string `json:"type" msgpack:"type"`
Asset int `json:"asset" msgpack:"asset"`
IsCross bool `json:"isCross" msgpack:"isCross"`
Leverage int `json:"leverage" msgpack:"leverage"`
}
UpdateLeverageAction represents leverage update
func (UpdateLeverageAction) MarshalEasyJSON ¶
func (v UpdateLeverageAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UpdateLeverageAction) MarshalJSON ¶
func (v UpdateLeverageAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UpdateLeverageAction) UnmarshalEasyJSON ¶
func (v *UpdateLeverageAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UpdateLeverageAction) UnmarshalJSON ¶
func (v *UpdateLeverageAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UsdClassTransferAction ¶
type UsdClassTransferAction struct {
Type string `json:"type" msgpack:"type"`
Amount string `json:"amount" msgpack:"amount"`
ToPerp bool `json:"toPerp" msgpack:"toPerp"`
Nonce int64 `json:"nonce" msgpack:"nonce"`
}
UsdClassTransferAction represents USD class transfer
func (UsdClassTransferAction) MarshalEasyJSON ¶
func (v UsdClassTransferAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UsdClassTransferAction) MarshalJSON ¶
func (v UsdClassTransferAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UsdClassTransferAction) UnmarshalEasyJSON ¶
func (v *UsdClassTransferAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UsdClassTransferAction) UnmarshalJSON ¶
func (v *UsdClassTransferAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UsdTransferAction ¶
type UsdTransferAction struct {
Type string `json:"type" msgpack:"type"`
Destination string `json:"destination" msgpack:"destination"`
Amount string `json:"amount" msgpack:"amount"`
Time int64 `json:"time" msgpack:"time"`
}
UsdTransferAction represents USD transfer
func (UsdTransferAction) MarshalEasyJSON ¶
func (v UsdTransferAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UsdTransferAction) MarshalJSON ¶
func (v UsdTransferAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UsdTransferAction) UnmarshalEasyJSON ¶
func (v *UsdTransferAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UsdTransferAction) UnmarshalJSON ¶
func (v *UsdTransferAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UseBigBlocksAction ¶
type UseBigBlocksAction struct {
Type string `json:"type" msgpack:"type"`
UsingBigBlocks bool `json:"usingBigBlocks" msgpack:"usingBigBlocks"`
}
UseBigBlocksAction represents use big blocks action
func (UseBigBlocksAction) MarshalEasyJSON ¶
func (v UseBigBlocksAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UseBigBlocksAction) MarshalJSON ¶
func (v UseBigBlocksAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UseBigBlocksAction) UnmarshalEasyJSON ¶
func (v *UseBigBlocksAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UseBigBlocksAction) UnmarshalJSON ¶
func (v *UseBigBlocksAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UserActiveAssetData ¶
type UserActiveAssetData struct {
User string `json:"user"`
Coin string `json:"coin"`
Leverage Leverage `json:"leverage"`
MaxTradeSzs []string `json:"maxTradeSzs"`
AvailableToTrade []string `json:"availableToTrade"`
MarkPx string `json:"markPx"`
}
func (UserActiveAssetData) MarshalEasyJSON ¶
func (v UserActiveAssetData) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UserActiveAssetData) MarshalJSON ¶
func (v UserActiveAssetData) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UserActiveAssetData) UnmarshalEasyJSON ¶
func (v *UserActiveAssetData) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UserActiveAssetData) UnmarshalJSON ¶
func (v *UserActiveAssetData) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UserFees ¶
type UserFees struct {
ActiveReferralDiscount string `json:"activeReferralDiscount"`
DailyUserVolume []UserVolume `json:"dailyUserVlm"`
FeeSchedule FeeSchedule `json:"feeSchedule"`
UserAddRate string `json:"userAddRate"`
UserCrossRate string `json:"userCrossRate"`
UserSpotCrossRate string `json:"userSpotCrossRate"`
UserSpotAddRate string `json:"userSpotAddRate"`
}
func (UserFees) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (UserFees) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*UserFees) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UserFees) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type UserFundingHistory ¶
type UserFundingHistory struct {
User string `json:"user"`
Type string `json:"type"`
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
}
func (UserFundingHistory) MarshalEasyJSON ¶
func (v UserFundingHistory) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UserFundingHistory) MarshalJSON ¶
func (v UserFundingHistory) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UserFundingHistory) UnmarshalEasyJSON ¶
func (v *UserFundingHistory) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UserFundingHistory) UnmarshalJSON ¶
func (v *UserFundingHistory) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UserState ¶
type UserState struct {
AssetPositions []AssetPosition `json:"assetPositions"`
CrossMarginSummary MarginSummary `json:"crossMarginSummary"`
MarginSummary MarginSummary `json:"marginSummary"`
Withdrawable string `json:"withdrawable"`
}
func (UserState) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (UserState) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*UserState) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UserState) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type UserVolume ¶
type UserVolume struct {
Date string `json:"date"`
Exchange string `json:"exchange"`
UserAdd string `json:"userAdd"`
UserCross string `json:"userCross"`
}
func (UserVolume) MarshalEasyJSON ¶
func (v UserVolume) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UserVolume) MarshalJSON ¶
func (v UserVolume) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UserVolume) UnmarshalEasyJSON ¶
func (v *UserVolume) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UserVolume) UnmarshalJSON ¶
func (v *UserVolume) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type VIPTier ¶
type VIPTier struct {
Add string `json:"add"`
Cross string `json:"cross"`
NtlCutoff string `json:"ntlCutoff"`
}
func (VIPTier) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (VIPTier) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*VIPTier) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*VIPTier) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type ValidationError ¶
func (ValidationError) Error ¶
func (e ValidationError) Error() string
func (ValidationError) MarshalEasyJSON ¶
func (v ValidationError) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ValidationError) MarshalJSON ¶
func (v ValidationError) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ValidationError) UnmarshalEasyJSON ¶
func (v *ValidationError) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ValidationError) UnmarshalJSON ¶
func (v *ValidationError) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ValidatorResponse ¶
type ValidatorResponse struct {
Status string `json:"status"`
TxHash string `json:"txHash,omitempty"`
Error string `json:"error,omitempty"`
}
func (ValidatorResponse) MarshalEasyJSON ¶
func (v ValidatorResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ValidatorResponse) MarshalJSON ¶
func (v ValidatorResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ValidatorResponse) UnmarshalEasyJSON ¶
func (v *ValidatorResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ValidatorResponse) UnmarshalJSON ¶
func (v *ValidatorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type VaultDistributeAction ¶
type VaultDistributeAction struct {
Type string `json:"type" msgpack:"type"`
VaultAddress string `json:"vaultAddress" msgpack:"vaultAddress"`
Usd int `json:"usd" msgpack:"usd"`
}
VaultDistributeAction represents vault distribute action
func (VaultDistributeAction) MarshalEasyJSON ¶
func (v VaultDistributeAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (VaultDistributeAction) MarshalJSON ¶
func (v VaultDistributeAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*VaultDistributeAction) UnmarshalEasyJSON ¶
func (v *VaultDistributeAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*VaultDistributeAction) UnmarshalJSON ¶
func (v *VaultDistributeAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type VaultModifyAction ¶
type VaultModifyAction struct {
Type string `json:"type" msgpack:"type"`
VaultAddress string `json:"vaultAddress" msgpack:"vaultAddress"`
AllowDeposits bool `json:"allowDeposits" msgpack:"allowDeposits"`
AlwaysCloseOnWithdraw bool `json:"alwaysCloseOnWithdraw" msgpack:"alwaysCloseOnWithdraw"`
}
VaultModifyAction represents vault modify action
func (VaultModifyAction) MarshalEasyJSON ¶
func (v VaultModifyAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (VaultModifyAction) MarshalJSON ¶
func (v VaultModifyAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*VaultModifyAction) UnmarshalEasyJSON ¶
func (v *VaultModifyAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*VaultModifyAction) UnmarshalJSON ¶
func (v *VaultModifyAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type VaultUsdTransferAction ¶
type VaultUsdTransferAction struct {
Type string `json:"type" msgpack:"type"`
VaultAddress string `json:"vaultAddress" msgpack:"vaultAddress"`
IsDeposit bool `json:"isDeposit" msgpack:"isDeposit"`
Usd int `json:"usd" msgpack:"usd"`
}
VaultUsdTransferAction represents vault USD transfer
func (VaultUsdTransferAction) MarshalEasyJSON ¶
func (v VaultUsdTransferAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (VaultUsdTransferAction) MarshalJSON ¶
func (v VaultUsdTransferAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*VaultUsdTransferAction) UnmarshalEasyJSON ¶
func (v *VaultUsdTransferAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*VaultUsdTransferAction) UnmarshalJSON ¶
func (v *VaultUsdTransferAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type WebData2 ¶
type WebData2 struct {
ClearinghouseState *ClearinghouseState `json:"clearinghouseState,omitempty"`
LeadingVaults []any `json:"leadingVaults,omitempty"`
TotalVaultEquity string `json:"totalVaultEquity,omitempty"`
OpenOrders []WsBasicOrder `json:"openOrders,omitempty"`
AgentAddress *string `json:"agentAddress,omitempty"`
AgentValidUntil *int64 `json:"agentValidUntil,omitempty"`
CumLedger string `json:"cumLedger,omitempty"`
Meta *WebData2Meta `json:"meta,omitempty"`
AssetCtxs []AssetCtx `json:"assetCtxs,omitempty"`
ServerTime int64 `json:"serverTime,omitempty"`
IsVault bool `json:"isVault,omitempty"`
User string `json:"user,omitempty"`
TwapStates []any `json:"twapStates,omitempty"`
SpotState *SpotState `json:"spotState,omitempty"`
SpotAssetCtxs []SpotAssetCtx `json:"spotAssetCtxs,omitempty"`
PerpsAtOpenInterestCap []string `json:"perpsAtOpenInterestCap,omitempty"`
}
type WebData2AssetInfo ¶
type WebData2AssetInfo struct {
SzDecimals int `json:"szDecimals,omitempty"`
Name string `json:"name,omitempty"`
MaxLeverage int `json:"maxLeverage,omitempty"`
MarginTableID int `json:"marginTableId,omitempty"`
IsDelisted bool `json:"isDelisted,omitempty"`
OnlyIsolated bool `json:"onlyIsolated,omitempty"`
}
func (WebData2AssetInfo) MarshalEasyJSON ¶
func (v WebData2AssetInfo) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (WebData2AssetInfo) MarshalJSON ¶
func (v WebData2AssetInfo) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*WebData2AssetInfo) UnmarshalEasyJSON ¶
func (v *WebData2AssetInfo) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WebData2AssetInfo) UnmarshalJSON ¶
func (v *WebData2AssetInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type WebData2MarginTable ¶
type WebData2MarginTable struct {
Description string `json:"description,omitempty"`
MarginTiers []WebData2MarginTier `json:"marginTiers,omitempty"`
}
func (WebData2MarginTable) MarshalEasyJSON ¶
func (v WebData2MarginTable) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (WebData2MarginTable) MarshalJSON ¶
func (v WebData2MarginTable) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*WebData2MarginTable) UnmarshalEasyJSON ¶
func (v *WebData2MarginTable) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WebData2MarginTable) UnmarshalJSON ¶
func (v *WebData2MarginTable) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type WebData2MarginTier ¶
type WebData2MarginTier struct {
LowerBound string `json:"lowerBound,omitempty"`
MaxLeverage int `json:"maxLeverage,omitempty"`
}
func (WebData2MarginTier) MarshalEasyJSON ¶
func (v WebData2MarginTier) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (WebData2MarginTier) MarshalJSON ¶
func (v WebData2MarginTier) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*WebData2MarginTier) UnmarshalEasyJSON ¶
func (v *WebData2MarginTier) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WebData2MarginTier) UnmarshalJSON ¶
func (v *WebData2MarginTier) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type WebData2Meta ¶
type WebData2Meta struct {
Universe []WebData2AssetInfo `json:"universe,omitempty"`
MarginTables []Tuple2[int, WebData2MarginTable] `json:"marginTables,omitempty"`
}
type WebData2SubscriptionParams ¶
type WebData2SubscriptionParams struct {
User string
}
type WebsocketClient ¶
type WebsocketClient struct {
// contains filtered or unexported fields
}
func NewWebsocketClient ¶
func NewWebsocketClient(baseURL string, opts ...WsOpt) *WebsocketClient
func (*WebsocketClient) ActiveAssetCtx ¶
func (w *WebsocketClient) ActiveAssetCtx( params ActiveAssetCtxSubscriptionParams, callback func(ActiveAssetCtx, error), ) (*Subscription, error)
func (*WebsocketClient) AllMids ¶
func (w *WebsocketClient) AllMids( params AllMidsSubscriptionParams, callback func(AllMids, error), ) (*Subscription, error)
func (*WebsocketClient) Bbo ¶
func (w *WebsocketClient) Bbo( params BboSubscriptionParams, callback func(Bbo, error), ) (*Subscription, error)
func (*WebsocketClient) Candles ¶
func (w *WebsocketClient) Candles( params CandlesSubscriptionParams, callback func(Candle, error), ) (*Subscription, error)
func (*WebsocketClient) Close ¶
func (w *WebsocketClient) Close() error
func (*WebsocketClient) L2Book ¶
func (w *WebsocketClient) L2Book( params L2BookSubscriptionParams, callback func(L2Book, error), ) (*Subscription, error)
func (*WebsocketClient) Notification ¶
func (w *WebsocketClient) Notification( params NotificationSubscriptionParams, callback func(Notification, error), ) (*Subscription, error)
func (*WebsocketClient) OrderFills ¶
func (w *WebsocketClient) OrderFills( params OrderFillsSubscriptionParams, callback func(WsOrderFills, error), ) (*Subscription, error)
func (*WebsocketClient) OrderUpdates ¶
func (w *WebsocketClient) OrderUpdates( params OrderUpdatesSubscriptionParams, callback func([]WsOrder, error), ) (*Subscription, error)
func (*WebsocketClient) Trades ¶
func (w *WebsocketClient) Trades( params TradesSubscriptionParams, callback func([]Trade, error), ) (*Subscription, error)
func (*WebsocketClient) WebData2 ¶
func (w *WebsocketClient) WebData2( params WebData2SubscriptionParams, callback func(WebData2, error), ) (*Subscription, error)
type WithdrawFromBridgeAction ¶
type WithdrawFromBridgeAction struct {
Type string `json:"type" msgpack:"type"`
Destination string `json:"destination" msgpack:"destination"`
Amount string `json:"amount" msgpack:"amount"`
Time int64 `json:"time" msgpack:"time"`
}
WithdrawFromBridgeAction represents withdraw from bridge action
func (WithdrawFromBridgeAction) MarshalEasyJSON ¶
func (v WithdrawFromBridgeAction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (WithdrawFromBridgeAction) MarshalJSON ¶
func (v WithdrawFromBridgeAction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*WithdrawFromBridgeAction) UnmarshalEasyJSON ¶
func (v *WithdrawFromBridgeAction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WithdrawFromBridgeAction) UnmarshalJSON ¶
func (v *WithdrawFromBridgeAction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type WsBasicOrder ¶
type WsBasicOrder struct {
Coin string `json:"coin"`
Side string `json:"side"`
LimitPx string `json:"limitPx"`
Sz string `json:"sz"`
Oid int64 `json:"oid"`
Timestamp int64 `json:"timestamp"`
OrigSz string `json:"origSz"`
Cloid *string `json:"cloid"`
}
func (WsBasicOrder) MarshalEasyJSON ¶
func (v WsBasicOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (WsBasicOrder) MarshalJSON ¶
func (v WsBasicOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*WsBasicOrder) UnmarshalEasyJSON ¶
func (v *WsBasicOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WsBasicOrder) UnmarshalJSON ¶
func (v *WsBasicOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type WsMsg ¶
WsMsg represents a WebSocket message with a channel and data payload.
func (WsMsg) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (WsMsg) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*WsMsg) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WsMsg) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type WsOrder ¶
type WsOrder struct {
Order WsBasicOrder `json:"order"`
Status OrderStatusValue `json:"status"`
StatusTimestamp int64 `json:"statusTimestamp"`
}
func (WsOrder) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (WsOrder) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*WsOrder) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WsOrder) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type WsOrderFill ¶
type WsOrderFill struct {
Coin string `json:"coin"`
Px string `json:"px"` // price
Sz string `json:"sz"` // size
Side string `json:"side"`
Time int64 `json:"time"`
StartPosition string `json:"startPosition"`
Dir string `json:"dir"` // used for frontend display
ClosedPnl string `json:"closedPnl"`
Hash string `json:"hash"` // L1 transaction hash
Oid int64 `json:"oid"` // order id
Crossed bool `json:"crossed"` // whether order crossed the spread (was taker)
Fee string `json:"fee"` // negative means rebate
Tid int64 `json:"tid"` // unique trade id
Liquidation *FillLiquidation `json:"liquidation,omitempty"`
FeeToken string `json:"feeToken"` // the token the fee was paid in
BuilderFee *string `json:"builderFee,omitempty"` // amount paid to builder, also included in fee
}
func (WsOrderFill) MarshalEasyJSON ¶
func (v WsOrderFill) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (WsOrderFill) MarshalJSON ¶
func (v WsOrderFill) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*WsOrderFill) UnmarshalEasyJSON ¶
func (v *WsOrderFill) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WsOrderFill) UnmarshalJSON ¶
func (v *WsOrderFill) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type WsOrderFills ¶
type WsOrderFills struct {
IsSnapshot bool `json:"isSnapshot"`
User string `json:"user"`
Fills []WsOrderFill `json:"fills"`
}
func (WsOrderFills) Key ¶
func (w WsOrderFills) Key() string
func (WsOrderFills) MarshalEasyJSON ¶
func (v WsOrderFills) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (WsOrderFills) MarshalJSON ¶
func (v WsOrderFills) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*WsOrderFills) UnmarshalEasyJSON ¶
func (v *WsOrderFills) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WsOrderFills) UnmarshalJSON ¶
func (v *WsOrderFills) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
Source Files
¶
- actions.go
- actions_easyjson.go
- api.go
- client.go
- cloid.go
- errors.go
- errors_easyjson.go
- exchange.go
- exchange_orders.go
- exchange_orders_cancel.go
- exchange_others.go
- info.go
- opt.go
- signing.go
- testutils.go
- types.go
- types_easyjson.go
- utils.go
- ws.go
- ws_msg_dispatch.go
- ws_sub_activeassetctx.go
- ws_sub_allmids.go
- ws_sub_bbo.go
- ws_sub_candle.go
- ws_sub_l2book.go
- ws_sub_notification.go
- ws_sub_orderfills.go
- ws_sub_orderupdates.go
- ws_sub_trades.go
- ws_sub_webdata2.go
- ws_types.go
- ws_types_easyjson.go
- ws_types_remote.go
- ws_types_remote_easyjson.go
- ws_types_subscriptable.go
- ws_uniq_subscriber.go
- ws_utils.go