uvd-x402-sdk 2.73.0 → 2.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1547,6 +1547,39 @@ interface SubmitRelayFeedbackRequest {
1547
1547
  /** Required only when `prepare` answered `delegated: false` */
1548
1548
  authorization?: RelayAuthorizationParams;
1549
1549
  }
1550
+ /**
1551
+ * Request body for `POST /feedback/response/evm/prepare`.
1552
+ *
1553
+ * `responder` is the address the chain will record as the author.
1554
+ */
1555
+ interface PrepareRelayResponseRequest {
1556
+ x402Version: 1 | 2;
1557
+ network: Erc8004Network;
1558
+ responder: string;
1559
+ agentId: number | string;
1560
+ /** WHOSE feedback is being answered — inside the signed struct. */
1561
+ clientAddress: string;
1562
+ /** Which feedback (1-indexed) — also inside the struct. */
1563
+ feedbackIndex: number;
1564
+ responseUri: string;
1565
+ responseHash?: string;
1566
+ }
1567
+ /** Request body for `POST /feedback/response/evm/submit`. */
1568
+ interface SubmitRelayResponseRequest {
1569
+ x402Version: 1 | 2;
1570
+ network: Erc8004Network;
1571
+ responder: string;
1572
+ agentId: number | string;
1573
+ clientAddress: string;
1574
+ feedbackIndex: number;
1575
+ responseUri: string;
1576
+ responseHash?: string;
1577
+ deadline: number;
1578
+ nonce: string;
1579
+ /** The responder's signature over the typed data. */
1580
+ signature: string;
1581
+ authorization?: RelayAuthorizationParams;
1582
+ }
1550
1583
  /**
1551
1584
  * Proof of payment returned when settling with ERC-8004 extension
1552
1585
  */
@@ -2174,11 +2207,50 @@ declare class Erc8004Client {
2174
2207
  supportedNetworks: Erc8004Network[];
2175
2208
  version: string;
2176
2209
  }>;
2210
+ /**
2211
+ * Ask what the RESPONDER must sign to author a response on-chain.
2212
+ *
2213
+ * The mirror of {@link prepareRelayedFeedback}, for the other write the
2214
+ * registry accepts from anybody. `appendResponse` is not agent-only — the
2215
+ * registry takes it from any address — so on the plain {@link appendResponse}
2216
+ * route the `responder` recorded on-chain is the FACILITATOR. That does not
2217
+ * destroy anyone's reputation the way a revoke would; it ties the
2218
+ * facilitator's on-chain identity to a third party's content, which is its own
2219
+ * kind of wrong.
2220
+ *
2221
+ * **v4 delegates only.** The v3 delegate accepts exactly two selectors and
2222
+ * `appendResponse` is not one of them, so a v3 network answers 400
2223
+ * `relay_response_needs_v4` rather than silently falling back to the route
2224
+ * this replaces.
2225
+ *
2226
+ * `clientAddress` and `feedbackIndex` are inside the signed struct: without
2227
+ * them one signature would answer any client's rating, or any rating at that
2228
+ * index.
2229
+ */
2230
+ prepareRelayedResponse(request: PrepareRelayResponseRequest): Promise<PrepareRelayFeedbackResponse>;
2231
+ /**
2232
+ * Relay a responder-authored response; the facilitator pays the gas.
2233
+ *
2234
+ * Pass back the same parameters, `deadline` and `nonce` that
2235
+ * {@link prepareRelayedResponse} returned: the facilitator rebuilds the struct
2236
+ * from them and refuses to relay anything the signature does not cover.
2237
+ */
2238
+ submitRelayedResponse(request: SubmitRelayResponseRequest): Promise<FeedbackResponse>;
2239
+ /** Shared POST for the relay routes: a refusal is data, never a throw. */
2240
+ private postRelay;
2177
2241
  /**
2178
2242
  * Append a response to existing feedback
2179
2243
  *
2180
- * Allows agents to respond to feedback they received.
2181
- * Only the agent (identity owner) can append responses.
2244
+ * @deprecated On this route the facilitator is the AUTHOR: the registry
2245
+ * records `msg.sender` as the `responder`, and that is the facilitator's
2246
+ * wallet. Where the delegate is **v4**, use {@link prepareRelayedResponse} +
2247
+ * {@link submitRelayedResponse} instead. This route still works and is the
2248
+ * only one available where the delegate is still v3.
2249
+ *
2250
+ * **This is NOT agent-only**, despite what this comment claimed until
2251
+ * 2026-08-25. Verified on-chain on 2026-08-18: the registry accepts
2252
+ * `appendResponse` from ANY address. There is no identity-owner check, here or
2253
+ * in the contract.
2182
2254
  *
2183
2255
  * @param network - Network where feedback was submitted
2184
2256
  * @param agentId - Agent ID
@@ -2766,4 +2838,4 @@ declare class AdvancedEscrowClient {
2766
2838
  private sendViaAdapter;
2767
2839
  }
2768
2840
 
2769
- export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentId, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, type AtomStats, BASE_MAINNET_CONTRACTS, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarRegisterOptions, type BazaarResource, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type DiscoveryAccepts, type DiscoveryCuration, type DiscoveryHealth, type DiscoveryHealthStatus, type DiscoveryListOptions, type DiscoveryPagination, type DiscoveryRegisterOptions, type DiscoveryResource, type DiscoveryResponse, type DiscoverySource, type DiscoveryStats, type DiscoveryTier, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, ESCROW_CONTRACTS, ESCROW_TIMEOUT_MS, Erc8004Client, type Erc8004ClientOptions, Erc8004LookupError, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStateResponse, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, HEALTH_FILTERS, type HonoMiddlewareOptions, type IdentityByOwnerResponse, type IdentityMetadataResponse, type IdentityTotalSupplyResponse, MAX_SEARCH_LEN, type MetadataEntryParam, OPERATOR_ABI, OPERATOR_ABI_CREATE3, PAYMENT_INFO_TYPEHASH, type PaymentAcceptance, type PaymentMiddlewareOptions, type PaymentPayloadV2, type PaymentRequirementResolver, type PaymentRequirements, type PaymentRequirementsOptions, type PaymentRequirementsV2, type PrepareRelayFeedbackRequest, type PrepareRelayFeedbackResponse, type ProofOfPayment, RELAYED_FEEDBACK_NETWORKS, type RefundRequest, type RefundStatus, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterJobResponse, type RegisterJobStatus, RegistrationPendingError, type RelayAuthorizationParams, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type ResourceInfoV2, type SettleRequest, type SettleRequestV2, type SettleResponse, type SettleResponseWithProof, type SubmitRelayFeedbackRequest, TIER_FILTERS, TIER_TIMINGS, USDC_DOMAIN_NAME, type VerifiedPaymentState, type VerifyRequest, type VerifyRequestV2, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildSettleRequestV2, buildVerifyRequest, buildVerifyRequestV2, canRefundEscrow, canReleaseEscrow, create402Response, createHonoMiddleware, createPaymentMiddleware, epochToDate, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, getEscrowContractsByChainId, getEscrowSupportedChainIds, isAlive, isEscrowExpired, isEscrowSupportedOnChain, isRegisterJobTerminal, parsePaymentHeader, supportsRelayedFeedback, wireNetwork };
2841
+ export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentId, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, type AtomStats, BASE_MAINNET_CONTRACTS, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarRegisterOptions, type BazaarResource, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type DiscoveryAccepts, type DiscoveryCuration, type DiscoveryHealth, type DiscoveryHealthStatus, type DiscoveryListOptions, type DiscoveryPagination, type DiscoveryRegisterOptions, type DiscoveryResource, type DiscoveryResponse, type DiscoverySource, type DiscoveryStats, type DiscoveryTier, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, ESCROW_CONTRACTS, ESCROW_TIMEOUT_MS, Erc8004Client, type Erc8004ClientOptions, Erc8004LookupError, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStateResponse, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, HEALTH_FILTERS, type HonoMiddlewareOptions, type IdentityByOwnerResponse, type IdentityMetadataResponse, type IdentityTotalSupplyResponse, MAX_SEARCH_LEN, type MetadataEntryParam, OPERATOR_ABI, OPERATOR_ABI_CREATE3, PAYMENT_INFO_TYPEHASH, type PaymentAcceptance, type PaymentMiddlewareOptions, type PaymentPayloadV2, type PaymentRequirementResolver, type PaymentRequirements, type PaymentRequirementsOptions, type PaymentRequirementsV2, type PrepareRelayFeedbackRequest, type PrepareRelayFeedbackResponse, type PrepareRelayResponseRequest, type ProofOfPayment, RELAYED_FEEDBACK_NETWORKS, type RefundRequest, type RefundStatus, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterJobResponse, type RegisterJobStatus, RegistrationPendingError, type RelayAuthorizationParams, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type ResourceInfoV2, type SettleRequest, type SettleRequestV2, type SettleResponse, type SettleResponseWithProof, type SubmitRelayFeedbackRequest, type SubmitRelayResponseRequest, TIER_FILTERS, TIER_TIMINGS, USDC_DOMAIN_NAME, type VerifiedPaymentState, type VerifyRequest, type VerifyRequestV2, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildSettleRequestV2, buildVerifyRequest, buildVerifyRequestV2, canRefundEscrow, canReleaseEscrow, create402Response, createHonoMiddleware, createPaymentMiddleware, epochToDate, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, getEscrowContractsByChainId, getEscrowSupportedChainIds, isAlive, isEscrowExpired, isEscrowSupportedOnChain, isRegisterJobTerminal, parsePaymentHeader, supportsRelayedFeedback, wireNetwork };
@@ -1547,6 +1547,39 @@ interface SubmitRelayFeedbackRequest {
1547
1547
  /** Required only when `prepare` answered `delegated: false` */
1548
1548
  authorization?: RelayAuthorizationParams;
1549
1549
  }
1550
+ /**
1551
+ * Request body for `POST /feedback/response/evm/prepare`.
1552
+ *
1553
+ * `responder` is the address the chain will record as the author.
1554
+ */
1555
+ interface PrepareRelayResponseRequest {
1556
+ x402Version: 1 | 2;
1557
+ network: Erc8004Network;
1558
+ responder: string;
1559
+ agentId: number | string;
1560
+ /** WHOSE feedback is being answered — inside the signed struct. */
1561
+ clientAddress: string;
1562
+ /** Which feedback (1-indexed) — also inside the struct. */
1563
+ feedbackIndex: number;
1564
+ responseUri: string;
1565
+ responseHash?: string;
1566
+ }
1567
+ /** Request body for `POST /feedback/response/evm/submit`. */
1568
+ interface SubmitRelayResponseRequest {
1569
+ x402Version: 1 | 2;
1570
+ network: Erc8004Network;
1571
+ responder: string;
1572
+ agentId: number | string;
1573
+ clientAddress: string;
1574
+ feedbackIndex: number;
1575
+ responseUri: string;
1576
+ responseHash?: string;
1577
+ deadline: number;
1578
+ nonce: string;
1579
+ /** The responder's signature over the typed data. */
1580
+ signature: string;
1581
+ authorization?: RelayAuthorizationParams;
1582
+ }
1550
1583
  /**
1551
1584
  * Proof of payment returned when settling with ERC-8004 extension
1552
1585
  */
@@ -2174,11 +2207,50 @@ declare class Erc8004Client {
2174
2207
  supportedNetworks: Erc8004Network[];
2175
2208
  version: string;
2176
2209
  }>;
2210
+ /**
2211
+ * Ask what the RESPONDER must sign to author a response on-chain.
2212
+ *
2213
+ * The mirror of {@link prepareRelayedFeedback}, for the other write the
2214
+ * registry accepts from anybody. `appendResponse` is not agent-only — the
2215
+ * registry takes it from any address — so on the plain {@link appendResponse}
2216
+ * route the `responder` recorded on-chain is the FACILITATOR. That does not
2217
+ * destroy anyone's reputation the way a revoke would; it ties the
2218
+ * facilitator's on-chain identity to a third party's content, which is its own
2219
+ * kind of wrong.
2220
+ *
2221
+ * **v4 delegates only.** The v3 delegate accepts exactly two selectors and
2222
+ * `appendResponse` is not one of them, so a v3 network answers 400
2223
+ * `relay_response_needs_v4` rather than silently falling back to the route
2224
+ * this replaces.
2225
+ *
2226
+ * `clientAddress` and `feedbackIndex` are inside the signed struct: without
2227
+ * them one signature would answer any client's rating, or any rating at that
2228
+ * index.
2229
+ */
2230
+ prepareRelayedResponse(request: PrepareRelayResponseRequest): Promise<PrepareRelayFeedbackResponse>;
2231
+ /**
2232
+ * Relay a responder-authored response; the facilitator pays the gas.
2233
+ *
2234
+ * Pass back the same parameters, `deadline` and `nonce` that
2235
+ * {@link prepareRelayedResponse} returned: the facilitator rebuilds the struct
2236
+ * from them and refuses to relay anything the signature does not cover.
2237
+ */
2238
+ submitRelayedResponse(request: SubmitRelayResponseRequest): Promise<FeedbackResponse>;
2239
+ /** Shared POST for the relay routes: a refusal is data, never a throw. */
2240
+ private postRelay;
2177
2241
  /**
2178
2242
  * Append a response to existing feedback
2179
2243
  *
2180
- * Allows agents to respond to feedback they received.
2181
- * Only the agent (identity owner) can append responses.
2244
+ * @deprecated On this route the facilitator is the AUTHOR: the registry
2245
+ * records `msg.sender` as the `responder`, and that is the facilitator's
2246
+ * wallet. Where the delegate is **v4**, use {@link prepareRelayedResponse} +
2247
+ * {@link submitRelayedResponse} instead. This route still works and is the
2248
+ * only one available where the delegate is still v3.
2249
+ *
2250
+ * **This is NOT agent-only**, despite what this comment claimed until
2251
+ * 2026-08-25. Verified on-chain on 2026-08-18: the registry accepts
2252
+ * `appendResponse` from ANY address. There is no identity-owner check, here or
2253
+ * in the contract.
2182
2254
  *
2183
2255
  * @param network - Network where feedback was submitted
2184
2256
  * @param agentId - Agent ID
@@ -2766,4 +2838,4 @@ declare class AdvancedEscrowClient {
2766
2838
  private sendViaAdapter;
2767
2839
  }
2768
2840
 
2769
- export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentId, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, type AtomStats, BASE_MAINNET_CONTRACTS, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarRegisterOptions, type BazaarResource, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type DiscoveryAccepts, type DiscoveryCuration, type DiscoveryHealth, type DiscoveryHealthStatus, type DiscoveryListOptions, type DiscoveryPagination, type DiscoveryRegisterOptions, type DiscoveryResource, type DiscoveryResponse, type DiscoverySource, type DiscoveryStats, type DiscoveryTier, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, ESCROW_CONTRACTS, ESCROW_TIMEOUT_MS, Erc8004Client, type Erc8004ClientOptions, Erc8004LookupError, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStateResponse, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, HEALTH_FILTERS, type HonoMiddlewareOptions, type IdentityByOwnerResponse, type IdentityMetadataResponse, type IdentityTotalSupplyResponse, MAX_SEARCH_LEN, type MetadataEntryParam, OPERATOR_ABI, OPERATOR_ABI_CREATE3, PAYMENT_INFO_TYPEHASH, type PaymentAcceptance, type PaymentMiddlewareOptions, type PaymentPayloadV2, type PaymentRequirementResolver, type PaymentRequirements, type PaymentRequirementsOptions, type PaymentRequirementsV2, type PrepareRelayFeedbackRequest, type PrepareRelayFeedbackResponse, type ProofOfPayment, RELAYED_FEEDBACK_NETWORKS, type RefundRequest, type RefundStatus, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterJobResponse, type RegisterJobStatus, RegistrationPendingError, type RelayAuthorizationParams, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type ResourceInfoV2, type SettleRequest, type SettleRequestV2, type SettleResponse, type SettleResponseWithProof, type SubmitRelayFeedbackRequest, TIER_FILTERS, TIER_TIMINGS, USDC_DOMAIN_NAME, type VerifiedPaymentState, type VerifyRequest, type VerifyRequestV2, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildSettleRequestV2, buildVerifyRequest, buildVerifyRequestV2, canRefundEscrow, canReleaseEscrow, create402Response, createHonoMiddleware, createPaymentMiddleware, epochToDate, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, getEscrowContractsByChainId, getEscrowSupportedChainIds, isAlive, isEscrowExpired, isEscrowSupportedOnChain, isRegisterJobTerminal, parsePaymentHeader, supportsRelayedFeedback, wireNetwork };
2841
+ export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentId, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, type AtomStats, BASE_MAINNET_CONTRACTS, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarRegisterOptions, type BazaarResource, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type DiscoveryAccepts, type DiscoveryCuration, type DiscoveryHealth, type DiscoveryHealthStatus, type DiscoveryListOptions, type DiscoveryPagination, type DiscoveryRegisterOptions, type DiscoveryResource, type DiscoveryResponse, type DiscoverySource, type DiscoveryStats, type DiscoveryTier, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, ESCROW_CONTRACTS, ESCROW_TIMEOUT_MS, Erc8004Client, type Erc8004ClientOptions, Erc8004LookupError, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStateResponse, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, HEALTH_FILTERS, type HonoMiddlewareOptions, type IdentityByOwnerResponse, type IdentityMetadataResponse, type IdentityTotalSupplyResponse, MAX_SEARCH_LEN, type MetadataEntryParam, OPERATOR_ABI, OPERATOR_ABI_CREATE3, PAYMENT_INFO_TYPEHASH, type PaymentAcceptance, type PaymentMiddlewareOptions, type PaymentPayloadV2, type PaymentRequirementResolver, type PaymentRequirements, type PaymentRequirementsOptions, type PaymentRequirementsV2, type PrepareRelayFeedbackRequest, type PrepareRelayFeedbackResponse, type PrepareRelayResponseRequest, type ProofOfPayment, RELAYED_FEEDBACK_NETWORKS, type RefundRequest, type RefundStatus, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterJobResponse, type RegisterJobStatus, RegistrationPendingError, type RelayAuthorizationParams, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type ResourceInfoV2, type SettleRequest, type SettleRequestV2, type SettleResponse, type SettleResponseWithProof, type SubmitRelayFeedbackRequest, type SubmitRelayResponseRequest, TIER_FILTERS, TIER_TIMINGS, USDC_DOMAIN_NAME, type VerifiedPaymentState, type VerifyRequest, type VerifyRequestV2, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildSettleRequestV2, buildVerifyRequest, buildVerifyRequestV2, canRefundEscrow, canReleaseEscrow, create402Response, createHonoMiddleware, createPaymentMiddleware, epochToDate, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, getEscrowContractsByChainId, getEscrowSupportedChainIds, isAlive, isEscrowExpired, isEscrowSupportedOnChain, isRegisterJobTerminal, parsePaymentHeader, supportsRelayedFeedback, wireNetwork };
@@ -3119,11 +3119,82 @@ var Erc8004Client = class {
3119
3119
  throw error;
3120
3120
  }
3121
3121
  }
3122
+ /**
3123
+ * Ask what the RESPONDER must sign to author a response on-chain.
3124
+ *
3125
+ * The mirror of {@link prepareRelayedFeedback}, for the other write the
3126
+ * registry accepts from anybody. `appendResponse` is not agent-only — the
3127
+ * registry takes it from any address — so on the plain {@link appendResponse}
3128
+ * route the `responder` recorded on-chain is the FACILITATOR. That does not
3129
+ * destroy anyone's reputation the way a revoke would; it ties the
3130
+ * facilitator's on-chain identity to a third party's content, which is its own
3131
+ * kind of wrong.
3132
+ *
3133
+ * **v4 delegates only.** The v3 delegate accepts exactly two selectors and
3134
+ * `appendResponse` is not one of them, so a v3 network answers 400
3135
+ * `relay_response_needs_v4` rather than silently falling back to the route
3136
+ * this replaces.
3137
+ *
3138
+ * `clientAddress` and `feedbackIndex` are inside the signed struct: without
3139
+ * them one signature would answer any client's rating, or any rating at that
3140
+ * index.
3141
+ */
3142
+ async prepareRelayedResponse(request) {
3143
+ return this.postRelay("/feedback/response/evm/prepare", request, {
3144
+ success: false,
3145
+ delegated: false,
3146
+ chainId: 0,
3147
+ network: request.network
3148
+ });
3149
+ }
3150
+ /**
3151
+ * Relay a responder-authored response; the facilitator pays the gas.
3152
+ *
3153
+ * Pass back the same parameters, `deadline` and `nonce` that
3154
+ * {@link prepareRelayedResponse} returned: the facilitator rebuilds the struct
3155
+ * from them and refuses to relay anything the signature does not cover.
3156
+ */
3157
+ async submitRelayedResponse(request) {
3158
+ return this.postRelay("/feedback/response/evm/submit", request, {
3159
+ success: false,
3160
+ network: request.network
3161
+ });
3162
+ }
3163
+ /** Shared POST for the relay routes: a refusal is data, never a throw. */
3164
+ async postRelay(path, request, onError) {
3165
+ const controller = new AbortController();
3166
+ const timeoutId = setTimeout(() => controller.abort(), this.timeout);
3167
+ try {
3168
+ const response = await fetch(`${this.baseUrl}${path}`, {
3169
+ method: "POST",
3170
+ headers: { "Content-Type": "application/json", "Accept": "application/json" },
3171
+ body: JSON.stringify({ ...request, network: wireNetwork(request.network) }),
3172
+ signal: controller.signal
3173
+ });
3174
+ clearTimeout(timeoutId);
3175
+ if (!response.ok) {
3176
+ const errorText = await response.text();
3177
+ return { ...onError, error: `Facilitator error: ${response.status} - ${errorText}` };
3178
+ }
3179
+ return await response.json();
3180
+ } catch (error) {
3181
+ clearTimeout(timeoutId);
3182
+ return { ...onError, error: error instanceof Error ? error.message : "Unknown error" };
3183
+ }
3184
+ }
3122
3185
  /**
3123
3186
  * Append a response to existing feedback
3124
3187
  *
3125
- * Allows agents to respond to feedback they received.
3126
- * Only the agent (identity owner) can append responses.
3188
+ * @deprecated On this route the facilitator is the AUTHOR: the registry
3189
+ * records `msg.sender` as the `responder`, and that is the facilitator's
3190
+ * wallet. Where the delegate is **v4**, use {@link prepareRelayedResponse} +
3191
+ * {@link submitRelayedResponse} instead. This route still works and is the
3192
+ * only one available where the delegate is still v3.
3193
+ *
3194
+ * **This is NOT agent-only**, despite what this comment claimed until
3195
+ * 2026-08-25. Verified on-chain on 2026-08-18: the registry accepts
3196
+ * `appendResponse` from ANY address. There is no identity-owner check, here or
3197
+ * in the contract.
3127
3198
  *
3128
3199
  * @param network - Network where feedback was submitted
3129
3200
  * @param agentId - Agent ID