import type { EVMTransaction, SolTransaction, TransactionResult, AuthProvider, User, SetOptions } from '@pooflabs/core'; import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js'; export declare class PrivyWalletProvider implements AuthProvider { private static instance; private containerElement; private networkUrl; private chainId; private root; private privyMethods; private privyConfig; private pendingLogin; private pendingTransaction; private pendingSignTransaction; private pendingSignMessage; private pendingSignAndSubmitTransaction; constructor(appName: string | null, appLogoUrl: string | null, privyConfig?: { appId: string; config: any; }, networkUrl?: string | null); static getInstance(appName: string | null, appLogoUrl: string | null, privyConfig: any): PrivyWalletProvider; private initialize; login(): Promise; getNativeMethods(): Promise; /** * Opens Privy's hosted export modal so the user can reveal/copy the private key * for their embedded Solana wallet. The key is assembled on Privy's origin — * neither this SDK nor the host app ever receives it. Only available for Privy * embedded wallets (email login); throws otherwise. */ exportWallet(address?: string): Promise; logout(): Promise; runTransaction(_evmTransactionData?: EVMTransaction, solTransactionData?: SolTransaction, options?: SetOptions): Promise; /** * Signs a Solana transaction without submitting it. * * This method handles blockhash automatically if not set - you do NOT need to * set recentBlockhash on the transaction before calling this method. * The network/RPC URL is derived from the provider's configuration (set during initialization). * * @param transaction - The transaction to sign (Transaction or VersionedTransaction) * @returns The signed transaction */ signTransaction(transaction: Transaction | VersionedTransaction): Promise; /** * Signs and submits a Solana transaction to the network. * * This method handles blockhash and transaction confirmation automatically - you do NOT need to * set recentBlockhash or lastValidBlockHeight on the transaction before calling this method. * The network/RPC URL is derived from the provider's configuration (set during initialization). * * @param transaction - The transaction to sign and submit (Transaction or VersionedTransaction) * @param feePayer - Optional fee payer public key. If not provided and the transaction doesn't * already have a feePayer set, the connected wallet address will be used. * Useful for co-signing scenarios where a different account pays the fees. * @returns The transaction signature */ signAndSubmitTransaction(transaction: Transaction | VersionedTransaction, feePayer?: PublicKey): Promise; private getRpcUrl; /** * Internal sign transaction - serializes and signs via Privy * Returns the raw result from Privy (Uint8Array) * This mirrors exactly what runTransaction was doing */ private signTransactionRaw; /** * Deserialize a signed transaction from Uint8Array to Transaction object */ private deserializeSignedTransaction; /** * Internal sign and submit - handles Surfnet vs non-Surfnet logic * This is the core submission logic used by both signAndSubmitTransaction and runTransaction * * For Surfnet: sign with signTransactionRaw, then sendRawTransaction * For non-Surfnet: use Privy's signAndSendTransaction (combined operation) */ private signAndSubmitInternal; signMessage(message: string): Promise; restoreSession(): Promise; private createSession; /** * Waits for a wallet matching the session address to appear in the wallets array. * This handles the timing gap where Privy's embedded wallet (created for email login users) * may not yet be in the useWallets() array when signTransaction is called immediately after login. */ private waitForMatchingWallet; private ensureReady; }