import { SuiClient } from "@mysten/sui/client"; import type { NetworkName } from "./types.js"; /** * Make many RPC requests using multiple endpoints. * @see SuiMultiClient.executeInBatches() */ export declare class SuiMultiClient { private readonly clients; private readonly rateLimitDelay; private clientIdx; /** * @param endpointUrls A list of Sui RPC endpoint URLs. * @param rateLimitDelay (optional) Minimum time between batches, in milliseconds. */ constructor(endpointUrls: string[], rateLimitDelay?: number); /** * Create a SuiMultiClient instance with the default endpoints for a given network. * @param network The network name to select default RPC endpoints. * @param rateLimitDelay (optional) Minimum time between batches, in milliseconds. */ static newWithDefaultEndpoints(network: NetworkName, rateLimitDelay?: number): SuiMultiClient; /** * Returns a different SuiClient in a round-robin fashion */ private getNextClient; /** * Execute `SuiClient` RPC operations in parallel using multiple endpoints. * If any operation fails, it's retried by calling this function recursively. * @param inputs The inputs for each RPC call. * @param operation A function that performs the RPC operation. * @returns The results of the RPC operations in the same order as the inputs. */ executeInBatches(inputs: InputType[], operation: (client: SuiClientWithEndpoint, input: InputType) => Promise, onUpdate?: (msg: string) => unknown): Promise; /** * Test the latency of various Sui RPC endpoints. */ testEndpoints(operation: (client: SuiClientWithEndpoint) => Promise): Promise; } /** * A `SuiClient` object that exposes the URL of its RPC endpoint. */ export type SuiClientWithEndpoint = SuiClient & { endpoint: string; };