@nktkas/hyperliquid
Version:
Hyperliquid API SDK for all major JS runtimes, written in TypeScript.
45 lines (44 loc) • 1.63 kB
TypeScript
/**
* Execute helpers for L1 and user-signed Exchange API actions.
* @module
*/
/// <amd-module name="file:///home/runner/work/hyperliquid/hyperliquid/src/api/exchange/_methods/_base/execute.ts" />
import type { ExchangeConfig } from "./_config.js";
/**
* Execute an L1 action on the Hyperliquid Exchange.
*
* Handles both single-wallet and multi-sig signing.
*
* @param config Exchange API configuration.
* @param action Action payload to execute.
* @param options Additional options for the request.
* @return API response.
*
* @throws {ValidationError} If the request options fail validation.
* @throws {ApiRequestError} If the API returns an error response.
*/
export declare function executeL1Action<T>(config: ExchangeConfig, action: Record<string, unknown>, options?: {
vaultAddress?: string;
expiresAfter?: string | number;
signal?: AbortSignal;
}): Promise<T>;
/**
* Execute a user-signed action (EIP-712) on the Hyperliquid Exchange.
*
* Handles both single-wallet and multi-sig signing.
*
* @param config Exchange API configuration.
* @param action Action payload to execute.
* @param types EIP-712 type definitions for signing.
* @param options Additional options for the request.
* @return API response.
*
* @throws {ValidationError} If the request options fail validation.
* @throws {ApiRequestError} If the API returns an error response.
*/
export declare function executeUserSignedAction<T>(config: ExchangeConfig, action: Record<string, unknown>, types: Record<string, readonly {
name: string;
type: string;
}[]>, options?: {
signal?: AbortSignal;
}): Promise<T>;