import type { ChainType } from './agent.js'; export declare const SOLANA_GENESIS_HASHES: { readonly mainnet: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"; readonly devnet: "EtWTRABZaYq6iMfeYKouRu166VU2xqa1"; readonly testnet: "4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"; }; /** * Agent identity for x402 PaymentRequired responses * Format follows CAIP-2 for registry addresses */ export interface X402AgentIdentity { /** * Registry address in CAIP-2 format * EVM: "eip155::
" (e.g., "eip155:8453:0x1234...") * Solana: "solana::" (e.g., "solana:EtWTRA...:HHCVWc...") */ agentRegistry: string; /** * Agent identifier * EVM: Token ID (e.g., "123") * Solana: Asset public key (base58) */ agentId: string; } /** * Proof of payment from x402 settlement * Used to link feedback to actual payment transactions */ export interface X402ProofOfPayment { /** * Payer address * EVM: Hex address (0x...) * Solana: Base58 public key */ fromAddress: string; /** * Payee address * EVM: Hex address (0x...) * Solana: Base58 public key */ toAddress: string; /** * Chain identifier * EVM: Chain ID string (e.g., "8453" for Base) * Solana: Genesis hash (e.g., "EtWTRABZaYq6iMfeYKouRu166VU2xqa1") */ chainId: string; /** * Transaction hash/signature * EVM: Hex transaction hash (0x...) * Solana: Base58 transaction signature */ txHash: string; } /** * Settlement result from x402 payment flow * Enriched information about the completed payment */ export interface X402Settlement { /** Whether the settlement succeeded */ success: boolean; /** Transaction hash/signature (same as ProofOfPayment.txHash) */ transaction: string; /** Network in CAIP-2 format (e.g., "eip155:8453" or "solana:EtWTRA...") */ network: string; /** Settlement timestamp in ISO 8601 format */ settledAt: string; } /** * x402 tag conventions for feedback categorization */ export declare const X402_TAGS: { readonly CLIENT_TAGS: { readonly RESOURCE_DELIVERED: "x402-resource-delivered"; readonly DELIVERY_FAILED: "x402-delivery-failed"; readonly DELIVERY_TIMEOUT: "x402-delivery-timeout"; readonly QUALITY_ISSUE: "x402-quality-issue"; }; readonly SERVER_TAGS: { readonly GOOD_PAYER: "x402-good-payer"; readonly PAYMENT_FAILED: "x402-payment-failed"; readonly INSUFFICIENT_FUNDS: "x402-insufficient-funds"; }; readonly NETWORK_TAGS: { readonly EVM: "exact-evm"; readonly SVM: "exact-svm"; }; }; /** * Feedback file structure for IPFS storage * Conforms to x402 8004-reputation spec */ export interface X402FeedbackFile { /** Registry in CAIP-2 format */ agentRegistry: string; /** Agent ID (token ID or pubkey) */ agentId: string; /** Client address in CAIP-2 format (e.g., "solana:EtWTRA...:ClientPubkey...") */ clientAddress: string; /** Feedback creation timestamp (ISO 8601) */ createdAt: string; /** Raw metric value (serialized as string for JSON compatibility) */ value: string; /** Decimal precision (0-6), default 0 */ valueDecimals?: number; /** Feedback score (0-100), optional */ score?: number; /** Primary tag - delivery/payment status */ tag1: string; /** Secondary tag - network type */ tag2: string; /** Agent endpoint that was called */ endpoint?: string; /** Proof of payment linking feedback to transaction */ proofOfPayment: X402ProofOfPayment; /** Optional enriched settlement information */ x402Settlement?: X402Settlement; /** Optional comment */ comment?: string; } /** * Input for x402_feedback_submit tool */ export interface X402FeedbackSubmitInput { /** Agent ID (global format like sol:xxx or chain:chainId:tokenId) */ agentId: string; /** Raw metric value (required) */ value: bigint | number; /** Decimal precision (0-6), default 0 */ valueDecimals?: number; /** Feedback score (0-100), optional */ score?: number; /** Primary tag (delivery/payment status) */ tag1: string; /** Secondary tag (network type) */ tag2: string; /** Agent endpoint that was called */ endpoint?: string; /** Proof of payment */ proofOfPayment: X402ProofOfPayment; /** Optional settlement info */ x402Settlement?: X402Settlement; /** Optional comment */ comment?: string; /** Validate proof on-chain (default: false) */ validateProof?: boolean; /** Store feedback on IPFS (default: true) */ storeOnIpfs?: boolean; /** Return unsigned transaction (default: false) */ skipSend?: boolean; /** Signer public key if skipSend=true */ signer?: string; /** Chain override (optional if using global ID) */ chain?: string; } /** * Result from x402_feedback_submit when transaction is signed and sent */ export interface X402FeedbackSubmitSignedResult { unsigned: false; signature: string; feedbackFileHash: string; feedbackUri?: string; agentId: string; value: string; valueDecimals: number; score?: number; tag1: string; tag2: string; } /** * Result from x402_feedback_submit when skipSend=true (unsigned) */ export interface X402FeedbackSubmitUnsignedResult { unsigned: true; /** Base64 serialized transaction (Solana) or transaction object (EVM) */ unsignedTx: string | X402EvmUnsignedTx; feedbackFileHash: string; feedbackUri?: string; feedbackFile: X402FeedbackFile; message: string; hint: string; } /** * EVM unsigned transaction object for external wallet signing */ export interface X402EvmUnsignedTx { to: string; data: string; chainId: number; value: string; } export type X402FeedbackSubmitResult = X402FeedbackSubmitSignedResult | X402FeedbackSubmitUnsignedResult; /** * Helper to build CAIP-2 network identifier */ export declare function buildCaip2Network(chainType: ChainType, chainId: string | number): string; /** * Helper to build agent registry CAIP-2 identifier * @throws Error if registryAddress is undefined/empty (chain not deployed) */ export declare function buildRegistryIdentifier(chainType: ChainType, chainId: string | number, registryAddress: string | undefined): string; /** * Helper to build client address CAIP-2 identifier */ export declare function buildClientAddress(chainType: ChainType, chainIdOrCluster: string | number, address: string): string; /** * Convert X402FeedbackFile to a plain JSON-serializable object */ export declare function feedbackFileToRecord(file: X402FeedbackFile): Record; /** * Parse CAIP-2 network identifier */ export declare function parseCaip2Network(network: string): { namespace: 'eip155' | 'solana'; reference: string; } | null; /** * Get chain type from network tag */ export declare function getChainTypeFromNetworkTag(tag: string): ChainType | undefined; /** * Get network tag for chain type */ export declare function getNetworkTagForChainType(chainType: ChainType): string; //# sourceMappingURL=x402.d.ts.map