Skip to content

Class: WebsocketAPIClient ​

Extends ​

Constructors ​

Constructor ​

ts
new WebsocketAPIClient(options?: WebsocketAPIClientOptions, logger?: object): WebsocketAPIClient;

Parameters ​

ParameterTypeDefault value
options?WebsocketAPIClientOptions{}
logger?{ error: (...params: LogParams) => void; info: (...params: LogParams) => void; trace: (..._params: LogParams) => void; }DefaultLogger
logger.error?(...params: LogParams) => void...
logger.info?(...params: LogParams) => void...
logger.trace?(..._params: LogParams) => void...

Returns ​

WebsocketAPIClient

Overrides ​

RestClient.constructor

Properties ​

baseUrl ​

ts
readonly baseUrl: string;

Inherited from ​

RestClient.baseUrl

Methods ​

approveApiWallet() ​

ts
approveApiWallet(params: ApproveApiWalletRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Approve an API wallet (approveAgent).

An account can have one unnamed agent and up to three named agents. Append valid_until {timestamp} to the name to set an expiration, at most 180 days ahead.

Parameters ​

ParameterType
paramsApproveApiWalletRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.approveApiWallet


approveBuilderFee() ​

ts
approveBuilderFee(options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Approve the configured builder fee (approveBuilderFee).

maxFeeRate is a percent string such as "0.001%".

Parameters ​

ParameterType
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.approveBuilderFee


authorizeAqav2Role() ​

ts
authorizeAqav2Role(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Authorize an AQAv2 role (authorizeAqav2Role).

token is the token index, for example 0 for USDC. role is "technical" or "treasury".

Parameters ​

ParameterType
params{ role: "technical" | "treasury"; token: number; }
params.role"technical" | "treasury"
params.tokennumber
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.authorizeAqav2Role


cancelOrders() ​

ts
cancelOrders(params: CancelOrdersRequest, options?: L1ActionOptions): Promise<ExchangeResponse<CancelResponseData>>;

Cancel orders by order id (cancel).

Each status is "success" or { error }. fastCancel sends f: true. Trigger orders are rejected when fast cancel is set. false is omitted.

Parameters ​

ParameterType
paramsCancelOrdersRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<CancelResponseData>>

Inherited from ​

RestClient.cancelOrders


cancelOrdersByClientOrderId() ​

ts
cancelOrdersByClientOrderId(params: CancelOrdersByClientOrderIdRequest, options?: L1ActionOptions): Promise<ExchangeResponse<CancelResponseData>>;

Cancel orders by client order id (cancelByCloid).

Statuses match cancelOrders(). fastCancel has the same meaning.

Parameters ​

ParameterType
paramsCancelOrdersByClientOrderIdRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<CancelResponseData>>

Inherited from ​

RestClient.cancelOrdersByClientOrderId


cancelTwapOrder() ​

ts
cancelTwapOrder(params: CancelTwapOrderRequest, options?: L1ActionOptions): Promise<ExchangeResponse<TwapCancelResponseData>>;

Cancel a TWAP order (twapCancel).

status is "success" or { error }.

Parameters ​

ParameterType
paramsCancelTwapOrderRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<TwapCancelResponseData>>

Inherited from ​

RestClient.cancelTwapOrder


claimRewards() ​

ts
claimRewards(options?: L1ActionOptions): Promise<ExchangeResponse>;

Claim rewards (claimRewards).

Parameters ​

ParameterType
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.claimRewards


close() ​

ts
close(): void;

Returns ​

void

See ​

Shut down cleanly


closeAll() ​

ts
closeAll(): void;

Returns ​

void


connect() ​

ts
connect(): Promise<void>;

Returns ​

Promise<void>


convertToMultiSigUser() ​

ts
convertToMultiSigUser(params: ConvertToMultiSigUserRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
paramsConvertToMultiSigUserRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.convertToMultiSigUser


createSubAccount() ​

ts
createSubAccount(params: object, options?: L1ActionOptions): Promise<ExchangeResponse<string>>;

Parameters ​

ParameterType
params{ name: string; }
params.namestring
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<string>>

Inherited from ​

RestClient.createSubAccount


createVault() ​

ts
createVault(params: object, options?: L1ActionOptions): Promise<ExchangeResponse<string>>;

Parameters ​

ParameterType
params{ description: string; initialUsd: number; name: string; }
params.descriptionstring
params.initialUsdnumber
params.namestring
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<string>>

Inherited from ​

RestClient.createVault


delegateOrUndelegateStake() ​

ts
delegateOrUndelegateStake(params: DelegateOrUndelegateStakeRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Delegate or undelegate stake to a validator (tokenDelegate).

A delegation to one validator locks for 1 day.

Parameters ​

ParameterType
paramsDelegateOrUndelegateStakeRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.delegateOrUndelegateStake


deployPerp() ​

ts
deployPerp(params: DeployPerpRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
paramsDeployPerpRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.deployPerp


deploySpot() ​

ts
deploySpot(params: DeploySpotRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
paramsDeploySpotRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.deploySpot


depositIntoStaking() ​

ts
depositIntoStaking(params: object, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Move native token from spot into staking (cDeposit).

wei is the amount in wei.

Parameters ​

ParameterType
params{ wei: number; }
params.weinumber
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.depositIntoStaking


ts
disableStakingTradingLink(params: object, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ tradingUser: string; }
params.tradingUserstring
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.disableStakingTradingLink


distributeVaultFunds() ​

ts
distributeVaultFunds(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ usd: number; vaultAddress: string; }
params.usdnumber
params.vaultAddressstring
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.distributeVaultFunds


enableApiWalletDexAbstraction() ​

ts
enableApiWalletDexAbstraction(options?: L1ActionOptions): Promise<ExchangeResponse>;

Enable HIP-3 DEX abstraction from an API wallet (agentEnableDexAbstraction).

Deprecated. Prefer setApiWalletAbstraction(). This only changes null to enabled.

Parameters ​

ParameterType
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.enableApiWalletDexAbstraction


executeBorrowLendOperation() ​

ts
executeBorrowLendOperation(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ amount: string | null; operation: "withdraw" | "borrow" | "repay" | "supply"; token: number; }
params.amountstring | null
params.operation"withdraw" | "borrow" | "repay" | "supply"
params.tokennumber
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.executeBorrowLendOperation


finalizeEvmContract() ​

ts
finalizeEvmContract(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ input: | { create: { nonce: number; }; } | "customStorageSlot" | "firstStorageSlot"; token: number; }
params.input| { create: { nonce: number; }; } | "customStorageSlot" | "firstStorageSlot"
params.tokennumber
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.finalizeEvmContract


getAccountAddress() ​

ts
getAccountAddress(): Promise<string>;

Returns ​

Promise<string>

Inherited from ​

RestClient.getAccountAddress


getActiveAssetData() ​

ts
getActiveAssetData(params: AccountRequest & object): Promise<ActiveAssetData>;

User's active asset data (activeAssetData): leverage, max trade size, available to trade, and mark price for one coin.

Parameters ​

ParameterType
paramsAccountRequest & object

Returns ​

Promise<ActiveAssetData>

Inherited from ​

RestClient.getActiveAssetData


getAlignedQuoteTokenStatus() ​

ts
getAlignedQuoteTokenStatus(params: object): Promise<AlignedQuoteTokenStatus>;

Published response schema; the public API currently rejects this request type.

Parameters ​

ParameterType
params{ token: number; }
params.tokennumber

Returns ​

Promise<AlignedQuoteTokenStatus>

Inherited from ​

RestClient.getAlignedQuoteTokenStatus


getAllBorrowLendReserveStates() ​

ts
getAllBorrowLendReserveStates(): Promise<BorrowLendReserveEntry[]>;

Borrow and lend reserve state for every token (allBorrowLendReserveStates).

Each entry is [token, reserve].

Returns ​

Promise<BorrowLendReserveEntry[]>

Inherited from ​

RestClient.getAllBorrowLendReserveStates


getAllMids() ​

ts
getAllMids(params?: object): Promise<AllMidsResponse>;

Mid prices for all coins (allMids).

An empty book falls back to the last trade price. Spot mids are included only when dex is omitted or empty.

Parameters ​

ParameterType
params?{ dex?: string; }
params.dex?string

Returns ​

Promise<AllMidsResponse>

Inherited from ​

RestClient.getAllMids


getAllPerpMetadata() ​

ts
getAllPerpMetadata(): Promise<PerpMeta[]>;

Metadata for every perp DEX (allPerpMetas).

Each entry is one DEX: universe, margin tables, and collateral token. Index 0 is the default perp DEX.

Returns ​

Promise<PerpMeta[]>

Inherited from ​

RestClient.getAllPerpMetadata


getApprovedBuilders() ​

ts
getApprovedBuilders(params?: AccountRequest): Promise<string[]>;

Builder addresses this user has approved (approvedBuilders).

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<string[]>

Inherited from ​

RestClient.getApprovedBuilders


getBalances() ​

ts
getBalances(params?: AccountDexRequest): Promise<AccountBalancesResponse>;

Parameters ​

ParameterType
params?AccountDexRequest

Returns ​

Promise<AccountBalancesResponse>

Inherited from ​

RestClient.getBalances


getBorrowLendReserveState() ​

ts
getBorrowLendReserveState(params: object): Promise<BorrowLendReserveState>;

Borrow and lend reserve state for one token (borrowLendReserveState).

Parameters ​

ParameterType
params{ token: number; }
params.tokennumber

Returns ​

Promise<BorrowLendReserveState>

Inherited from ​

RestClient.getBorrowLendReserveState


getCandles() ​

ts
getCandles(params: GetCandlesRequest): Promise<Candle[]>;

Candle snapshot (candleSnapshot).

Only the most recent 5000 candles are available. HIP-3 coins use a dex:COIN name.

Parameters ​

ParameterType
paramsGetCandlesRequest

Returns ​

Promise<Candle[]>

Inherited from ​

RestClient.getCandles


getConcisePerpAnnotations() ​

ts
getConcisePerpAnnotations(): Promise<PerpConciseAnnotation[]>;

Concise perp annotations (perpConciseAnnotations).

Each entry is [coin, annotation]. keywords is omitted when absent.

Returns ​

Promise<PerpConciseAnnotation[]>

Inherited from ​

RestClient.getConcisePerpAnnotations


getExchangeStatus() ​

ts
getExchangeStatus(): Promise<ExchangeStatus>;

Returns ​

Promise<ExchangeStatus>

Inherited from ​

RestClient.getExchangeStatus


getExtraAgents() ​

ts
getExtraAgents(params?: AccountRequest): Promise<ExtraAgent[]>;

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<ExtraAgent[]>

Inherited from ​

RestClient.getExtraAgents


getFrontendOpenOrders() ​

ts
getFrontendOpenOrders(params?: AccountDexRequest): Promise<FrontendOpenOrder[]>;

Open orders with trigger and reduce-only fields (frontendOpenOrders).

Spot orders are included only for the first perp DEX.

Parameters ​

ParameterType
params?AccountDexRequest

Returns ​

Promise<FrontendOpenOrder[]>

Inherited from ​

RestClient.getFrontendOpenOrders


getFundingHistory() ​

ts
getFundingHistory(params: GetFundingHistoryRequest): Promise<FundingHistory[]>;

Historical funding rates for one coin (fundingHistory).

Parameters ​

ParameterType
paramsGetFundingHistoryRequest

Returns ​

Promise<FundingHistory[]>

Inherited from ​

RestClient.getFundingHistory


getGossipPriorityAuctionStatus() ​

ts
getGossipPriorityAuctionStatus(): Promise<GossipPriorityAuctionStatus>;

Returns ​

Promise<GossipPriorityAuctionStatus>

Inherited from ​

RestClient.getGossipPriorityAuctionStatus


getGossipRootIps() ​

ts
getGossipRootIps(): Promise<string[]>;

Returns ​

Promise<string[]>

Inherited from ​

RestClient.getGossipRootIps


getLeadingVaults() ​

ts
getLeadingVaults(params?: AccountRequest): Promise<LeadingVault[]>;

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<LeadingVault[]>

Inherited from ​

RestClient.getLeadingVaults


getLegalStatus() ​

ts
getLegalStatus(params?: AccountRequest): Promise<LegalStatus>;

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<LegalStatus>

Inherited from ​

RestClient.getLegalStatus


getLiquidatablePositions() ​

ts
getLiquidatablePositions(): Promise<LiquidatablePosition[]>;

Returns ​

Promise<LiquidatablePosition[]>

Inherited from ​

RestClient.getLiquidatablePositions


getMarginTable() ​

ts
getMarginTable(params: object): Promise<PerpMarginTable>;

Parameters ​

ParameterType
params{ id: number; }
params.idnumber

Returns ​

Promise<PerpMarginTable>

Inherited from ​

RestClient.getMarginTable


getMaxBuilderFee() ​

ts
getMaxBuilderFee(params: GetMaxBuilderFeeRequest): Promise<number>;

Maximum approved builder fee (maxBuilderFee).

The number is in tenths of a basis point. 1 means 0.001%.

Parameters ​

ParameterType
paramsGetMaxBuilderFeeRequest

Returns ​

Promise<number>

Inherited from ​

RestClient.getMaxBuilderFee


getMaxMarketOrderNotionals() ​

ts
getMaxMarketOrderNotionals(): Promise<MaxMarketOrderNotional[]>;

Returns ​

Promise<MaxMarketOrderNotional[]>

Inherited from ​

RestClient.getMaxMarketOrderNotionals


getMultiSigSigners() ​

ts
getMultiSigSigners(params?: AccountRequest): Promise<MultiSigSigners | null>;

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<MultiSigSigners | null>

Inherited from ​

RestClient.getMultiSigSigners


getOpenOrders() ​

ts
getOpenOrders(params?: AccountDexRequest): Promise<OpenOrder[]>;

Open orders (openOrders).

Spot orders are included only for the first perp DEX. side "B" is bid and "A" is ask.

Parameters ​

ParameterType
params?AccountDexRequest

Returns ​

Promise<OpenOrder[]>

Inherited from ​

RestClient.getOpenOrders


getOrderBook() ​

ts
getOrderBook(params: GetOrderBookRequest): Promise<OrderBookResponse | null>;

L2 order book (l2Book).

At most 20 levels per side. nSigFigs aggregates prices. mantissa is only valid when nSigFigs is 5.

Parameters ​

ParameterType
paramsGetOrderBookRequest

Returns ​

Promise<OrderBookResponse | null>

Inherited from ​

RestClient.getOrderBook


getOrderHistory() ​

ts
getOrderHistory(params?: AccountRequest): Promise<HistoricalOrder[]>;

Recent historical orders (historicalOrders).

Returns at most 2000 orders. status uses the same values as getOrderStatus().

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<HistoricalOrder[]>

Inherited from ​

RestClient.getOrderHistory


getOrderStatus() ​

ts
getOrderStatus(params: GetOrderStatusRequest): Promise<OrderStatusResponse>;

Order status by order id or client order id (orderStatus).

status: "unknownOid" means the order was not found. Otherwise status is "order" and order.status is the order state.

Parameters ​

ParameterType
paramsGetOrderStatusRequest

Returns ​

Promise<OrderStatusResponse>

Inherited from ​

RestClient.getOrderStatus


getOutcomeDeployerLimits() ​

ts
getOutcomeDeployerLimits(params: object): Promise<OutcomeDeployerLimits>;

Remaining outcome deployment allowance for a venue (outcomeDeployerLimits).

venue is the venue name, for example "out".

Parameters ​

ParameterType
params{ venue: string; }
params.venuestring

Returns ​

Promise<OutcomeDeployerLimits>

Inherited from ​

RestClient.getOutcomeDeployerLimits


getOutcomeMetadata() ​

ts
getOutcomeMetadata(): Promise<OutcomeMetadata>;

Outcome metadata (outcomeMeta): outcomes, questions, and deployers.

Returns ​

Promise<OutcomeMetadata>

Inherited from ​

RestClient.getOutcomeMetadata


getPerpAccountSummary() ​

ts
getPerpAccountSummary(params?: AccountDexRequest): Promise<PerpAccountSummaryResponse>;

Perp account summary (clearinghouseState): open positions and margin.

assetPositions[].position.szi is signed: positive is long, negative is short. Under unified account or portfolio margin, use spot balances for the trading account balance across spot and perps.

Parameters ​

ParameterType
params?AccountDexRequest

Returns ​

Promise<PerpAccountSummaryResponse>

Inherited from ​

RestClient.getPerpAccountSummary


getPerpAnnotation() ​

ts
getPerpAnnotation(params: object): Promise<PerpAnnotation | null>;

Perp annotation for one coin (perpAnnotation).

Returns null when the coin has no annotation.

Parameters ​

ParameterType
params{ coin: string; }
params.coinstring

Returns ​

Promise<PerpAnnotation | null>

Inherited from ​

RestClient.getPerpAnnotation


getPerpAssetContexts() ​

ts
getPerpAssetContexts(params?: object): Promise<PerpMetaAndAssetContexts>;

Perp metadata plus asset contexts (metaAndAssetCtxs).

The tuple is [meta, contexts]. Contexts line up with meta.universe and include mark price, funding, open interest, and related fields. dex defaults to the empty string, which is the first perp DEX.

Parameters ​

ParameterType
params?{ dex?: string; }
params.dex?string

Returns ​

Promise<PerpMetaAndAssetContexts>

Inherited from ​

RestClient.getPerpAssetContexts


getPerpCategories() ​

ts
getPerpCategories(): Promise<PerpCategory[]>;

Perp category for each listed coin (perpCategories).

Each entry is [coin, category].

Returns ​

Promise<PerpCategory[]>

Inherited from ​

RestClient.getPerpCategories


getPerpDeployAuctionStatus() ​

ts
getPerpDeployAuctionStatus(): Promise<DeployGasAuction>;

Perp deploy auction status (perpDeployAuctionStatus).

Returns ​

Promise<DeployGasAuction>

Inherited from ​

RestClient.getPerpDeployAuctionStatus


getPerpDexLimits() ​

ts
getPerpDexLimits(params: object): Promise<PerpDexLimits>;

Builder-deployed perp market limits (perpDexLimits).

dex is required. The empty string is not allowed.

Parameters ​

ParameterType
params{ dex: string; }
params.dexstring

Returns ​

Promise<PerpDexLimits>

Inherited from ​

RestClient.getPerpDexLimits


getPerpDexs() ​

ts
getPerpDexs(): Promise<(PerpDex | null)[]>;

All perpetual DEXs (perpDexs).

Index 0 is null, the default perp DEX. Later entries are builder-deployed HIP-3 DEXs.

Returns ​

Promise<(PerpDex | null)[]>

Inherited from ​

RestClient.getPerpDexs


getPerpDexStatus() ​

ts
getPerpDexStatus(params: object): Promise<PerpDexStatus>;

Perp DEX deposit status (perpDexStatus).

The empty string is the first perp DEX.

Parameters ​

ParameterType
params{ dex: string; }
params.dexstring

Returns ​

Promise<PerpDexStatus>

Inherited from ​

RestClient.getPerpDexStatus


getPerpMetadata() ​

ts
getPerpMetadata(params?: object): Promise<PerpMeta>;

Perp metadata (meta): universe and margin tables.

dex defaults to the empty string, which is the first perp DEX.

Parameters ​

ParameterType
params?{ dex?: string; }
params.dex?string

Returns ​

Promise<PerpMeta>

Inherited from ​

RestClient.getPerpMetadata


getPerpsAtOpenInterestCap() ​

ts
getPerpsAtOpenInterestCap(params?: object): Promise<string[]>;

Coins currently at their open-interest cap (perpsAtOpenInterestCap).

dex selects a builder-deployed market. Omitted means the first perp DEX.

Parameters ​

ParameterType
params?{ dex?: string; }
params.dex?string

Returns ​

Promise<string[]>

Inherited from ​

RestClient.getPerpsAtOpenInterestCap


getPortfolio() ​

ts
getPortfolio(params?: AccountRequest): Promise<PortfolioEntry[]>;

Account value, PnL, and volume history (portfolio).

Each entry is [period, snapshot]. Periods include day, week, month, allTime, and the perp* variants.

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<PortfolioEntry[]>

Inherited from ​

RestClient.getPortfolio


getPredictedFundingRates() ​

ts
getPredictedFundingRates(): Promise<PredictedFunding[]>;

Predicted funding rates by venue (predictedFundings).

Only the first perp DEX is supported. Each entry is [coin, venues], and each venue is [venue, quote]. quote is null when that venue has no predicted rate.

Returns ​

Promise<PredictedFunding[]>

Inherited from ​

RestClient.getPredictedFundingRates


getPreTransferCheck() ​

ts
getPreTransferCheck(params: GetPreTransferCheckRequest): Promise<PreTransferCheck>;

Parameters ​

ParameterType
paramsGetPreTransferCheckRequest

Returns ​

Promise<PreTransferCheck>

Inherited from ​

RestClient.getPreTransferCheck


getRecentTrades() ​

ts
getRecentTrades(params: object): Promise<Trade[]>;

Parameters ​

ParameterType
params{ coin: string; }
params.coinstring

Returns ​

Promise<Trade[]>

Inherited from ​

RestClient.getRecentTrades


getReferralInfo() ​

ts
getReferralInfo(params?: AccountRequest): Promise<ReferralInfo>;

Referral state (referral).

referredBy is null when the user was not referred. referrerState.stage is "ready" or "needToTrade". Claimed rewards now also appear in the non-funding ledger. rewardHistory is legacy.

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<ReferralInfo>

Inherited from ​

RestClient.getReferralInfo


getSettledOutcome() ​

ts
getSettledOutcome(params: object): Promise<SettledOutcome | null>;

Settled outcome (settledOutcome).

Returns null when the outcome is still unsettled.

Parameters ​

ParameterType
params{ outcome: number; }
params.outcomenumber

Returns ​

Promise<SettledOutcome | null>

Inherited from ​

RestClient.getSettledOutcome


getSpotAssetContexts() ​

ts
getSpotAssetContexts(): Promise<SpotMetaAndAssetContexts>;

Spot metadata plus asset contexts (spotMetaAndAssetCtxs).

The tuple is [meta, contexts]. Contexts include mark price, volume, and supply. midPx is null when there is no mid.

Returns ​

Promise<SpotMetaAndAssetContexts>

Inherited from ​

RestClient.getSpotAssetContexts


getSpotBalances() ​

ts
getSpotBalances(params?: AccountRequest): Promise<SpotBalancesResponse>;

Spot token balances (spotClearinghouseState).

Under unified account or portfolio margin, this is the trading-account balance across spot and perps.

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<SpotBalancesResponse>

Inherited from ​

RestClient.getSpotBalances


getSpotDeployAuctionStatus() ​

ts
getSpotDeployAuctionStatus(params?: AccountRequest): Promise<SpotDeployStateResponse>;

Spot deploy state for a user (spotDeployState), including the gas auction.

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<SpotDeployStateResponse>

Inherited from ​

RestClient.getSpotDeployAuctionStatus


getSpotMetadata() ​

ts
getSpotMetadata(): Promise<SpotMeta>;

Spot metadata (spotMeta): tokens and trading pairs.

Returns ​

Promise<SpotMeta>

Inherited from ​

RestClient.getSpotMetadata


getSpotPairDeployAuctionStatus() ​

ts
getSpotPairDeployAuctionStatus(): Promise<DeployGasAuction>;

Dutch auction for deploying a spot pair (spotPairDeployAuctionStatus).

Returns ​

Promise<DeployGasAuction>

Inherited from ​

RestClient.getSpotPairDeployAuctionStatus


getStakingDelegations() ​

ts
getStakingDelegations(params?: AccountRequest): Promise<StakingDelegation[]>;

Stake delegated to validators (delegations).

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<StakingDelegation[]>

Inherited from ​

RestClient.getStakingDelegations


getStakingHistory() ​

ts
getStakingHistory(params?: AccountRequest): Promise<StakingHistoryEntry[]>;

Staking history (delegatorHistory).

delta is one of delegate, cDeposit, or withdrawal.

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<StakingHistoryEntry[]>

Inherited from ​

RestClient.getStakingHistory


getStakingRewards() ​

ts
getStakingRewards(params?: AccountRequest): Promise<StakingReward[]>;

Staking rewards (delegatorRewards).

source is "delegation" or "commission" in the documented samples.

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<StakingReward[]>

Inherited from ​

RestClient.getStakingRewards


getStakingSummary() ​

ts
getStakingSummary(params?: AccountRequest): Promise<StakingSummary>;

Staking summary (delegatorSummary): delegated, undelegated, and pending withdrawals.

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<StakingSummary>

Inherited from ​

RestClient.getStakingSummary


getSubAccounts() ​

ts
getSubAccounts(params?: AccountRequest): Promise<SubAccount[] | null>;

Subaccounts of a master (subAccounts).

Returns null when the address has no subaccounts.

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<SubAccount[] | null>

Inherited from ​

RestClient.getSubAccounts


getSubAccountsWithAllDexStates() ​

ts
getSubAccountsWithAllDexStates(params?: AccountRequest): Promise<
  | SubAccountWithAllDexStates[]
| null>;

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise< | SubAccountWithAllDexStates[] | null>

Inherited from ​

RestClient.getSubAccountsWithAllDexStates


getTokenDetails() ​

ts
getTokenDetails(params: object): Promise<TokenDetails>;

Token details (tokenDetails): supply, prices, and genesis balances.

tokenId is the 34-character onchain id, for example 0x00000000000000000000000000000000.

Parameters ​

ParameterType
params{ tokenId: string; }
params.tokenIdstring

Returns ​

Promise<TokenDetails>

Inherited from ​

RestClient.getTokenDetails


getTwapHistory() ​

ts
getTwapHistory(params?: AccountRequest): Promise<TwapHistoryEntry[]>;

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<TwapHistoryEntry[]>

Inherited from ​

RestClient.getTwapHistory


getUserAbstraction() ​

ts
getUserAbstraction(params?: AccountRequest): Promise<UserAbstraction>;

Account abstraction mode (userAbstraction).

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<UserAbstraction>

Inherited from ​

RestClient.getUserAbstraction


getUserBorrowLendInterest() ​

ts
getUserBorrowLendInterest(params: GetUserBorrowLendInterestRequest): Promise<UserBorrowLendInterest[]>;

Parameters ​

ParameterType
paramsGetUserBorrowLendInterestRequest

Returns ​

Promise<UserBorrowLendInterest[]>

Inherited from ​

RestClient.getUserBorrowLendInterest


getUserBorrowLendState() ​

ts
getUserBorrowLendState(params?: AccountRequest): Promise<BorrowLendUserState>;

User borrow and lend balances (borrowLendUserState).

tokenToState entries are [token, state].

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<BorrowLendUserState>

Inherited from ​

RestClient.getUserBorrowLendState


getUserDexAbstraction() ​

ts
getUserDexAbstraction(params?: AccountRequest): Promise<boolean>;

Whether HIP-3 DEX abstraction is enabled (userDexAbstraction).

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<boolean>

Inherited from ​

RestClient.getUserDexAbstraction


getUserFees() ​

ts
getUserFees(params?: AccountRequest): Promise<UserFees>;

User fee rates and the current fee schedule (userFees).

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<UserFees>

Inherited from ​

RestClient.getUserFees


getUserFills() ​

ts
getUserFills(params?: GetUserFillsRequest): Promise<UserFill[]>;

Recent fills (userFills).

Returns at most 2000 fills. builderFee is omitted when it is zero. side "B" is buy and "A" is sell.

Parameters ​

ParameterType
params?GetUserFillsRequest

Returns ​

Promise<UserFill[]>

Inherited from ​

RestClient.getUserFills


getUserFillsByTime() ​

ts
getUserFillsByTime(params: GetUserFillsByTimeRequest): Promise<UserFill[]>;

Fills in a time range (userFillsByTime).

Returns at most 2000 fills, and only the 10000 most recent fills are available. Paginate by using the last time as the next startTime.

Parameters ​

ParameterType
paramsGetUserFillsByTimeRequest

Returns ​

Promise<UserFill[]>

Inherited from ​

RestClient.getUserFillsByTime


getUserFundingHistory() ​

ts
getUserFundingHistory(params?: GetUserFundingHistoryRequest): Promise<UserFunding[]>;

User funding payments (userFunding).

startTime is inclusive, in milliseconds. endTime defaults to now.

Parameters ​

ParameterType
params?GetUserFundingHistoryRequest

Returns ​

Promise<UserFunding[]>

Inherited from ​

RestClient.getUserFundingHistory


getUserNonFundingLedgerUpdates() ​

ts
getUserNonFundingLedgerUpdates(params?: GetUserNonFundingLedgerUpdatesRequest): Promise<UserNonFundingLedgerUpdate[]>;

User non-funding ledger updates (userNonFundingLedgerUpdates): deposits, withdrawals, transfers, and other account events.

startTime is inclusive, in milliseconds. endTime defaults to now. Read delta.type to see which delta fields are set.

Parameters ​

ParameterType
params?GetUserNonFundingLedgerUpdatesRequest

Returns ​

Promise<UserNonFundingLedgerUpdate[]>

Inherited from ​

RestClient.getUserNonFundingLedgerUpdates


getUserRateLimit() ​

ts
getUserRateLimit(params?: AccountRequest): Promise<UserRateLimit>;

Address request usage and cap (userRateLimit).

nRequestsUsed is usage above the reserved amount. nRequestsSurplus is reserved amount not yet used.

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<UserRateLimit>

Inherited from ​

RestClient.getUserRateLimit


getUserRole() ​

ts
getUserRole(params: UserRequest): Promise<UserRoleResponse>;

Account role (userRole): user, agent, vault, subaccount, or missing.

Query the master or subaccount address itself. An agent wallet address returns the agent role, not the trading account.

Parameters ​

ParameterType
paramsUserRequest

Returns ​

Promise<UserRoleResponse>

Inherited from ​

RestClient.getUserRole


getUserTwapSliceFills() ​

ts
getUserTwapSliceFills(params?: AccountRequest): Promise<TwapSliceFill[]>;

Recent TWAP slice fills (userTwapSliceFills).

Returns at most 2000 fills. TWAP fill hashes are zero.

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<TwapSliceFill[]>

Inherited from ​

RestClient.getUserTwapSliceFills


getUserTwapSliceFillsByTime() ​

ts
getUserTwapSliceFillsByTime(params: GetUserTwapSliceFillsByTimeRequest): Promise<TwapSliceFill[]>;

Parameters ​

ParameterType
paramsGetUserTwapSliceFillsByTimeRequest

Returns ​

Promise<TwapSliceFill[]>

Inherited from ​

RestClient.getUserTwapSliceFillsByTime


getUserVaultDeposits() ​

ts
getUserVaultDeposits(params?: AccountRequest): Promise<UserVaultDeposit[]>;

Vault equity for this user (userVaultEquities).

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<UserVaultDeposit[]>

Inherited from ​

RestClient.getUserVaultDeposits


getValidatorL1Votes() ​

ts
getValidatorL1Votes(): Promise<ValidatorL1Vote[]>;

Returns ​

Promise<ValidatorL1Vote[]>

Inherited from ​

RestClient.getValidatorL1Votes


getValidatorSummaries() ​

ts
getValidatorSummaries(): Promise<ValidatorSummary[]>;

Returns ​

Promise<ValidatorSummary[]>

Inherited from ​

RestClient.getValidatorSummaries


getVaultDetails() ​

ts
getVaultDetails(params: GetVaultDetailsRequest): Promise<VaultDetails | null>;

Vault details (vaultDetails).

Returns null when the vault does not exist. relationship.type is "normal", "parent", or "child". Pass user for followerState.

Parameters ​

ParameterType
paramsGetVaultDetailsRequest

Returns ​

Promise<VaultDetails | null>

Inherited from ​

RestClient.getVaultDetails


getVaultSummaries() ​

ts
getVaultSummaries(): Promise<VaultSummary[]>;

Returns ​

Promise<VaultSummary[]>

Inherited from ​

RestClient.getVaultSummaries


getVipStatus() ​

ts
getVipStatus(params?: AccountRequest): Promise<boolean>;

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<boolean>

Inherited from ​

RestClient.getVipStatus


getWebData2() ​

ts
getWebData2(params?: AccountRequest): Promise<WebData2>;

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<WebData2>

Inherited from ​

RestClient.getWebData2


getWSClient() ​

ts
getWSClient(): WebsocketClient;

Returns ​

WebsocketClient


invalidateNonce() ​

ts
invalidateNonce(options?: L1ActionOptions): Promise<ExchangeResponse>;

Mark a nonce as used without another effect (noop).

Parameters ​

ParameterType
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.invalidateNonce


isConnected() ​

ts
isConnected(): boolean;

Returns ​

boolean


linkStakingAccount() ​

ts
linkStakingAccount(params: LinkStakingAccountRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
paramsLinkStakingAccountRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.linkStakingAccount


modifyOrder() ​

ts
modifyOrder(params: ModifyOrderRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Modify one resting order (modify).

Success is the default acknowledgement. The exchange assigns a new oid. Callers must read open orders (or use cloid) to find it.

alwaysPlace sends a: true so the new order is placed even when the cancel fails. false is omitted, because hashing a: false is rejected.

Parameters ​

ParameterType
paramsModifyOrderRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.modifyOrder


modifyOrders() ​

ts
modifyOrders(params: ModifyOrdersRequest, options?: L1ActionOptions): Promise<ExchangeResponse<OrderResponseData>>;

Modify multiple resting orders (batchModify).

Statuses match submitOrder(). alwaysPlace has the same meaning as on modifyOrder().

Parameters ​

ParameterType
paramsModifyOrdersRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<OrderResponseData>>

Inherited from ​

RestClient.modifyOrders


modifyVault() ​

ts
modifyVault(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ allowDeposits?: boolean | null; alwaysCloseOnWithdraw?: boolean | null; vaultAddress: string; }
params.allowDeposits?boolean | null
params.alwaysCloseOnWithdraw?boolean | null
params.vaultAddressstring
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.modifyVault


nameToCoin() ​

ts
nameToCoin(name: string): Promise<string>;

Parameters ​

ParameterType
namestring

Returns ​

Promise<string>

Inherited from ​

RestClient.nameToCoin


off() ​

ts
off<K extends keyof WebsocketClientEventMap<WsKey>>(event: K, listener: (...args: WebsocketClientEventMap<WsKey>[K]) => void): this;

Type Parameters ​

Type Parameter
K extends keyof WebsocketClientEventMap<WsKey>

Parameters ​

ParameterType
eventK
listener(...args: WebsocketClientEventMap<WsKey>[K]) => void

Returns ​

this


on() ​

ts
on<K extends keyof WebsocketClientEventMap<WsKey>>(event: K, listener: (...args: WebsocketClientEventMap<WsKey>[K]) => void): this;

Type Parameters ​

Type Parameter
K extends keyof WebsocketClientEventMap<WsKey>

Parameters ​

ParameterType
eventK
listener(...args: WebsocketClientEventMap<WsKey>[K]) => void

Returns ​

this


once() ​

ts
once<K extends keyof WebsocketClientEventMap<WsKey>>(event: K, listener: (...args: WebsocketClientEventMap<WsKey>[K]) => void): this;

Type Parameters ​

Type Parameter
K extends keyof WebsocketClientEventMap<WsKey>

Parameters ​

ParameterType
eventK
listener(...args: WebsocketClientEventMap<WsKey>[K]) => void

Returns ​

this


refreshAssetMetadata() ​

ts
refreshAssetMetadata(): Promise<void>;

Returns ​

Promise<void>

Inherited from ​

RestClient.refreshAssetMetadata


registerReferrer() ​

ts
registerReferrer(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ code: string; }
params.codestring
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.registerReferrer


renameSubAccount() ​

ts
renameSubAccount(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ name: string; subAccountUser: string; }
params.namestring
params.subAccountUserstring
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.renameSubAccount


reserveAdditionalActions() ​

ts
reserveAdditionalActions(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Buy extra address request weight (reserveRequestWeight).

Each reserved action costs 0.0005 USDC from the perp balance.

Parameters ​

ParameterType
params{ weight: number; }
params.weightnumber
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.reserveAdditionalActions


resolveAsset() ​

ts
resolveAsset(identifier: AssetIdentifier): Promise<ResolvedAsset>;

Parameters ​

ParameterType
identifierAssetIdentifier

Returns ​

Promise<ResolvedAsset>

Inherited from ​

RestClient.resolveAsset


sendAsset() ​

ts
sendAsset(params: SendAssetRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Transfer collateral between perp DEXs, spot, users, or subaccounts (sendAsset).

Use "" for the default USDC perp DEX and "spot" for spot. Only the collateral token can move to or from a perp DEX.

Parameters ​

ParameterType
paramsSendAssetRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.sendAsset


sendAssetFromApiWallet() ​

ts
sendAssetFromApiWallet(params: SendAssetRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Transfer collateral with an API wallet (agentSendAsset).

Destination must match the source address. Dex names match sendAsset().

Parameters ​

ParameterType
paramsSendAssetRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.sendAssetFromApiWallet


sendSpotAsset() ​

ts
sendSpotAsset(params: SendSpotAssetRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Send a spot token to another address on HyperCore (spotSend).

This does not touch the EVM bridge. token is name:tokenId.

Parameters ​

ParameterType
paramsSendSpotAssetRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.sendSpotAsset


sendToEvmWithData() ​

ts
sendToEvmWithData(params: SendToEvmWithDataRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Send tokens from Core to EVM with calldata (sendToEvmWithData).

The linked contract must implement coreReceiveWithData.

Parameters ​

ParameterType
paramsSendToEvmWithDataRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.sendToEvmWithData


sendUsd() ​

ts
sendUsd(params: SendUsdRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Send USDC to another address on HyperCore (usdSend).

This does not touch the EVM bridge. expiresAfter is not supported.

Parameters ​

ParameterType
paramsSendUsdRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.sendUsd


setApiWalletAbstraction() ​

ts
setApiWalletAbstraction(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Set account abstraction from an API wallet (agentSetAbstraction).

"i" is disabled, "u" is unified account, and "p" is portfolio margin.

Parameters ​

ParameterType
params{ abstraction: "i" | "p" | "u"; }
params.abstraction"i" | "p" | "u"
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.setApiWalletAbstraction


setCancelAllAfter() ​

ts
setCancelAllAfter(params?: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Schedule a cancel-all, or clear one (scheduleCancel).

time is a millisecond timestamp at least 5 seconds in the future. Omit time to remove the scheduled cancel. At most 10 triggers per day.

Parameters ​

ParameterType
params?{ time?: number; }
params.time?number
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.setCancelAllAfter


setDisplayName() ​

ts
setDisplayName(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ displayName: string; }
params.displayNamestring
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.setDisplayName


setEvmBigBlocks() ​

ts
setEvmBigBlocks(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ usingBigBlocks: boolean; }
params.usingBigBlocksboolean
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.setEvmBigBlocks


setIsolatedMarginLeverage() ​

ts
setIsolatedMarginLeverage(params: SetIsolatedMarginLeverageRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Set isolated margin to a target leverage (topUpIsolatedOnlyMargin).

This changes leverage directly. updateIsolatedMargin() changes a USDC amount.

Parameters ​

ParameterType
paramsSetIsolatedMarginLeverageRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.setIsolatedMarginLeverage


setReferrer() ​

ts
setReferrer(options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.setReferrer


setSpotDusting() ​

ts
setSpotDusting(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ toggleSpotDusting: { optOut: boolean; }; }
params.toggleSpotDusting{ optOut: boolean; }
params.toggleSpotDusting.optOutboolean
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.setSpotDusting


setUserAbstraction() ​

ts
setUserAbstraction(params: SetUserAbstractionRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Set account abstraction (userSetAbstraction).

abstraction is "disabled", "unifiedAccount", or "portfolioMargin".

Parameters ​

ParameterType
paramsSetUserAbstractionRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.setUserAbstraction


setUserDexAbstraction() ​

ts
setUserDexAbstraction(params: UserToggleRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Enable or disable HIP-3 DEX abstraction (userDexAbstraction).

Deprecated. Prefer setUserAbstraction().

Parameters ​

ParameterType
paramsUserToggleRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.setUserDexAbstraction


setUserPortfolioMargin() ​

ts
setUserPortfolioMargin(params: UserToggleRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
paramsUserToggleRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.setUserPortfolioMargin


submitGossipPriorityBid() ​

ts
submitGossipPriorityBid(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params{ ip: string; maxGas: number; slotId: 0 | 1; }
params.ipstring
params.maxGasnumber
params.slotId0 | 1
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.submitGossipPriorityBid


submitLimitOrder() ​

ts
submitLimitOrder(params: SubmitLimitOrderRequest, options?: L1ActionOptions): Promise<ExchangeResponse<OrderResponseData>>;

Place a limit order (order).

postOnly sends ALO. timeInForce: "IOC" sends IOC. Otherwise the order is GTC.

Parameters ​

ParameterType
paramsSubmitLimitOrderRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<OrderResponseData>>

Inherited from ​

RestClient.submitLimitOrder


submitMarketClose() ​

ts
submitMarketClose(params: SubmitMarketCloseRequest, options?: L1ActionOptions): Promise<ExchangeResponse<OrderResponseData>>;

Close a perp position with a reduce-only IOC order (order).

Closes the entire position for that coin, not just a recently opened size. Size defaults to the open position size.

Parameters ​

ParameterType
paramsSubmitMarketCloseRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<OrderResponseData>>

Inherited from ​

RestClient.submitMarketClose


submitMarketOrder() ​

ts
submitMarketOrder(params: SubmitMarketOrderRequest, options?: L1ActionOptions): Promise<ExchangeResponse<OrderResponseData>>;

Place an IOC order around the current mid (order).

maxSlippage is a fraction from 0 inclusive to 1 exclusive. The default is 0.05.

Parameters ​

ParameterType
paramsSubmitMarketOrderRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<OrderResponseData>>

Inherited from ​

RestClient.submitMarketOrder


submitMultiSigL1Action() ​

ts
submitMultiSigL1Action<T = ExchangeResponse<unknown>>(action: JsonObject, options: MultiSigL1RequestOptions): Promise<T>;

Type Parameters ​

Type ParameterDefault type
TExchangeResponse<unknown>

Parameters ​

ParameterType
actionJsonObject
optionsMultiSigL1RequestOptions

Returns ​

Promise<T>

Inherited from ​

RestClient.submitMultiSigL1Action


submitMultiSigUserSignedAction() ​

ts
submitMultiSigUserSignedAction<T = ExchangeResponse<unknown>>(
   action: JsonObject, 
   definition: UserSignedActionDefinition, 
   options: MultiSigUserSignedRequestOptions
): Promise<T>;

Type Parameters ​

Type ParameterDefault type
TExchangeResponse<unknown>

Parameters ​

ParameterType
actionJsonObject
definitionUserSignedActionDefinition
optionsMultiSigUserSignedRequestOptions

Returns ​

Promise<T>

Inherited from ​

RestClient.submitMultiSigUserSignedAction


submitOrder() ​

ts
submitOrder(params: SubmitOrderRequest, options?: L1ActionOptions): Promise<ExchangeResponse<OrderResponseData>>;

Place one or more orders (order).

Each status is resting, filled, or error. The request can succeed while an individual order is rejected.

Parameters ​

ParameterType
paramsSubmitOrderRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<OrderResponseData>>

Inherited from ​

RestClient.submitOrder


submitRawInfoRequest() ​

ts
submitRawInfoRequest<T = InfoResponse>(request: object): Promise<T>;

Type Parameters ​

Type ParameterDefault type
TInfoResponse

Parameters ​

ParameterType
requestobject

Returns ​

Promise<T>

Inherited from ​

RestClient.submitRawInfoRequest


submitRawL1Action() ​

ts
submitRawL1Action<T = ExchangeResponse<unknown>>(action: JsonObject, options?: L1ActionOptions): Promise<T>;

Type Parameters ​

Type ParameterDefault type
TExchangeResponse<unknown>

Parameters ​

ParameterType
actionJsonObject
options?L1ActionOptions

Returns ​

Promise<T>

Inherited from ​

RestClient.submitRawL1Action


submitRawUserSignedAction() ​

ts
submitRawUserSignedAction<T = ExchangeResponse<unknown>>(
   action: JsonObject, 
   definition: UserSignedActionDefinition, 
   options?: UserSignedActionOptions
): Promise<T>;

Type Parameters ​

Type ParameterDefault type
TExchangeResponse<unknown>

Parameters ​

ParameterType
actionJsonObject
definitionUserSignedActionDefinition
options?UserSignedActionOptions

Returns ​

Promise<T>

Inherited from ​

RestClient.submitRawUserSignedAction


submitSignerAction() ​

ts
submitSignerAction(params: 
  | {
  jailSelf: null;
}
  | {
  unjailSelf: null;
}, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
params| { jailSelf: null; } | { unjailSelf: null; }
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.submitSignerAction


submitTwapOrder() ​

ts
submitTwapOrder(params: SubmitTwapOrderRequest, options?: L1ActionOptions): Promise<ExchangeResponse<TwapOrderResponseData>>;

Place a TWAP order (twapOrder).

A running TWAP returns { running: { twapId } }. A rejected TWAP returns { error }.

Parameters ​

ParameterType
paramsSubmitTwapOrderRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse<TwapOrderResponseData>>

Inherited from ​

RestClient.submitTwapOrder


submitUserOutcome() ​

ts
submitUserOutcome(params: SubmitUserOutcomeRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Split, merge, or negate outcome shares (userOutcome).

splitOutcome turns quote tokens into Yes and No shares. mergeOutcome and mergeQuestion turn shares back into quote tokens. amount: null merges the maximum. negateOutcome converts No shares into Yes shares of the other outcomes on the same question.

Parameters ​

ParameterType
paramsSubmitUserOutcomeRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.submitUserOutcome


submitValidatorAction() ​

ts
submitValidatorAction(params: Omit<JsonObject, "type">, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
paramsOmit<JsonObject, "type">
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.submitValidatorAction


transferHip3LiquidatorFunds() ​

ts
transferHip3LiquidatorFunds(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Deposit or withdraw from an HIP-3 backstop liquidator (hip3LiquidatorTransfer).

ntl is an integer in 1e-6 quote-token units and must be a multiple of 1000 quote tokens. Only principal can be withdrawn, not PnL.

Parameters ​

ParameterType
params{ dex: string; isDeposit: boolean; ntl: number; }
params.dexstring
params.isDepositboolean
params.ntlnumber
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.transferHip3LiquidatorFunds


transferSpotToOrFromSubAccount() ​

ts
transferSpotToOrFromSubAccount(params: TransferSpotToOrFromSubAccountRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
paramsTransferSpotToOrFromSubAccountRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.transferSpotToOrFromSubAccount


transferUsdBetweenSpotAndPerp() ​

ts
transferUsdBetweenSpotAndPerp(params: TransferUsdBetweenSpotAndPerpRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Move USDC between spot and perp (usdClassTransfer).

toPerp: true sends spot to perp.

Parameters ​

ParameterType
paramsTransferUsdBetweenSpotAndPerpRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.transferUsdBetweenSpotAndPerp


transferUsdToOrFromSubAccount() ​

ts
transferUsdToOrFromSubAccount(params: TransferUsdToOrFromSubAccountRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Parameters ​

ParameterType
paramsTransferUsdToOrFromSubAccountRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.transferUsdToOrFromSubAccount


transferVaultFunds() ​

ts
transferVaultFunds(params: TransferVaultFundsRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Deposit or withdraw vault funds (vaultTransfer).

Parameters ​

ParameterType
paramsTransferVaultFundsRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.transferVaultFunds


updateIsolatedMargin() ​

ts
updateIsolatedMargin(params: UpdateIsolatedMarginRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Add or remove isolated margin (updateIsolatedMargin).

ntli is a 6-decimal integer. 1000000 is 1 USD.

Parameters ​

ParameterType
paramsUpdateIsolatedMarginRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.updateIsolatedMargin


updateLeverage() ​

ts
updateLeverage(params: UpdateLeverageRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;

Set cross or isolated leverage for one asset (updateLeverage).

Parameters ​

ParameterType
paramsUpdateLeverageRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.updateLeverage


updateValidatorL1Stream() ​

ts
updateValidatorL1Stream(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;

Vote the risk-free rate for an aligned quote asset (validatorL1Stream).

riskFreeRate is a decimal string such as "0.04" for 4%.

Parameters ​

ParameterType
params{ riskFreeRate: string; }
params.riskFreeRatestring
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.updateValidatorL1Stream


withdrawFromStaking() ​

ts
withdrawFromStaking(params: object, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Move native token from staking back to spot (cWithdraw).

The transfer waits in a 7-day unstaking queue.

Parameters ​

ParameterType
params{ wei: number; }
params.weinumber
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.withdrawFromStaking


withdrawUsd() ​

ts
withdrawUsd(params: SendUsdRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;

Start a USDC withdrawal to the bridge (withdraw3).

Parameters ​

ParameterType
paramsSendUsdRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>

Inherited from ​

RestClient.withdrawUsd

Built by Siebly. Open source SDKs for exchange APIs.