import { Hash, Address } from 'viem'; import { CovenantSDK, CovenantConfigV2, InsuranceClaimData, MemberInfo, DisputeData, ReceiptType, ReceiptDataV2, V2ContractAddresses } from './index.js'; import '@covenant/shared-types'; /** * COVENANT SDK V2 — extends CovenantSDK with v2 contract methods. * * Adds support for InsurancePool, DisputeResolution, and ReceiptVerifier v2. * All v1 methods remain available through inheritance. * * @example * ```typescript * import { CovenantSDKV2 } from "@covenant/sdk/v2"; * * const sdk = new CovenantSDKV2({ * version: "v2", * chainId: 84532, * publicClient: client, * walletClient: wallet, * }); * * // V2 methods * await sdk.joinInsurancePool(parseEther("0.01")); * const receipt = await sdk.createReceiptV2(issuer, counterparty, 0, dataHash); * ``` */ declare class CovenantSDKV2 extends CovenantSDK { private v2Addresses; constructor(config: CovenantConfigV2); /** * Join the insurance pool by contributing ETH */ joinInsurancePool(contribution: bigint): Promise; /** * File an insurance claim for a failed task */ fileClaim(taskId: bigint, amount: bigint): Promise; /** * Get insurance claim details */ getClaim(claimId: bigint): Promise; /** * Get the current balance of the insurance pool */ getPoolBalance(): Promise; /** * Get insurance membership info for an agent */ getMemberInfo(member: Address): Promise; /** * File a formal dispute on a task (requires bond in ETH) */ fileDispute(taskId: bigint, bond: bigint): Promise; /** * Resolve a dispute (arbiter-only). Sets winner and worker share. */ resolveDispute(disputeId: bigint, workerWins: boolean, workerShare: bigint): Promise; /** * Get dispute details */ getDispute(disputeId: bigint): Promise; /** * Create an ERC-8004 attestation receipt with enum type */ createReceiptV2(issuer: Address, counterparty: Address, receiptType: ReceiptType, dataHash: `0x${string}`): Promise; /** * Verify a single receipt by its bytes32 ID */ verifyReceipt(receiptId: `0x${string}`): Promise; /** * Batch verify multiple receipts by their bytes32 IDs */ batchVerifyReceipts(receiptIds: `0x${string}`[]): Promise; /** * Get full receipt details by bytes32 ID */ getReceiptV2(receiptId: `0x${string}`): Promise; /** * Get v2 contract addresses being used */ getV2Addresses(): V2ContractAddresses; } /** * Convert a string (IPFS CID, capability string, etc.) to a bytes32 hash. * Uses keccak256 for deterministic hashing. * * @param input - The string to convert * @returns The bytes32 hex string (0x-prefixed, 66 chars) * * @example * ```typescript * import { toBytes32 } from "@covenant/sdk/v2"; * * const hash = toBytes32("QmYwAPJzv5CZsnN625s3XfREM3zN1"); // IPFS CID * const cap = toBytes32("data-analysis"); // capability string * ``` */ declare function toBytes32(input: string): `0x${string}`; export { CovenantConfigV2, CovenantSDKV2, DisputeData, InsuranceClaimData, MemberInfo, ReceiptDataV2, ReceiptType, V2ContractAddresses, toBytes32 };