import { Keypair, PublicKey } from '@solana/web3.js'; import type { SolanaIntent, IntentStatus } from '../intent'; import { type SyncResult } from '../sync'; export type TossConfig = { projectId: string; mode?: 'devnet' | 'testnet' | 'mainnet-beta'; privateTransactions?: boolean; provider?: any; sync?: { syncBackupDb?: boolean; dbUrl?: string; }; rpcUrl?: string; maxRetries?: number; retryDelay?: number; feePayer?: Keypair; }; export declare class TossClient { private connection; private config; private nonceAccount?; private nonceAuth?; static createClient(config: TossConfig): TossClient; private constructor(); private getDefaultRpcUrl; private withRetry; /** * Initialize a nonce account for durable transactions * @param amount SOL amount to fund the nonce account with (default: 1 SOL) * @returns Object containing nonce account and authority public keys */ initializeNonceAccount(amount?: number): Promise<{ nonceAccount: string; nonceAuth: string; }>; /** * Get the current nonce value from the nonce account * @returns The current nonce value as a base58 string */ getCurrentNonce(): Promise; createIntent(sender: Keypair | 'current', recipient: PublicKey | string, amount: number, feePayer?: PublicKey | string, options?: { expiresIn?: number; nonce?: number; useDurableNonce?: boolean; memo?: string; }): Promise; getIntents(): Promise; updateIntentStatus(intentId: string, status: IntentStatus, error?: string): Promise; sync(): Promise; /** * Full synchronisation with Solana blockchain (TOSS Section 9) * * Performs complete reconciliation: * - Detects conflicts with onchain state * - Settles all pending intents * - Updates local state deterministically * * @returns Complete sync results including settlements, conflicts, and final state */ fullSync(): Promise; /** * Check synchronisation status without settling * * Lightweight operation to query current reconciliation state * without committing any settlements to the blockchain. */ checkSyncStatus(): Promise; /** * Detect conflicts between local intents and onchain state * * Useful for monitoring and alerting users to potential issues * before attempting settlement. */ detectIntentConflicts(): Promise<{ intentId: string; conflict: string; }[]>; /** * Get current reconciliation state * * Returns summary of processed, failed, and conflicting intents * for UI updates or logging. */ getReconciliationStatus(): Promise; /** * Create an intent from the current user's wallet */ /** * Create an intent using an explicit Keypair for the sender. * Use this method from non-React contexts. For React apps, use * WalletProvider.createUserIntent helper wrappers that call * TossClient.createIntent with the unlocked keypair. */ createUserIntent(senderKeypair: Keypair, recipient: PublicKey | string, amount: number, options?: { memo?: string; useDurableNonce?: boolean; }): Promise; /** * The following helper methods require a WalletProvider (React) context. * TossClient is framework-agnostic; if you need these features from a * React app, use the WalletProvider utilities instead. */ getCurrentUserAddress(): string | null; isWalletUnlocked(): boolean; lockWallet(): Promise; signOut(): Promise; } //# sourceMappingURL=TossClient.d.ts.map