import * as anchor from "@coral-xyz/anchor"; import { PublicKey } from "@solana/web3.js"; import { AttestationResponse, BalanceResponse, ChannelFinalizeResponse, ChannelRequestResponse, CloseChannelResponse, OpenChannelResponse, ParticipantReceiptResponse, Subly402VaultClientConfig } from "./types"; /** * Subly402 vault client SDK — deposit, withdraw, and direct enclave fetch. */ export declare class Subly402VaultClient { private wallet; private vaultAddress; private enclaveUrl; private connection; private cachedAttestation; private latestClientReceipt; private nitroAttestation; private attestationVerifier; constructor(config: Subly402VaultClientConfig); /** Verify enclave attestation. Caches result. */ verifyAttestation(): Promise; private verifyLocalAttestationDocument; /** * Deposit USDC into the vault on-chain. * @param amount Amount in atomic units (e.g., 1_000_000 = 1 USDC) * @param program Anchor program instance */ deposit(amount: number, program: anchor.Program, usdcMint: PublicKey): Promise; /** * Withdraw USDC from the vault. Requests authorization from enclave. * @param amount Amount in atomic units * @param program Anchor program instance */ withdraw(amount: number, program: anchor.Program, usdcMint: PublicKey): Promise; /** Query client balance from enclave. */ getBalance(): Promise; /** * Request a signed ParticipantReceipt from the enclave. * Used for force-settle (emergency withdrawal when enclave is down). */ getReceipt(usdcMint: PublicKey): Promise; /** Return the most recently cached client receipt, if any. */ getLatestClientReceipt(): ParticipantReceiptResponse | null; /** Restore or update the cached client receipt. */ rememberClientReceipt(receipt: ParticipantReceiptResponse): void; /** * Initiate a force settle using a ParticipantReceipt. * Used when the enclave is unresponsive and funds need to be recovered. */ forceSettle(receipt: ParticipantReceiptResponse | undefined, program: anchor.Program): Promise; /** * Finalize a previously initiated force settle after the dispute window elapses. */ finalizeForceSettle(program: anchor.Program, receipt?: ParticipantReceiptResponse): Promise; /** * Fetch a URL with automatic x402 payment handling. * If the server returns 402, constructs and sends payment signature. */ fetch(url: string, options?: RequestInit): Promise; /** * Open an Atomic Service Channel with a provider. * @param providerId Provider identifier * @param initialDeposit Amount to lock in the channel (atomic units) */ openChannel(providerId: string, initialDeposit: number): Promise; /** * Submit a request within an open channel (locks funds for this request). */ channelRequest(channelId: string, requestId: string, amount: number, requestHash: string): Promise; /** * Finalize an off-chain exchange by providing the adaptor secret. * Returns the decrypted result. */ channelFinalize(channelId: string, adaptorSecret: string): Promise; /** * Close an ASC and settle accumulated provider earnings. */ closeChannel(channelId: string): Promise; private buildClientAuth; private buildPaymentPayload; private signTextMessage; } //# sourceMappingURL=client.d.ts.map