interface RelayFeedbackConfig { /** * ERC-8004 agentId (NFT tokenId) of the **target API** you are calling. */ agentId: string | number; /** * Whether the API call succeeded. */ success: boolean; /** * Elapsed milliseconds for the API call. */ responseTimeMs?: number; /** * Endpoint path of the called API (e.g. '/v1/data'). */ endpoint?: string; /** * Private key of the **relay/third-party** wallet that signs feedback. * MUST be different from the API owner's wallet — ReputationRegistry * may restrict self-feedback. Wallet needs CREDIT tokens on SKALE Base. * Default: process.env.FEEDBACK_WALLET_PRIVATE_KEY */ feedbackWalletPrivateKey?: string; /** * SKALE Base Sepolia RPC URL. * Default: process.env.ERC8004_RPC_URL or SKALE Base Sepolia public RPC. */ rpcUrl?: string; /** * ERC-8004 ReputationRegistry contract address. * Default: process.env.ERC8004_REPUTATION_REGISTRY */ reputationRegistryAddress?: string; } /** * Submit ERC-8004 on-chain feedback about a **third-party API** you called. * * Call this fire-and-forget from your relay/aggregator after every external API call. * Uses a separate relay wallet (not the API owner's key) to avoid self-feedback restrictions. * * Records: * - `successRate`: 10000 (= 100%) on success, 0 on failure — 2 decimal places * - `responseTime`: elapsed milliseconds * * @example * ```typescript * import { submitRelayFeedback } from '@relai-fi/x402/relay-feedback'; * * // after calling an external API: * const start = Date.now(); * const result = await fetch('https://other-api.com/data'); * submitRelayFeedback({ * agentId: '5', * success: result.ok, * responseTimeMs: Date.now() - start, * endpoint: '/data', * }); * ``` */ declare function submitRelayFeedback(config: RelayFeedbackConfig): void; export { type RelayFeedbackConfig, submitRelayFeedback };