/** * NEXUS: Atomic Composability Client * * All-or-nothing signing across multiple wallets and chains. * Submit a batch of signing operations -- either all succeed and * produce signatures, or the entire batch is aborted atomically. * * 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 wallets and produce partial sigs * Phase 2: Partial sigs are aggregated; if any operation fails, all roll back * * @example * ```typescript * import { NexusClient } from '@sequence0/sdk'; * * const nexus = new NexusClient({ baseUrl: 'http://agent:8080' }); * * const result = await nexus.signAtomic({ * operations: [ * { walletId: 'eth-wallet', chain: 'ethereum', message: '0xabc...' }, * { walletId: 'arb-wallet', chain: 'arbitrum', message: '0xdef...' }, * ], * deadlineBlocks: 50, * timeout: 60000, * }); * * if (result.status === 'committed') { * for (const [reqId, sig] of result.signatures) { * console.log(`Request ${reqId}: ${sig}`); * } * } * ``` */ import { AtomicSignOptions, AtomicSignResult } from './atomic'; /** * Status of an atomic signing manifest. * * - `pending` — manifest received, agents are being coordinated * - `locking` — Phase 1: agents are locking wallets and creating partial sigs * - `committed` — Phase 2 complete: all operations signed successfully * - `aborted` — at least one operation failed; all signatures rolled back * - `expired` — manifest timed out before completion */ export type ManifestStatus = 'pending' | 'locking' | 'committed' | 'aborted' | 'expired'; /** * Client for the NEXUS Atomic Composability protocol. * * Communicates with atomic signing endpoints on the agent node to * submit multi-wallet, multi-chain signing manifests, poll status, * and wait for completion. */ export declare class NexusClient { private baseUrl; /** * Create a new NexusClient. * * @param options - Client configuration * @param options.baseUrl - Agent node HTTP endpoint URL */ constructor(options: { baseUrl: string; }); /** * Submit an atomic signing manifest. * * All operations in the batch are executed atomically via a 2-phase * commit protocol. If any operation fails, all are rolled back. * * @param options - Atomic signing parameters * @returns The manifest result (committed with signatures, or aborted with error) * * @throws {Sequence0Error} If the parameters are invalid * @throws {TimeoutError} If the manifest does not complete within the timeout * @throws {NetworkError} If the agent is unreachable */ signAtomic(options: AtomicSignOptions): Promise; /** * Get the current status of an atomic signing manifest. * * @param manifestId - The manifest ID to query * @returns The manifest status and, if complete, the signatures * * @throws {Sequence0Error} If the manifest ID is invalid * @throws {NetworkError} If the agent is unreachable */ getManifestStatus(manifestId: string): Promise; /** * Wait for an atomic signing manifest to reach a terminal state. * * Polls the manifest status endpoint at 2-second intervals until * the manifest is committed, aborted, or the timeout is exceeded. * * @param manifestId - The manifest ID to wait for * @param timeoutMs - Max time to wait in ms (default: 60000) * @returns The completed manifest result * * @throws {TimeoutError} If the manifest does not complete within the timeout * @throws {Sequence0Error} If the manifest is aborted or expired * @throws {NetworkError} If the agent is unreachable */ waitForCompletion(manifestId: string, timeoutMs?: number): Promise; private get; private post; private mapAtomicResponse; } //# sourceMappingURL=nexus.d.ts.map