/** * Reconciliation and Settlement Module for TOSS * * Implements Section 9-10 of the TOSS Technical Paper: * - Synchronisation and reconciliation with onchain state * - Deterministic failure handling * - Conflict resolution */ import { Connection, PublicKey, Transaction } from '@solana/web3.js'; import type { SolanaIntent } from './intent'; /** * Result of intent settlement attempt */ export interface SettlementResult { intentId: string; status: 'success' | 'failed' | 'rejected'; signature?: string; error?: string; timestamp: number; } /** * State of a device's reconciliation with onchain */ export interface ReconciliationState { lastSyncTime: number; lastSyncSlot: number; processedIntents: string[]; failedIntents: string[]; conflictingIntents: string[]; } /** * Validates an intent can be settled with current onchain state */ export declare function validateIntentOnchain(intent: SolanaIntent, connection: Connection): Promise<{ valid: boolean; error?: string; }>; /** * Builds a Solana transaction from an intent */ export declare function buildTransactionFromIntent(intent: SolanaIntent, connection: Connection, feePayer?: PublicKey): Promise; /** * Submits a transaction to the network with confirmation */ export declare function submitTransactionToChain(transaction: Transaction, connection: Connection, maxRetries?: number): Promise; /** * GAP #7 FIX: Submit transaction to Arcium MXE program for confidential execution * Per TOSS Paper Section 7: "Arcium operates strictly before onchain execution" */ export declare function submitTransactionToArciumMXE(intent: SolanaIntent, connection: Connection, mxeProgramId: PublicKey, provider: any, // AnchorProvider maxRetries?: number): Promise; /** * Attempts to settle a single intent and returns the result */ export declare function settleIntent(intent: SolanaIntent, connection: Connection, feePayer?: PublicKey): Promise; /** * Core reconciliation: process all pending intents for settlement */ export declare function reconcilePendingIntents(connection: Connection, feePayer?: PublicKey): Promise; /** * Detects conflicts between local intents and onchain state */ export declare function detectConflicts(connection: Connection): Promise<{ intentId: string; conflict: string; }[]>; /** * Gets reconciliation state summary */ export declare function getReconciliationState(connection: Connection): Promise; //# sourceMappingURL=reconciliation.d.ts.map