import { Connection, PublicKey } from '@solana/web3.js'; import { I as Identity, A as AuthProvider, W as WalletRegistry, S as SocialRecoveryCredential, a as SocialRecoveryClient, E as EnclaveDekPort, D as DeviceFactor, b as WrapStore, c as Ed25519Seed, g as Ed25519SpendSigner, d as PasskeyPrfProvider, V as VaultClient } from './VaultClient-CkzLCyXH.mjs'; import { b as SolanaExecuteOptions, M as MessageSignature, c as SolanaSignedTransaction } from './signing-BC_pkVbS.mjs'; declare const SOLANA_NETWORKS: { readonly "solana-devnet": "https://api.devnet.solana.com"; readonly "solana-mainnet": "https://api.mainnet-beta.solana.com"; readonly "solana-localnet": "http://127.0.0.1:8899"; }; type SolanaNetwork = keyof typeof SOLANA_NETWORKS; interface SolanaRelayerOptions { baseUrl: string; appId: string; environment?: "development" | "production"; network: SolanaNetwork; connection: Connection; } /** * Client for the Cavos Solana sponsoring relayer. The user signs; the relayer * co-signs as fee payer. Native system accounts only. */ declare class SolanaRelayer { private readonly opts; private feePayer?; constructor(opts: SolanaRelayerOptions); getFeePayer(): Promise; sendSigned(serialized: Uint8Array): Promise; } interface TollQuote { /** Opaque sealed payload; submit it back unchanged. */ quote: string; feePayer: PublicKey; treasury: PublicKey; mint: PublicKey; /** Base units of `mint` the user owes. */ amount: bigint; decimals: number; expiresAt: number; } interface TollClientOptions { baseUrl?: string; } interface QuoteRequest { mint: string; /** Instructions the transaction will carry, the payment included. */ instructions: number; computeUnits?: number; microLamportsPerUnit?: number; fundedTokenAccounts?: number; } /** * Client for Toll, which pays a transaction's SOL fee and takes settlement in * the token the user already holds. * * Toll is the fee payer, never a custodian: it co-signs a transaction the user * signed and cannot alter its instructions. */ declare class TollClient { private readonly baseUrl; constructor(opts?: TollClientOptions); quote(req: QuoteRequest): Promise; submit(quote: string, serialized: Uint8Array): Promise; } interface InstructionAccount { pubkey: string; isSigner: boolean; isWritable: boolean; } interface InstructionData { programId: string; accounts: InstructionAccount[]; data: Uint8Array; } interface ConnectSolanaOptions { network: SolanaNetwork; auth?: AuthProvider; identity?: Identity; appSalt: string; appId?: string; environment?: "development" | "production"; backendUrl?: string; registry?: WalletRegistry; rpcUrl?: string; relayer?: SolanaRelayer; /** Pays fees in a token the user already holds. See `fee: { token }`. */ toll?: TollClient; credential?: SocialRecoveryCredential; socialRecovery?: SocialRecoveryClient; recovery?: EnclaveDekPort; factor?: DeviceFactor; wrapStore?: WrapStore; importSpend?: (seed: Ed25519Seed, keyId: string) => Promise; passkey?: PasskeyPrfProvider; /** Keep the key in the Cavos vault instead of this page's storage. */ vault?: VaultClient; } type ConnectStatus = "undeployed" | "ready" | "needs-device-approval"; /** @deprecated Native Solana restores via connect, not backup add_signer. */ type RecoverSolanaOptions = ConnectSolanaOptions; /** * Native Ed25519 system account. The address is HKDF of the MasterDEK. * There is no device-account program and no second on-chain spender. */ declare class CavosSolana { readonly chain: "solana"; readonly identity: Identity; readonly address: string; readonly connection: Connection; isNewAccount: boolean; onAuthorizationNeeded?: () => Promise; private statusValue; private readonly relayer?; private readonly toll?; private readonly spend?; private readonly passkeyRestore; private readonly statusListeners; /** * An object, not positions: this list grows with every capability, and each * time it grew positionally something downstream silently read the wrong * argument. */ private constructor(); get status(): ConnectStatus; onStatusChange(listener: () => void): () => void; private setStatus; /** * Always true. A native Ed25519 system account is not deployed — its address * IS its public key, so it exists the moment it is derived. Kept because the * shared wallet shape exposes it. */ get isDeployed(): boolean; static connect(opts: ConnectSolanaOptions): Promise; hasPasskey(): Promise; /** * Ready means one thing here: this device holds the spend key. There is no * on-chain signer set to wait for, so this resolves off-chain and never * flips back to false once the key is in hand. */ isReady(): Promise; execute(amount: bigint, destination: string, opts?: SolanaExecuteOptions): Promise; executeInstructions(instructions: InstructionData[], opts?: SolanaExecuteOptions): Promise; signMessage(message: string | Uint8Array): Promise; /** * Sign a transfer without submitting it. The account signs as its own fee * payer, matching the default `execute()` route — web3.js cannot compile a * message at all without a fee payer set. */ signTransaction(amount: bigint, destination: string): Promise; private requireSpend; /** * Three ways to pay, and the account signs its own transaction in all of them: * * - `'self'` (default) → the account pays from its own SOL. It is a native * Ed25519 system account, so it is signer and fee payer at once. * - `'sponsored'` → the Cavos relayer is fee payer and submits. * - `{ token }` → Toll is fee payer and settles in that token, paid * from the account's own token balance in the same transaction. */ private sendNative; /** * Quote first, because the amount owed has to be inside the message the user * signs — settling the fee and doing the thing are one transaction, so either * both happen or neither does. */ private sendViaToll; } export { CavosSolana as C, type InstructionAccount as I, type QuoteRequest as Q, type RecoverSolanaOptions as R, SOLANA_NETWORKS as S, TollClient as T, type ConnectSolanaOptions as a, type InstructionData as b, type SolanaNetwork as c, SolanaRelayer as d, type SolanaRelayerOptions as e, type TollClientOptions as f, type TollQuote as g };