import * as _wagmi_core from '@wagmi/core';
import * as viem from 'viem';
import { WalletDetailsParams, Wallet } from '@rainbow-me/rainbowkit';

/**
 * Options for creating a wagmi connector for a Privy cross-app wallet
 */
interface CreatePrivyConnectorOptions {
    /**
     * The Privy app ID of the cross-app wallet provider.
     */
    id: string;
    /**
     * Will show up as the wallet's name in RainbowKit UIs
     */
    name: string;
    /**
     * Will show up as the wallet's image in RainbowKit UIs
     */
    iconUrl: string;
    /**
     * @experimental Interfaces are subject to change in the future.
     * Informs the wagmi connector to use the smart wallet and
     * transforms the connector functions.
     */
    smartWalletMode?: boolean;
    /**
     * @experimental Interfaces are subject to change in the future.
     *
     * Configure the default amount of time before a wallet request is closed with
     * a timeout error.
     */
    defaultPopupTimeout?: number;
    /**
     * Override the default connect URL for the cross-app wallet provider.
     * When set, this URL will be used instead of the URL returned by the API.
     */
    overrideConnectUrl?: string;
    /**
     * Override the default transact URL for the cross-app wallet provider.
     * When set, this URL will be used instead of the URL returned by the API.
     */
    overrideTransactUrl?: string;
}
/**
 * Create a wagmi connector for the Privy cross-app wallet provider.
 *
 * Adapted from wagmi injected connector as a reference implementation:
 * https://github.com/wevm/wagmi/blob/main/packages/core/src/connectors/injected.ts#L94
 *
 * @example
 * import { createConfig, http } from "wagmi";
 * import { mainnet } from "wagmi/chains";
 *
 * const privyWalletConnector = toPrivyWalletConnector({
 *   providerAppId: <your-app-id>,
 *   providerName: 'Your app',
 *   providerIconUrl: 'https://example.com/image.png',
 * })
 *
 * export const wagmiConfig = createConfig({
 *   chains: [mainnet],
 *   transports: {
 *     [mainnet.id]: http(),
 *   },
 *   connectors: [privyWalletConnector],
 *   ssr: true,
 * });
 */
declare function toPrivyWalletConnector(params: CreatePrivyConnectorOptions, rkDetails?: WalletDetailsParams): _wagmi_core.CreateConnectorFn<{
    on: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
    removeListener: <event extends keyof viem.EIP1193EventMap>(event: event, listener: viem.EIP1193EventMap[event]) => void;
    request: viem.EIP1193RequestFn<viem.EIP1474Methods>;
}, Record<string, unknown>, Record<string, unknown>>;

/**
 * Options for creating a RainbowKit wallet for a Privy cross-app wallet
 */
interface CreatePrivyWalletOptions {
    /**
     * The Privy app ID of the cross-app wallet provider.
     */
    id: string;
    /**
     * Will show up as the wallet's name in RainbowKit UIs
     */
    name: string;
    /**
     * Will show up as the wallet's image in RainbowKit UIs
     */
    iconUrl: string;
    /**
     * Will show up as the wallet's image background in RainbowKit UIs.
     *
     * @default '#000000'
     */
    iconBackground?: string;
    /**
     * @experimental Interfaces are subject to change in the future.
     *
     * Configure the default amount of time before a wallet request is closed with
     * a timeout error.
     */
    defaultPopupTimeout?: number;
    /**
     * Override the default connect URL for the cross-app wallet provider.
     * When set, this URL will be used instead of the URL returned by the API.
     */
    overrideConnectUrl?: string;
    /**
     * Override the default transact URL for the cross-app wallet provider.
     * When set, this URL will be used instead of the URL returned by the API.
     */
    overrideTransactUrl?: string;
}
/**
 * Create a RainbowKit wallet for a Privy cross-app waller
 *
 * @example
 * import { connectorsForWallets } from "@rainbow-me/rainbowkit";
 *
 * const privyWallet = toPrivyWallet({
 *   id: <privy-wallet-app-id>,
 *   name: 'Privy wallet app',
 *   iconUrl: 'https://example.com/image.png',
 * })
 *
 * const connectors = connectorsForWallets(
 *  [
 *    {
 *      groupName: "Privy",
 *      wallets: [privyWallet],
 *    },
 *  ],
 *  {
 *    appName: "Privy",
 *    projectId: "Example",
 *  }
 * );
 */
declare const toPrivyWallet: (opts: CreatePrivyWalletOptions) => () => Wallet;

export { toPrivyWallet, toPrivyWalletConnector };
export type { CreatePrivyConnectorOptions, CreatePrivyWalletOptions };
