import type { WebsocketClientOptions } from './rpc-websocket-client.js'; /** * An object defining headers to be passed to the RPC server */ export type HttpHeaders = { [header: string]: string; }; /** * A function that can inspect and modify RPC requests before they are executed. * Useful for monitoring, tracing, and error handling. */ export type RequestInspector = (input: IotaTransportRequestOptions, executeRequest: () => Promise) => Promise; export interface IotaHTTPTransportOptions { fetch?: typeof fetch; WebSocketConstructor?: typeof WebSocket; url: string; rpc?: { headers?: HttpHeaders; url?: string; }; websocket?: WebsocketClientOptions & { url?: string; }; inspector?: RequestInspector; } export interface IotaTransportRequestOptions { method: string; params: unknown[]; signal?: AbortSignal; } export interface IotaTransportSubscribeOptions { method: string; unsubscribe: string; params: unknown[]; onMessage: (event: T) => void; signal?: AbortSignal; } export interface IotaTransport { request(input: IotaTransportRequestOptions): Promise; subscribe(input: IotaTransportSubscribeOptions): Promise<() => Promise>; } export declare class IotaHTTPTransport implements IotaTransport { #private; constructor(options: IotaHTTPTransportOptions); fetch(input: RequestInfo, init?: RequestInit): Promise; request(input: IotaTransportRequestOptions): Promise; subscribe(input: IotaTransportSubscribeOptions): Promise<() => Promise>; } //# sourceMappingURL=http-transport.d.ts.map