Skip to content
Hightop docs header art
Hightop
API and Integrations

TypeScript SDK Reference#

This page is generated from the Agent API endpoint catalog and the public @hightop/sdk client surface. Current package version: @hightop/sdk@0.1.4.

Client Construction#

The SDK exports HightopAgentClient, createIdempotencyKey, HightopAgentSDKError, HightopAgentOperationWaitTimeoutError, generated endpoint metadata, and generated request/response types.

Config fieldPurpose
baseUrlAgent API origin. Defaults to https://api.hightop.com.
agentId + apiKeyHeader-key auth. Configure both together.
bearerTokenOAuth bearer token auth. Do not combine with header-key auth.
fetchOptional fetch implementation for tests or custom runtimes.
timeoutMsDefault request timeout in milliseconds.

Domain Helpers#

HelperEndpointIdempotencySignatureDescription
client.self.get(options?)GET /v1/agent/selfnot required() => Promise<AgentApiSelfResponse>Return the authenticated agent and wallet context.
client.self.usage(options?)GET /v1/agent/self/usagenot required() => Promise<AgentApiSelfUsageResponse>Return current Agent API rate-limit and usage state.
client.capabilities.get(options?)GET /v1/agent/capabilitiesnot required() => Promise<AgentApiCapabilitiesResponse>Return authenticated runtime capabilities.
client.capabilities.json(options?)GET /v1/agent/capabilities.jsonnot required() => Promise<AgentApiCapabilitiesResponse>Return Agent API capabilities as JSON.
client.openapi.get(options?)GET /v1/agent/openapi.jsonnot required() => Promise<Record<string, unknown>>Fetch the public Agent API OpenAPI document.
client.account.get(options?)GET /v1/agent/accountnot required() => Promise<AgentApiAccountResponse>Return a scoped account summary.
client.balances.list(query?, options?)GET /v1/agent/balancesnot required(query?: Record<string, unknown>) => Promise<AgentApiBalancesResponse>List balances for the authenticated agent wallet.
client.balances.cash(query?, options?)GET /v1/agent/balances/cashnot required(query?: Record<string, unknown>) => Promise<AgentApiBalancesResponse>List cash balances.
client.operations.list(query?, options?)GET /v1/agent/operationsnot required(query?: AgentApiOperationsQuery) => Promise<AgentApiOperationsResponse>List AgentOperation rows.
client.operations.get(id, query?, options?)GET /v1/agent/operations/{id}not required(id: string, query?: Omit<AgentApiOperationDetailQuery, "id">) => Promise<AgentApiOperationResponse>Fetch one operation, optionally including onchain details.
client.operations.wait(id, options?)GET /v1/agent/operations/{id}not required(id: string, options?: WaitForOperationOptions) => Promise<AgentApiOperationResponse>Poll an operation until a terminal status or timeout.
client.borrow.get(options?)GET /v1/agent/borrownot required() => Promise<AgentApiBorrowResponse>Return borrow summary.
client.borrow.repay(body, options)POST /v1/agent/borrow/repayrequired via options.idempotencyKey(body: AgentApiBorrowRepayRequest, options: HightopAgentRequestOptions) => Promise<AgentApiWriteResponse>Create a debt repayment operation.
client.borrow.deleverage(body, options)POST /v1/agent/borrow/deleveragerequired via options.idempotencyKey(body: AgentApiDeleverageRequest, options: HightopAgentRequestOptions) => Promise<AgentApiWriteResponse>Create a target-LTV deleverage operation.
client.conversions.quote(body, options)POST /v1/agent/conversions/quoterequired via options.idempotencyKey(body: AgentApiConversionQuoteRequest, options: HightopAgentRequestOptions) => Promise<AgentApiConversionQuoteResponse>Create a stateful conversion quote.
client.conversions.execute(body, options)POST /v1/agent/conversionsrequired via options.idempotencyKey(body: AgentApiConversionExecuteRequest, options: HightopAgentRequestOptions) => Promise<AgentApiWriteResponse>Execute a conversion from a quote.
client.simulate.request(body, options?)POST /v1/agent/simulatenot required(body: AgentApiSimulateRequest) => Promise<AgentApiSimulateResponse>Validate a write request shape without broadcasting.
client.x402.sign(body, options)POST /v1/agent/x402/signrequired via options.idempotencyKey(body: AgentApiX402SignRequest, options: HightopAgentRequestOptions) => Promise<AgentApiX402SignResponse>Sign a Base USDC x402 payment authorization.
client.x402.quote(body, options?)POST /v1/agent/x402/quotenot required(body: AgentApiX402QuoteRequest) => Promise<AgentApiX402QuoteResponse>Fetch a URL and return its supported x402 price without paying.
client.x402.purchase(body, options)POST /v1/agent/x402/purchaserequired via options.idempotencyKey(body: AgentApiX402PurchaseRequest, options: HightopAgentRequestOptions) => Promise<AgentApiX402PurchaseResponse>Fetch a URL, satisfy an x402 challenge, and return the upstream response.
client.request(key, payload?, options?)multipledepends on endpoint<Key extends AgentApiEndpointKey>(key: Key, payload?: AgentApiRequestFor<Key>) => Promise<AgentApiResponseFor<Key>>Typed generic access to every catalogued Agent API endpoint.
client.rawRequest(request)multipledepends on endpoint<Response = unknown>(request: HightopAgentRawRequest) => Promise<Response>Support/debug path for known /v1/agent routes plus public OpenAPI.

Generic Endpoint Map#

client.request(key, payload, options) covers every catalogued endpoint below. For mutating endpoints marked required, pass options.idempotencyKey; createIdempotencyKey() generates a suitable value.

Endpoint keyRequest typeResponse typePath paramsQuery paramsBody paramsIdempotencyRate class
GET /v1/agent/selfundefinedAgentApiSelfResponsenonenonenonenot requiredread
GET /v1/agent/self/usageundefinedAgentApiSelfUsageResponsenonenonenonenot requiredread
GET /v1/agent/capabilitiesundefinedAgentApiCapabilitiesResponsenonenonenonenot requiredread
GET /v1/agent/capabilities.jsonundefinedAgentApiCapabilitiesResponsenonenonenonenot requiredread
GET /v1/agent/accountundefinedAgentApiAccountResponsenonenonenonenot requiredread
GET /v1/agent/assetsAgentApiResourceListQueryAgentApiAssetsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/protocolsAgentApiResourceListQueryAgentApiProtocolsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/balancesAgentApiResourceListQueryAgentApiBalancesResponsenonecursor, limitnonenot requiredread
GET /v1/agent/balances/cashAgentApiResourceListQueryAgentApiBalancesResponsenonecursor, limitnonenot requiredread
GET /v1/agent/activityAgentApiActivityQueryAgentApiActivityResponsenonecursor, limit, type, sincenonenot requiredread
GET /v1/agent/operationsAgentApiOperationsQueryAgentApiOperationsResponsenonecursor, limit, status, type, sincenonenot requiredread
GET /v1/agent/operations/{id}AgentApiOperationDetailQueryAgentApiOperationResponseidincludenonenot requiredread
GET /v1/agent/recipientsAgentApiRecipientsQueryAgentApiRecipientsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/recipients/{id}AgentApiRecipientDetailQueryAgentApiRecipientResponseidnonenonenot requiredread
POST /v1/agent/recipients/resolveAgentApiRecipientResolveRequestAgentApiRecipientResponsenonenoneto, asset, actionnot requiredread
POST /v1/agent/paymentsAgentApiPaymentCreateRequestAgentApiWriteResponsenonenoneto, asset, deliver_as, note, slippage_percent, prefer, amount, amount_usdrequiredwrite
GET /v1/agent/paymentsAgentApiResourceListQueryAgentApiOperationsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/payments/{id}AgentApiResourceDetailQueryAgentApiOperationResponseidincludenonenot requiredread
POST /v1/agent/one-off-paymentsAgentApiOneOffPaymentCreateRequestAgentApiWriteResponsenonenoneto, asset, note, unlock_delay_seconds, expires_in_seconds, amount, amount_usdrequiredwrite
GET /v1/agent/one-off-paymentsAgentApiResourceListQueryAgentApiOperationsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/one-off-payments/{id}AgentApiResourceDetailQueryAgentApiOperationResponseidincludenonenot requiredread
POST /v1/agent/withdrawals/to-bankAgentApiWithdrawalToBankRequestAgentApiWriteResponsenonenonemethod_id, asset, note, amount, amount_usdrequiredwrite
POST /v1/agent/withdrawals/to-cryptoAgentApiWithdrawalToCryptoRequestAgentApiWriteResponsenonenonedestination_id, asset, note, amount, amount_usdrequiredwrite
GET /v1/agent/withdrawalsAgentApiResourceListQueryAgentApiOperationsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/withdrawals/{id}AgentApiResourceDetailQueryAgentApiOperationResponseidincludenonenot requiredread
GET /v1/agent/withdrawal-methodsAgentApiResourceListQueryAgentApiWithdrawalMethodsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/deposit-methodsAgentApiResourceListQueryAgentApiDepositMethodsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/deposit-addressAgentApiDepositAddressQueryAgentApiDepositAddressResponsenoneasset, chainnonenot requiredread
GET /v1/agent/earnAgentApiResourceListQueryAgentApiEarnResponsenonecursor, limitnonenot requiredread
GET /v1/agent/earn/{id}AgentApiEarnDetailQueryAgentApiEarnPositionResponseidnonenonenot requiredread
GET /v1/agent/earn/opportunitiesAgentApiResourceListQueryAgentApiEarnOpportunitiesResponsenonecursor, limitnonenot requiredread
POST /v1/agent/earn/depositAgentApiEarnDepositRequestAgentApiWriteResponsenonenoneasset, vault_id, use_best_available, amount, amount_usdrequiredwrite
POST /v1/agent/earn/withdrawAgentApiEarnWithdrawRequestAgentApiWriteResponsenonenoneposition_id, withdraw_all, destination_asset, allow_conversion, amount, amount_usdrequiredwrite
POST /v1/agent/earn/moveAgentApiEarnMoveRequestAgentApiWriteResponsenonenonefrom_position_id, move_all, to_vault_id, to_best_available, amount, amount_usdrequiredwrite
POST /v1/agent/earn/rewards/claimAgentApiEarnRewardsClaimRequestAgentApiWriteResponsenonenoneprotocolsrequiredwrite
GET /v1/agent/borrowundefinedAgentApiBorrowResponsenonenonenonenot requiredread
POST /v1/agent/borrowAgentApiBorrowRequestAgentApiWriteResponsenonenoneasset, max_ltv_after, amount, amount_usdrequiredwrite
GET /v1/agent/borrow/collateralAgentApiResourceListQueryAgentApiCollateralResponsenonecursor, limitnonenot requiredread
POST /v1/agent/borrow/repayAgentApiBorrowRepayRequestAgentApiWriteResponsenonenoneasset, repay_all, source_asset, allow_conversion, amount, amount_usdrequiredwrite
POST /v1/agent/borrow/deleverageAgentApiDeleverageRequestAgentApiWriteResponsenonenonetarget_ltv, max_repay_amount_usd, source_asset, use_available_cash_first, allow_conversion, allow_partialrequiredwrite
POST /v1/agent/borrow/collateral/addAgentApiCollateralAddRequestAgentApiWriteResponsenonenoneasset, source_asset, allow_conversion, amount, amount_usdrequiredwrite
POST /v1/agent/borrow/collateral/removeAgentApiCollateralRemoveRequestAgentApiWriteResponsenonenoneasset, remove_all, max_ltv_after, amount, amount_usdrequiredwrite
POST /v1/agent/conversions/quoteAgentApiConversionQuoteRequestAgentApiConversionQuoteResponsenonenonefrom_asset, to_asset, from_vault_address, to_vault_address, slippage_percent, amount, amount_usdrequiredsimulate
POST /v1/agent/conversionsAgentApiConversionExecuteRequestAgentApiWriteResponsenonenonequote_idrequiredwrite
GET /v1/agent/conversionsAgentApiResourceListQueryAgentApiOperationsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/conversions/{id}AgentApiResourceDetailQueryAgentApiOperationResponseidincludenonenot requiredread
GET /v1/agent/trusted-destinationsAgentApiResourceListQueryAgentApiRecipientsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/trusted-destinations/{id}AgentApiRecipientDetailQueryAgentApiRecipientResponseidnonenonenot requiredread
DELETE /v1/agent/trusted-destinations/{id}AgentApiTrustedDestinationWriteRequestAgentApiWriteResponseidnonenonerequiredwrite
POST /v1/agent/trusted-destinations/{id}/confirmAgentApiTrustedDestinationWriteRequestAgentApiWriteResponseidnonenonerequiredwrite
POST /v1/agent/trusted-destinations/{id}/cancelAgentApiTrustedDestinationWriteRequestAgentApiWriteResponseidnonenonerequiredwrite
GET /v1/agent/recurring-paymentsAgentApiResourceListQueryAgentApiRecipientsResponsenonecursor, limitnonenot requiredread
GET /v1/agent/recurring-payments/{id}AgentApiRecipientDetailQueryAgentApiRecipientResponseidnonenonenot requiredread
POST /v1/agent/simulateAgentApiSimulateRequestAgentApiSimulateResponsenonenonemethod, path, bodynot requiredsimulate
POST /v1/agent/x402/signAgentApiX402SignRequestAgentApiX402SignResponsenonenonepayment_requirements, pay_to, amount, target_url, max_timeout_secondsrequiredwrite
POST /v1/agent/x402/quoteAgentApiX402QuoteRequestAgentApiX402QuoteResponsenonenoneurl, method, body, timeout_msnot requiredsimulate
POST /v1/agent/x402/purchaseAgentApiX402PurchaseRequestAgentApiX402PurchaseResponsenonenoneurl, method, body, max_amountrequiredwrite
POST /v1/agent/webhooksAgentApiWebhookCreateRequestAgentApiWebhookCreateResponsenonenoneurl, description, event_typesrequiredwebhook_management
GET /v1/agent/webhooksAgentApiResourceListQueryAgentApiWebhooksResponsenonecursor, limitnonenot requiredwebhook_management
GET /v1/agent/webhooks/{id}AgentApiResourceDetailQueryAgentApiWebhookResponseidincludenonenot requiredwebhook_management
PATCH /v1/agent/webhooks/{id}AgentApiWebhookPatchRequestAgentApiWebhookResponseidnoneurl, description, event_types, enabledrequiredwebhook_management
DELETE /v1/agent/webhooks/{id}AgentApiWebhookDeleteRequestAgentApiWebhookDeleteResponseidnonenonerequiredwebhook_management
POST /v1/agent/webhooks/{id}/rotate-secretAgentApiWebhookRotateSecretRequestAgentApiWebhookRotateSecretResponseidnonenonerequiredwebhook_management
GET /v1/agent/webhooks/{id}/deliveriesAgentApiWebhookDeliveriesQueryAgentApiWebhookDeliveriesResponseidcursor, limit, status, event_idnonenot requiredread
POST /v1/agent/webhooks/{id}/testAgentApiWebhookTestRequestAgentApiWebhookTestResponseidnonenonerequiredwebhook_management

Previous

TypeScript SDK

Next

CLI