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 field | Purpose |
|---|---|
baseUrl | Agent API origin. Defaults to https://api.hightop.com. |
agentId + apiKey | Header-key auth. Configure both together. |
bearerToken | OAuth bearer token auth. Do not combine with header-key auth. |
fetch | Optional fetch implementation for tests or custom runtimes. |
timeoutMs | Default request timeout in milliseconds. |
Domain Helpers#
| Helper | Endpoint | Idempotency | Signature | Description |
|---|---|---|---|---|
client.self.get(options?) | GET /v1/agent/self | not required | () => Promise<AgentApiSelfResponse> | Return the authenticated agent and wallet context. |
client.self.usage(options?) | GET /v1/agent/self/usage | not required | () => Promise<AgentApiSelfUsageResponse> | Return current Agent API rate-limit and usage state. |
client.capabilities.get(options?) | GET /v1/agent/capabilities | not required | () => Promise<AgentApiCapabilitiesResponse> | Return authenticated runtime capabilities. |
client.capabilities.json(options?) | GET /v1/agent/capabilities.json | not required | () => Promise<AgentApiCapabilitiesResponse> | Return Agent API capabilities as JSON. |
client.openapi.get(options?) | GET /v1/agent/openapi.json | not required | () => Promise<Record<string, unknown>> | Fetch the public Agent API OpenAPI document. |
client.account.get(options?) | GET /v1/agent/account | not required | () => Promise<AgentApiAccountResponse> | Return a scoped account summary. |
client.balances.list(query?, options?) | GET /v1/agent/balances | not required | (query?: Record<string, unknown>) => Promise<AgentApiBalancesResponse> | List balances for the authenticated agent wallet. |
client.balances.cash(query?, options?) | GET /v1/agent/balances/cash | not required | (query?: Record<string, unknown>) => Promise<AgentApiBalancesResponse> | List cash balances. |
client.operations.list(query?, options?) | GET /v1/agent/operations | not 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/borrow | not required | () => Promise<AgentApiBorrowResponse> | Return borrow summary. |
client.borrow.repay(body, options) | POST /v1/agent/borrow/repay | required via options.idempotencyKey | (body: AgentApiBorrowRepayRequest, options: HightopAgentRequestOptions) => Promise<AgentApiWriteResponse> | Create a debt repayment operation. |
client.borrow.deleverage(body, options) | POST /v1/agent/borrow/deleverage | required via options.idempotencyKey | (body: AgentApiDeleverageRequest, options: HightopAgentRequestOptions) => Promise<AgentApiWriteResponse> | Create a target-LTV deleverage operation. |
client.conversions.quote(body, options) | POST /v1/agent/conversions/quote | required via options.idempotencyKey | (body: AgentApiConversionQuoteRequest, options: HightopAgentRequestOptions) => Promise<AgentApiConversionQuoteResponse> | Create a stateful conversion quote. |
client.conversions.execute(body, options) | POST /v1/agent/conversions | required via options.idempotencyKey | (body: AgentApiConversionExecuteRequest, options: HightopAgentRequestOptions) => Promise<AgentApiWriteResponse> | Execute a conversion from a quote. |
client.simulate.request(body, options?) | POST /v1/agent/simulate | not required | (body: AgentApiSimulateRequest) => Promise<AgentApiSimulateResponse> | Validate a write request shape without broadcasting. |
client.x402.sign(body, options) | POST /v1/agent/x402/sign | required 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/quote | not 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/purchase | required 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?) | multiple | depends 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) | multiple | depends 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 key | Request type | Response type | Path params | Query params | Body params | Idempotency | Rate class |
|---|---|---|---|---|---|---|---|
GET /v1/agent/self | undefined | AgentApiSelfResponse | none | none | none | not required | read |
GET /v1/agent/self/usage | undefined | AgentApiSelfUsageResponse | none | none | none | not required | read |
GET /v1/agent/capabilities | undefined | AgentApiCapabilitiesResponse | none | none | none | not required | read |
GET /v1/agent/capabilities.json | undefined | AgentApiCapabilitiesResponse | none | none | none | not required | read |
GET /v1/agent/account | undefined | AgentApiAccountResponse | none | none | none | not required | read |
GET /v1/agent/assets | AgentApiResourceListQuery | AgentApiAssetsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/protocols | AgentApiResourceListQuery | AgentApiProtocolsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/balances | AgentApiResourceListQuery | AgentApiBalancesResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/balances/cash | AgentApiResourceListQuery | AgentApiBalancesResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/activity | AgentApiActivityQuery | AgentApiActivityResponse | none | cursor, limit, type, since | none | not required | read |
GET /v1/agent/operations | AgentApiOperationsQuery | AgentApiOperationsResponse | none | cursor, limit, status, type, since | none | not required | read |
GET /v1/agent/operations/{id} | AgentApiOperationDetailQuery | AgentApiOperationResponse | id | include | none | not required | read |
GET /v1/agent/recipients | AgentApiRecipientsQuery | AgentApiRecipientsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/recipients/{id} | AgentApiRecipientDetailQuery | AgentApiRecipientResponse | id | none | none | not required | read |
POST /v1/agent/recipients/resolve | AgentApiRecipientResolveRequest | AgentApiRecipientResponse | none | none | to, asset, action | not required | read |
POST /v1/agent/payments | AgentApiPaymentCreateRequest | AgentApiWriteResponse | none | none | to, asset, deliver_as, note, slippage_percent, prefer, amount, amount_usd | required | write |
GET /v1/agent/payments | AgentApiResourceListQuery | AgentApiOperationsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/payments/{id} | AgentApiResourceDetailQuery | AgentApiOperationResponse | id | include | none | not required | read |
POST /v1/agent/one-off-payments | AgentApiOneOffPaymentCreateRequest | AgentApiWriteResponse | none | none | to, asset, note, unlock_delay_seconds, expires_in_seconds, amount, amount_usd | required | write |
GET /v1/agent/one-off-payments | AgentApiResourceListQuery | AgentApiOperationsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/one-off-payments/{id} | AgentApiResourceDetailQuery | AgentApiOperationResponse | id | include | none | not required | read |
POST /v1/agent/withdrawals/to-bank | AgentApiWithdrawalToBankRequest | AgentApiWriteResponse | none | none | method_id, asset, note, amount, amount_usd | required | write |
POST /v1/agent/withdrawals/to-crypto | AgentApiWithdrawalToCryptoRequest | AgentApiWriteResponse | none | none | destination_id, asset, note, amount, amount_usd | required | write |
GET /v1/agent/withdrawals | AgentApiResourceListQuery | AgentApiOperationsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/withdrawals/{id} | AgentApiResourceDetailQuery | AgentApiOperationResponse | id | include | none | not required | read |
GET /v1/agent/withdrawal-methods | AgentApiResourceListQuery | AgentApiWithdrawalMethodsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/deposit-methods | AgentApiResourceListQuery | AgentApiDepositMethodsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/deposit-address | AgentApiDepositAddressQuery | AgentApiDepositAddressResponse | none | asset, chain | none | not required | read |
GET /v1/agent/earn | AgentApiResourceListQuery | AgentApiEarnResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/earn/{id} | AgentApiEarnDetailQuery | AgentApiEarnPositionResponse | id | none | none | not required | read |
GET /v1/agent/earn/opportunities | AgentApiResourceListQuery | AgentApiEarnOpportunitiesResponse | none | cursor, limit | none | not required | read |
POST /v1/agent/earn/deposit | AgentApiEarnDepositRequest | AgentApiWriteResponse | none | none | asset, vault_id, use_best_available, amount, amount_usd | required | write |
POST /v1/agent/earn/withdraw | AgentApiEarnWithdrawRequest | AgentApiWriteResponse | none | none | position_id, withdraw_all, destination_asset, allow_conversion, amount, amount_usd | required | write |
POST /v1/agent/earn/move | AgentApiEarnMoveRequest | AgentApiWriteResponse | none | none | from_position_id, move_all, to_vault_id, to_best_available, amount, amount_usd | required | write |
POST /v1/agent/earn/rewards/claim | AgentApiEarnRewardsClaimRequest | AgentApiWriteResponse | none | none | protocols | required | write |
GET /v1/agent/borrow | undefined | AgentApiBorrowResponse | none | none | none | not required | read |
POST /v1/agent/borrow | AgentApiBorrowRequest | AgentApiWriteResponse | none | none | asset, max_ltv_after, amount, amount_usd | required | write |
GET /v1/agent/borrow/collateral | AgentApiResourceListQuery | AgentApiCollateralResponse | none | cursor, limit | none | not required | read |
POST /v1/agent/borrow/repay | AgentApiBorrowRepayRequest | AgentApiWriteResponse | none | none | asset, repay_all, source_asset, allow_conversion, amount, amount_usd | required | write |
POST /v1/agent/borrow/deleverage | AgentApiDeleverageRequest | AgentApiWriteResponse | none | none | target_ltv, max_repay_amount_usd, source_asset, use_available_cash_first, allow_conversion, allow_partial | required | write |
POST /v1/agent/borrow/collateral/add | AgentApiCollateralAddRequest | AgentApiWriteResponse | none | none | asset, source_asset, allow_conversion, amount, amount_usd | required | write |
POST /v1/agent/borrow/collateral/remove | AgentApiCollateralRemoveRequest | AgentApiWriteResponse | none | none | asset, remove_all, max_ltv_after, amount, amount_usd | required | write |
POST /v1/agent/conversions/quote | AgentApiConversionQuoteRequest | AgentApiConversionQuoteResponse | none | none | from_asset, to_asset, from_vault_address, to_vault_address, slippage_percent, amount, amount_usd | required | simulate |
POST /v1/agent/conversions | AgentApiConversionExecuteRequest | AgentApiWriteResponse | none | none | quote_id | required | write |
GET /v1/agent/conversions | AgentApiResourceListQuery | AgentApiOperationsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/conversions/{id} | AgentApiResourceDetailQuery | AgentApiOperationResponse | id | include | none | not required | read |
GET /v1/agent/trusted-destinations | AgentApiResourceListQuery | AgentApiRecipientsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/trusted-destinations/{id} | AgentApiRecipientDetailQuery | AgentApiRecipientResponse | id | none | none | not required | read |
DELETE /v1/agent/trusted-destinations/{id} | AgentApiTrustedDestinationWriteRequest | AgentApiWriteResponse | id | none | none | required | write |
POST /v1/agent/trusted-destinations/{id}/confirm | AgentApiTrustedDestinationWriteRequest | AgentApiWriteResponse | id | none | none | required | write |
POST /v1/agent/trusted-destinations/{id}/cancel | AgentApiTrustedDestinationWriteRequest | AgentApiWriteResponse | id | none | none | required | write |
GET /v1/agent/recurring-payments | AgentApiResourceListQuery | AgentApiRecipientsResponse | none | cursor, limit | none | not required | read |
GET /v1/agent/recurring-payments/{id} | AgentApiRecipientDetailQuery | AgentApiRecipientResponse | id | none | none | not required | read |
POST /v1/agent/simulate | AgentApiSimulateRequest | AgentApiSimulateResponse | none | none | method, path, body | not required | simulate |
POST /v1/agent/x402/sign | AgentApiX402SignRequest | AgentApiX402SignResponse | none | none | payment_requirements, pay_to, amount, target_url, max_timeout_seconds | required | write |
POST /v1/agent/x402/quote | AgentApiX402QuoteRequest | AgentApiX402QuoteResponse | none | none | url, method, body, timeout_ms | not required | simulate |
POST /v1/agent/x402/purchase | AgentApiX402PurchaseRequest | AgentApiX402PurchaseResponse | none | none | url, method, body, max_amount | required | write |
POST /v1/agent/webhooks | AgentApiWebhookCreateRequest | AgentApiWebhookCreateResponse | none | none | url, description, event_types | required | webhook_management |
GET /v1/agent/webhooks | AgentApiResourceListQuery | AgentApiWebhooksResponse | none | cursor, limit | none | not required | webhook_management |
GET /v1/agent/webhooks/{id} | AgentApiResourceDetailQuery | AgentApiWebhookResponse | id | include | none | not required | webhook_management |
PATCH /v1/agent/webhooks/{id} | AgentApiWebhookPatchRequest | AgentApiWebhookResponse | id | none | url, description, event_types, enabled | required | webhook_management |
DELETE /v1/agent/webhooks/{id} | AgentApiWebhookDeleteRequest | AgentApiWebhookDeleteResponse | id | none | none | required | webhook_management |
POST /v1/agent/webhooks/{id}/rotate-secret | AgentApiWebhookRotateSecretRequest | AgentApiWebhookRotateSecretResponse | id | none | none | required | webhook_management |
GET /v1/agent/webhooks/{id}/deliveries | AgentApiWebhookDeliveriesQuery | AgentApiWebhookDeliveriesResponse | id | cursor, limit, status, event_id | none | not required | read |
POST /v1/agent/webhooks/{id}/test | AgentApiWebhookTestRequest | AgentApiWebhookTestResponse | id | none | none | required | webhook_management |
