import type { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js'; export interface TurnkeySignResult { /** 64-byte ed25519 signature. */ signature: Uint8Array; /** The signer's Solana address (base58). */ address: string; /** The user's Turnkey sub-org id. */ subOrgId: string; } export interface TurnkeyWallet { address: string; subOrgId: string; } /** * Destroy the 24h signing session held on the signer origin for this device. * Called by logout(): logout must END the signing session, never leave it to * expire (TURNKEY-EMAIL-SIGNING-PLAN.md). Best-effort by design - the session * lives in the signer origin's storage, so the only way to reach it is a hidden * signer iframe, and a blocked/offline frame must never block logout itself; * an unswept session is account-bound and unusable without a live authorization, * it just costs its owner nothing and a stranger nothing. */ export declare function clearTurnkeySigningSession(): Promise; export declare function hasTurnkeyWallet(): boolean; /** * Get-or-create the user's non-custodial Turnkey wallet, resolving with its stable * Solana address. Creation never prompts: on first use the signer silently provisions * the email-rooted wallet (no code), and an existing wallet resolves immediately. * Call from a USER GESTURE (the transport may need to open a window). * * Use this to learn the fee-payer address BEFORE building a transaction to sign. */ export declare function getOrCreateTurnkeyWallet(): Promise; /** * Open the hosted PRIVATE-KEY EXPORT page for the session's Turnkey wallet in a * new tab. Works for BOTH session kinds: hosted (issuer-cookie) sessions open it * bare, and inline (authMode:"turnkey") sessions - which own no issuer cookie - * carry a short-lived, purpose-bound exportWallet authorization in the URL * FRAGMENT (never sent to any server; the page strips it from the address bar * immediately and uses it as its bearer session). MUST be called from a USER * GESTURE or the browser blocks the tab. The key itself is decrypted only in * that tab - it never transits Bounded. */ export declare function openTurnkeyKeyExport(): Promise; /** * Open the Bounded Turnkey signer popup and sign `message` (raw bytes) with the * user's non-custodial Turnkey wallet, resolving with the ed25519 signature + * the wallet address. MUST be called from a USER GESTURE (click/tap) or the * browser blocks the popup. * * The signer shows the decoded transaction on an approve card. With a live 24-hour * signing session (normally established by the login code itself) one click signs; * without one, the card collects a Turnkey-emailed one-time code inline, which * establishes the session, and the same click completes the signature. */ export declare function signSolanaMessageViaTurnkey(message: Uint8Array): Promise; export declare function signMessageWithTurnkey(message: string): Promise; export declare function signTransactionWithTurnkey(transaction: T): Promise; export declare function signAndSubmitTransactionWithTurnkey(transaction: Transaction | VersionedTransaction, feePayer?: PublicKey): Promise;