import { RpcTransport } from "@solana/rpc-spec";
import { SolanaRpcApi } from "@solana/kit";
/**
 * This is the type we pass to define a Solana RPC request "task".
 */
export interface SolanaRateLimitTask {
    rpcArgs: Parameters<RpcTransport>;
    resolve: (result: unknown) => void;
    reject: (err: unknown) => void;
}
export type TransactionResult = {
    err: string | undefined;
    logs: Array<string>;
    postExecutionAccounts: ExecutionAccounts[];
    preExecutionAccounts: ExecutionAccounts[];
    returnData: string | undefined;
    unitsConsumed: bigint;
};
export type ExecutionAccounts = {
    data: [string, string];
    executable: boolean;
    lamports: bigint;
    owner: string;
    rentEpoch: bigint;
    space: bigint;
};
export type SolanaBundleSimulation = {
    context: {
        apiVersion: string;
        slot: bigint;
    };
    value: {
        summary: "succeeded" | {
            failed: {
                error: {
                    TransactionFailure: [Array<bigint>, string];
                };
                tx_signature: string;
            };
        };
        transactionResults: Array<TransactionResult>;
    };
};
export type SimulationOpts = {
    simulationBank?: string;
    skipSigVerify?: boolean;
    replaceRecentBlockhash?: boolean;
    accounts?: {
        addresses: string[];
        encoding: string;
    };
    preExecutionAccountsConfigs: Array<{
        accountIndex: number;
        addresses: string[];
    } | undefined>;
    postExecutionAccountsConfigs: Array<{
        accountIndex: number;
        addresses: string[];
    } | undefined>;
};
export interface JitoInterface extends SolanaRpcApi {
    simulateBundle(transactions: {
        encodedTransactions: string[];
    }, opts?: SimulationOpts): SolanaBundleSimulation;
}
/**
 * Determine whether a Solana RPC error indicates an unrecoverable error that should not be retried.
 * @param method RPC method name.
 * @param error Error object from the RPC call.
 * @returns True if the request should be aborted immediately, otherwise false.
 */
export declare function shouldFailImmediate(method: string, error: unknown): boolean;
