Skip to content

Class: RestClient ​

Extends ​

  • BaseRestClient

Extended by ​

Constructors ​

Constructor ​

ts
new RestClient(options?: RestClientOptions, networkOptions?: RestClientNetworkOptions): RestClient;

Parameters ​

ParameterType
options?RestClientOptions
networkOptions?RestClientNetworkOptions

Returns ​

RestClient

Overrides ​

BaseRestClient.constructor

Properties ​

baseUrl ​

ts
readonly baseUrl: string;

Inherited from ​

BaseRestClient.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>


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>


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>


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>>


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>>


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>>


claimRewards() ​

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

Claim rewards (claimRewards).

Parameters ​

ParameterType
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>


convertToMultiSigUser() ​

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

Parameters ​

ParameterType
paramsConvertToMultiSigUserRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>


createSubAccount() ​

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

Parameters ​

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

Returns ​

Promise<ExchangeResponse<string>>


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>>


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>


deployPerp() ​

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

Parameters ​

ParameterType
paramsDeployPerpRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>


deploySpot() ​

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

Parameters ​

ParameterType
paramsDeploySpotRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>


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>


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

Parameters ​

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

Returns ​

Promise<ExchangeResponse>


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>


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>


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>


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>


getAccountAddress() ​

ts
getAccountAddress(): Promise<string>;

Returns ​

Promise<string>


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>


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>


getAllBorrowLendReserveStates() ​

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

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

Each entry is [token, reserve].

Returns ​

Promise<BorrowLendReserveEntry[]>


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>

Example ​

ts
import { RestClient } from '@siebly/hyperliquid-api';

async function main() {
  const client = new RestClient();
  const mids = await client.getAllMids();
  if (mids.BTC === undefined) {
    throw new Error('BTC was not present in the mid-price response.');
  }
  console.log('BTC mid price:', mids.BTC);
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

See ​

Quickstart


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[]>


getApprovedBuilders() ​

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

Builder addresses this user has approved (approvedBuilders).

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<string[]>


getBalances() ​

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

Parameters ​

ParameterType
params?AccountDexRequest

Returns ​

Promise<AccountBalancesResponse>


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>


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[]>

Example ​

ts
import { RestClient } from '@siebly/hyperliquid-api';

async function main() {
  const client = new RestClient();
  const candles = await client.getCandles({
    coin: 'BTC',
    interval: '1h',
    startTime: Date.now() - 24 * 60 * 60 * 1000,
  });
  console.log(candles);
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

See ​

Read candle history


getConcisePerpAnnotations() ​

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

Concise perp annotations (perpConciseAnnotations).

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

Returns ​

Promise<PerpConciseAnnotation[]>


getExchangeStatus() ​

ts
getExchangeStatus(): Promise<ExchangeStatus>;

Returns ​

Promise<ExchangeStatus>


getExtraAgents() ​

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<ExtraAgent[]>


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[]>


getFundingHistory() ​

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

Historical funding rates for one coin (fundingHistory).

Parameters ​

ParameterType
paramsGetFundingHistoryRequest

Returns ​

Promise<FundingHistory[]>


getGossipPriorityAuctionStatus() ​

ts
getGossipPriorityAuctionStatus(): Promise<GossipPriorityAuctionStatus>;

Returns ​

Promise<GossipPriorityAuctionStatus>


getGossipRootIps() ​

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

Returns ​

Promise<string[]>


getLeadingVaults() ​

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<LeadingVault[]>


getLegalStatus() ​

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<LegalStatus>


getLiquidatablePositions() ​

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

Returns ​

Promise<LiquidatablePosition[]>


getMarginTable() ​

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

Parameters ​

ParameterType
params{ id: number; }
params.idnumber

Returns ​

Promise<PerpMarginTable>


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>


getMaxMarketOrderNotionals() ​

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

Returns ​

Promise<MaxMarketOrderNotional[]>


getMultiSigSigners() ​

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<MultiSigSigners | null>


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[]>


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>

Example ​

ts
import { RestClient } from '@siebly/hyperliquid-api';

async function main() {
  const client = new RestClient();
  const book = await client.getOrderBook({ coin: 'BTC' });
  if (!book) {
    console.log('No order book was returned for BTC.');
    return;
  }

  const [bids, asks] = book.levels;
  console.log({ bestBid: bids[0] ?? null, bestAsk: asks[0] ?? null });
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

See ​

Read an order book


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[]>


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>

Example ​

ts
import { RestClient } from '@siebly/hyperliquid-api';

async function main() {
  const accountAddress = process.env.HYPERLIQUID_ACCOUNT_ADDRESS;
  const clientOrderId = process.env.HYPERLIQUID_CLIENT_ORDER_ID;
  if (!accountAddress || !clientOrderId) {
    throw new Error('Set HYPERLIQUID_ACCOUNT_ADDRESS and HYPERLIQUID_CLIENT_ORDER_ID.');
  }

  const client = new RestClient({ accountAddress });
  const result = await client.getOrderStatus({ oid: clientOrderId });
  if (result.status === 'unknownOid') {
    console.log('Order not found. Check the account, network and client order ID.');
    return;
  }
  console.log('Order status:', result.order.status);
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

See ​

Check an order after a timeout


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>


getOutcomeMetadata() ​

ts
getOutcomeMetadata(): Promise<OutcomeMetadata>;

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

Returns ​

Promise<OutcomeMetadata>


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>

Example ​

ts
import { RestClient } from '@siebly/hyperliquid-api';

async function main() {
  const accountAddress = process.env.HYPERLIQUID_ACCOUNT_ADDRESS;
  if (!accountAddress) throw new Error('Set HYPERLIQUID_ACCOUNT_ADDRESS.');

  const client = new RestClient({ accountAddress });
  const account = await client.getPerpAccountSummary();
  console.log(account.assetPositions);
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

See ​

Read account state


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>


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>


getPerpCategories() ​

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

Perp category for each listed coin (perpCategories).

Each entry is [coin, category].

Returns ​

Promise<PerpCategory[]>


getPerpDeployAuctionStatus() ​

ts
getPerpDeployAuctionStatus(): Promise<DeployGasAuction>;

Perp deploy auction status (perpDeployAuctionStatus).

Returns ​

Promise<DeployGasAuction>


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>


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)[]>


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>


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>


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[]>


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[]>


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[]>


getPreTransferCheck() ​

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

Parameters ​

ParameterType
paramsGetPreTransferCheckRequest

Returns ​

Promise<PreTransferCheck>


getRecentTrades() ​

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

Parameters ​

ParameterType
params{ coin: string; }
params.coinstring

Returns ​

Promise<Trade[]>


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>


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>


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>


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>


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>


getSpotMetadata() ​

ts
getSpotMetadata(): Promise<SpotMeta>;

Spot metadata (spotMeta): tokens and trading pairs.

Returns ​

Promise<SpotMeta>


getSpotPairDeployAuctionStatus() ​

ts
getSpotPairDeployAuctionStatus(): Promise<DeployGasAuction>;

Dutch auction for deploying a spot pair (spotPairDeployAuctionStatus).

Returns ​

Promise<DeployGasAuction>


getStakingDelegations() ​

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

Stake delegated to validators (delegations).

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<StakingDelegation[]>


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[]>


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[]>


getStakingSummary() ​

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

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<StakingSummary>


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>


getSubAccountsWithAllDexStates() ​

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise< | SubAccountWithAllDexStates[] | null>


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>


getTwapHistory() ​

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<TwapHistoryEntry[]>


getUserAbstraction() ​

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

Account abstraction mode (userAbstraction).

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<UserAbstraction>


getUserBorrowLendInterest() ​

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

Parameters ​

ParameterType
paramsGetUserBorrowLendInterestRequest

Returns ​

Promise<UserBorrowLendInterest[]>


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>


getUserDexAbstraction() ​

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

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<boolean>


getUserFees() ​

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

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<UserFees>


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[]>


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[]>


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[]>


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[]>


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>


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>


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[]>


getUserTwapSliceFillsByTime() ​

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

Parameters ​

ParameterType
paramsGetUserTwapSliceFillsByTimeRequest

Returns ​

Promise<TwapSliceFill[]>


getUserVaultDeposits() ​

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

Vault equity for this user (userVaultEquities).

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<UserVaultDeposit[]>


getValidatorL1Votes() ​

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

Returns ​

Promise<ValidatorL1Vote[]>


getValidatorSummaries() ​

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

Returns ​

Promise<ValidatorSummary[]>


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>


getVaultSummaries() ​

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

Returns ​

Promise<VaultSummary[]>


getVipStatus() ​

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<boolean>


getWebData2() ​

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

Parameters ​

ParameterType
params?AccountRequest

Returns ​

Promise<WebData2>


invalidateNonce() ​

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

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

Parameters ​

ParameterType
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>


linkStakingAccount() ​

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

Parameters ​

ParameterType
paramsLinkStakingAccountRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>


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>


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>>


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>


nameToCoin() ​

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

Parameters ​

ParameterType
namestring

Returns ​

Promise<string>


refreshAssetMetadata() ​

ts
refreshAssetMetadata(): Promise<void>;

Returns ​

Promise<void>


registerReferrer() ​

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

Parameters ​

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

Returns ​

Promise<ExchangeResponse>


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>


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>


resolveAsset() ​

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

Parameters ​

ParameterType
identifierAssetIdentifier

Returns ​

Promise<ResolvedAsset>


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>


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>


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>


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>


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>


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>


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>


setDisplayName() ​

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

Parameters ​

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

Returns ​

Promise<ExchangeResponse>


setEvmBigBlocks() ​

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

Parameters ​

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

Returns ​

Promise<ExchangeResponse>


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>


setReferrer() ​

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

Parameters ​

ParameterType
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>


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>


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>


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>


setUserPortfolioMargin() ​

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

Parameters ​

ParameterType
paramsUserToggleRequest
options?UserSignedActionOptions

Returns ​

Promise<ExchangeResponse>


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>


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>>


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>>


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>>


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 ​

BaseRestClient.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 ​

BaseRestClient.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>>

See ​

Handle individual order results


submitRawInfoRequest() ​

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

Type Parameters ​

Type ParameterDefault type
TInfoResponse

Parameters ​

ParameterType
requestobject

Returns ​

Promise<T>

Inherited from ​

BaseRestClient.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 ​

BaseRestClient.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 ​

BaseRestClient.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>


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>>


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>


submitValidatorAction() ​

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

Parameters ​

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

Returns ​

Promise<ExchangeResponse>


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>


transferSpotToOrFromSubAccount() ​

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

Parameters ​

ParameterType
paramsTransferSpotToOrFromSubAccountRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>


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>


transferUsdToOrFromSubAccount() ​

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

Parameters ​

ParameterType
paramsTransferUsdToOrFromSubAccountRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>


transferVaultFunds() ​

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

Deposit or withdraw vault funds (vaultTransfer).

Parameters ​

ParameterType
paramsTransferVaultFundsRequest
options?L1ActionOptions

Returns ​

Promise<ExchangeResponse>


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>


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>


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>


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>


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>

Built by Siebly. Open source SDKs for exchange APIs.