Versions in this module Expand all Collapse all v0 v0.1.0 Nov 18, 2026 Changes in this version + const AccountHeader + const BaseDecimals + const CodeAPIEndpointTemporarilyDeactivated + const CodeAddMarginFailed + const CodeAddMarginToEmptyPosition + const CodeAddMarginToNonIsolatedPosition + const CodeAssetQuoteBalDecConfigNotFound + const CodeAssetUnderlyingBalDecConfigNotFound + const CodeBothOrderIDAndClientOrderIDProvided + const CodeBothTransferWalletTypeMustBeProvided + const CodeBuilderFeeExceedsAuthorizationLimit + const CodeBuilderFeeNegative + const CodeBuilderMissing + const CodeBuilderNotAuthorized + const CodeBulkOrdersMaxCountExceeded + const CodeBulkOrdersNotFromApiSource + const CodeBulkOrdersNotSupportTriggerOrder + const CodeBurningMoreVaultTokensThanOwned + const CodeBurningTokenWhileActiveRedemption + const CodeCVRZeroNotAllowedInFuturesWallet + const CodeCancelTTLDisabled + const CodeCancelTTLMaxExceeded + const CodeChargedTradingFeeBelowConfigMinimum + const CodeClientOrderIDOverlaps + const CodeClientOrderIDRepeats + const CodeClientOrderIDShouldBeSupplied + const CodeCollateralLimitExceeded + const CodeCreatingSplitTPSLExceedingPositionSize + const CodeCreatingSplitTPSLWithoutExistingPosition + const CodeCrossExchangeVaultNotSupported + const CodeCurrencyNotAllowedInWallet + const CodeCurrencyNotConvertible + const CodeCurrencyNotEnabledAsCollateral + const CodeCurrencyTransferNotAllowed + const CodeDelistCreateOrderBlocked + const CodeDelistPositionOpenBlocked + const CodeDeriskMMRatioOutOfRange + const CodeDuplicatePrimarySelector + const CodeDuplicatedTransfer + const CodeECNOrderMustBeFromApiSource + const CodeECNOrderMustBeGTT + const CodeECNOrderMustBeLimit + const CodeECNOrderMustBePostOnly + const CodeECNOrderMustNotBeConditional + const CodeECNOrderMustNotBeReduceOnly + const CodeECNOrderNotSupported + const CodeEmptyTriggerPrice + const CodeExactLimitNotSupported + const CodeExecutionMetadataShouldBeEmpty + const CodeFailedPostOrderCheck + const CodeFailedPreOrderCheck + const CodeForbidden + const CodeFundingAccountDoesntExist + const CodeGatewayTimeout + const CodeGrvtExternalTransferNotAllowed + const CodeIPNotWhitelisted + const CodeInactiveDerivative + const CodeInexactConversion + const CodeInstrumentNotSupported + const CodeInsufficientBalanceToTransfer + const CodeInsufficientFundingVaultShares + const CodeInsufficientInvestorTokenBalanceForRedemption + const CodeInsufficientMargin + const CodeInsufficientTradingVaultShares + const CodeInsufficientVaultLPToken + const CodeInternalServer + const CodeInvalidBulkOrdersAssetMismatch + const CodeInvalidCandlestickInterval + const CodeInvalidCandlestickType + const CodeInvalidCandlestickTypeForSpot + const CodeInvalidCandlestickTypeForStablePerp + const CodeInvalidChainID + const CodeInvalidContractGrainSize + const CodeInvalidCursor + const CodeInvalidDepth + const CodeInvalidDirection + const CodeInvalidEndpoint + const CodeInvalidFeedFormat + const CodeInvalidFeedRate + const CodeInvalidFundingAggregationTypeForStablePerp + const CodeInvalidInitialLeverage + const CodeInvalidInstrument + const CodeInvalidJSONRPCVersion + const CodeInvalidLimit + const CodeInvalidLimitPriceTick + const CodeInvalidOCO + const CodeInvalidOCOInvalidLeg + const CodeInvalidOCOMismatchedLegs + const CodeInvalidOSO + const CodeInvalidOSOInvalidLeg + const CodeInvalidOSOMismatchedLegs + const CodeInvalidOSOTriggerPrice + const CodeInvalidOrderID + const CodeInvalidPTPSL + const CodeInvalidPTPSLOrderLinkage + const CodeInvalidPTPSLReduceOnly + const CodeInvalidPTPSLSize + const CodeInvalidRequest + const CodeInvalidSignatureChainID + const CodeInvalidSubAccountID + const CodeInvalidSubscribeParams + const CodeInvalidTierOrder + const CodeInvalidTimeInForceOrderbook + const CodeInvalidTimeInForceRFQ + const CodeInvalidTransferMetadata + const CodeInvalidTransferProvider + const CodeInvalidTriggerBy + const CodeInvalidTriggerOrder + const CodeInvalidTriggerPriceTick + const CodeInvalidUnsubscribeParams + const CodeInvalidVaultID + const CodeInvalidVaultInvestorID + const CodeInvalidWalletTypeForFundingAccount + const CodeInvalidWalletTypeForSubAccount + const CodeInvestmentExceedsCap + const CodeInvestorNotVaultLP + const CodeJSONRPCIDExceedsUint32 + const CodeLegsEmpty + const CodeLegsMultipleOrderbook + const CodeLegsNotSorted + const CodeLimitOrderWithoutLimitPrice + const CodeLiquidationOrderNotSupported + const CodeLongCancelOnDisconnectCountdown + const CodeMMConfigNotFound + const CodeMainAccIDInvalid + const CodeMaintenanceCreateOrderBlocked + const CodeMarginTypeChangeFailed + const CodeMarginTypeChangeFailedHasOpenOrders + const CodeMarginTypeChangeFailedHasOpenPosition + const CodeMarginTypeNotSupported + const CodeMarketOrderWithLimitPrice + const CodeMaxAddableAmountExceeded + const CodeMaxOpenOrdersExceeded + const CodeMaxRemovableAmountExceeded + const CodeMaximumLeverageConfigPositionSizeExceeded + const CodeMaximumPositionSizeExceeded + const CodeMissingIndexPrice + const CodeModifyingSplitTPSLMismatchedCancels + const CodeNegativeBalance + const CodeNewLeverageAboveMaximum + const CodeNewLeverageBelowMinimum + const CodeNoOrdersProvided + const CodeNoTradePermission + const CodeNoTransferPermission + const CodeNonEmptyState + const CodeNotApplicableForSpotInstrument + const CodeNotFound + const CodeNotIsolatedMarginPosition + const CodeNotTPSLOrder + const CodeNotionalBelowMinimum + const CodeNumContractsUnderMinBlockSize + const CodeNumContractsUnderMinSize + const CodeOngoingRedemption + const CodeOnlyAllowedToInvestInVaultInvestmentCurrency + const CodeOnlyAllowedToRedeemInVaultInvestmentCurrency + const CodeOrderIDShouldBeEmpty + const CodeOrderSubAccountDoesNotMatchLoggedInUser + const CodePTPSLMustBeFromWebOrMobile + const CodePTPSLOrderAlreadyExists + const CodePositionClosingNotionalBelowMinimum + const CodePostOnlyWhenTakerOrder + const CodePriceOutOfConvertBand + const CodePrimarySelectorParts + const CodeRPCMethodNotFound + const CodeRPIOrderMustBeFromApiSource + const CodeRPIOrderMustBeLimit + const CodeRPIOrderMustBePostOnly + const CodeRPIOrderNotSupported + const CodeRateLimit + const CodeReduceOnlyOrderIncreaseSize + const CodeReduceOnlyOrderSizeExceeded + const CodeReduceOnlyOrderWithNoPosition + const CodeReplaceOrderNumOrdersMismatch + const CodeRfqAlreadyExistsForAsset + const CodeRfqIDNotAllowedForNonSFP + const CodeRfqInstrumentNotStablePerp + const CodeRfqInvalidExpiry + const CodeRfqSizeAboveMaximum + const CodeRfqSizeBelowMinimum + const CodeRfqSubAccountDoesNotMatchLoggedInUser + const CodeSecondarySelectorParts + const CodeServiceUnavailable + const CodeSessionKeySignerExpired + const CodeSessionOrderReduceOnlyRequired + const CodeSfpEndpointNotSupported + const CodeSfpIndicativeNotQualifiedMaker + const CodeSfpInstrumentMismatch + const CodeSfpMarketClosed + const CodeSfpMarketOrderNotAllowed + const CodeSfpOrderNotSupported + const CodeSfpPostOnlyNotAllowedForRetail + const CodeSfpPrivateQuoteNotSupported + const CodeSfpRfqAlreadyHasTakerOrder + const CodeSfpRfqNotLive + const CodeSfpTakerInvalidTimeInForce + const CodeSignatureDoesNotMatchPayload + const CodeSignatureExpirationTooLong + const CodeSignatureExpired + const CodeSignatureInvalidRSLength + const CodeSignatureInvalidV + const CodeSignatureSIsNotCurveLowerHalf + const CodeSignerUnauthorized + const CodeSlippageBelowMinimum + const CodeSlippageExceedsPriceProtectionBand + const CodeSlippageFeatureDisabled + const CodeSlippageRequiresIOCLimitOrder + const CodeSplitTPSLCreatesExceedsSetSize + const CodeSplitTPSLCreatesMustNotContainNonSplit + const CodeSplitTPSLMustBeReduceOnly + const CodeSplitTPSLMustNotBePositionLinkedTPSL + const CodeSplitTPSLNotSupported + const CodeSplitTPSLSetAlreadyExists + const CodeSpotFeeRebateNotSupported + const CodeSpotOrderNotSupported + const CodeSpotOrderReduceOnlyNotSupported + const CodeSpotOrderTPSLNotSupported + const CodeSpotTradingBlockedDuringSocializedLoss + const CodeStablePerpRequiresMultiAssetMode + const CodeStreamNotFound + const CodeTradingCouponNotTransferable + const CodeTransferAccountNotFound + const CodeTransferBetweenSubAccOfDifferentAccount + const CodeTransferFailedReasonUnrefined + const CodeTransferSubAccountNotFound + const CodeTransferSubAccountNotUnderAccount + const CodeTransferWithdrawalBlocked + const CodeUnauthorized + const CodeUnknownErr + const CodeUnknownTransactionType + const CodeUnspecifiedTransferType + const CodeUnsupportedBulkOrders + const CodeUnsupportedCurrency + const CodeUnsupportedTriggerBy + const CodeUsdcCollateralDisabled + const CodeValueOverflow + const CodeVaultCannotTrade + const CodeVaultConversionPriceStale + const CodeVaultConversionRateNotAllowed + const CodeVaultConversionZeroOutput + const CodeVaultInvalidInvestSource + const CodeVaultInvestAlreadyExecuted + const CodeVaultInvestSourceNeedsSpotTransfers + const CodeVaultLpTokensLocked + const CodeVaultNotActive + const CodeVaultShareTransferRoute + const CodeVaultsCannotConfigureLeverage + const CodeVisibilityRestricted + const CodeWithdrawalWalletNotSupported + const CodeWithdrawalWalletUnderReview + const ConnectTimeout + const ContractVersion + const CookieName + const Heartbeat + const IdleTimeout + const LiteWSPath + const LoginPath + const LoginSignatureTTL + const RateLimitCode + const ReadAttempts + const ResyncTimeout + const SignatureTTL + var ErrClosed = errors.New("grvt: client closed") + var RPCAccountAggregatedAccountSummary = RPCSpec + var RPCAccountFundingAccountSummary = RPCSpec + var RPCAccountGetSubAccounts = RPCSpec + var RPCAccountSpotAccountSummary = RPCSpec + var RPCAccountSubAccountSummary = RPCSpec + var RPCAlgoOrderAlgoOrderHistory = RPCSpec + var RPCAlgoOrderAlgoSubOrderHistory = RPCSpec + var RPCAlgoOrderCancelAlgoOrder = RPCSpec + var RPCAlgoOrderCreateAlgoOrder = RPCSpec + var RPCAlgoOrderGetAlgoOrder = RPCSpec + var RPCAlgoOrderOpenAlgoOrders = RPCSpec + var RPCBuilderGetAuthorizedBuilders = RPCSpec + var RPCCandlestickCandlestick = RPCSpec + var RPCDeriskMmRatioSetDeriskMmRatio = RPCSpec + var RPCEdgeAPIKeyLogin = RPCSpec + var RPCEdgeWalletLogin = RPCSpec + var RPCExecutionBuilderFillHistory = RPCSpec + var RPCExecutionFillHistory = RPCSpec + var RPCExecutionFundingPaymentHistory = RPCSpec + var RPCExecutionInterestPaymentHistory = RPCSpec + var RPCInitialLeverageGetAllInitialLeverage = RPCSpec + var RPCInitialLeverageSetInitialLeverage = RPCSpec + var RPCInstrumentGetAllCollateralAssetInfo = RPCSpec + var RPCInstrumentGetAllInstruments = RPCSpec + var RPCInstrumentGetCurrency = RPCSpec + var RPCInstrumentGetFilteredInstruments = RPCSpec + var RPCInstrumentGetInstrument = RPCSpec + var RPCInstrumentGetMarginRules = RPCSpec + var RPCInstrumentGetSupportedAssets = RPCSpec + var RPCOrderBulkOrders = RPCSpec + var RPCOrderCancelAllOrders = RPCSpec + var RPCOrderCancelOnDisconnect = RPCSpec + var RPCOrderCancelOrder = RPCSpec + var RPCOrderCreateOrder = RPCSpec + var RPCOrderGetOrder = RPCSpec + var RPCOrderOpenOrders = RPCSpec + var RPCOrderOrderHistory = RPCSpec + var RPCOrderbookOrderbookLevels = RPCSpec + var RPCPositionAddPositionMargin = RPCSpec + var RPCPositionGetPositionMarginLimits = RPCSpec + var RPCPositionPositionHistory = RPCSpec + var RPCPositionPositions = RPCSpec + var RPCPositionSetPositionConfig = RPCSpec + var RPCRfqCancelRfq = RPCSpec + var RPCRfqCreateRfq = RPCSpec + var RPCSettlementFundingRate = RPCSpec + var RPCSfpTradingScheduleGetSfpTradingSchedule = RPCSpec + var RPCSubAccountGetCollateralPreference = RPCSpec + var RPCTickerMiniTicker = RPCSpec + var RPCTickerTicker = RPCSpec + var RPCTradeTrade = RPCSpec + var RPCTradeTradeHistory = RPCSpec + var RPCTransferDepositHistory = RPCSpec + var RPCTransferGetWithdrawalFee = RPCSpec + var RPCTransferTransfer = RPCSpec + var RPCTransferTransferHistory = RPCSpec + var RPCTransferWithdrawal = RPCSpec + var RPCTransferWithdrawalHistory = RPCSpec + var RPCVaultVaultBurnTokens = RPCSpec + var RPCVaultVaultConversionRate = RPCSpec + var RPCVaultVaultInvest = RPCSpec + var RPCVaultVaultInvestorSummary = RPCSpec + var RPCVaultVaultManagerInvestmentHistory = RPCSpec + var RPCVaultVaultRedeem = RPCSpec + var RPCVaultVaultRedeemCancel = RPCSpec + var RPCVaultVaultRedemptionQueue = RPCSpec + var RPCs = []*RPCSpec + var StreamAlgoOrderAlgoOrder = StreamSpec + var StreamCandlestickCandlestick = StreamSpec + var StreamExecutionFill = StreamSpec + var StreamExecutionPositions = StreamSpec + var StreamOrderCancelStatus = StreamSpec + var StreamOrderOrder = StreamSpec + var StreamOrderOrderState = StreamSpec + var StreamOrderbookOrderbookDelta = StreamSpec + var StreamOrderbookOrderbookSnap = StreamSpec + var StreamRfqRfqQuote = StreamSpec + var StreamTickerMiniTickerDelta = StreamSpec + var StreamTickerMiniTickerSnap = StreamSpec + var StreamTickerTickerDelta = StreamSpec + var StreamTickerTickerSnap = StreamSpec + var StreamTradeTrade = StreamSpec + var StreamTransferDeposit = StreamSpec + var StreamTransferTransfer = StreamSpec + var StreamTransferWithdrawal = StreamSpec + var Streams = []*StreamSpec + func AddressSet(v string) bool + func BackfillPages[P Page](ctx context.Context, fetch func(context.Context, string) (P, error), ...) iter.Seq2[BackfillPage[P], error] + func Call[Req, Resp any](ctx context.Context, rt *Runtime, spec *RPCSpec, req *Req, ...) (*Resp, error) + func CheckOrder(checks *OrderChecks, order models.OrderInput, meta *Meta) error + func ChecksumAddress(a Address) string + func DecimalText(value *models.Decimal) string + func Deref[T any](p *T) *T + func Hex0x(b []byte) string + func Pages[P Page](ctx context.Context, fetch func(context.Context, string) (P, error), ...) iter.Seq2[P, error] + func Ptr[T any](v T) *T + func Redact(data []byte, limit int) string + func ScaleDecimal(s string, decimals uint32) (*big.Int, error) + func Selector(primary, secondary []string) string + func SelectorInt[T ~uint8 | ~uint16 | ~uint32 | ~uint64](v *T) string + func SignDeriskMmRatioSetDeriskMmRatio(ctx context.Context, rt *Runtime, ...) error + func SignEdgeWalletLogin(ctx context.Context, rt *Runtime, req *models.EdgeWalletLoginRequestInput) error + func SignOrderBulkOrders(ctx context.Context, rt *Runtime, req *models.ApiBulkOrdersRequestInput) error + func SignOrderCreateOrder(ctx context.Context, rt *Runtime, req *models.ApiCreateOrderRequestInput) error + func SignPositionAddPositionMargin(ctx context.Context, rt *Runtime, ...) error + func SignPositionSetPositionConfig(ctx context.Context, rt *Runtime, ...) error + func SignTransferTransfer(ctx context.Context, rt *Runtime, req *models.ApiTransferRequestInput) error + func SignTransferWithdrawal(ctx context.Context, rt *Runtime, req *models.ApiWithdrawalRequestInput) error + func SignVaultVaultBurnTokens(ctx context.Context, rt *Runtime, req *models.ApiVaultBurnTokensRequestInput) error + func SignVaultVaultInvest(ctx context.Context, rt *Runtime, req *models.ApiVaultInvestV2RequestInput) error + func SignVaultVaultRedeem(ctx context.Context, rt *Runtime, req *models.ApiVaultRedeemV2RequestInput) error + type APIError struct + Code int + Message string + RPC string + Retryable bool + Status int + func (e *APIError) Error() string + type Address [20]byte + type BackfillPage struct + Gap GapRange + HistoryExhausted bool + Page P + func (p BackfillPage[P]) Continuity() string + type Backoff struct + Attempt int + Base time.Duration + Cap time.Duration + func (b *Backoff) Next() time.Duration + func (b *Backoff) Reset() + type BookError struct + Gap *GapRange + Reason string + func (e *BookError) Error() string + type BookMode string + const BookDelta + const BookSnapshots + type BookSnapshot struct + Asks []models.OrderbookLevel + Bids []models.OrderbookLevel + EventTime time.Time + Instrument string + SequenceNumber uint64 + type Client struct + func New(cfg Config) (*Client, error) + func (c *Client) AddPositionMargin(ctx context.Context, req *models.ApiAddIsolatedPositionMarginRequestInput) (*models.ApiAddIsolatedPositionMarginResponse, error) + func (c *Client) AggregatedAccountSummary(ctx context.Context, req *models.EmptyRequest) (*models.ApiAggregatedAccountSummaryResponse, error) + func (c *Client) AlgoOrderHistory(ctx context.Context, req *models.ApiAlgoOrderHistoryRequest) (*models.ApiAlgoOrderHistoryResponse, error) + func (c *Client) AlgoOrderStream(ctx context.Context, sel *models.WSAlgoOrderFeedSelectorV1) (*Subscription[models.WSAlgoOrderFeedDataV1], error) + func (c *Client) AlgoSubOrderHistory(ctx context.Context, req *models.ApiAlgoSubOrderHistoryRequest) (*models.ApiAlgoSubOrderHistoryResponse, error) + func (c *Client) BuilderFillHistory(ctx context.Context, req *models.ApiBuilderFillHistoryRequest) (*models.ApiBuilderFillHistoryResponse, error) + func (c *Client) BulkOrders(ctx context.Context, req *models.ApiBulkOrdersRequestInput) (*models.ApiBulkOrdersResponse, error) + func (c *Client) CancelAlgoOrder(ctx context.Context, req *models.ApiCancelAlgoOrderRequest) (*models.AckResponse, error) + func (c *Client) CancelAllOrders(ctx context.Context, req *models.ApiCancelAllOrdersRequest) (*models.AckResponse, error) + func (c *Client) CancelOnDisconnect(ctx context.Context, req *models.ApiCancelOnDisconnectRequest) (*models.AckResponse, error) + func (c *Client) CancelOrder(ctx context.Context, req *models.ApiCancelOrderRequest) (*models.AckResponse, error) + func (c *Client) CancelRfq(ctx context.Context, req *models.ApiCancelRfqRequest) (*models.AckResponse, error) + func (c *Client) CancelStatusStream(ctx context.Context, sel *models.WSCancelFeedSelectorV1) (*Subscription[models.WSCancelFeedDataV1], error) + func (c *Client) Candlestick(ctx context.Context, req *models.ApiCandlestickRequest) (*models.ApiCandlestickResponse, error) + func (c *Client) CandlestickStream(ctx context.Context, sel *models.WSCandlestickFeedSelectorV1) (*Subscription[models.WSCandlestickFeedDataV1], error) + func (c *Client) Close() error + func (c *Client) CreateAlgoOrder(ctx context.Context, req *models.ApiCreateAlgoOrderRequest) (*models.ApiCreateAlgoOrderResponse, error) + func (c *Client) CreateOrder(ctx context.Context, req *models.ApiCreateOrderRequestInput) (*models.ApiCreateOrderResponse, error) + func (c *Client) CreateRfq(ctx context.Context, req *models.ApiCreateRfqRequestInput) (*models.ApiCreateRfqResponse, error) + func (c *Client) DepositHistory(ctx context.Context, req *models.ApiDepositHistoryRequest) (*models.ApiDepositHistoryResponse, error) + func (c *Client) DepositStream(ctx context.Context, sel *models.WSDepositFeedSelectorV1) (*Subscription[models.WSDepositFeedDataV1], error) + func (c *Client) FillHistory(ctx context.Context, req *models.ApiFillHistoryRequest) (*models.ApiFillHistoryResponse, error) + func (c *Client) FillStream(ctx context.Context, sel *models.WSFillFeedSelectorV1) (*Subscription[models.WSFillFeedDataV1], error) + func (c *Client) FundingAccountSummary(ctx context.Context, req *models.EmptyRequest) (*models.ApiFundingAccountSummaryResponse, error) + func (c *Client) FundingPaymentHistory(ctx context.Context, req *models.ApiFundingPaymentHistoryRequest) (*models.ApiFundingPaymentHistoryResponse, error) + func (c *Client) FundingRate(ctx context.Context, req *models.ApiFundingRateRequest) (*models.ApiFundingRateResponse, error) + func (c *Client) GetAlgoOrder(ctx context.Context, req *models.ApiGetAlgoOrderRequest) (*models.ApiGetAlgoOrderResponse, error) + func (c *Client) GetAllCollateralAssetInfo(ctx context.Context, req *models.EmptyRequest) (*models.ApiGetAllCollateralAssetInfoResponse, error) + func (c *Client) GetAllInitialLeverage(ctx context.Context, req *models.ApiGetAllInitialLeverageRequest) (*models.ApiGetAllInitialLeverageResponse, error) + func (c *Client) GetAllInstruments(ctx context.Context, req *models.ApiGetAllInstrumentsRequest) (*models.ApiGetAllInstrumentsResponse, error) + func (c *Client) GetAuthorizedBuilders(ctx context.Context, req *models.EmptyRequest) (*models.ApiGetAuthorizedBuildersResponse, error) + func (c *Client) GetCollateralPreference(ctx context.Context, req *models.ApiGetSubAccountCollateralPreferenceRequest) (*models.ApiGetSubAccountCollateralPreferenceResponse, error) + func (c *Client) GetCurrency(ctx context.Context, req *models.ApiGetCurrencyRequest) (*models.ApiGetCurrencyResponse, error) + func (c *Client) GetFilteredInstruments(ctx context.Context, req *models.ApiGetFilteredInstrumentsRequest) (*models.ApiGetFilteredInstrumentsResponse, error) + func (c *Client) GetInstrument(ctx context.Context, req *models.ApiGetInstrumentRequest) (*models.ApiGetInstrumentResponse, error) + func (c *Client) GetMarginRules(ctx context.Context, req *models.ApiGetMarginRulesRequest) (*models.ApiGetMarginRulesResponse, error) + func (c *Client) GetOrder(ctx context.Context, req *models.ApiGetOrderRequest) (*models.ApiGetOrderResponse, error) + func (c *Client) GetPositionMarginLimits(ctx context.Context, req *models.ApiGetIsolatedPositionMarginLimitsRequest) (*models.ApiGetIsolatedPositionMarginLimitsResponse, error) + func (c *Client) GetSfpTradingSchedule(ctx context.Context, req *models.EmptyRequest) (*models.ApiSfpTradingScheduleResponse, error) + func (c *Client) GetSubAccounts(ctx context.Context, req *models.EmptyRequest) (*models.ApiGetSubAccountsResponse, error) + func (c *Client) GetSupportedAssets(ctx context.Context, req *models.EmptyRequest) (*models.ApiGetSupportedAssetsResponse, error) + func (c *Client) GetWithdrawalFee(ctx context.Context, req *models.ApiWithdrawalFeeRequest) (*models.ApiWithdrawalFeeResponse, error) + func (c *Client) InterestPaymentHistory(ctx context.Context, req *models.ApiInterestPaymentHistoryRequest) (*models.ApiInterestPaymentHistoryResponse, error) + func (c *Client) MiniTicker(ctx context.Context, req *models.ApiMiniTickerRequest) (*models.ApiMiniTickerResponse, error) + func (c *Client) MiniTickerDeltaStream(ctx context.Context, sel *models.WSMiniTickerFeedSelectorV1) (*Subscription[models.PartialWSMiniTickerFeedDataV1], error) + func (c *Client) MiniTickerSnapStream(ctx context.Context, sel *models.WSMiniTickerFeedSelectorV1) (*Subscription[models.WSMiniTickerFeedDataV1], error) + func (c *Client) OpenAlgoOrders(ctx context.Context, req *models.ApiOpenAlgoOrdersRequest) (*models.ApiOpenAlgoOrdersResponse, error) + func (c *Client) OpenOrders(ctx context.Context, req *models.ApiOpenOrdersRequest) (*models.ApiOpenOrdersResponse, error) + func (c *Client) OrderHistory(ctx context.Context, req *models.ApiOrderHistoryRequest) (*models.ApiOrderHistoryResponse, error) + func (c *Client) OrderStateStream(ctx context.Context, sel *models.WSOrderStateFeedSelectorV1) (*Subscription[models.WSOrderStateFeedDataV1], error) + func (c *Client) OrderStream(ctx context.Context, sel *models.WSOrderFeedSelectorV1) (*Subscription[models.WSOrderFeedDataV1], error) + func (c *Client) OrderbookDeltaStream(ctx context.Context, sel *models.WSOrderbookLevelsFeedSelectorV1) (*Subscription[models.WSOrderbookLevelsFeedDataV1], error) + func (c *Client) OrderbookLevels(ctx context.Context, req *models.ApiOrderbookLevelsRequest) (*models.ApiOrderbookLevelsResponse, error) + func (c *Client) OrderbookSnapStream(ctx context.Context, sel *models.WSOrderbookLevelsFeedSelectorV1) (*Subscription[models.WSOrderbookLevelsFeedDataV1], error) + func (c *Client) PositionHistory(ctx context.Context, req *models.ApiPositionHistoryRequest) (*models.ApiPositionHistoryResponse, error) + func (c *Client) Positions(ctx context.Context, req *models.ApiPositionsRequest) (*models.ApiPositionsResponse, error) + func (c *Client) PositionsStream(ctx context.Context, sel *models.WSPositionsFeedSelectorV1) (*Subscription[models.WSPositionsFeedDataV1], error) + func (c *Client) RfqQuoteStream(ctx context.Context, sel *models.WSRfqQuoteFeedSelectorV1) (*Subscription[models.WSRfqQuoteFeedDataV1], error) + func (c *Client) Runtime() *Runtime + func (c *Client) SetDeriskMmRatio(ctx context.Context, ...) (*models.ApiSetDeriskToMaintenanceMarginRatioResponse, error) + func (c *Client) SetInitialLeverage(ctx context.Context, req *models.ApiSetInitialLeverageRequest) (*models.ApiSetInitialLeverageResponse, error) + func (c *Client) SetPositionConfig(ctx context.Context, ...) (*models.ApiSetSubAccountPositionMarginConfigResponse, error) + func (c *Client) SpotAccountSummary(ctx context.Context, req *models.ApiSpotSubAccountSummaryRequest) (*models.ApiSpotSubAccountSummaryResponse, error) + func (c *Client) SubAccountSummary(ctx context.Context, req *models.ApiSubAccountSummaryRequest) (*models.ApiSubAccountSummaryResponse, error) + func (c *Client) Ticker(ctx context.Context, req *models.ApiTickerRequest) (*models.ApiTickerResponse, error) + func (c *Client) TickerDeltaStream(ctx context.Context, sel *models.WSTickerFeedSelectorV1) (*Subscription[models.PartialWSTickerFeedDataV1], error) + func (c *Client) TickerSnapStream(ctx context.Context, sel *models.WSTickerFeedSelectorV1) (*Subscription[models.WSTickerFeedDataV1], error) + func (c *Client) Trade(ctx context.Context, req *models.ApiTradeRequest) (*models.ApiTradeResponse, error) + func (c *Client) TradeHistory(ctx context.Context, req *models.ApiTradeHistoryRequest) (*models.ApiTradeHistoryResponse, error) + func (c *Client) TradeStream(ctx context.Context, sel *models.WSTradeFeedSelectorV1) (*Subscription[models.WSTradeFeedDataV1], error) + func (c *Client) Transfer(ctx context.Context, req *models.ApiTransferRequestInput) (*models.ApiTransferResponse, error) + func (c *Client) TransferHistory(ctx context.Context, req *models.ApiTransferHistoryRequest) (*models.ApiTransferHistoryResponse, error) + func (c *Client) TransferStream(ctx context.Context, sel *models.WSTransferFeedSelectorV1) (*Subscription[models.WSTransferFeedDataV1], error) + func (c *Client) VaultBurnTokens(ctx context.Context, req *models.ApiVaultBurnTokensRequestInput) (*models.AckResponse, error) + func (c *Client) VaultConversionRate(ctx context.Context, req *models.ApiVaultConversionRateRequest) (*models.ApiVaultConversionRateResponse, error) + func (c *Client) VaultInvest(ctx context.Context, req *models.ApiVaultInvestV2RequestInput) (*models.ApiVaultInvestV2Response, error) + func (c *Client) VaultInvestorSummary(ctx context.Context, req *models.ApiVaultInvestorSummaryRequest) (*models.ApiVaultInvestorSummaryResponse, error) + func (c *Client) VaultManagerInvestmentHistory(ctx context.Context, req *models.ApiQueryVaultManagerInvestorHistoryRequest) (*models.ApiQueryVaultManagerInvestorHistoryResponse, error) + func (c *Client) VaultRedeem(ctx context.Context, req *models.ApiVaultRedeemV2RequestInput) (*models.AckResponse, error) + func (c *Client) VaultRedeemCancel(ctx context.Context, req *models.ApiVaultRedeemCancelRequest) (*models.AckResponse, error) + func (c *Client) VaultRedemptionQueue(ctx context.Context, req *models.ApiVaultViewRedemptionQueueRequest) (*models.ApiVaultViewRedemptionQueueResponse, error) + func (c *Client) Withdrawal(ctx context.Context, req *models.ApiWithdrawalRequestInput) (*models.AckResponse, error) + func (c *Client) WithdrawalHistory(ctx context.Context, req *models.ApiWithdrawalHistoryRequest) (*models.ApiWithdrawalHistoryResponse, error) + func (c *Client) WithdrawalStream(ctx context.Context, sel *models.WSWithdrawalFeedSelectorV1) (*Subscription[models.WSWithdrawalFeedDataV1], error) + type ClientOrderIDProvider interface + NextClientOrderID func() uint64 + type Clock interface + NowNs func() int64 + type Config struct + APIKey string + BeforeSend func(call *OutgoingCall) + CallTimeout time.Duration + CheckOrders *bool + ClientOrderIDs ClientOrderIDProvider + Clock Clock + Encoding Encoding + Env Environment + HTTPAttemptTimeout time.Duration + HTTPClient *http.Client + Logger *slog.Logger + Nonces NonceProvider + OnEvent func(e Event) + OrderTransport OrderTransport + QueueSize int + ResyncTimeout time.Duration + Signer Signer + SubAccountID uint64 + WSRequestTimeout time.Duration + func (c Config) GoString() string + func (c Config) LogValue() slog.Value + func (c Config) String() string + type ConfigError struct + Message string + func (e *ConfigError) Error() string + type CountdownClient interface + CancelOnDisconnect func(context.Context, *models.ApiCancelOnDisconnectRequest) (*models.AckResponse, error) + type CountdownReceipt struct + Acknowledged bool + CountdownSeconds uint16 + SubAccountID uint64 + func RefreshCancelCountdown(ctx context.Context, client CountdownClient, subAccountID uint64, ...) (CountdownReceipt, error) + func (r CountdownReceipt) Scope() string + type CurrencyMeta struct + BalanceDecimals uint32 + ID uint32 + Symbol string + type DecodeError struct + Err error + RPC string + func (e *DecodeError) Error() string + func (e *DecodeError) Unwrap() error + type Domain struct + ChainID uint64 + Name string + VerifyingContract *Address + Version string + func ExchangeDomain(chainID uint64) *Domain + func NewDomain(name, version string, chainID uint64, verifyingContract *Address) *Domain + func (d *Domain) Separator() [32]byte + type Encoding int + const EncodingFull + const EncodingLite + func (e Encoding) String() string + type Environment struct + ChainID uint64 + EdgeURL string + MarketDataURL string + MarketDataWS string + MarketDataWSLite string + Name string + TradingURL string + TradingWS string + TradingWSLite string + WSMaxFrameBytes int + func EnvironmentNamed(name string) (Environment, error) + func Prod() Environment + func Testnet() Environment + func (e *Environment) Validate() error + type ErrorInfo struct + Code int + Message string + Name string + Retryable bool + Status int + type ErrorTable []ErrorInfo + func (t ErrorTable) Get(code int) (ErrorInfo, bool) + func (t ErrorTable) Retryable(code, status int) bool + type Event struct + Attempt int + Code int + Delay time.Duration + Err string + ExpectedPrev uint64 + ExpiresAt time.Time + Fatal bool + Gap *GapRange + Generation uint64 + Kind EventKind + LatestSequenceNumber uint64 + NumSnapshots uint64 + Outgoing bool + Prev uint64 + RPC string + Raw []byte + Reason string + Selector string + Seq uint64 + Socket string + Stream string + WebsocketReconnectRequired bool + type EventKind string + const EventConnect + const EventDisconnect + const EventError + const EventFrame + const EventGap + const EventReconnect + const EventRetry + const EventSessionRotated + const EventSubscribe + type FieldDef struct + Name string + Type string + type FixedClock int64 + func (c FixedClock) NowNs() int64 + type FrameTooLargeError struct + Limit int + Size int + func (e *FrameTooLargeError) Error() string + type GapRange struct + AfterSequence *uint64 + Reason string + ThroughSequence *uint64 + type Gateway int + const GatewayEdge + const GatewayMarketData + const GatewayTrading + func (g Gateway) String() string + type InstrumentMeta struct + BaseDecimals uint32 + InstrumentHash string + Limits map[string]string + QuoteDecimals uint32 + type List []Value + func Each[T any](items []T, f func(*T) Value) List + type MessageBuilder struct + Err error + func (b *MessageBuilder) Address(v, at string) Value + func (b *MessageBuilder) AssetKey(meta *Meta, name string) Value + func (b *MessageBuilder) Copy(v any, eipType, at string, def any) Value + func (b *MessageBuilder) CurrencyBalanceDecimals(meta *Meta, symbol string) uint32 + func (b *MessageBuilder) CurrencyID(meta *Meta, symbol string) Value + func (b *MessageBuilder) EnumCode(v WireEnum, at string) Value + func (b *MessageBuilder) InstrumentBaseDecimals(meta *Meta, name string) uint32 + func (b *MessageBuilder) InstrumentQuoteDecimals(meta *Meta, name string) uint32 + func (b *MessageBuilder) MainAccount(meta *Meta) Value + func (b *MessageBuilder) Scaled(v string, decimals uint32, at, def string) Value + type Meta struct + Currencies map[string]CurrencyMeta + Instruments map[string]InstrumentMeta + MainAccount string + func (m *Meta) Currency(symbol string) (CurrencyMeta, error) + func (m *Meta) Instrument(name string) (InstrumentMeta, error) + type MetadataCache struct + func (c *MetadataCache) Currency(ctx context.Context, symbol string, ...) (CurrencyMeta, error) + func (c *MetadataCache) DropInstrument(name string) + func (c *MetadataCache) Instrument(ctx context.Context, name string, ...) (InstrumentMeta, error) + func (c *MetadataCache) MainAccount(ctx context.Context, fn func(context.Context) (string, error)) (string, error) + func (c *MetadataCache) PutCurrency(symbol string, v CurrencyMeta) + func (c *MetadataCache) PutInstrument(name string, v InstrumentMeta) + func (c *MetadataCache) PutMainAccount(address string) + type NonceProvider interface + NextNonce func() uint32 + type OrderBook struct + func NewOrderBook(instrument string, mode BookMode) (*OrderBook, error) + func (b *OrderBook) Apply(frame models.WSOrderbookLevelsFeedDataV1) error + func (b *OrderBook) Invalidate(gap *GapRange) + func (b *OrderBook) OnEvent(event Event) + func (b *OrderBook) Ready() bool + func (b *OrderBook) Reset(frame models.WSOrderbookLevelsFeedDataV1) error + func (b *OrderBook) Snapshot() (BookSnapshot, error) + type OrderCheckRule struct + Check string + Field string + Limit string + ServerCode int + SkipIf []string + Times string + type OrderChecks struct + Instrument string + Rules []OrderCheckRule + Scales map[string]int + type OrderLookup interface + GetOrder func(context.Context, *models.ApiGetOrderRequest) (*models.ApiGetOrderResponse, error) + type OrderOutOfBoundsError struct + Check string + Field string + Instrument string + Leg int + Limit string + LimitValue string + Message string + Nearest []string + ServerCode int + Value string + func (e *OrderOutOfBoundsError) Error() string + type OrderResolution struct + Order *models.Order + Status OrderResolutionStatus + func ResolveOrder(ctx context.Context, client OrderLookup, subAccountID, clientOrderID uint64) (OrderResolution, error) + type OrderResolutionStatus string + const OrderFound + const OrderStillUnknown + type OrderStateUnknownError struct + ClientOrderID uint64 + ClientOrderIDs []uint64 + Err error + RPC string + Reason string + func (e *OrderStateUnknownError) Error() string + func (e *OrderStateUnknownError) Unwrap() error + type OrderTransport int + const OrderTransportREST + const OrderTransportWS + type OutgoingCall struct + Params any + RPC string + Transport Via + type Page interface + NextCursor func() string + type PaginationCycleError struct + Cursor string + func (e *PaginationCycleError) Error() string + type PrivateKeySigner struct + func NewPrivateKeySigner(privateKey string) (*PrivateKeySigner, error) + func (s *PrivateKeySigner) Address() string + func (s *PrivateKeySigner) SignDigest(digest [32]byte) Signature + func (s *PrivateKeySigner) SignTyped(_ context.Context, domain *Domain, primary *StructType, message Value) (Signature, error) + func (s *PrivateKeySigner) String() string + type RPCSpec struct + Auth bool + Gateway Gateway + LitePath string + Method string + OrderEntry bool + Path string + RefreshMetadataOn []int + Write bool + type RandomNonce struct + func (RandomNonce) NextNonce() uint32 + type RateLimitError struct + Message string + RPC string + Status int + func (e *RateLimitError) Error() string + func (e *RateLimitError) Unwrap() error + type RequestInfo struct + ClientOrderID func(*Req, ClientOrderIDProvider) uint64 + ClientOrderIDs func(*Req, ClientOrderIDProvider) []uint64 + DefaultAccount func(*Req, uint64) + Missing func(*Req) string + type Runtime struct + func NewRuntime(cfg Config, errors ErrorTable) (*Runtime, error) + func (rt *Runtime) Close() error + func (rt *Runtime) Domain() *Domain + func (rt *Runtime) Encoding() Encoding + func (rt *Runtime) Env() Environment + func (rt *Runtime) Metadata() *MetadataCache + func (rt *Runtime) PrepareSignature(signer *string, nonce **uint32, expiration **time.Time, chainID **uint64, ...) error + func (rt *Runtime) Session() SessionState + func (rt *Runtime) Sign(ctx context.Context, chainID *uint64, st *StructType, message Value) (Signature, error) + func (rt *Runtime) Signer() Signer + func (rt *Runtime) Socket(g Gateway) *Socket + func (rt *Runtime) SyncClock(ctx context.Context, clock *SystemClock) error + type Sequencer struct + Gaps uint64 + Last uint64 + ResyncStarted time.Time + SnapshotsLeft uint64 + func (s *Sequencer) OnAck(latest, numSnapshots uint64) + func (s *Sequencer) OnFrame(seq, prev uint64, hasPrev bool) Verdict + func (s *Sequencer) Reset() + func (s *Sequencer) ResyncOverdue(now time.Time, limit time.Duration) bool + type SessionState struct + AccountID string + Cookie string + ExpiresAt time.Time + FundingAccountAddress string + Generation uint64 + IssuedAt time.Time + func (s SessionState) GoString() string + func (s SessionState) LogValue() slog.Value + func (s SessionState) RefreshDue() time.Time + func (s SessionState) String() string + type SignFunc func(ctx context.Context, rt *Runtime, req *Req) error + type Signature struct + R string + S string + Signer string + V uint8 + type Signer interface + Address func() string + SignTyped func(ctx context.Context, domain *Domain, primary *StructType, message Value) (Signature, error) + type SigningError struct + Message string + func (e *SigningError) Error() string + type Socket struct + func (s *Socket) ForceReconnect(reason string) + func (s *Socket) Name() string + func (s *Socket) SetResyncTimeout(d time.Duration) + type StreamOverflowError struct + Capacity int + Selector string + Stream string + func (e *StreamOverflowError) Error() string + type StreamSpec struct + Auth bool + Conflate bool + Gateway Gateway + SnapshotFeed bool + Stream string + type Struct []Value + type StructType struct + func (st *StructType) Digest(d *Domain, message Value) ([32]byte, error) + func (st *StructType) EncodeType() string + func (st *StructType) HashStruct(message Value) ([32]byte, error) + func (st *StructType) Name() string + func (st *StructType) TypeHash() [32]byte + func (st *StructType) TypedData(d *Domain, message Value) (map[string]any, error) + func (st *StructType) Types() []TypeDef + type Subscription struct + func Subscribe[F any](ctx context.Context, rt *Runtime, spec *StreamSpec, selector string) (*Subscription[F], error) + func (s *Subscription[F]) All() iter.Seq2[*F, error] + func (s *Subscription[F]) Close() error + func (s *Subscription[F]) Dropped() uint64 + func (s *Subscription[F]) Next(ctx context.Context) (*F, error) + func (s *Subscription[F]) Selector() string + func (s *Subscription[F]) Stream() string + type SystemClock struct + func (c *SystemClock) NowNs() int64 + func (c *SystemClock) Observe(serverMs int64, rtt time.Duration) + func (c *SystemClock) OffsetNs() int64 + type TimeCounterClientOrderID struct + func (p *TimeCounterClientOrderID) NextClientOrderID() uint64 + type TransportError struct + Err error + Message string + RPC string + Sent bool + func (e *TransportError) Error() string + func (e *TransportError) Unwrap() error + type TypeDef struct + Fields []FieldDef + Name string + type Value = any + type Verdict int + const Deliver + const Drop + const Gap + type Via string + const ViaREST + const ViaWS + type WireEnum interface + Code func() (int64, bool) + String func() string