Skip to content

Latest commit

 

History

History
192 lines (170 loc) · 24.6 KB

endpointFunctionList.md

File metadata and controls

192 lines (170 loc) · 24.6 KB

Endpoint maps

SDK Logo

Each REST client is a JavaScript class, which provides functions individually mapped to each endpoint available in the exchange's API offering.

The following table shows all methods available in each REST client, whether the method requires authentication (automatically handled if a private key or signer is provided), as well as the exact endpoint each method is connected to.

Hyperliquid exposes two HTTP paths: POST /info and POST /exchange. The value in parentheses is the request type field from the official docs (for example allMids, order, usdSend). Search this table for that type name to find the SDK function.

This can be used to easily find which method to call, once you have found which endpoint you're looking to use.

All REST clients are in the src folder. For usage examples, make sure to check the examples folder.

List of clients:

If anything is missing or wrong, please open an issue or let us know in our Node.js Traders telegram group!

How to use table

Table consists of 4 parts:

  • Function name
  • AUTH
  • HTTP Method
  • Endpoint

Function name is the name of the function that can be called through the SDK. Check examples folder in the repo for more help on how to use them!

AUTH is a boolean value that indicates if the function requires authentication - which means you need to pass your private key or a signer to the SDK. Public Info calls work with new RestClient(). Account Info, L1 actions, and user-signed actions need credentials.

HTTP Method shows HTTP method that the function uses to call the endpoint. Hyperliquid uses POST for both Info and Exchange.

Endpoint is the path plus Hyperliquid type. Best way to find exact function you need is to search for the official type (or /info / /exchange) in this table and find corresponding function name.

RestClient.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in RestClient.ts.

WebsocketAPIClient extends RestClient and exposes the same methods over Hyperliquid's WebSocket POST protocol (info / action).

Function AUTH HTTP Method Endpoint
getAllMids() POST /info (allMids)
getActiveAssetData() 🔐 POST /info (activeAssetData)
getAllBorrowLendReserveStates() POST /info (allBorrowLendReserveStates)
getAllPerpMetadata() POST /info (allPerpMetas)
getApprovedBuilders() 🔐 POST /info (approvedBuilders)
getBorrowLendReserveState() POST /info (borrowLendReserveState)
getUserBorrowLendState() 🔐 POST /info (borrowLendUserState)
getCandles() POST /info (candleSnapshot)
getPerpAccountSummary() 🔐 POST /info (clearinghouseState)
getStakingDelegations() 🔐 POST /info (delegations)
getStakingHistory() 🔐 POST /info (delegatorHistory)
getStakingRewards() 🔐 POST /info (delegatorRewards)
getStakingSummary() 🔐 POST /info (delegatorSummary)
getExchangeStatus() POST /info (exchangeStatus)
getExtraAgents() 🔐 POST /info (extraAgents)
getFrontendOpenOrders() 🔐 POST /info (frontendOpenOrders)
getFundingHistory() POST /info (fundingHistory)
getGossipPriorityAuctionStatus() POST /info (gossipPriorityAuctionStatus)
getGossipRootIps() POST /info (gossipRootIps)
getOrderHistory() 🔐 POST /info (historicalOrders)
getVipStatus() 🔐 POST /info (isVip)
getOrderBook() POST /info (l2Book)
getLeadingVaults() 🔐 POST /info (leadingVaults)
getLegalStatus() 🔐 POST /info (legalCheck)
getLiquidatablePositions() POST /info (liquidatable)
getMarginTable() POST /info (marginTable)
getMaxBuilderFee() 🔐 POST /info (maxBuilderFee)
getMaxMarketOrderNotionals() POST /info (maxMarketOrderNtls)
getPerpMetadata() POST /info (meta)
getPerpAssetContexts() POST /info (metaAndAssetCtxs)
getOpenOrders() 🔐 POST /info (openOrders)
getOrderStatus() 🔐 POST /info (orderStatus)
getOutcomeMetadata() POST /info (outcomeMeta)
getOutcomeDeployerLimits() POST /info (outcomeDeployerLimits)
getPerpAnnotation() POST /info (perpAnnotation)
getPerpCategories() POST /info (perpCategories)
getConcisePerpAnnotations() POST /info (perpConciseAnnotations)
getPerpDeployAuctionStatus() POST /info (perpDeployAuctionStatus)
getPerpDexLimits() POST /info (perpDexLimits)
getPerpDexStatus() POST /info (perpDexStatus)
getPerpDexs() POST /info (perpDexs)
getPerpsAtOpenInterestCap() POST /info (perpsAtOpenInterestCap)
getPortfolio() 🔐 POST /info (portfolio)
getPreTransferCheck() POST /info (preTransferCheck)
getPredictedFundingRates() POST /info (predictedFundings)
getRecentTrades() POST /info (recentTrades)
getReferralInfo() 🔐 POST /info (referral)
getSettledOutcome() POST /info (settledOutcome)
getBalances() 🔐 POST /info (clearinghouseState, spotClearinghouseState)
getSpotBalances() 🔐 POST /info (spotClearinghouseState)
getSpotDeployAuctionStatus() 🔐 POST /info (spotDeployState)
getSpotMetadata() POST /info (spotMeta)
getSpotAssetContexts() POST /info (spotMetaAndAssetCtxs)
getSpotPairDeployAuctionStatus() POST /info (spotPairDeployAuctionStatus)
getSubAccounts() 🔐 POST /info (subAccounts)
getSubAccountsWithAllDexStates() 🔐 POST /info (subAccounts2)
getTokenDetails() POST /info (tokenDetails)
getTwapHistory() 🔐 POST /info (twapHistory)
getUserAbstraction() 🔐 POST /info (userAbstraction)
getUserBorrowLendInterest() 🔐 POST /info (userBorrowLendInterest)
getUserDexAbstraction() 🔐 POST /info (userDexAbstraction)
getUserFees() 🔐 POST /info (userFees)
getUserFills() 🔐 POST /info (userFills)
getUserFillsByTime() 🔐 POST /info (userFillsByTime)
getUserFundingHistory() 🔐 POST /info (userFunding)
getUserNonFundingLedgerUpdates() 🔐 POST /info (userNonFundingLedgerUpdates)
getUserRateLimit() 🔐 POST /info (userRateLimit)
getUserRole() POST /info (userRole)
getMultiSigSigners() 🔐 POST /info (userToMultiSigSigners)
getUserTwapSliceFills() 🔐 POST /info (userTwapSliceFills)
getUserTwapSliceFillsByTime() 🔐 POST /info (userTwapSliceFillsByTime)
getUserVaultDeposits() 🔐 POST /info (userVaultEquities)
getValidatorL1Votes() POST /info (validatorL1Votes)
getValidatorSummaries() POST /info (validatorSummaries)
getVaultDetails() POST /info (vaultDetails)
getVaultSummaries() POST /info (vaultSummaries)
getWebData2() 🔐 POST /info (webData2)
getAlignedQuoteTokenStatus() POST /info (alignedQuoteTokenInfo)
submitOrder() 🔐 POST /exchange (order)
submitMarketOrder() 🔐 POST /exchange (order)
submitMarketClose() 🔐 POST /exchange (order)
submitLimitOrder() 🔐 POST /exchange (order)
modifyOrder() 🔐 POST /exchange (modify)
modifyOrders() 🔐 POST /exchange (batchModify)
cancelOrders() 🔐 POST /exchange (cancel)
cancelOrdersByClientOrderId() 🔐 POST /exchange (cancelByCloid)
updateLeverage() 🔐 POST /exchange (updateLeverage)
updateIsolatedMargin() 🔐 POST /exchange (updateIsolatedMargin)
setIsolatedMarginLeverage() 🔐 POST /exchange (topUpIsolatedOnlyMargin)
submitTwapOrder() 🔐 POST /exchange (twapOrder)
cancelTwapOrder() 🔐 POST /exchange (twapCancel)
setCancelAllAfter() 🔐 POST /exchange (scheduleCancel)
setReferrer() 🔐 POST /exchange (setReferrer)
registerReferrer() 🔐 POST /exchange (registerReferrer)
approveApiWallet() 🔐 POST /exchange (approveAgent)
sendUsd() 🔐 POST /exchange (usdSend)
sendSpotAsset() 🔐 POST /exchange (spotSend)
withdrawUsd() 🔐 POST /exchange (withdraw3)
transferUsdBetweenSpotAndPerp() 🔐 POST /exchange (usdClassTransfer)
sendAsset() 🔐 POST /exchange (sendAsset)
sendToEvmWithData() 🔐 POST /exchange (sendToEvmWithData)
sendAssetFromApiWallet() 🔐 POST /exchange (agentSendAsset)
depositIntoStaking() 🔐 POST /exchange (cDeposit)
withdrawFromStaking() 🔐 POST /exchange (cWithdraw)
delegateOrUndelegateStake() 🔐 POST /exchange (tokenDelegate)
convertToMultiSigUser() 🔐 POST /exchange (convertToMultiSigUser)
linkStakingAccount() 🔐 POST /exchange (linkStakingUser)
disableStakingTradingLink() 🔐 POST /exchange (stakingLinkDisableTradingUser)
setUserPortfolioMargin() 🔐 POST /exchange (userPortfolioMargin)
setUserAbstraction() 🔐 POST /exchange (userSetAbstraction)
setUserDexAbstraction() 🔐 POST /exchange (userDexAbstraction)
enableApiWalletDexAbstraction() 🔐 POST /exchange (agentEnableDexAbstraction)
setApiWalletAbstraction() 🔐 POST /exchange (agentSetAbstraction)
executeBorrowLendOperation() 🔐 POST /exchange (borrowLend)
claimRewards() 🔐 POST /exchange (claimRewards)
createSubAccount() 🔐 POST /exchange (createSubAccount)
createVault() 🔐 POST /exchange (createVault)
setEvmBigBlocks() 🔐 POST /exchange (evmUserModify)
finalizeEvmContract() 🔐 POST /exchange (finalizeEvmContract)
submitGossipPriorityBid() 🔐 POST /exchange (gossipPriorityBid)
transferHip3LiquidatorFunds() 🔐 POST /exchange (hip3LiquidatorTransfer)
invalidateNonce() 🔐 POST /exchange (noop)
deployPerp() 🔐 POST /exchange (perpDeploy)
deploySpot() 🔐 POST /exchange (spotDeploy)
reserveAdditionalActions() 🔐 POST /exchange (reserveRequestWeight)
setDisplayName() 🔐 POST /exchange (setDisplayName)
setSpotDusting() 🔐 POST /exchange (spotUser)
renameSubAccount() 🔐 POST /exchange (subAccountModify)
transferSpotToOrFromSubAccount() 🔐 POST /exchange (subAccountSpotTransfer)
transferUsdToOrFromSubAccount() 🔐 POST /exchange (subAccountTransfer)
transferVaultFunds() 🔐 POST /exchange (vaultTransfer)
distributeVaultFunds() 🔐 POST /exchange (vaultDistribute)
modifyVault() 🔐 POST /exchange (vaultModify)
updateValidatorL1Stream() 🔐 POST /exchange (validatorL1Stream)
submitSignerAction() 🔐 POST /exchange (CSignerAction)
submitValidatorAction() 🔐 POST /exchange (CValidatorAction)
authorizeAqav2Role() 🔐 POST /exchange (authorizeAqav2Role)
submitUserOutcome() 🔐 POST /exchange (userOutcome)