import { zkVerifySessionOptions } from '../../types.js';
import { AccountConnection, EstablishedConnection, WalletConnection } from '../../../api/connection/types.js';
import { ApiPromise, WsProvider } from '@polkadot/api';
import { KeyringPair } from '@polkadot/keyring/types';
import { AccountInfo, NetworkConfig } from '../../../types.js';
export declare class ConnectionManager {
    private accountMutex;
    private connection;
    isMainnetNetwork: boolean;
    customNetwork: boolean;
    readOnly: boolean;
    constructor(connection: AccountConnection | WalletConnection | EstablishedConnection, config: NetworkConfig);
    /**
     * Creates a new session with a connection to the specified network.
     * Supports multiple accounts for startSession if provided in options.
     * @param {zkVerifySessionOptions} options - The session configuration options.
     * @returns {Promise<ConnectionManager>} A promise resolving to a ConnectionManager instance.
     */
    static createSession(options: zkVerifySessionOptions): Promise<ConnectionManager>;
    /**
     * Closes the current session, disconnecting from the provider and cleaning up resources.
     * @returns {Promise<void>} A promise that resolves when the session is closed.
     */
    close(): Promise<void>;
    /**
     * Retrieves account information for a specified address or all accounts.
     * If no address is provided, returns an array of all account info objects.
     *
     * @param {string} [accountAddress] - The address of the account to fetch info for. If undefined, returns all accounts.
     * @returns {Promise<AccountInfo[]>} A promise resolving to an array of account info objects.
     * @throws Will throw an error if the account is not found.
     */
    getAccountInfo(accountAddress?: string): Promise<AccountInfo[]>;
    /**
     * Adds a single account to the session in a thread-safe manner.
     *
     * @param {string} seedPhrase - The seed phrase used to generate the account.
     * @returns {Promise<string>} A promise resolving to the account address.
     * @throws {Error} If the account is already added.
     */
    addAccount(seedPhrase: string): Promise<string>;
    /**
     * Adds multiple accounts to the session in a thread-safe manner.
     *
     * @param {string[]} seedPhrases - An array of seed phrases to generate accounts.
     * @returns {Promise<string[]>} A promise resolving to an array of added account addresses.
     * @throws {Error} If any of the accounts are already active.
     */
    addAccounts(seedPhrases: string[]): Promise<string[]>;
    /**
     * Removes an account from the session in a thread-safe manner.
     *
     * @param {string} [address] - (Optional) The account address to remove.
     *                              If omitted and only one account exists, that account will be removed.
     *                              If omitted and no accounts exist, the method does nothing.
     * @throws {Error} If a specified account is not found or the connection type does not support accounts.
     */
    removeAccount(address?: string): Promise<void>;
    /**
     * Getter for the API instance.
     * @returns {ApiPromise} The Polkadot.js API instance.
     */
    get api(): ApiPromise;
    /**
     * Getter for the provider.
     * @returns {WsProvider} The WebSocket provider.
     */
    get provider(): WsProvider;
    /**
     * Retrieves the account associated with the given address.
     * If no address is provided, it returns the first available account.
     *
     * @param {string} [accountAddress] - The address of the account to retrieve. If not provided, the first account is returned.
     * @returns {KeyringPair} The associated KeyringPair.
     * @throws {Error} If no accounts exist in the session or the specified account is not found.
     */
    getAccount(accountAddress?: string): KeyringPair;
    /**
     * Retrieves the current connection details.
     *
     * @returns {AccountConnection | WalletConnection | EstablishedConnection} The current connection instance.
     */
    get connectionDetails(): AccountConnection | WalletConnection | EstablishedConnection;
    /**
     * Adds `count` derived accounts to the session from an existing base account.
     * Uses hard derivation paths (`//0`, `//1`, …) and skips any that already exist.
     *
     * @param {string} baseAddress - The address of an account already in the session to derive from.
     * @param {number} count - The number of derived accounts to add (must be a positive integer).
     * @returns {Promise<string[]>} A promise resolving to the list of SS58-encoded addresses that were added.
     * @throws Will throw an error if the connection does not support accounts, the base account is not found, or `count` is invalid.
     */
    addDerivedAccounts(baseAddress: string, count: number): Promise<string[]>;
}
//# sourceMappingURL=index.d.ts.map