/** * PRISM: Verifiable Solvency Protocol * * Continuous, cryptographic proof-of-reserves across 94 chains. * Exchanges prove solvency in real-time via threshold attestations * and ZK range proofs. WASM policies prevent transactions that * would cause insolvency. * * @example * ```typescript * import { SolvencyClient } from '@sequence0/sdk'; * * const solvency = new SolvencyClient({ baseUrl: 'http://agent:8080' }); * const exchange = await solvency.registerExchange({ * name: 'MyExchange', * chains: ['ethereum', 'bitcoin', 'solana'], * }); * * const attestation = await solvency.requestAttestation({ * exchangeId: exchange.exchangeId, * addresses: { * ethereum: ['0x...hot', '0x...cold'], * bitcoin: ['bc1q...'], * solana: ['DYw8j...'], * }, * liabilitiesRoot: '0x...', * }); * ``` */ /** * Options for registering an exchange with the Verifiable Solvency Protocol. */ export interface RegisterExchangeOptions { /** Human-readable exchange name */ name: string; /** Chains the exchange operates on (e.g., ['ethereum', 'bitcoin', 'solana']) */ chains: string[]; } /** * Information about a registered exchange. */ export interface ExchangeInfo { /** Unique exchange identifier */ exchangeId: string; /** Human-readable exchange name */ name: string; /** On-chain owner address of the exchange registration */ ownerAddress: string; /** Chains the exchange has registered for solvency proofs */ chains: string[]; /** ISO 8601 timestamp of registration */ registeredAt: string; /** Whether the exchange is currently active */ isActive: boolean; /** Total number of attestations completed */ totalAttestations: number; /** ISO 8601 timestamp of the most recent attestation (undefined if none) */ lastAttestationAt?: string; } /** * Request for a solvency attestation across multiple chains. * The exchange provides its addresses on each chain and a * Merkle root of its liabilities for ZK verification. */ export interface AttestationRequest { /** Exchange ID to attest solvency for */ exchangeId: string; /** Map of chain name to list of addresses (hot + cold wallets) */ addresses: Record; /** Hex-encoded Merkle root of the exchange's liabilities tree */ liabilitiesRoot: string; } /** * Cryptographic proof of a balance on a single chain/address. * Verified by threshold agents reading on-chain state. */ export interface BalanceProof { /** Chain the balance was verified on */ chain: string; /** Address whose balance was verified */ address: string; /** Verified balance in the chain's smallest denomination */ balance: string; /** Block number at which the balance was read */ blockNumber: number; /** Whether the balance proof was verified by threshold agents */ verified: boolean; } /** * A completed solvency attestation — the cryptographic proof that * an exchange's total assets exceed its total liabilities across * all registered chains. */ export interface SolvencyAttestation { /** Unique attestation identifier */ attestationId: string; /** Exchange this attestation is for */ exchangeId: string; /** Hex-encoded hash of the aggregated asset proofs */ assetsHash: string; /** Hex-encoded hash of the liabilities Merkle root */ liabilitiesHash: string; /** Whether assets >= liabilities (the solvency verdict) */ isSolvent: boolean; /** Unix timestamp of the attestation */ timestamp: number; /** Block number on the Sequence0 chain where the attestation was anchored */ blockNumber: number; /** Number of chains included in the attestation */ totalChains: number; /** Hex-encoded threshold signature from the agent committee */ signature: string; } /** * Status of an in-progress solvency attestation. * * - `pending` — request received, agents are being coordinated * - `verifying` — agents are reading on-chain balances and computing proofs * - `complete` — attestation is finalized with a threshold signature * - `failed` — attestation could not be completed (e.g., insufficient agents) */ export type AttestationStatus = 'pending' | 'verifying' | 'complete' | 'failed'; /** * Response for polling the status of an attestation request. */ export interface AttestationStatusResponse { /** The attestation request ID */ attestationId: string; /** Current status of the attestation process */ status: AttestationStatus; /** Number of chains verified so far (only during 'verifying' status) */ chainsVerified?: number; /** Total number of chains to verify (only during 'verifying' status) */ chainsTotal?: number; /** The completed attestation (only when status is 'complete') */ attestation?: SolvencyAttestation; } /** * Client for the PRISM Verifiable Solvency Protocol. * * Communicates with solvency endpoints on the agent node to register * exchanges, request attestations, and query attestation history. */ export declare class SolvencyClient { private baseUrl; /** * Create a new SolvencyClient. * * @param options - Client configuration * @param options.baseUrl - Agent node HTTP endpoint URL */ constructor(options: { baseUrl: string; }); /** * Register a new exchange with the Verifiable Solvency Protocol. * * @param options - Exchange registration details * @returns The registered exchange information * * @throws {Sequence0Error} If the registration parameters are invalid * @throws {NetworkError} If the agent is unreachable */ registerExchange(options: RegisterExchangeOptions): Promise; /** * Request a solvency attestation for an exchange. * * Agents will read on-chain balances for all provided addresses, * verify the liabilities root, and produce a threshold-signed * attestation if the exchange is solvent. * * @param request - Attestation request details * @returns The attestation request ID for polling status * * @throws {Sequence0Error} If the request parameters are invalid * @throws {NetworkError} If the agent is unreachable */ requestAttestation(request: AttestationRequest): Promise<{ attestationId: string; }>; /** * Get the current status of an attestation request. * * @param attestationId - The attestation request ID * @returns Current status and, if complete, the attestation * * @throws {Sequence0Error} If the attestation ID is invalid * @throws {NetworkError} If the agent is unreachable */ getAttestationStatus(attestationId: string): Promise; /** * Get the latest completed solvency attestation for an exchange. * * @param exchangeId - The exchange ID * @returns The latest attestation, or null if no attestations exist * * @throws {NetworkError} If the agent is unreachable */ getLatestAttestation(exchangeId: string): Promise; /** * Get attestation history for an exchange. * * @param exchangeId - The exchange ID * @param limit - Max number of attestations to return (default: 20) * @returns Array of attestations, most recent first * * @throws {NetworkError} If the agent is unreachable */ getAttestationHistory(exchangeId: string, limit?: number): Promise; /** * List all registered exchanges. * * @returns Array of exchange info objects * * @throws {NetworkError} If the agent is unreachable */ listExchanges(): Promise; private get; private post; private mapExchangeResponse; private mapAttestationResponse; } //# sourceMappingURL=solvency.d.ts.map