/** * Client-Side Unshield Operations * * Generates ZK proofs ENTIRELY in the browser. * Spending keys NEVER leave the browser. * * Flow: * 1. User signs message → derive keys locally * 2. Fetch UTXOs from API (no keys sent) * 3. Generate ZK proof with snarkjs (client-side) * 4. User signs and sends transaction * * First-time users: 25-60 seconds (artifact download + proof) * Returning users: 5-15 seconds (proof only, artifacts cached) */ import type { Signer } from 'ethers'; import type { SupportedToken } from './local-config'; import { type ChangeNoteInfo } from './proof-inputs'; export interface UnshieldOptions { amount: string; token: SupportedToken; recipientAddress: string; signer: Signer; network?: 'mainnet' | 'testnet'; chainId?: number; onProgress?: (progress: number, status: string) => void; } export interface UnshieldResult { hash: string; hashes?: string[]; amount: string; to: string; totalReceiveAmountWei?: string; } /** * Unshield tokens from Railgun to incognito wallet * * TRUE CLIENT-SIDE IMPLEMENTATION: * - Keys derived locally from signature * - UTXOs fetched from indexed API (no keys sent) * - ZK proof generated with snarkjs in browser * - Spending keys NEVER leave the browser * * @param options - Unshield configuration * @returns Transaction result */ export declare function unshieldTokens(options: UnshieldOptions): Promise; /** * Options for partial unshield */ export interface PartialUnshieldOptions { amount: string; token: SupportedToken; recipientAddress: string; signer: Signer; network?: 'mainnet' | 'testnet'; chainId?: number; onProgress?: (progress: number, status: string) => void; } /** * Result of partial unshield including change note info */ export interface PartialUnshieldResult { hash: string; unshieldedAmount: string; changeNote: ChangeNoteInfo; } /** * Partial unshield - unshield a specific amount and keep the rest shielded * * Uses 01x02 circuit (1 input, 2 outputs): * - Output 1: Unshield amount → sent to recipient * - Output 2: Change → new shielded UTXO back to self * * @param options - Partial unshield configuration * @returns Transaction result with change note info */ export declare function partialUnshieldTokens(options: PartialUnshieldOptions): Promise;