Class: WebsocketAPIClient
Extends
Constructors
Constructor
new WebsocketAPIClient(options?: WebsocketAPIClientOptions, logger?: object): WebsocketAPIClient;Parameters
| Parameter | Type | Default 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
Properties
baseUrl
readonly baseUrl: string;Inherited from
Methods
approveApiWallet()
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
| Parameter | Type |
|---|---|
params | ApproveApiWalletRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
approveBuilderFee()
approveBuilderFee(options?: UserSignedActionOptions): Promise<ExchangeResponse>;Approve the configured builder fee (approveBuilderFee).
maxFeeRate is a percent string such as "0.001%".
Parameters
| Parameter | Type |
|---|---|
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
authorizeAqav2Role()
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
| Parameter | Type |
|---|---|
params | { role: "technical" | "treasury"; token: number; } |
params.role | "technical" | "treasury" |
params.token | number |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
cancelOrders()
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
| Parameter | Type |
|---|---|
params | CancelOrdersRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<CancelResponseData>>
Inherited from
cancelOrdersByClientOrderId()
cancelOrdersByClientOrderId(params: CancelOrdersByClientOrderIdRequest, options?: L1ActionOptions): Promise<ExchangeResponse<CancelResponseData>>;Cancel orders by client order id (cancelByCloid).
Statuses match cancelOrders(). fastCancel has the same meaning.
Parameters
| Parameter | Type |
|---|---|
params | CancelOrdersByClientOrderIdRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<CancelResponseData>>
Inherited from
RestClient.cancelOrdersByClientOrderId
cancelTwapOrder()
cancelTwapOrder(params: CancelTwapOrderRequest, options?: L1ActionOptions): Promise<ExchangeResponse<TwapCancelResponseData>>;Cancel a TWAP order (twapCancel).
status is "success" or { error }.
Parameters
| Parameter | Type |
|---|---|
params | CancelTwapOrderRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<TwapCancelResponseData>>
Inherited from
claimRewards()
claimRewards(options?: L1ActionOptions): Promise<ExchangeResponse>;Claim rewards (claimRewards).
Parameters
| Parameter | Type |
|---|---|
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
close()
close(): void;Returns
void
See
closeAll()
closeAll(): void;Returns
void
connect()
connect(): Promise<void>;Returns
Promise<void>
convertToMultiSigUser()
convertToMultiSigUser(params: ConvertToMultiSigUserRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | ConvertToMultiSigUserRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.convertToMultiSigUser
createSubAccount()
createSubAccount(params: object, options?: L1ActionOptions): Promise<ExchangeResponse<string>>;Parameters
| Parameter | Type |
|---|---|
params | { name: string; } |
params.name | string |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<string>>
Inherited from
createVault()
createVault(params: object, options?: L1ActionOptions): Promise<ExchangeResponse<string>>;Parameters
| Parameter | Type |
|---|---|
params | { description: string; initialUsd: number; name: string; } |
params.description | string |
params.initialUsd | number |
params.name | string |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<string>>
Inherited from
delegateOrUndelegateStake()
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
| Parameter | Type |
|---|---|
params | DelegateOrUndelegateStakeRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.delegateOrUndelegateStake
deployPerp()
deployPerp(params: DeployPerpRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | DeployPerpRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
deploySpot()
deploySpot(params: DeploySpotRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | DeploySpotRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
depositIntoStaking()
depositIntoStaking(params: object, options?: UserSignedActionOptions): Promise<ExchangeResponse>;Move native token from spot into staking (cDeposit).
wei is the amount in wei.
Parameters
| Parameter | Type |
|---|---|
params | { wei: number; } |
params.wei | number |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
disableStakingTradingLink()
disableStakingTradingLink(params: object, options?: UserSignedActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { tradingUser: string; } |
params.tradingUser | string |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.disableStakingTradingLink
distributeVaultFunds()
distributeVaultFunds(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { usd: number; vaultAddress: string; } |
params.usd | number |
params.vaultAddress | string |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.distributeVaultFunds
enableApiWalletDexAbstraction()
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
| Parameter | Type |
|---|---|
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.enableApiWalletDexAbstraction
executeBorrowLendOperation()
executeBorrowLendOperation(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { amount: string | null; operation: "withdraw" | "borrow" | "repay" | "supply"; token: number; } |
params.amount | string | null |
params.operation | "withdraw" | "borrow" | "repay" | "supply" |
params.token | number |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.executeBorrowLendOperation
finalizeEvmContract()
finalizeEvmContract(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { input: | { create: { nonce: number; }; } | "customStorageSlot" | "firstStorageSlot"; token: number; } |
params.input | | { create: { nonce: number; }; } | "customStorageSlot" | "firstStorageSlot" |
params.token | number |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.finalizeEvmContract
getAccountAddress()
getAccountAddress(): Promise<string>;Returns
Promise<string>
Inherited from
getActiveAssetData()
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
| Parameter | Type |
|---|---|
params | AccountRequest & object |
Returns
Promise<ActiveAssetData>
Inherited from
getAlignedQuoteTokenStatus()
getAlignedQuoteTokenStatus(params: object): Promise<AlignedQuoteTokenStatus>;Published response schema; the public API currently rejects this request type.
Parameters
| Parameter | Type |
|---|---|
params | { token: number; } |
params.token | number |
Returns
Promise<AlignedQuoteTokenStatus>
Inherited from
RestClient.getAlignedQuoteTokenStatus
getAllBorrowLendReserveStates()
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()
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
| Parameter | Type |
|---|---|
params? | { dex?: string; } |
params.dex? | string |
Returns
Promise<AllMidsResponse>
Inherited from
getAllPerpMetadata()
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
getApprovedBuilders()
getApprovedBuilders(params?: AccountRequest): Promise<string[]>;Builder addresses this user has approved (approvedBuilders).
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<string[]>
Inherited from
RestClient.getApprovedBuilders
getBalances()
getBalances(params?: AccountDexRequest): Promise<AccountBalancesResponse>;Parameters
| Parameter | Type |
|---|---|
params? | AccountDexRequest |
Returns
Promise<AccountBalancesResponse>
Inherited from
getBorrowLendReserveState()
getBorrowLendReserveState(params: object): Promise<BorrowLendReserveState>;Borrow and lend reserve state for one token (borrowLendReserveState).
Parameters
| Parameter | Type |
|---|---|
params | { token: number; } |
params.token | number |
Returns
Promise<BorrowLendReserveState>
Inherited from
RestClient.getBorrowLendReserveState
getCandles()
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
| Parameter | Type |
|---|---|
params | GetCandlesRequest |
Returns
Promise<Candle[]>
Inherited from
getConcisePerpAnnotations()
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()
getExchangeStatus(): Promise<ExchangeStatus>;Returns
Promise<ExchangeStatus>
Inherited from
getExtraAgents()
getExtraAgents(params?: AccountRequest): Promise<ExtraAgent[]>;Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<ExtraAgent[]>
Inherited from
getFrontendOpenOrders()
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
| Parameter | Type |
|---|---|
params? | AccountDexRequest |
Returns
Promise<FrontendOpenOrder[]>
Inherited from
RestClient.getFrontendOpenOrders
getFundingHistory()
getFundingHistory(params: GetFundingHistoryRequest): Promise<FundingHistory[]>;Historical funding rates for one coin (fundingHistory).
Parameters
| Parameter | Type |
|---|---|
params | GetFundingHistoryRequest |
Returns
Promise<FundingHistory[]>
Inherited from
getGossipPriorityAuctionStatus()
getGossipPriorityAuctionStatus(): Promise<GossipPriorityAuctionStatus>;Returns
Promise<GossipPriorityAuctionStatus>
Inherited from
RestClient.getGossipPriorityAuctionStatus
getGossipRootIps()
getGossipRootIps(): Promise<string[]>;Returns
Promise<string[]>
Inherited from
getLeadingVaults()
getLeadingVaults(params?: AccountRequest): Promise<LeadingVault[]>;Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<LeadingVault[]>
Inherited from
getLegalStatus()
getLegalStatus(params?: AccountRequest): Promise<LegalStatus>;Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<LegalStatus>
Inherited from
getLiquidatablePositions()
getLiquidatablePositions(): Promise<LiquidatablePosition[]>;Returns
Promise<LiquidatablePosition[]>
Inherited from
RestClient.getLiquidatablePositions
getMarginTable()
getMarginTable(params: object): Promise<PerpMarginTable>;Parameters
| Parameter | Type |
|---|---|
params | { id: number; } |
params.id | number |
Returns
Promise<PerpMarginTable>
Inherited from
getMaxBuilderFee()
getMaxBuilderFee(params: GetMaxBuilderFeeRequest): Promise<number>;Maximum approved builder fee (maxBuilderFee).
The number is in tenths of a basis point. 1 means 0.001%.
Parameters
| Parameter | Type |
|---|---|
params | GetMaxBuilderFeeRequest |
Returns
Promise<number>
Inherited from
getMaxMarketOrderNotionals()
getMaxMarketOrderNotionals(): Promise<MaxMarketOrderNotional[]>;Returns
Promise<MaxMarketOrderNotional[]>
Inherited from
RestClient.getMaxMarketOrderNotionals
getMultiSigSigners()
getMultiSigSigners(params?: AccountRequest): Promise<MultiSigSigners | null>;Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<MultiSigSigners | null>
Inherited from
getOpenOrders()
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
| Parameter | Type |
|---|---|
params? | AccountDexRequest |
Returns
Promise<OpenOrder[]>
Inherited from
getOrderBook()
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
| Parameter | Type |
|---|---|
params | GetOrderBookRequest |
Returns
Promise<OrderBookResponse | null>
Inherited from
getOrderHistory()
getOrderHistory(params?: AccountRequest): Promise<HistoricalOrder[]>;Recent historical orders (historicalOrders).
Returns at most 2000 orders. status uses the same values as getOrderStatus().
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<HistoricalOrder[]>
Inherited from
getOrderStatus()
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
| Parameter | Type |
|---|---|
params | GetOrderStatusRequest |
Returns
Promise<OrderStatusResponse>
Inherited from
getOutcomeDeployerLimits()
getOutcomeDeployerLimits(params: object): Promise<OutcomeDeployerLimits>;Remaining outcome deployment allowance for a venue (outcomeDeployerLimits).
venue is the venue name, for example "out".
Parameters
| Parameter | Type |
|---|---|
params | { venue: string; } |
params.venue | string |
Returns
Promise<OutcomeDeployerLimits>
Inherited from
RestClient.getOutcomeDeployerLimits
getOutcomeMetadata()
getOutcomeMetadata(): Promise<OutcomeMetadata>;Outcome metadata (outcomeMeta): outcomes, questions, and deployers.
Returns
Promise<OutcomeMetadata>
Inherited from
getPerpAccountSummary()
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
| Parameter | Type |
|---|---|
params? | AccountDexRequest |
Returns
Promise<PerpAccountSummaryResponse>
Inherited from
RestClient.getPerpAccountSummary
getPerpAnnotation()
getPerpAnnotation(params: object): Promise<PerpAnnotation | null>;Perp annotation for one coin (perpAnnotation).
Returns null when the coin has no annotation.
Parameters
| Parameter | Type |
|---|---|
params | { coin: string; } |
params.coin | string |
Returns
Promise<PerpAnnotation | null>
Inherited from
getPerpAssetContexts()
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
| Parameter | Type |
|---|---|
params? | { dex?: string; } |
params.dex? | string |
Returns
Promise<PerpMetaAndAssetContexts>
Inherited from
RestClient.getPerpAssetContexts
getPerpCategories()
getPerpCategories(): Promise<PerpCategory[]>;Perp category for each listed coin (perpCategories).
Each entry is [coin, category].
Returns
Promise<PerpCategory[]>
Inherited from
getPerpDeployAuctionStatus()
getPerpDeployAuctionStatus(): Promise<DeployGasAuction>;Perp deploy auction status (perpDeployAuctionStatus).
Returns
Promise<DeployGasAuction>
Inherited from
RestClient.getPerpDeployAuctionStatus
getPerpDexLimits()
getPerpDexLimits(params: object): Promise<PerpDexLimits>;Builder-deployed perp market limits (perpDexLimits).
dex is required. The empty string is not allowed.
Parameters
| Parameter | Type |
|---|---|
params | { dex: string; } |
params.dex | string |
Returns
Promise<PerpDexLimits>
Inherited from
getPerpDexs()
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
getPerpDexStatus()
getPerpDexStatus(params: object): Promise<PerpDexStatus>;Perp DEX deposit status (perpDexStatus).
The empty string is the first perp DEX.
Parameters
| Parameter | Type |
|---|---|
params | { dex: string; } |
params.dex | string |
Returns
Promise<PerpDexStatus>
Inherited from
getPerpMetadata()
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
| Parameter | Type |
|---|---|
params? | { dex?: string; } |
params.dex? | string |
Returns
Promise<PerpMeta>
Inherited from
getPerpsAtOpenInterestCap()
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
| Parameter | Type |
|---|---|
params? | { dex?: string; } |
params.dex? | string |
Returns
Promise<string[]>
Inherited from
RestClient.getPerpsAtOpenInterestCap
getPortfolio()
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
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<PortfolioEntry[]>
Inherited from
getPredictedFundingRates()
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()
getPreTransferCheck(params: GetPreTransferCheckRequest): Promise<PreTransferCheck>;Parameters
| Parameter | Type |
|---|---|
params | GetPreTransferCheckRequest |
Returns
Promise<PreTransferCheck>
Inherited from
RestClient.getPreTransferCheck
getRecentTrades()
getRecentTrades(params: object): Promise<Trade[]>;Parameters
| Parameter | Type |
|---|---|
params | { coin: string; } |
params.coin | string |
Returns
Promise<Trade[]>
Inherited from
getReferralInfo()
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
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<ReferralInfo>
Inherited from
getSettledOutcome()
getSettledOutcome(params: object): Promise<SettledOutcome | null>;Settled outcome (settledOutcome).
Returns null when the outcome is still unsettled.
Parameters
| Parameter | Type |
|---|---|
params | { outcome: number; } |
params.outcome | number |
Returns
Promise<SettledOutcome | null>
Inherited from
getSpotAssetContexts()
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()
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
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<SpotBalancesResponse>
Inherited from
getSpotDeployAuctionStatus()
getSpotDeployAuctionStatus(params?: AccountRequest): Promise<SpotDeployStateResponse>;Spot deploy state for a user (spotDeployState), including the gas auction.
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<SpotDeployStateResponse>
Inherited from
RestClient.getSpotDeployAuctionStatus
getSpotMetadata()
getSpotMetadata(): Promise<SpotMeta>;Spot metadata (spotMeta): tokens and trading pairs.
Returns
Promise<SpotMeta>
Inherited from
getSpotPairDeployAuctionStatus()
getSpotPairDeployAuctionStatus(): Promise<DeployGasAuction>;Dutch auction for deploying a spot pair (spotPairDeployAuctionStatus).
Returns
Promise<DeployGasAuction>
Inherited from
RestClient.getSpotPairDeployAuctionStatus
getStakingDelegations()
getStakingDelegations(params?: AccountRequest): Promise<StakingDelegation[]>;Stake delegated to validators (delegations).
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<StakingDelegation[]>
Inherited from
RestClient.getStakingDelegations
getStakingHistory()
getStakingHistory(params?: AccountRequest): Promise<StakingHistoryEntry[]>;Staking history (delegatorHistory).
delta is one of delegate, cDeposit, or withdrawal.
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<StakingHistoryEntry[]>
Inherited from
getStakingRewards()
getStakingRewards(params?: AccountRequest): Promise<StakingReward[]>;Staking rewards (delegatorRewards).
source is "delegation" or "commission" in the documented samples.
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<StakingReward[]>
Inherited from
getStakingSummary()
getStakingSummary(params?: AccountRequest): Promise<StakingSummary>;Staking summary (delegatorSummary): delegated, undelegated, and pending withdrawals.
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<StakingSummary>
Inherited from
getSubAccounts()
getSubAccounts(params?: AccountRequest): Promise<SubAccount[] | null>;Subaccounts of a master (subAccounts).
Returns null when the address has no subaccounts.
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<SubAccount[] | null>
Inherited from
getSubAccountsWithAllDexStates()
getSubAccountsWithAllDexStates(params?: AccountRequest): Promise<
| SubAccountWithAllDexStates[]
| null>;Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise< | SubAccountWithAllDexStates[] | null>
Inherited from
RestClient.getSubAccountsWithAllDexStates
getTokenDetails()
getTokenDetails(params: object): Promise<TokenDetails>;Token details (tokenDetails): supply, prices, and genesis balances.
tokenId is the 34-character onchain id, for example 0x00000000000000000000000000000000.
Parameters
| Parameter | Type |
|---|---|
params | { tokenId: string; } |
params.tokenId | string |
Returns
Promise<TokenDetails>
Inherited from
getTwapHistory()
getTwapHistory(params?: AccountRequest): Promise<TwapHistoryEntry[]>;Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<TwapHistoryEntry[]>
Inherited from
getUserAbstraction()
getUserAbstraction(params?: AccountRequest): Promise<UserAbstraction>;Account abstraction mode (userAbstraction).
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<UserAbstraction>
Inherited from
getUserBorrowLendInterest()
getUserBorrowLendInterest(params: GetUserBorrowLendInterestRequest): Promise<UserBorrowLendInterest[]>;Parameters
| Parameter | Type |
|---|---|
params | GetUserBorrowLendInterestRequest |
Returns
Promise<UserBorrowLendInterest[]>
Inherited from
RestClient.getUserBorrowLendInterest
getUserBorrowLendState()
getUserBorrowLendState(params?: AccountRequest): Promise<BorrowLendUserState>;User borrow and lend balances (borrowLendUserState).
tokenToState entries are [token, state].
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<BorrowLendUserState>
Inherited from
RestClient.getUserBorrowLendState
getUserDexAbstraction()
getUserDexAbstraction(params?: AccountRequest): Promise<boolean>;Whether HIP-3 DEX abstraction is enabled (userDexAbstraction).
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<boolean>
Inherited from
RestClient.getUserDexAbstraction
getUserFees()
getUserFees(params?: AccountRequest): Promise<UserFees>;User fee rates and the current fee schedule (userFees).
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<UserFees>
Inherited from
getUserFills()
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
| Parameter | Type |
|---|---|
params? | GetUserFillsRequest |
Returns
Promise<UserFill[]>
Inherited from
getUserFillsByTime()
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
| Parameter | Type |
|---|---|
params | GetUserFillsByTimeRequest |
Returns
Promise<UserFill[]>
Inherited from
getUserFundingHistory()
getUserFundingHistory(params?: GetUserFundingHistoryRequest): Promise<UserFunding[]>;User funding payments (userFunding).
startTime is inclusive, in milliseconds. endTime defaults to now.
Parameters
| Parameter | Type |
|---|---|
params? | GetUserFundingHistoryRequest |
Returns
Promise<UserFunding[]>
Inherited from
RestClient.getUserFundingHistory
getUserNonFundingLedgerUpdates()
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
| Parameter | Type |
|---|---|
params? | GetUserNonFundingLedgerUpdatesRequest |
Returns
Promise<UserNonFundingLedgerUpdate[]>
Inherited from
RestClient.getUserNonFundingLedgerUpdates
getUserRateLimit()
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
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<UserRateLimit>
Inherited from
getUserRole()
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
| Parameter | Type |
|---|---|
params | UserRequest |
Returns
Promise<UserRoleResponse>
Inherited from
getUserTwapSliceFills()
getUserTwapSliceFills(params?: AccountRequest): Promise<TwapSliceFill[]>;Recent TWAP slice fills (userTwapSliceFills).
Returns at most 2000 fills. TWAP fill hashes are zero.
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<TwapSliceFill[]>
Inherited from
RestClient.getUserTwapSliceFills
getUserTwapSliceFillsByTime()
getUserTwapSliceFillsByTime(params: GetUserTwapSliceFillsByTimeRequest): Promise<TwapSliceFill[]>;Parameters
| Parameter | Type |
|---|---|
params | GetUserTwapSliceFillsByTimeRequest |
Returns
Promise<TwapSliceFill[]>
Inherited from
RestClient.getUserTwapSliceFillsByTime
getUserVaultDeposits()
getUserVaultDeposits(params?: AccountRequest): Promise<UserVaultDeposit[]>;Vault equity for this user (userVaultEquities).
Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<UserVaultDeposit[]>
Inherited from
RestClient.getUserVaultDeposits
getValidatorL1Votes()
getValidatorL1Votes(): Promise<ValidatorL1Vote[]>;Returns
Promise<ValidatorL1Vote[]>
Inherited from
RestClient.getValidatorL1Votes
getValidatorSummaries()
getValidatorSummaries(): Promise<ValidatorSummary[]>;Returns
Promise<ValidatorSummary[]>
Inherited from
RestClient.getValidatorSummaries
getVaultDetails()
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
| Parameter | Type |
|---|---|
params | GetVaultDetailsRequest |
Returns
Promise<VaultDetails | null>
Inherited from
getVaultSummaries()
getVaultSummaries(): Promise<VaultSummary[]>;Returns
Promise<VaultSummary[]>
Inherited from
getVipStatus()
getVipStatus(params?: AccountRequest): Promise<boolean>;Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<boolean>
Inherited from
getWebData2()
getWebData2(params?: AccountRequest): Promise<WebData2>;Parameters
| Parameter | Type |
|---|---|
params? | AccountRequest |
Returns
Promise<WebData2>
Inherited from
getWSClient()
getWSClient(): WebsocketClient;Returns
invalidateNonce()
invalidateNonce(options?: L1ActionOptions): Promise<ExchangeResponse>;Mark a nonce as used without another effect (noop).
Parameters
| Parameter | Type |
|---|---|
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
isConnected()
isConnected(): boolean;Returns
boolean
linkStakingAccount()
linkStakingAccount(params: LinkStakingAccountRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | LinkStakingAccountRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
modifyOrder()
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
| Parameter | Type |
|---|---|
params | ModifyOrderRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
modifyOrders()
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
| Parameter | Type |
|---|---|
params | ModifyOrdersRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<OrderResponseData>>
Inherited from
modifyVault()
modifyVault(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { allowDeposits?: boolean | null; alwaysCloseOnWithdraw?: boolean | null; vaultAddress: string; } |
params.allowDeposits? | boolean | null |
params.alwaysCloseOnWithdraw? | boolean | null |
params.vaultAddress | string |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
nameToCoin()
nameToCoin(name: string): Promise<string>;Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
Promise<string>
Inherited from
off()
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
| Parameter | Type |
|---|---|
event | K |
listener | (...args: WebsocketClientEventMap<WsKey>[K]) => void |
Returns
this
on()
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
| Parameter | Type |
|---|---|
event | K |
listener | (...args: WebsocketClientEventMap<WsKey>[K]) => void |
Returns
this
once()
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
| Parameter | Type |
|---|---|
event | K |
listener | (...args: WebsocketClientEventMap<WsKey>[K]) => void |
Returns
this
refreshAssetMetadata()
refreshAssetMetadata(): Promise<void>;Returns
Promise<void>
Inherited from
RestClient.refreshAssetMetadata
registerReferrer()
registerReferrer(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { code: string; } |
params.code | string |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
renameSubAccount()
renameSubAccount(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { name: string; subAccountUser: string; } |
params.name | string |
params.subAccountUser | string |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
reserveAdditionalActions()
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
| Parameter | Type |
|---|---|
params | { weight: number; } |
params.weight | number |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.reserveAdditionalActions
resolveAsset()
resolveAsset(identifier: AssetIdentifier): Promise<ResolvedAsset>;Parameters
| Parameter | Type |
|---|---|
identifier | AssetIdentifier |
Returns
Promise<ResolvedAsset>
Inherited from
sendAsset()
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
| Parameter | Type |
|---|---|
params | SendAssetRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
sendAssetFromApiWallet()
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
| Parameter | Type |
|---|---|
params | SendAssetRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.sendAssetFromApiWallet
sendSpotAsset()
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
| Parameter | Type |
|---|---|
params | SendSpotAssetRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
sendToEvmWithData()
sendToEvmWithData(params: SendToEvmWithDataRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;Send tokens from Core to EVM with calldata (sendToEvmWithData).
The linked contract must implement coreReceiveWithData.
Parameters
| Parameter | Type |
|---|---|
params | SendToEvmWithDataRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
sendUsd()
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
| Parameter | Type |
|---|---|
params | SendUsdRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
setApiWalletAbstraction()
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
| Parameter | Type |
|---|---|
params | { abstraction: "i" | "p" | "u"; } |
params.abstraction | "i" | "p" | "u" |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.setApiWalletAbstraction
setCancelAllAfter()
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
| Parameter | Type |
|---|---|
params? | { time?: number; } |
params.time? | number |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
setDisplayName()
setDisplayName(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { displayName: string; } |
params.displayName | string |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
setEvmBigBlocks()
setEvmBigBlocks(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { usingBigBlocks: boolean; } |
params.usingBigBlocks | boolean |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
setIsolatedMarginLeverage()
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
| Parameter | Type |
|---|---|
params | SetIsolatedMarginLeverageRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.setIsolatedMarginLeverage
setReferrer()
setReferrer(options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
setSpotDusting()
setSpotDusting(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { toggleSpotDusting: { optOut: boolean; }; } |
params.toggleSpotDusting | { optOut: boolean; } |
params.toggleSpotDusting.optOut | boolean |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
setUserAbstraction()
setUserAbstraction(params: SetUserAbstractionRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;Set account abstraction (userSetAbstraction).
abstraction is "disabled", "unifiedAccount", or "portfolioMargin".
Parameters
| Parameter | Type |
|---|---|
params | SetUserAbstractionRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
setUserDexAbstraction()
setUserDexAbstraction(params: UserToggleRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;Enable or disable HIP-3 DEX abstraction (userDexAbstraction).
Deprecated. Prefer setUserAbstraction().
Parameters
| Parameter | Type |
|---|---|
params | UserToggleRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.setUserDexAbstraction
setUserPortfolioMargin()
setUserPortfolioMargin(params: UserToggleRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | UserToggleRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.setUserPortfolioMargin
submitGossipPriorityBid()
submitGossipPriorityBid(params: object, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | { ip: string; maxGas: number; slotId: 0 | 1; } |
params.ip | string |
params.maxGas | number |
params.slotId | 0 | 1 |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.submitGossipPriorityBid
submitLimitOrder()
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
| Parameter | Type |
|---|---|
params | SubmitLimitOrderRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<OrderResponseData>>
Inherited from
submitMarketClose()
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
| Parameter | Type |
|---|---|
params | SubmitMarketCloseRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<OrderResponseData>>
Inherited from
submitMarketOrder()
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
| Parameter | Type |
|---|---|
params | SubmitMarketOrderRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<OrderResponseData>>
Inherited from
submitMultiSigL1Action()
submitMultiSigL1Action<T = ExchangeResponse<unknown>>(action: JsonObject, options: MultiSigL1RequestOptions): Promise<T>;Type Parameters
| Type Parameter | Default type |
|---|---|
T | ExchangeResponse<unknown> |
Parameters
| Parameter | Type |
|---|---|
action | JsonObject |
options | MultiSigL1RequestOptions |
Returns
Promise<T>
Inherited from
RestClient.submitMultiSigL1Action
submitMultiSigUserSignedAction()
submitMultiSigUserSignedAction<T = ExchangeResponse<unknown>>(
action: JsonObject,
definition: UserSignedActionDefinition,
options: MultiSigUserSignedRequestOptions
): Promise<T>;Type Parameters
| Type Parameter | Default type |
|---|---|
T | ExchangeResponse<unknown> |
Parameters
| Parameter | Type |
|---|---|
action | JsonObject |
definition | UserSignedActionDefinition |
options | MultiSigUserSignedRequestOptions |
Returns
Promise<T>
Inherited from
RestClient.submitMultiSigUserSignedAction
submitOrder()
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
| Parameter | Type |
|---|---|
params | SubmitOrderRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<OrderResponseData>>
Inherited from
submitRawInfoRequest()
submitRawInfoRequest<T = InfoResponse>(request: object): Promise<T>;Type Parameters
| Type Parameter | Default type |
|---|---|
T | InfoResponse |
Parameters
| Parameter | Type |
|---|---|
request | object |
Returns
Promise<T>
Inherited from
RestClient.submitRawInfoRequest
submitRawL1Action()
submitRawL1Action<T = ExchangeResponse<unknown>>(action: JsonObject, options?: L1ActionOptions): Promise<T>;Type Parameters
| Type Parameter | Default type |
|---|---|
T | ExchangeResponse<unknown> |
Parameters
| Parameter | Type |
|---|---|
action | JsonObject |
options? | L1ActionOptions |
Returns
Promise<T>
Inherited from
submitRawUserSignedAction()
submitRawUserSignedAction<T = ExchangeResponse<unknown>>(
action: JsonObject,
definition: UserSignedActionDefinition,
options?: UserSignedActionOptions
): Promise<T>;Type Parameters
| Type Parameter | Default type |
|---|---|
T | ExchangeResponse<unknown> |
Parameters
| Parameter | Type |
|---|---|
action | JsonObject |
definition | UserSignedActionDefinition |
options? | UserSignedActionOptions |
Returns
Promise<T>
Inherited from
RestClient.submitRawUserSignedAction
submitSignerAction()
submitSignerAction(params:
| {
jailSelf: null;
}
| {
unjailSelf: null;
}, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | | { jailSelf: null; } | { unjailSelf: null; } |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
submitTwapOrder()
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
| Parameter | Type |
|---|---|
params | SubmitTwapOrderRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse<TwapOrderResponseData>>
Inherited from
submitUserOutcome()
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
| Parameter | Type |
|---|---|
params | SubmitUserOutcomeRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
submitValidatorAction()
submitValidatorAction(params: Omit<JsonObject, "type">, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | Omit<JsonObject, "type"> |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.submitValidatorAction
transferHip3LiquidatorFunds()
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
| Parameter | Type |
|---|---|
params | { dex: string; isDeposit: boolean; ntl: number; } |
params.dex | string |
params.isDeposit | boolean |
params.ntl | number |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.transferHip3LiquidatorFunds
transferSpotToOrFromSubAccount()
transferSpotToOrFromSubAccount(params: TransferSpotToOrFromSubAccountRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | TransferSpotToOrFromSubAccountRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.transferSpotToOrFromSubAccount
transferUsdBetweenSpotAndPerp()
transferUsdBetweenSpotAndPerp(params: TransferUsdBetweenSpotAndPerpRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;Move USDC between spot and perp (usdClassTransfer).
toPerp: true sends spot to perp.
Parameters
| Parameter | Type |
|---|---|
params | TransferUsdBetweenSpotAndPerpRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.transferUsdBetweenSpotAndPerp
transferUsdToOrFromSubAccount()
transferUsdToOrFromSubAccount(params: TransferUsdToOrFromSubAccountRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;Parameters
| Parameter | Type |
|---|---|
params | TransferUsdToOrFromSubAccountRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.transferUsdToOrFromSubAccount
transferVaultFunds()
transferVaultFunds(params: TransferVaultFundsRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;Deposit or withdraw vault funds (vaultTransfer).
Parameters
| Parameter | Type |
|---|---|
params | TransferVaultFundsRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
updateIsolatedMargin()
updateIsolatedMargin(params: UpdateIsolatedMarginRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;Add or remove isolated margin (updateIsolatedMargin).
ntli is a 6-decimal integer. 1000000 is 1 USD.
Parameters
| Parameter | Type |
|---|---|
params | UpdateIsolatedMarginRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.updateIsolatedMargin
updateLeverage()
updateLeverage(params: UpdateLeverageRequest, options?: L1ActionOptions): Promise<ExchangeResponse>;Set cross or isolated leverage for one asset (updateLeverage).
Parameters
| Parameter | Type |
|---|---|
params | UpdateLeverageRequest |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
updateValidatorL1Stream()
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
| Parameter | Type |
|---|---|
params | { riskFreeRate: string; } |
params.riskFreeRate | string |
options? | L1ActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.updateValidatorL1Stream
withdrawFromStaking()
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
| Parameter | Type |
|---|---|
params | { wei: number; } |
params.wei | number |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>
Inherited from
RestClient.withdrawFromStaking
withdrawUsd()
withdrawUsd(params: SendUsdRequest, options?: UserSignedActionOptions): Promise<ExchangeResponse>;Start a USDC withdrawal to the bridge (withdraw3).
Parameters
| Parameter | Type |
|---|---|
params | SendUsdRequest |
options? | UserSignedActionOptions |
Returns
Promise<ExchangeResponse>