@haven_ai/sdk 0.8.1-alpha.0 → 0.10.0-alpha.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.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/dist/base64-CiR5BJhk.d.cts +1352 -0
  3. package/dist/base64-CxkinHPQ.d.ts +1352 -0
  4. package/dist/{chunk-HFOAYTD4.cjs → chunk-22FJ4JQO.cjs} +47 -35
  5. package/dist/chunk-22FJ4JQO.cjs.map +1 -0
  6. package/dist/chunk-6LEXYQ7J.cjs +106 -0
  7. package/dist/chunk-6LEXYQ7J.cjs.map +1 -0
  8. package/dist/chunk-EWTHDEIW.js +103 -0
  9. package/dist/chunk-EWTHDEIW.js.map +1 -0
  10. package/dist/{chunk-HX34HOW4.cjs → chunk-H37YVYZA.cjs} +6 -4
  11. package/dist/chunk-H37YVYZA.cjs.map +1 -0
  12. package/dist/{chunk-WDA3IGJP.js → chunk-MLUWABVT.js} +15 -6
  13. package/dist/chunk-MLUWABVT.js.map +1 -0
  14. package/dist/{chunk-H4APV67M.js → chunk-TD2PHUYP.js} +6 -4
  15. package/dist/chunk-TD2PHUYP.js.map +1 -0
  16. package/dist/edge.cjs +105 -89
  17. package/dist/edge.d.cts +4 -2
  18. package/dist/edge.d.ts +4 -2
  19. package/dist/edge.js +4 -4
  20. package/dist/index.cjs +1138 -500
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +128 -144
  23. package/dist/index.d.ts +128 -144
  24. package/dist/index.js +801 -199
  25. package/dist/index.js.map +1 -1
  26. package/dist/receipt-Cg9a5Seq.d.ts +130 -0
  27. package/dist/receipt-q7ez8Zb2.d.cts +130 -0
  28. package/dist/test-support.cjs +71 -18
  29. package/dist/test-support.cjs.map +1 -1
  30. package/dist/test-support.d.cts +21 -1
  31. package/dist/test-support.d.ts +21 -1
  32. package/dist/test-support.js +53 -3
  33. package/dist/test-support.js.map +1 -1
  34. package/dist/{base64-BjxHPgtC.d.cts → types-BKgqzvnk.d.cts} +238 -1307
  35. package/dist/{base64-BjxHPgtC.d.ts → types-BKgqzvnk.d.ts} +238 -1307
  36. package/package.json +1 -1
  37. package/dist/chunk-H4APV67M.js.map +0 -1
  38. package/dist/chunk-HFOAYTD4.cjs.map +0 -1
  39. package/dist/chunk-HX34HOW4.cjs.map +0 -1
  40. package/dist/chunk-WDA3IGJP.js.map +0 -1
package/README.md CHANGED
@@ -454,7 +454,7 @@ Hosted MCP and signer tools also return stable `code` values on recoverable x402
454
454
  | `PRICE_EXCEEDS_MAX` | The merchant-authoritative x402 price is above the caller's spending cap. No funding transfer was created. | Tell the user the live price exceeded the cap and retry only after they confirm a higher one. Payloads carry `next_action: stop_and_tell_user` and `retry_with_new_quote: true` — the latter means any retry needs a fresh quote, not that one should be attempted unattended. |
455
455
  | `AMBIGUOUS_MAX_AMOUNT` | Both `max_amount` (atomic units) and `max_amount_human` (whole tokens) were sent 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. |
456
456
  | `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`. |
457
- | `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`. |
457
+ | `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. An out-of-gas refusal (`reason_code: settlement_wallet_out_of_gas`) needs the merchant's operator to top up its settlement wallet first; retrying before then is refused again. Payloads carry `next_action: stop_and_tell_user` and `retry_with_new_quote: true`. |
458
458
  | `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`. |
459
459
  | `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). |
460
460
  | `MERCHANT_UNRESPONSIVE_AFTER_FUNDING` | The merchant did not answer the paid retry before the timeout — NOT proof of rejection, the merchant may still settle late. On eip3009 Haven's funding leg had succeeded; on erc7710 there is no funding leg (#3000). | eip3009: check `haven_get_payment_status`, retry `haven_complete_mcp_tool` once, and only then call `haven_sweep_delegate` if no settlement appears. erc7710: nothing to sweep and `haven_complete_mcp_tool` has no erc7710 branch — do not retry it; check `haven_get_payment_status` after the payment window and re-quote only if it shows no settlement. |