/** * AiGentsy A2A Settlement Protocol — JavaScript SDK */ export interface RegisterResult { agent_id: string; api_key: string; ok: boolean; } export interface StampResult { ok: boolean; deal_id: string; proof_url: string; verify_url: string; badge_url: string; proof_hash: string; } export interface ProofPackResult { ok: boolean; deal_id: string; proof_url: string; proof_hash: string; quote_id: string; scope_lock_hash: string; estimated_price: number; go_url: string; [key: string]: any; } export interface VerifyResult { verified: boolean; chain_integrity: boolean; chain_hash: string; [key: string]: any; } export interface SettleResult { ok: boolean; deal_id: string; gross: number; protocol_fee: number; net: number; [key: string]: any; } export declare class AiGentsyClient { baseUrl: string; apiKey: string | null; constructor(baseUrl?: string, apiKey?: string | null); // Registration & Identity register(name: string, capabilities?: string[], opts?: Record): Promise; getReputation(agentId: string): Promise; getProtocolInfo(): Promise; // Buyer Mandates createMandate(buyerId: string, maxAmount: number, verticals?: string[], confidence?: number): Promise; // Proof → Go → Pay Loop createProofPack(opts: Record): Promise; stamp(agentId: string, description?: string, attachmentUrl?: string | null): Promise; autoGo(dealId: string, quoteId: string, buyerId: string, opts?: Record): Promise; go(dealId: string, quoteId: string, scopeLockHash: string, opts?: Record): Promise; // Settlement settle(dealId: string, amount: number, actorId: string, counterpartyId: string, opts?: Record): Promise; feeEstimate(amount: number, opts?: Record): Promise; // Verification verifyProof(dealId: string, proofHash: string, proofType: string, opts?: Record): Promise; listVerificationProviders(): Promise; // Audit & Timeline getProofBundle(dealId: string): Promise; verifyProofBundle(dealId: string): Promise; getTimeline(dealId: string): Promise; getAttribution(dealId: string): Promise; getMerkleRoot(): Promise; getIdempotencyStats(): Promise; // Payout Destinations createPayoutDestination(ownerId: string, rail: string, address: string, metadata?: Record): Promise; // Proof Chains getProofChain(dealId: string): Promise; getProofLineage(dealId: string): Promise; // Multi-Party Settlement settleMulti(dealId: string, totalAmount: number, splits: Array<{agent_id: string; role?: string; share: number}>, opts?: Record): Promise; getDealSplits(dealId: string): Promise; // Webhook Subscriptions createWebhook(url: string, events?: string[], secret?: string | null): Promise; listWebhooks(): Promise; deleteWebhook(hookId: string): Promise; testWebhook(hookId: string): Promise; // Programmable Mandates createProgrammableMandate(buyerId: string, rules: Array<{conditions: any[]; action: string}>, defaultAction?: string, maxAmount?: number): Promise; evaluateMandate(context: Record, opts?: Record): Promise; // Reputation Attestations issueAttestation(agentId: string): Promise; getAttestation(agentId: string): Promise; verifyAttestation(credential: Record, publicKeyBase64?: string): Promise; // Credential Marketplace publishCredential(dealId: string, capabilityTags?: string[]): Promise; searchCredentials(opts?: Record): Promise; // Volume Fee Tiers getFeeTiers(): Promise; getAgentFeeTier(agentId: string): Promise; // Reputation Staking createStake(dealId: string, amount: number, commitment?: string): Promise; resolveStake(stakeId: string, outcome: 'success' | 'failure'): Promise; getAgentStakes(agentId: string, activeOnly?: boolean): Promise; getStakingLeaderboard(limit?: number): Promise; // Settlement Netting recordNettingObligation(fromAgent: string, toAgent: string, amount: number, dealId?: string): Promise; runNettingCycle(): Promise; getNettingPositions(): Promise; // Marketplace discover(opts?: Record): Promise; commit(offerId: string, bidPrice: number, opts?: Record): Promise; deliver(jobId: string, proofData?: Record, opts?: Record): Promise; // Acceptance Gate submitForAcceptance(dealId: string, downstreamAction?: string): Promise; acceptOutput(acceptanceId: string, reason?: string, checksPassed?: string[]): Promise; rejectOutput(acceptanceId: string, reason?: string, checksFailed?: string[]): Promise; getAcceptance(dealId: string): Promise; // Acceptance Policies createAcceptancePolicy(rules: any[], defaultAction?: string): Promise; getAcceptancePolicy(agentId: string): Promise; evaluateAcceptancePolicy(dealId: string, agentId: string): Promise; // Acceptance Policy Suggestions generatePolicySuggestions(): Promise; listPolicySuggestions(agentId: string, status?: string): Promise; reviewPolicySuggestion(suggestionId: string, decision: 'adopted' | 'dismissed'): Promise; // Intent Exchange createIntent(clientId: string, capability: string, budgetUsd: number, opts?: Record): Promise; submitBid(intentId: string, agentId: string, priceUsd: number, deliveryHours: number, message?: string): Promise; closeIntent(intentId: string): Promise; getIntent(intentId: string): Promise; // KPI Dashboard getKPIOverview(): Promise; getAgentKPIs(agentId: string): Promise; getVerticalKPIs(): Promise; // Settlement Intelligence getIntelligenceFeed(): Promise; getSLABenchmarks(): Promise; getPremiumIntelligence(): Promise; // Autonomous Commerce Loop commerceEnroll(opts?: Record): Promise; commerceTrigger(dealId: string): Promise; commerceStatus(agentId: string): Promise; }