uvd-x402-sdk 2.72.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.
@@ -1486,6 +1486,22 @@ interface PrepareRelayFeedbackResponse {
1486
1486
  * nobody.
1487
1487
  */
1488
1488
  signingPayload?: string;
1489
+ /**
1490
+ * The full `eth_signTypedData_v4` payload. **v4 delegates only.**
1491
+ *
1492
+ * Present exactly when the delegate deployed on that chain is v4, which the
1493
+ * facilitator reads from the chain per request rather than assuming from a
1494
+ * release. **When it is present, sign IT** — the wallet renders the agent, the
1495
+ * score, the tags and the deadline as named fields, so the rater sees what
1496
+ * they authorise instead of a hex blob.
1497
+ *
1498
+ * v4 carries no {@link signingPayload} and needs none: `signTypedData` has no
1499
+ * envelope to apply twice, which is the entire class of bug that kept the v3
1500
+ * rail at zero signatures for days.
1501
+ *
1502
+ * Requires facilitator v1.96.0+.
1503
+ */
1504
+ typedData?: Record<string, unknown>;
1489
1505
  /**
1490
1506
  * Unix seconds after which the authorisation is void. Short on purpose:
1491
1507
  * relaying is permissionless, so a signed authorisation is live in the wild
@@ -1531,6 +1547,39 @@ interface SubmitRelayFeedbackRequest {
1531
1547
  /** Required only when `prepare` answered `delegated: false` */
1532
1548
  authorization?: RelayAuthorizationParams;
1533
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
+ }
1534
1583
  /**
1535
1584
  * Proof of payment returned when settling with ERC-8004 extension
1536
1585
  */
@@ -2077,6 +2126,9 @@ declare class Erc8004Client {
2077
2126
  * - wallet: `personal_sign` over `signingPayload`. `personal_sign` adds the
2078
2127
  * envelope itself, so signing `digest` with it wraps the value TWICE and
2079
2128
  * recovers a stranger — the only symptom is `relay_bad_signature`.
2129
+ * - **unless `typedData` came back** — that chain runs a v4 delegate. Then
2130
+ * sign THAT with `eth_signTypedData_v4` and ignore the other two: it is
2131
+ * the only form the rater can read, and it has no envelope ambiguity.
2080
2132
  * 2. If `delegated` is `false`, also produce an EIP-7702 authorization over
2081
2133
  * `(chainId, delegate, accountNonce)`.
2082
2134
  * 3. Hand both to {@link submitRelayedFeedback} with the SAME feedback
@@ -2155,11 +2207,50 @@ declare class Erc8004Client {
2155
2207
  supportedNetworks: Erc8004Network[];
2156
2208
  version: string;
2157
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;
2158
2241
  /**
2159
2242
  * Append a response to existing feedback
2160
2243
  *
2161
- * Allows agents to respond to feedback they received.
2162
- * 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.
2163
2254
  *
2164
2255
  * @param network - Network where feedback was submitted
2165
2256
  * @param agentId - Agent ID
@@ -2747,4 +2838,4 @@ declare class AdvancedEscrowClient {
2747
2838
  private sendViaAdapter;
2748
2839
  }
2749
2840
 
2750
- 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 };
@@ -1486,6 +1486,22 @@ interface PrepareRelayFeedbackResponse {
1486
1486
  * nobody.
1487
1487
  */
1488
1488
  signingPayload?: string;
1489
+ /**
1490
+ * The full `eth_signTypedData_v4` payload. **v4 delegates only.**
1491
+ *
1492
+ * Present exactly when the delegate deployed on that chain is v4, which the
1493
+ * facilitator reads from the chain per request rather than assuming from a
1494
+ * release. **When it is present, sign IT** — the wallet renders the agent, the
1495
+ * score, the tags and the deadline as named fields, so the rater sees what
1496
+ * they authorise instead of a hex blob.
1497
+ *
1498
+ * v4 carries no {@link signingPayload} and needs none: `signTypedData` has no
1499
+ * envelope to apply twice, which is the entire class of bug that kept the v3
1500
+ * rail at zero signatures for days.
1501
+ *
1502
+ * Requires facilitator v1.96.0+.
1503
+ */
1504
+ typedData?: Record<string, unknown>;
1489
1505
  /**
1490
1506
  * Unix seconds after which the authorisation is void. Short on purpose:
1491
1507
  * relaying is permissionless, so a signed authorisation is live in the wild
@@ -1531,6 +1547,39 @@ interface SubmitRelayFeedbackRequest {
1531
1547
  /** Required only when `prepare` answered `delegated: false` */
1532
1548
  authorization?: RelayAuthorizationParams;
1533
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
+ }
1534
1583
  /**
1535
1584
  * Proof of payment returned when settling with ERC-8004 extension
1536
1585
  */
@@ -2077,6 +2126,9 @@ declare class Erc8004Client {
2077
2126
  * - wallet: `personal_sign` over `signingPayload`. `personal_sign` adds the
2078
2127
  * envelope itself, so signing `digest` with it wraps the value TWICE and
2079
2128
  * recovers a stranger — the only symptom is `relay_bad_signature`.
2129
+ * - **unless `typedData` came back** — that chain runs a v4 delegate. Then
2130
+ * sign THAT with `eth_signTypedData_v4` and ignore the other two: it is
2131
+ * the only form the rater can read, and it has no envelope ambiguity.
2080
2132
  * 2. If `delegated` is `false`, also produce an EIP-7702 authorization over
2081
2133
  * `(chainId, delegate, accountNonce)`.
2082
2134
  * 3. Hand both to {@link submitRelayedFeedback} with the SAME feedback
@@ -2155,11 +2207,50 @@ declare class Erc8004Client {
2155
2207
  supportedNetworks: Erc8004Network[];
2156
2208
  version: string;
2157
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;
2158
2241
  /**
2159
2242
  * Append a response to existing feedback
2160
2243
  *
2161
- * Allows agents to respond to feedback they received.
2162
- * 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.
2163
2254
  *
2164
2255
  * @param network - Network where feedback was submitted
2165
2256
  * @param agentId - Agent ID
@@ -2747,4 +2838,4 @@ declare class AdvancedEscrowClient {
2747
2838
  private sendViaAdapter;
2748
2839
  }
2749
2840
 
2750
- 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 };
@@ -2911,6 +2911,9 @@ var Erc8004Client = class {
2911
2911
  * - wallet: `personal_sign` over `signingPayload`. `personal_sign` adds the
2912
2912
  * envelope itself, so signing `digest` with it wraps the value TWICE and
2913
2913
  * recovers a stranger — the only symptom is `relay_bad_signature`.
2914
+ * - **unless `typedData` came back** — that chain runs a v4 delegate. Then
2915
+ * sign THAT with `eth_signTypedData_v4` and ignore the other two: it is
2916
+ * the only form the rater can read, and it has no envelope ambiguity.
2914
2917
  * 2. If `delegated` is `false`, also produce an EIP-7702 authorization over
2915
2918
  * `(chainId, delegate, accountNonce)`.
2916
2919
  * 3. Hand both to {@link submitRelayedFeedback} with the SAME feedback
@@ -3116,11 +3119,82 @@ var Erc8004Client = class {
3116
3119
  throw error;
3117
3120
  }
3118
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
+ }
3119
3185
  /**
3120
3186
  * Append a response to existing feedback
3121
3187
  *
3122
- * Allows agents to respond to feedback they received.
3123
- * 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.
3124
3198
  *
3125
3199
  * @param network - Network where feedback was submitted
3126
3200
  * @param agentId - Agent ID