import * as _wagmi_core from '@wagmi/core'; import { O as OneAuthProvider } from './provider-DwZPA2N1.js'; import { O as OneAuthClient } from './client-CPt1hn4_.js'; import 'viem'; import './types-BN6cCuAd.js'; import '@rhinestone/sdk'; type OneAuthConnectorOptions = { client: OneAuthClient; chainId?: number; storageKey?: string; waitForHash?: boolean; hashTimeoutMs?: number; hashIntervalMs?: number; }; /** * Creates a wagmi connector backed by 1auth passkey authentication. * * The connector lazily instantiates a single `OneAuthProvider` on the first call to * `getProvider()` and reuses it for the lifetime of the wagmi config. Event listeners * (`accountsChanged`, `chainChanged`, `disconnect`) are attached on connect and torn * down on disconnect to prevent memory leaks. * * @param options - Connector configuration * @param options.client - Configured `OneAuthClient` instance * @param options.chainId - Override the initial chain ID. When omitted the first chain * in the wagmi config's `chains` array is used. * @param options.storageKey - localStorage key for persisting the connected user. * Forwarded to `createOneAuthProvider`. Defaults to `"1auth-user"`. * @param options.waitForHash - When true, `sendTransaction` waits for a tx hash before * resolving. Forwarded to `createOneAuthProvider`. Defaults to true. * @param options.hashTimeoutMs - Maximum milliseconds to wait for a transaction hash. * @param options.hashIntervalMs - Polling interval when waiting for a hash. * @returns A wagmi connector factory function (pass directly to wagmi `createConfig`) * * @example * ```typescript * import { createConfig } from "wagmi"; * import { base, optimism } from "viem/chains"; * import { oneAuth } from "@rhinestone/1auth/wagmi"; * import { OneAuthClient } from "@rhinestone/1auth"; * * const client = new OneAuthClient({ clientId: "my-app" }); * * export const wagmiConfig = createConfig({ * chains: [base, optimism], * connectors: [ * oneAuth({ client }), * ], * }); * ``` */ declare function oneAuth(options: OneAuthConnectorOptions): _wagmi_core.CreateConnectorFn, Record>; export { type OneAuthConnectorOptions, oneAuth };