/** * NEXUS: Cross-Chain Atomic Composability -- all-or-nothing signing across chains * * Submit a batch of signing operations spanning multiple wallets and chains. * Either all operations succeed and produce signatures, or the entire batch * is aborted atomically. This is essential for cross-chain arbitrage, bridge * transfers, and multi-leg DeFi strategies where partial execution would * leave funds stranded. * * The agent network coordinates via a 2-phase commit protocol: * Phase 1: All participating agents lock the wallets and produce partial sigs * Phase 2: Partial sigs are aggregated; if any operation fails, all are rolled back * * @example * ```typescript * import { Sequence0 } from '@sequence0/sdk'; * * const s0 = new Sequence0({ network: 'mainnet', ownerPrivateKey: '0x...' }); * * const result = await s0.signAtomic({ * operations: [ * { walletId: 'eth-wallet', chain: 'ethereum', message: '0xabc...' }, * { walletId: 'arb-wallet', chain: 'arbitrum', message: '0xdef...' }, * ], * deadlineBlocks: 50, * timeout: 60000, * }); * * if (result.status === 'committed') { * // All signatures available * for (const [reqId, sig] of result.signatures) { * console.log(`Request ${reqId}: ${sig}`); * } * } * ``` */ import { Chain } from './types'; export interface AtomicOperation { /** Wallet ID to sign with */ walletId: string; /** Target blockchain */ chain: Chain; /** Hex-encoded message to sign */ message: string; } export interface AtomicSignOptions { /** Array of operations to execute atomically */ operations: AtomicOperation[]; /** Max blocks to wait for completion (default: 50) */ deadlineBlocks?: number; /** Polling timeout in ms (default: 60000) */ timeout?: number; } export interface AtomicSignResult { /** Unique manifest identifier for this atomic batch */ manifestId: string; /** Final status: all succeeded ('committed') or all rolled back ('aborted') */ status: 'committed' | 'aborted'; /** Map of requestId to hex-encoded signature (only populated if committed) */ signatures: Map; /** Error message explaining why the batch was aborted (only if aborted) */ error?: string; } export interface AtomicOperationResult { /** Request ID for this individual operation */ requestId: string; /** Wallet ID that signed */ walletId: string; /** Chain this operation targeted */ chain: Chain; /** Hex-encoded signature (only if this operation succeeded) */ signature?: string; /** Error message (only if this operation failed, triggering abort) */ error?: string; } //# sourceMappingURL=atomic.d.ts.map