import type { Address } from 'viem/accounts';
import * as Adapter from '../Adapter.js';
/**
 * Creates a Privy adapter backed by `@privy-io/js-sdk-core` Privy sessions and embedded
 * Ethereum wallets.
 *
 * The adapter owns silent reconnect, session-expiry cleanup, and signing. Apps supply
 * the UI-bearing login flow via `loadAccounts` (and optionally a distinct `createAccount`
 * for registration). Callbacks fire only on user-initiated `wallet_connect`/registration —
 * never during silent restore on page reload.
 *
 * Silent restore on page reload pulls wallets directly from the Privy SDK
 * (`client.user.get` + `client.embeddedWallet.getEthereumProvider`), so apps don't
 * need to re-run the login UI when the user returns with a still-valid Privy session.
 *
 * Callbacks only run the Privy auth UI. They may optionally return a subset of
 * embedded wallet addresses to expose; if omitted, the adapter exposes every
 * embedded wallet on the resulting Privy user.
 *
 * @example
 * ```ts
 * import Privy from '@privy-io/js-sdk-core'
 *
 * const client = new Privy({ appId: import.meta.env.VITE_PRIVY_APP_ID })
 *
 * const provider = Provider.create({
 *   adapter: privy({
 *     client,
 *     // Optional: omit to route registration through `loadAccounts`.
 *     createAccount: async ({ client }) => {
 *       await myPrivyRegisterUI(client)
 *     },
 *     loadAccounts: async ({ client }) => {
 *       await myPrivyLoginUI(client)
 *     },
 *   }),
 * })
 * ```
 */
export declare function privy<const client extends privy.Client>(options: privy.Options<client>): Adapter.Adapter;
export declare namespace privy {
    /** Options for {@link privy}. */
    type Options<client extends Client = Client> = {
        /** Existing Privy client, such as `Privy` from `@privy-io/js-sdk-core`. */
        client: client;
        /**
         * Runs the Privy registration UI. May optionally return a subset of the user's
         * embedded wallet addresses to expose to the provider; if omitted, the adapter
         * exposes every embedded wallet on the resulting Privy user.
         *
         * The adapter materializes EIP-1193 providers internally via
         * `client.embeddedWallet.getEthereumProvider` — callbacks should not.
         *
         * Defaults to `loadAccounts` — apps that don't distinguish register vs login
         * can omit this.
         */
        createAccount?: ((parameters: {
            /** Initialized Privy client. */
            client: client;
            /** Provider create-account parameters. */
            parameters: Adapter.createAccount.Parameters;
        }) => Promise<AccountSelection>) | undefined;
        /** Data URI of the provider icon. @default Black 1×1 SVG. */
        icon?: `data:image/${string}` | undefined;
        /**
         * Runs the Privy login UI in response to a user-initiated `wallet_connect`.
         * May optionally return a subset of the user's embedded wallet addresses to
         * expose to the provider; if omitted, the adapter exposes every embedded
         * wallet on the Privy user.
         *
         * Silent restore on page reload pulls wallets directly from the Privy SDK
         * (`client.user.get` + `client.embeddedWallet.getEthereumProvider`) and does
         * NOT call this function.
         */
        loadAccounts: (parameters: {
            /** Initialized Privy client. */
            client: client;
            /** Provider load-accounts parameters. */
            parameters?: Adapter.loadAccounts.Parameters | undefined;
        }) => Promise<AccountSelection>;
        /** Display name of the provider. @default "Privy" */
        name?: string | undefined;
        /** Reverse DNS identifier. @default "io.privy" */
        rdns?: string | undefined;
    };
    /**
     * Optional subset of embedded wallet addresses returned from `createAccount` /
     * `loadAccounts`. `void`/`undefined` means "expose every embedded wallet".
     */
    type AccountSelection = readonly Address[] | void;
    /**
     * Minimal structural Privy client surface used by the adapter for session checks,
     * silent restore, and disconnect. User-initiated `wallet_connect`/registration
     * is delegated to the app's `loadAccounts` / `createAccount` callbacks.
     *
     * Satisfied by `Privy` from `@privy-io/js-sdk-core` — apps pass the SDK instance
     * directly. The adapter never imports `@privy-io/js-sdk-core` itself; the structural
     * shape keeps the dependency one-way.
     */
    type Client = {
        /** Auth API; the adapter only needs `logout`. */
        auth: {
            /**
             * Clears the current Privy session. The adapter passes the current user id
             * (when available) so multi-tab/multi-user setups scope the logout correctly.
             */
            logout: (parameters?: {
                userId: string;
            } | undefined) => Promise<void> | void;
        };
        /** Embedded wallet API used by the adapter to materialize EIP-1193 providers. */
        embeddedWallet: {
            /** Returns an EIP-1193 provider for a Privy embedded Ethereum wallet. */
            getEthereumProvider(parameters: {
                wallet: LinkedAccount;
                entropyId: string;
                entropyIdVerifier: string;
            }): Promise<EthereumProvider> | EthereumProvider;
        };
        /** Returns the current Privy access token, or `null` if no session. */
        getAccessToken: () => Promise<string | null>;
        /** Initializes the client. Called once by the adapter, before any other method. */
        initialize?: (() => Promise<void> | void) | undefined;
        /** User API used by the adapter to scope `auth.logout` and to silently restore wallets. */
        user: {
            /** Returns the currently authenticated Privy user. */
            get: () => Promise<{
                user: User;
            }>;
        };
    };
    /** Minimal Privy user shape used by the adapter for silent restore. */
    type User = {
        id: string;
        linked_accounts?: readonly LinkedAccount[] | undefined;
    };
    /** Minimal Privy linked account shape used by the adapter for silent restore. */
    type LinkedAccount = {
        address?: string | undefined;
        chain_type?: string | undefined;
        connector_type?: string | undefined;
        type?: string | undefined;
        wallet_client_type?: string | undefined;
        wallet_index?: number | undefined;
    };
    /** Minimal EIP-1193 provider surface used by the adapter for `secp256k1_sign`. */
    type EthereumProvider = {
        request(parameters: {
            method: string;
            params?: readonly unknown[] | undefined;
        }): Promise<unknown>;
    };
    /**
     * Materialized Privy embedded wallet — the `{ address, provider }` shape the
     * adapter caches internally after calling
     * `client.embeddedWallet.getEthereumProvider`. The adapter calls
     * `provider.request({ method: 'secp256k1_sign', params: [hash] })` for signing.
     */
    type EmbeddedWallet = {
        address: string;
        provider: EthereumProvider;
    };
}
//# sourceMappingURL=privy.d.ts.map