@haven_ai/sdk 0.0.0-dev.202609142053.7f40fec → 0.0.0-dev.202609150533.14ee4de

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.
package/README.md CHANGED
@@ -362,7 +362,7 @@ Terminal from any non-confirmed phase:
362
362
 
363
363
  x402 tool-window failures:
364
364
  expired funding/quote window → PAYMENT_WINDOW_EXPIRED → re-quote with same idempotency_key
365
- merchant rejection after funding → MERCHANT_REJECTED_AFTER_FUNDING → haven_sweep_delegate
365
+ merchant rejection after funding → MERCHANT_REJECTED_AFTER_FUNDING → haven_sweep_delegate (eip3009 only; erc7710: nothing to sweep, follow the message)
366
366
  ```
367
367
 
368
368
  ### `phase` reference
@@ -408,7 +408,7 @@ Hosted MCP and signer tools also return stable `code` values on recoverable x402
408
408
  | `MAX_AMOUNT_UNCONVERTIBLE` | `max_amount_human` could not be converted against this quote's asset — its decimals are unknown to Haven, or the cap has more decimal places than the asset supports. Nothing was spent. | Round the cap to the asset's decimals, or re-send it as an exact atomic `max_amount`. |
409
409
  | `MERCHANT_NOT_READY` | The merchant answered the quote probe with its own `503 { error: 'merchant_not_ready', reason_code, retry_after_s }` instead of a 402 — it cannot settle right now (e.g. its settlement wallet is out of gas). No payment was created. | Tell the user and retry later (`retry_after_s` in the message when given); do not treat it as a wrong endpoint. Payloads carry `next_action: stop_and_tell_user` and `retry_with_new_quote: true`. |
410
410
  | `PAYMENT_WINDOW_EXPIRED` | The funding/quote window closed before `haven_x402_sign_header`, `haven_submit`, or `haven_complete_mcp_tool` could finish. | Re-run `haven_pay_mcp_tool` with the same `idempotency_key`, then sign and complete the fresh quote. Payloads include `retry_with_new_quote: true`. |
411
- | `MERCHANT_REJECTED_AFTER_FUNDING` | Haven's funding leg succeeded, but the merchant rejected the paid retry. | Stop retrying the merchant and call `haven_sweep_delegate` so the user can recover stranded delegate USDC. |
411
+ | `MERCHANT_REJECTED_AFTER_FUNDING` | The merchant rejected the paid retry. On eip3009 Haven's funding leg had succeeded; on erc7710 there is no funding leg (#2983). | eip3009: stop retrying the merchant and call `haven_sweep_delegate` so the user can recover stranded delegate USDC. erc7710: nothing to sweep — follow the message (re-quote later if the merchant declined to settle; otherwise check `haven_get_payment_status` after the payment window before re-quoting). |
412
412
 
413
413
  ## Payments outside the agent's budget
414
414
 
package/dist/index.cjs CHANGED
@@ -164,7 +164,8 @@ var AgentPaymentFailureCode = {
164
164
  PriceExceedsMax: "PRICE_EXCEEDS_MAX",
165
165
  /** The x402 funding/quote window expired before the signer or hosted settle step could finish. */
166
166
  PaymentWindowExpired: "PAYMENT_WINDOW_EXPIRED",
167
- /** The Haven funding leg succeeded, but the merchant rejected the paid retry. */
167
+ /** The merchant rejected the paid retry. On eip3009 the funding leg had succeeded (sweep);
168
+ * on erc7710 there is no funding leg — nothing to sweep, follow the message (#2983). */
168
169
  MerchantRejectedAfterFunding: "MERCHANT_REJECTED_AFTER_FUNDING",
169
170
  /** #1300 review: funding is on-chain but the merchant never ANSWERED the
170
171
  * paid retry within the timeout. NOT proof of rejection — the merchant
@@ -259,7 +260,7 @@ var AgentPaymentNextActionDescriptions = {
259
260
  var AgentPaymentFailureCodeDescriptions = {
260
261
  [AgentPaymentFailureCode.PriceExceedsMax]: "The merchant-authoritative x402 amount exceeds the caller's max_amount cap. No funding transfer was created; ask the user before retrying with a larger cap.",
261
262
  [AgentPaymentFailureCode.PaymentWindowExpired]: "The x402 funding/quote window expired before the signer or hosted settle step could finish. Re-quote via haven_pay_mcp_tool with the same idempotency key to avoid duplicate funding.",
262
- [AgentPaymentFailureCode.MerchantRejectedAfterFunding]: "The Haven funding leg succeeded, but the merchant rejected the paid retry. Stop retrying the merchant and reconcile stranded delegate funds with haven_sweep_delegate.",
263
+ [AgentPaymentFailureCode.MerchantRejectedAfterFunding]: "The merchant rejected the paid retry. eip3009: the funding leg succeeded \u2014 stop retrying the merchant and reconcile stranded delegate funds with haven_sweep_delegate. erc7710: no funding leg, nothing to sweep \u2014 follow the message (re-quote later, or check haven_get_payment_status after the window first).",
263
264
  [AgentPaymentFailureCode.MerchantUnresponsiveAfterFunding]: "The Haven funding leg succeeded, but the merchant did not answer the paid retry before the timeout. The merchant may still settle late \u2014 check haven_get_payment_status (and retry haven_complete_mcp_tool once) BEFORE sweeping; sweep only if no settlement appears.",
264
265
  [AgentPaymentFailureCode.MerchantCallContextUnavailable]: "merchant_url/tool_name were omitted and no stored merchant call context is available for this payment_id. Re-send merchant_url, tool_name, arguments, and mcp_transport explicitly.",
265
266
  [AgentPaymentFailureCode.AmbiguousMaxAmount]: "Both max_amount (atomic units) and max_amount_human (whole tokens) were supplied for one purchase. Nothing was contacted and nothing was spent. Re-send with exactly ONE: max_amount_human for a cap the user stated in tokens, max_amount for an exact atomic figure.",
@@ -4884,8 +4885,12 @@ present and surface \`message\` or \`error\` verbatim. Common cases:
4884
4885
  retry later (the message carries \`retry_after_s\` when the merchant gave
4885
4886
  one) \u2014 this is not a wrong or broken endpoint.
4886
4887
  - \`MERCHANT_REJECTED_AFTER_FUNDING\`: the merchant refused the paid retry.
4887
- Stop-and-sweep \u2014 stop retrying the merchant and use
4888
- \`mcp__haven__haven_sweep_delegate\` to recover stranded delegate funds.
4888
+ On eip3009 (\`rail\` not \`erc7710\`): Stop-and-sweep \u2014 stop retrying the
4889
+ merchant and use \`mcp__haven__haven_sweep_delegate\` to recover stranded
4890
+ delegate funds. On erc7710 there is no funding leg and nothing to sweep:
4891
+ follow the message \u2014 it says whether the merchant declined to settle
4892
+ (re-quote later) or whether to check \`haven_get_payment_status\` after
4893
+ the payment window first.
4889
4894
  - \`MERCHANT_UNRESPONSIVE_AFTER_FUNDING\`: funding confirmed on-chain, but the
4890
4895
  merchant never answered the paid retry. This is NOT proof of rejection \u2014 the
4891
4896
  merchant may still settle late. Verify-then-sweep, never a blind sweep: