@aptos-labs/aptos-client
Version:
Client package for accessing the Aptos network API.
31 lines • 1.29 kB
TypeScript
import type { AptosClientRequest, AptosClientResponse } from "./types.js";
export type { AptosClientRequest, AptosClientResponse, CookieJarLike } from "./types.js";
/**
* Send a JSON request to an Aptos API endpoint.
*
* This is the default export and the primary entry point for most callers.
*
* @typeParam Res - Expected shape of the JSON response body.
* @param options - Request configuration.
* @returns Parsed response with status, headers, and deserialized body.
*/
export default function aptosClient<Res>(options: AptosClientRequest): Promise<AptosClientResponse<Res>>;
/**
* Send a request and parse the response as JSON.
*
* Identical to the default export; useful when a named import is preferred.
*
* @typeParam Res - Expected shape of the JSON response body.
* @param options - Request configuration.
*/
export declare function jsonRequest<Res>(options: AptosClientRequest): Promise<AptosClientResponse<Res>>;
/**
* Send a request and return the response as an `ArrayBuffer`.
*
* Intended for BCS-encoded responses from the Aptos API.
*
* @experimental
* @param options - Request configuration.
*/
export declare function bcsRequest(options: AptosClientRequest): Promise<AptosClientResponse<ArrayBuffer>>;
//# sourceMappingURL=index.browser.d.ts.map