import { P as PasskeyProviderConfig, S as SponsorshipConfig, H as HeadlessIntentOptions, a as HeadlessPrepareResult, b as HeadlessSubmitOptions, c as HeadlessSubmitResult, d as HeadlessIntentStatusResult, I as InstallSmartSessionOptions, e as InstallSmartSessionResult, f as SessionKeyHandle } from './types-BN6cCuAd.mjs'; export { g as SmartSessionEnableRequest } from './types-BN6cCuAd.mjs'; import * as _rhinestone_sdk from '@rhinestone/sdk'; import { Hex, Address } from 'viem'; /** * Headless 1auth client. * * Used by integrators that hold their own ECDSA signer in localStorage * and produce signatures for an ERC-7579 validator other than the * passkey one (typically `@rhinestone/sdk` experimental SmartSession). * * Responsibilities: * - Fetch sponsorship JWTs from the app's own backend. * - Call `/api/intent/prepare?signingMode=headless` to get an * orchestrator-quoted `intentOp` + `digestResult`. * - Forward pre-encoded validator-prefixed signatures to the new * `/api/intent/headless-execute` route. * - Drive the existing passkey dialog (via {@link OneAuthClient}) for * the one-time SmartSession install ceremony. * * 1auth itself stays ignorant of session keys — the on-chain * SmartSession validator is the only authority over what a session key * may sign for. The host app persists `{ sessionKeyAddress, permissionId, * accountAddress, permissions }` in its own storage. */ declare class OneAuthHeadlessClient { private providerUrl; private clientId?; private sponsorship; constructor(config: PasskeyProviderConfig); setSponsorship(sponsorship: SponsorshipConfig | undefined): void; private fetchAccessToken; /** Mint one digest-bound extension grant from a canonical intent input. */ private fetchExtensionToken; /** * Quote an intent without opening any dialog. Returns the orchestrator's * `intentOp` plus the digest the caller must sign with their own * validator (e.g. SmartSession). The caller is responsible for * encoding signatures and submitting via {@link submitIntent}. */ prepareIntent(options: HeadlessIntentOptions): Promise; /** * Forward a pre-signed intent using a fresh single-use execution grant. * The quote grant was consumed during prepare and must never be replayed. */ submitIntent(options: HeadlessSubmitOptions): Promise; /** * Fetch the latest known status for a submitted headless intent. * This is a non-blocking read and may return `pending` before a * solver has produced a fill transaction hash. */ getIntentStatus(intentId: string): Promise; /** * Wait for a submitted headless intent to produce a status update and, * when available, the final fill transaction hash. The wait endpoint * needs the opaque `transactionResult` returned by submit because 1auth * does not persist that SDK object in its database. */ waitForIntent(intentId: string, transactionResult: unknown): Promise; /** * Resolve the SmartSession install call(s) for `sessionKeyAddress` * with the supplied `permissions`. * * Returns `{ install, sessionKeyHandle }`: * * - `install` is a `{ targetChain, calls }` pair the caller feeds * straight into `OneAuthClient.sendIntent({ targetChain, calls })` * so the user passkey-signs the install via the existing dialog. * - `sessionKeyHandle` contains the deterministic `permissionId` * plus metadata to persist in localStorage. Persist this BEFORE * submitting the install so a refresh during signing doesn't * lose the handle. * * If the validator is already installed on the user's account, * `install.calls` is empty and `install.alreadyInstalled` is true. * The caller should still persist `sessionKeyHandle` — the on-chain * session enabling happens at first headless use via SmartSession's * ENABLE-mode signature wrapping (see follow-up). */ installSmartSession(options: InstallSmartSessionOptions): Promise; } interface BuildSmartSessionHeadlessSignaturesOptions { /** ECDSA private key for the locally-held SmartSession signer. */ privateKey: Hex; /** Smart account address the SmartSession is scoped to. */ accountAddress: Address; /** Persisted handle returned by `grantPermissions` / SmartSession install. */ sessionKeyHandle: SessionKeyHandle; /** Prepared headless intent returned by `OneAuthHeadlessClient.prepareIntent`. */ prepared: HeadlessPrepareResult; } /** * Builds SmartSession signatures for `OneAuthHeadlessClient.submitIntent`. * * This intentionally delegates signing and SmartSession signature packing to * `@rhinestone/sdk`. 1auth only rebuilds the persisted session descriptor and * supplies the SDK-native `SignData` returned by the orchestrator quote. */ declare function buildSmartSessionHeadlessSignatures(options: BuildSmartSessionHeadlessSignaturesOptions): Promise<_rhinestone_sdk.SignedIntentData>; export { type BuildSmartSessionHeadlessSignaturesOptions, HeadlessIntentOptions, HeadlessIntentStatusResult, HeadlessPrepareResult, HeadlessSubmitOptions, HeadlessSubmitResult, InstallSmartSessionOptions, InstallSmartSessionResult, OneAuthHeadlessClient, SessionKeyHandle, buildSmartSessionHeadlessSignatures };