@haven_ai/sdk 0.11.0-alpha.0 → 0.12.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 +37 -4
  2. package/dist/{base64-D4VZhgUg.d.ts → base64-C5OrJLij.d.ts} +10 -2
  3. package/dist/{base64-DR4Gl8cD.d.cts → base64-COaV1Sis.d.cts} +10 -2
  4. package/dist/{chunk-DXBAN4SN.cjs → chunk-4JTLJVBS.cjs} +4 -4
  5. package/dist/chunk-4JTLJVBS.cjs.map +1 -0
  6. package/dist/{chunk-ZDJ55LR7.js → chunk-7M3CIW7W.js} +7 -6
  7. package/dist/chunk-7M3CIW7W.js.map +1 -0
  8. package/dist/{chunk-I7SL4A6X.js → chunk-UPEDQLAL.js} +55 -5
  9. package/dist/chunk-UPEDQLAL.js.map +1 -0
  10. package/dist/{chunk-IKQIIMM6.cjs → chunk-V2ODMLDD.cjs} +38 -37
  11. package/dist/chunk-V2ODMLDD.cjs.map +1 -0
  12. package/dist/{chunk-34YJQFCM.js → chunk-WFTGZS24.js} +3 -3
  13. package/dist/chunk-WFTGZS24.js.map +1 -0
  14. package/dist/{chunk-MZKLAHBK.cjs → chunk-ZA3NOSO2.cjs} +56 -4
  15. package/dist/chunk-ZA3NOSO2.cjs.map +1 -0
  16. package/dist/edge.cjs +93 -93
  17. package/dist/edge.d.cts +11 -8
  18. package/dist/edge.d.ts +11 -8
  19. package/dist/edge.js +4 -4
  20. package/dist/index.cjs +441 -355
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +22 -15
  23. package/dist/index.d.ts +22 -15
  24. package/dist/index.js +125 -47
  25. package/dist/index.js.map +1 -1
  26. package/dist/{receipt-_bWCELEH.d.cts → receipt-Dy77vCea.d.cts} +5 -4
  27. package/dist/{receipt-CbD8L0WL.d.ts → receipt-DyUInpvF.d.ts} +5 -4
  28. package/dist/test-support.cjs +21 -21
  29. package/dist/test-support.d.cts +2 -2
  30. package/dist/test-support.d.ts +2 -2
  31. package/dist/test-support.js +2 -2
  32. package/dist/{types-DKmvjXK6.d.cts → types-CAvsjRKi.d.cts} +144 -2
  33. package/dist/{types-DKmvjXK6.d.ts → types-CAvsjRKi.d.ts} +144 -2
  34. package/package.json +1 -1
  35. package/dist/chunk-34YJQFCM.js.map +0 -1
  36. package/dist/chunk-DXBAN4SN.cjs.map +0 -1
  37. package/dist/chunk-I7SL4A6X.js.map +0 -1
  38. package/dist/chunk-IKQIIMM6.cjs.map +0 -1
  39. package/dist/chunk-MZKLAHBK.cjs.map +0 -1
  40. package/dist/chunk-ZDJ55LR7.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkIKQIIMM6_cjs = require('./chunk-IKQIIMM6.cjs');
4
- var chunkDXBAN4SN_cjs = require('./chunk-DXBAN4SN.cjs');
5
- var chunkMZKLAHBK_cjs = require('./chunk-MZKLAHBK.cjs');
3
+ var chunkV2ODMLDD_cjs = require('./chunk-V2ODMLDD.cjs');
4
+ var chunk4JTLJVBS_cjs = require('./chunk-4JTLJVBS.cjs');
5
+ var chunkZA3NOSO2_cjs = require('./chunk-ZA3NOSO2.cjs');
6
6
  var viem = require('viem');
7
7
  var ethers = require('ethers');
8
8
  var async_hooks = require('async_hooks');
@@ -15,7 +15,7 @@ function signHash(privateKey, hash) {
15
15
  const sig = signingKey.sign(hash);
16
16
  return sig.serialized;
17
17
  } catch (err) {
18
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
18
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
19
19
  `Failed to sign hash: ${err instanceof Error ? err.message : String(err)}`
20
20
  );
21
21
  }
@@ -31,7 +31,7 @@ async function signTypedDataVerbatim(privateKey, typedData, label) {
31
31
  typedData.message
32
32
  );
33
33
  } catch (err) {
34
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
34
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
35
35
  `Failed to sign ${label}: ${err instanceof Error ? err.message : String(err)}`
36
36
  );
37
37
  }
@@ -46,7 +46,7 @@ function addressFromKey(privateKey) {
46
46
  try {
47
47
  return new ethers.ethers.Wallet(privateKey).address;
48
48
  } catch (err) {
49
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
49
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
50
50
  `Invalid private key: ${err instanceof Error ? err.message : String(err)}`
51
51
  );
52
52
  }
@@ -62,7 +62,7 @@ function verifySignature(hash, signature, expectedAddress) {
62
62
  var DEFAULT_BASE_URL = "http://localhost:3001";
63
63
  var DEFAULT_REQUEST_TIMEOUT = 3e4;
64
64
  function withoutClientHeader(headers) {
65
- const target = chunkIKQIIMM6_cjs.HAVEN_CLIENT_HEADER.toLowerCase();
65
+ const target = chunkV2ODMLDD_cjs.HAVEN_CLIENT_HEADER.toLowerCase();
66
66
  return Object.fromEntries(Object.entries(headers).filter(([name]) => name.toLowerCase() !== target));
67
67
  }
68
68
  var HavenApiTransport = class {
@@ -78,7 +78,7 @@ var HavenApiTransport = class {
78
78
  this.baseUrl = (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
79
79
  this.requestTimeout = config.requestTimeout ?? DEFAULT_REQUEST_TIMEOUT;
80
80
  this.defaultHeaders = { ...config.defaultHeaders ?? {} };
81
- this.clientIdentity = config.clientIdentity ?? chunkIKQIIMM6_cjs.SDK_CLIENT_IDENTITY;
81
+ this.clientIdentity = config.clientIdentity ?? chunkV2ODMLDD_cjs.SDK_CLIENT_IDENTITY;
82
82
  }
83
83
  /**
84
84
  * The newest `client_update` the backend sent (#3303): inside a
@@ -91,7 +91,7 @@ var HavenApiTransport = class {
91
91
  }
92
92
  recordClientUpdate(data) {
93
93
  if (data === null || typeof data !== "object" || Array.isArray(data)) return;
94
- const hint = chunkIKQIIMM6_cjs.readClientUpdate(data.client_update);
94
+ const hint = chunkV2ODMLDD_cjs.readClientUpdate(data.client_update);
95
95
  if (!hint) return;
96
96
  this.lastClientUpdate = hint;
97
97
  const store = this.requestContext.getStore();
@@ -124,7 +124,7 @@ var HavenApiTransport = class {
124
124
  // JOIN `x-haven-client` and `X-Haven-Client` into one unparseable
125
125
  // value), so neither `defaultHeaders` nor a dispatch context can
126
126
  // misname the client; `clientIdentity` is the one way to set it.
127
- [chunkIKQIIMM6_cjs.HAVEN_CLIENT_HEADER]: this.clientIdentity
127
+ [chunkV2ODMLDD_cjs.HAVEN_CLIENT_HEADER]: this.clientIdentity
128
128
  },
129
129
  body: body ? JSON.stringify(body) : void 0,
130
130
  signal: controller.signal
@@ -137,17 +137,21 @@ var HavenApiTransport = class {
137
137
  const rawDetails = record.details ?? record.detail;
138
138
  const detailsText = typeof rawDetails === "string" ? rawDetails : rawDetails != null ? JSON.stringify(rawDetails) : void 0;
139
139
  const message = errorText && detailsText ? `${errorText}: ${detailsText}` : errorText ?? detailsText ?? "API request failed";
140
- throw new chunkMZKLAHBK_cjs.HavenApiError(message, res.status, data);
140
+ throw new chunkZA3NOSO2_cjs.HavenApiError(message, res.status, data);
141
141
  }
142
142
  return data;
143
143
  } catch (err) {
144
- if (err instanceof chunkMZKLAHBK_cjs.HavenApiError) throw err;
144
+ if (err instanceof chunkZA3NOSO2_cjs.HavenApiError) throw err;
145
+ const failureCause = { kind: "no_answer", method };
145
146
  if (err instanceof Error && err.name === "AbortError") {
146
- throw new chunkMZKLAHBK_cjs.HavenApiError(`Request to ${path} timed out`, 408);
147
+ throw new chunkZA3NOSO2_cjs.HavenApiError(`Request to ${path} timed out`, 408, void 0, void 0, failureCause);
147
148
  }
148
- throw new chunkMZKLAHBK_cjs.HavenApiError(
149
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
149
150
  `Request to ${path} failed: ${err instanceof Error ? err.message : String(err)}`,
150
- 0
151
+ 0,
152
+ void 0,
153
+ void 0,
154
+ failureCause
151
155
  );
152
156
  } finally {
153
157
  clearTimeout(timeout);
@@ -168,13 +172,13 @@ async function fetchUnsignedTaxDeclaration(client) {
168
172
  if (reason === "feature_disabled" || reason === "disabled" || reason === "no_company_details" || reason === "vies_not_valid") {
169
173
  return { available: false, reason };
170
174
  }
171
- throw new chunkMZKLAHBK_cjs.HavenApiError(
175
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
172
176
  "The tax-declaration endpoint answered a body that is neither the \xA72.1 content nor a named unavailability reason.",
173
177
  502
174
178
  );
175
179
  }
176
180
  async function resolveTaxDeclarationHeader(client, input) {
177
- if (chunkIKQIIMM6_cjs.isErc7710Option(input.accepted)) {
181
+ if (chunkV2ODMLDD_cjs.isErc7710Option(input.accepted)) {
178
182
  return { header: void 0 };
179
183
  }
180
184
  let content;
@@ -186,7 +190,7 @@ async function resolveTaxDeclarationHeader(client, input) {
186
190
  if (!content.available) {
187
191
  return { header: void 0 };
188
192
  }
189
- const signed = chunkIKQIIMM6_cjs.buildSignedTaxDeclaration({
193
+ const signed = chunkV2ODMLDD_cjs.buildSignedTaxDeclaration({
190
194
  content: content.declaration,
191
195
  network: input.accepted.network,
192
196
  delegateKey: input.delegateKey
@@ -195,19 +199,19 @@ async function resolveTaxDeclarationHeader(client, input) {
195
199
  `[haven-sdk] signing x402 tax declaration taxId=${JSON.stringify(content.declaration.taxId)} jurisdiction=${JSON.stringify(content.declaration.jurisdiction)} principalId=${signed.declaration.principalId}
196
200
  `
197
201
  );
198
- return { header: chunkIKQIIMM6_cjs.encodeTaxDeclarationHeader(signed) };
202
+ return { header: chunkV2ODMLDD_cjs.encodeTaxDeclarationHeader(signed) };
199
203
  }
200
204
  function withTaxDeclarationHeader(init, header) {
201
205
  if (!header) {
202
- if (init?.headers && new Headers(init.headers).has(chunkIKQIIMM6_cjs.X_TAX_DECLARATION_HEADER)) {
206
+ if (init?.headers && new Headers(init.headers).has(chunkV2ODMLDD_cjs.X_TAX_DECLARATION_HEADER)) {
203
207
  const headers2 = new Headers(init.headers);
204
- headers2.delete(chunkIKQIIMM6_cjs.X_TAX_DECLARATION_HEADER);
208
+ headers2.delete(chunkV2ODMLDD_cjs.X_TAX_DECLARATION_HEADER);
205
209
  return { ...init, headers: headers2 };
206
210
  }
207
211
  return init ?? {};
208
212
  }
209
213
  const headers = new Headers(init?.headers);
210
- headers.set(chunkIKQIIMM6_cjs.X_TAX_DECLARATION_HEADER, header);
214
+ headers.set(chunkV2ODMLDD_cjs.X_TAX_DECLARATION_HEADER, header);
211
215
  return { ...init, headers };
212
216
  }
213
217
 
@@ -353,6 +357,24 @@ function mapPaymentReceipt(raw) {
353
357
  if ("approval_request_id" in raw) {
354
358
  receipt.approvalRequestId = raw.approval_request_id ?? null;
355
359
  }
360
+ if ("settlement_scheme" in raw) {
361
+ receipt.settlementScheme = raw.settlement_scheme ?? null;
362
+ }
363
+ if ("budget_delegation_hash" in raw) {
364
+ receipt.budgetDelegationHash = raw.budget_delegation_hash ?? null;
365
+ }
366
+ if ("delivery_quality" in raw) {
367
+ receipt.deliveryQuality = raw.delivery_quality ?? null;
368
+ }
369
+ if ("delivery_note" in raw) {
370
+ receipt.deliveryNote = raw.delivery_note ?? null;
371
+ }
372
+ if ("delivery_reported_at" in raw) {
373
+ receipt.deliveryReportedAt = raw.delivery_reported_at ?? null;
374
+ }
375
+ if ("delivery_reference" in raw) {
376
+ receipt.deliveryReference = raw.delivery_reference ?? null;
377
+ }
356
378
  return receipt;
357
379
  }
358
380
 
@@ -373,29 +395,29 @@ function paymentStateStatusCode(status, fallback = 502) {
373
395
  return PAYMENT_STATE_STATUS_CODES[status] ?? fallback;
374
396
  }
375
397
  function phaseForStatus(status) {
376
- if (status === "pending_signature") return chunkMZKLAHBK_cjs.AgentPaymentPhase.AgentSignatureRequired;
377
- if (status === "submitted") return chunkMZKLAHBK_cjs.AgentPaymentPhase.PaymentSubmitted;
378
- if (status === "confirmed") return chunkMZKLAHBK_cjs.AgentPaymentPhase.PaymentConfirmed;
379
- if (status === "pending" || status === "pending_approval") return chunkMZKLAHBK_cjs.AgentPaymentPhase.UserApprovalRequired;
380
- if (status === "approved") return chunkMZKLAHBK_cjs.AgentPaymentPhase.UserExecutionRequired;
381
- if (status === "proposed") return chunkMZKLAHBK_cjs.AgentPaymentPhase.WaitingForAdditionalApprovals;
382
- if (status === "executed") return chunkMZKLAHBK_cjs.AgentPaymentPhase.FundingSent;
383
- if (status === "rejected") return chunkMZKLAHBK_cjs.AgentPaymentPhase.Rejected;
384
- if (status === "expired") return chunkMZKLAHBK_cjs.AgentPaymentPhase.Expired;
385
- if (status === "failed") return chunkMZKLAHBK_cjs.AgentPaymentPhase.Failed;
398
+ if (status === "pending_signature") return chunkZA3NOSO2_cjs.AgentPaymentPhase.AgentSignatureRequired;
399
+ if (status === "submitted") return chunkZA3NOSO2_cjs.AgentPaymentPhase.PaymentSubmitted;
400
+ if (status === "confirmed") return chunkZA3NOSO2_cjs.AgentPaymentPhase.PaymentConfirmed;
401
+ if (status === "pending" || status === "pending_approval") return chunkZA3NOSO2_cjs.AgentPaymentPhase.UserApprovalRequired;
402
+ if (status === "approved") return chunkZA3NOSO2_cjs.AgentPaymentPhase.UserExecutionRequired;
403
+ if (status === "proposed") return chunkZA3NOSO2_cjs.AgentPaymentPhase.WaitingForAdditionalApprovals;
404
+ if (status === "executed") return chunkZA3NOSO2_cjs.AgentPaymentPhase.FundingSent;
405
+ if (status === "rejected") return chunkZA3NOSO2_cjs.AgentPaymentPhase.Rejected;
406
+ if (status === "expired") return chunkZA3NOSO2_cjs.AgentPaymentPhase.Expired;
407
+ if (status === "failed") return chunkZA3NOSO2_cjs.AgentPaymentPhase.Failed;
386
408
  return null;
387
409
  }
388
410
  function nextActionForStatus(status) {
389
- if (status === "pending_signature") return chunkMZKLAHBK_cjs.AgentPaymentNextAction.SignAndSubmitPayment;
390
- if (status === "submitted") return chunkMZKLAHBK_cjs.AgentPaymentNextAction.CheckStatusLater;
391
- if (status === "confirmed") return chunkMZKLAHBK_cjs.AgentPaymentNextAction.None;
392
- if (status === "pending" || status === "pending_approval") return chunkMZKLAHBK_cjs.AgentPaymentNextAction.StopAndTellUser;
393
- if (status === "approved") return chunkMZKLAHBK_cjs.AgentPaymentNextAction.StopAndTellUser;
394
- if (status === "proposed") return chunkMZKLAHBK_cjs.AgentPaymentNextAction.StopAndTellUser;
395
- if (status === "executed") return chunkMZKLAHBK_cjs.AgentPaymentNextAction.StopAndTellUser;
396
- if (status === "rejected") return chunkMZKLAHBK_cjs.AgentPaymentNextAction.StopAndTellUser;
397
- if (status === "expired") return chunkMZKLAHBK_cjs.AgentPaymentNextAction.RequestAgainIfUserStillWantsIt;
398
- if (status === "failed") return chunkMZKLAHBK_cjs.AgentPaymentNextAction.StopAndTellUser;
411
+ if (status === "pending_signature") return chunkZA3NOSO2_cjs.AgentPaymentNextAction.SignAndSubmitPayment;
412
+ if (status === "submitted") return chunkZA3NOSO2_cjs.AgentPaymentNextAction.CheckStatusLater;
413
+ if (status === "confirmed") return chunkZA3NOSO2_cjs.AgentPaymentNextAction.None;
414
+ if (status === "pending" || status === "pending_approval") return chunkZA3NOSO2_cjs.AgentPaymentNextAction.StopAndTellUser;
415
+ if (status === "approved") return chunkZA3NOSO2_cjs.AgentPaymentNextAction.StopAndTellUser;
416
+ if (status === "proposed") return chunkZA3NOSO2_cjs.AgentPaymentNextAction.StopAndTellUser;
417
+ if (status === "executed") return chunkZA3NOSO2_cjs.AgentPaymentNextAction.StopAndTellUser;
418
+ if (status === "rejected") return chunkZA3NOSO2_cjs.AgentPaymentNextAction.StopAndTellUser;
419
+ if (status === "expired") return chunkZA3NOSO2_cjs.AgentPaymentNextAction.RequestAgainIfUserStillWantsIt;
420
+ if (status === "failed") return chunkZA3NOSO2_cjs.AgentPaymentNextAction.StopAndTellUser;
399
421
  return null;
400
422
  }
401
423
  function messageForState(label, status, paymentId, nextAction) {
@@ -469,17 +491,17 @@ function throwPaymentStateError(label, raw) {
469
491
  const statusCode = paymentStateStatusCode(raw.status);
470
492
  const state = paymentStateFromRaw(label, raw);
471
493
  if (state) {
472
- throw new chunkMZKLAHBK_cjs.HavenPaymentStateError(state.message, statusCode, state, raw);
494
+ throw new chunkZA3NOSO2_cjs.HavenPaymentStateError(state.message, statusCode, state, raw);
473
495
  }
474
496
  if (raw.status === "pending_approval") {
475
- throw new chunkMZKLAHBK_cjs.HavenApiError(
497
+ throw chunkZA3NOSO2_cjs.HavenApiError.deterministic(
476
498
  `${label} exceeds the agent's on-chain budget and was declined; no approval is pending and none will arrive (payment_id: ${raw.payment_id}).`,
477
499
  statusCode,
478
500
  raw
479
501
  );
480
502
  }
481
503
  if (raw.status === "expired") {
482
- throw new chunkMZKLAHBK_cjs.HavenApiError(
504
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
483
505
  `${label} expired before it could be completed (payment_id: ${raw.payment_id}).`,
484
506
  statusCode,
485
507
  raw
@@ -487,7 +509,8 @@ function throwPaymentStateError(label, raw) {
487
509
  }
488
510
  const paymentId = raw.payment_id ? ` (payment_id: ${raw.payment_id})` : "";
489
511
  const message = raw.error ?? `${label} ${raw.status}${paymentId}`;
490
- throw new chunkMZKLAHBK_cjs.HavenApiError(message, statusCode, raw);
512
+ if (statusCode >= 500) throw chunkZA3NOSO2_cjs.HavenApiError.deterministic(message, statusCode, raw);
513
+ throw new chunkZA3NOSO2_cjs.HavenApiError(message, statusCode, raw);
491
514
  }
492
515
 
493
516
  // src/x402-retry-target.ts
@@ -519,7 +542,7 @@ function isSecureX402RetryTarget(url) {
519
542
  return RESERVED_SUFFIXES.some((suffix) => host.endsWith(suffix));
520
543
  }
521
544
  var INSECURE_RETRY_TARGET_CODE = "INSECURE_RETRY_TARGET";
522
- var HavenInsecureRetryTargetError = class extends chunkMZKLAHBK_cjs.HavenError {
545
+ var HavenInsecureRetryTargetError = class extends chunkZA3NOSO2_cjs.HavenError {
523
546
  constructor(url) {
524
547
  super(
525
548
  `Refusing to send a payment header to ${url}: the paid x402 retry must go to an https URL (or a loopback / reserved test host). The merchant's challenge declared this resource URL; retry with the https URL you quoted (pass it as \`url\`), and report a merchant whose challenge downgrades the scheme.`,
@@ -537,7 +560,7 @@ function assertSecureX402RetryTarget(url) {
537
560
 
538
561
  // src/merchant-egress.ts
539
562
  var MERCHANT_EGRESS_REFUSED_CODE = "MERCHANT_EGRESS_REFUSED";
540
- var MerchantEgressRefusedError = class extends chunkMZKLAHBK_cjs.HavenError {
563
+ var MerchantEgressRefusedError = class extends chunkZA3NOSO2_cjs.HavenError {
541
564
  url;
542
565
  refusal;
543
566
  beforeRequest;
@@ -568,7 +591,7 @@ var MerchantEgressRefusedError = class extends chunkMZKLAHBK_cjs.HavenError {
568
591
  }
569
592
  };
570
593
  var MERCHANT_EGRESS_RESPONSE_CAP_CODE = "MERCHANT_EGRESS_RESPONSE_CAP";
571
- var MerchantEgressResponseCapError = class extends chunkMZKLAHBK_cjs.HavenError {
594
+ var MerchantEgressResponseCapError = class extends chunkZA3NOSO2_cjs.HavenError {
572
595
  url;
573
596
  limitBytes;
574
597
  constructor(message, limitBytes, url) {
@@ -752,7 +775,7 @@ var McpMerchantTransport = class {
752
775
  return await this.followRedirects(url, init, signal, void 0, carriesPayment);
753
776
  } catch (err) {
754
777
  if (timeoutSignal.aborted) {
755
- throw new chunkMZKLAHBK_cjs.MerchantTimeoutError(`Merchant request timed out after ${timeoutMs}ms: ${url}`);
778
+ throw new chunkZA3NOSO2_cjs.MerchantTimeoutError(`Merchant request timed out after ${timeoutMs}ms: ${url}`);
756
779
  }
757
780
  throw err;
758
781
  }
@@ -786,7 +809,7 @@ var McpMerchantTransport = class {
786
809
  return this.capResponse(response, finalUrl, maxBytes);
787
810
  } catch (err) {
788
811
  if (timeoutSignal.aborted) {
789
- throw new chunkMZKLAHBK_cjs.MerchantTimeoutError(`Merchant request timed out after ${timeoutMs}ms: ${finalUrl}`);
812
+ throw new chunkZA3NOSO2_cjs.MerchantTimeoutError(`Merchant request timed out after ${timeoutMs}ms: ${finalUrl}`);
790
813
  }
791
814
  throw err;
792
815
  }
@@ -980,7 +1003,7 @@ var McpMerchantTransport = class {
980
1003
  text = await response.clone().text();
981
1004
  } catch (err) {
982
1005
  if (err instanceof MerchantEgressResponseCapError) throw err;
983
- if (isBodyPhaseTimeout(err)) throw new chunkMZKLAHBK_cjs.MerchantTimeoutError(`Merchant response body read timed out.`);
1006
+ if (isBodyPhaseTimeout(err)) throw new chunkZA3NOSO2_cjs.MerchantTimeoutError(`Merchant response body read timed out.`);
984
1007
  return void 0;
985
1008
  }
986
1009
  if ((response.headers.get("content-type") ?? "").includes("text/event-stream")) {
@@ -1005,7 +1028,7 @@ var McpMerchantTransport = class {
1005
1028
  text = await response.clone().text();
1006
1029
  } catch (err) {
1007
1030
  if (err instanceof MerchantEgressResponseCapError) throw err;
1008
- if (isBodyPhaseTimeout(err)) throw new chunkMZKLAHBK_cjs.MerchantTimeoutError(`Merchant response body read timed out.`);
1031
+ if (isBodyPhaseTimeout(err)) throw new chunkZA3NOSO2_cjs.MerchantTimeoutError(`Merchant response body read timed out.`);
1009
1032
  return response;
1010
1033
  }
1011
1034
  const message = selectJsonRpcResult(parseSseJsonRpcMessages(text));
@@ -1067,8 +1090,8 @@ var McpMerchantTransport = class {
1067
1090
  async deliverPayment(url, init, paymentHeader) {
1068
1091
  assertSecureX402RetryTarget(url);
1069
1092
  const headers = new Headers(init?.headers);
1070
- const send = chunkIKQIIMM6_cjs.x402PaymentHeaderNamesFor(paymentHeader);
1071
- for (const name of chunkIKQIIMM6_cjs.X402_PAYMENT_HEADER_NAMES) {
1093
+ const send = chunkV2ODMLDD_cjs.x402PaymentHeaderNamesFor(paymentHeader);
1094
+ for (const name of chunkV2ODMLDD_cjs.X402_PAYMENT_HEADER_NAMES) {
1072
1095
  if (send.includes(name)) headers.set(name, paymentHeader);
1073
1096
  else headers.delete(name);
1074
1097
  }
@@ -1155,7 +1178,7 @@ function mcpToolResultOf(value) {
1155
1178
  function extractMcpPaymentRequired(toolResult) {
1156
1179
  if (toolResult.isError !== true) return void 0;
1157
1180
  if (isRecord(toolResult.structuredContent)) {
1158
- const parsed = chunkIKQIIMM6_cjs.normalizePaymentRequired(toolResult.structuredContent);
1181
+ const parsed = chunkV2ODMLDD_cjs.normalizePaymentRequired(toolResult.structuredContent);
1159
1182
  if (parsed) return parsed;
1160
1183
  }
1161
1184
  if (Array.isArray(toolResult.content)) {
@@ -1167,7 +1190,7 @@ function extractMcpPaymentRequired(toolResult) {
1167
1190
  } catch {
1168
1191
  continue;
1169
1192
  }
1170
- const parsed = chunkIKQIIMM6_cjs.normalizePaymentRequired(candidate);
1193
+ const parsed = chunkV2ODMLDD_cjs.normalizePaymentRequired(candidate);
1171
1194
  if (parsed) return parsed;
1172
1195
  }
1173
1196
  }
@@ -1191,7 +1214,7 @@ function withMcpPaymentMeta(init, paymentHeader) {
1191
1214
  if (!request) return init;
1192
1215
  let envelope;
1193
1216
  try {
1194
- envelope = chunkIKQIIMM6_cjs.decodeBase64Json(paymentHeader);
1217
+ envelope = chunkV2ODMLDD_cjs.decodeBase64Json(paymentHeader);
1195
1218
  } catch {
1196
1219
  return init;
1197
1220
  }
@@ -1207,7 +1230,7 @@ function withMcpPaymentMeta(init, paymentHeader) {
1207
1230
  };
1208
1231
  }
1209
1232
  function encodeMcpSettlementReceipt(settlement) {
1210
- return chunkIKQIIMM6_cjs.encodeBase64Json(settlement);
1233
+ return chunkV2ODMLDD_cjs.encodeBase64Json(settlement);
1211
1234
  }
1212
1235
  function bodyCarriesX402Payment(body) {
1213
1236
  let text;
@@ -1345,8 +1368,19 @@ function deriveReadiness(status, allowances) {
1345
1368
  if (status !== "active") return "revoked";
1346
1369
  return allowances.some((allowance) => safeBigInt(allowance.remainingAtomic) > 0n) ? "ready" : "needs_approval";
1347
1370
  }
1371
+ function deriveBudgetRefillsAt(readiness, allowances) {
1372
+ if (readiness !== "needs_approval" || allowances.length === 0) return null;
1373
+ const times = allowances.map((allowance) => allowance.nextRefillAt).filter((at) => at !== null && !Number.isNaN(Date.parse(at)));
1374
+ if (times.length === 0) return null;
1375
+ return times.reduce((earliest, at) => Date.parse(at) < Date.parse(earliest) ? at : earliest);
1376
+ }
1377
+ function deriveBudgetEndedAt(readiness, allowances, budgetEndedAt) {
1378
+ if (readiness !== "needs_approval" || allowances.length > 0) return null;
1379
+ if (!budgetEndedAt || Number.isNaN(Date.parse(budgetEndedAt))) return null;
1380
+ return budgetEndedAt;
1381
+ }
1348
1382
  function formatRemainingDisplay(tokenAddress, tokenSymbol, remainingAtomic) {
1349
- const token = chunkIKQIIMM6_cjs.resolveTokenFromAddress(tokenAddress);
1383
+ const token = chunkV2ODMLDD_cjs.resolveTokenFromAddress(tokenAddress);
1350
1384
  return token ? `${formatAtomicAmount(safeBigInt(remainingAtomic), token.decimals)} ${tokenSymbol}` : `${remainingAtomic} ${tokenSymbol} (atomic; unknown decimals)`;
1351
1385
  }
1352
1386
  function formatTokenAmount(atomic, decimals) {
@@ -1366,7 +1400,7 @@ function mapSupersession(raw) {
1366
1400
  replacementAgentId,
1367
1401
  supersededAt,
1368
1402
  warning: `This agent was replaced on its machine by agent ${replacementAgentId} at ${supersededAt}. This session is still running as the old agent: restart the agent runtime so it loads the new agent, and ask the user to remove this agent on its Haven agent page if it is no longer used \u2014 it keeps any budget it still holds until then.`,
1369
- nextAction: chunkMZKLAHBK_cjs.AgentPaymentNextAction.StopAndTellUser,
1403
+ nextAction: chunkZA3NOSO2_cjs.AgentPaymentNextAction.StopAndTellUser,
1370
1404
  nextToolOmittedReason: "The next step is the user's: restart this session, and remove the superseded agent in the Haven dashboard. No Haven tool does either."
1371
1405
  };
1372
1406
  }
@@ -1436,7 +1470,7 @@ function summarizePendingSubBudget(row) {
1436
1470
  };
1437
1471
  }
1438
1472
  function summarizeTaskBudget(taskBudget) {
1439
- const token = chunkIKQIIMM6_cjs.resolveTokenFromAddress(taskBudget.tokenAddress);
1473
+ const token = chunkV2ODMLDD_cjs.resolveTokenFromAddress(taskBudget.tokenAddress);
1440
1474
  const maxDisplay = token ? `${formatAtomicAmount(safeBigInt(taskBudget.maxAtomic), token.decimals)} ${token.symbol}` : `${taskBudget.maxAtomic} (atomic; unknown decimals)`;
1441
1475
  const spendDisplay = (atomic) => {
1442
1476
  if (atomic === null) return null;
@@ -1513,11 +1547,23 @@ var AccountReads = class {
1513
1547
  isResetPending: allowance.onchain.isResetPending,
1514
1548
  // #3731: same provenance as the detailed read's field — the compact
1515
1549
  // row is a projection of the same allowance, never a second source.
1516
- fundsCoverRemaining: allowance.fundsCoverRemaining
1550
+ fundsCoverRemaining: allowance.fundsCoverRemaining,
1551
+ nextRefillAt: allowance.nextRefillAt
1517
1552
  };
1518
1553
  });
1519
1554
  const readiness = deriveReadiness(agent.status, allowances);
1520
- return { ...agent, readiness, spend_authority_readiness: readiness, allowances, taskBudgets, pendingSubBudgetSignatures };
1555
+ const budgetRefillsAt = deriveBudgetRefillsAt(readiness, allowances);
1556
+ const budgetEndedAt = deriveBudgetEndedAt(readiness, allowances, allowanceSummary.budgetEndedAt);
1557
+ return {
1558
+ ...agent,
1559
+ readiness,
1560
+ spend_authority_readiness: readiness,
1561
+ budgetRefillsAt,
1562
+ budgetEndedAt,
1563
+ allowances,
1564
+ taskBudgets,
1565
+ pendingSubBudgetSignatures
1566
+ };
1521
1567
  }
1522
1568
  /**
1523
1569
  * #3329: `GET /task-budgets?status=open`, mapped to the condensed summary
@@ -1569,7 +1615,7 @@ var AccountReads = class {
1569
1615
  async listTaskBudgetsSummary() {
1570
1616
  try {
1571
1617
  const raw = await this.transport.get("/task-budgets?status=live").catch((error) => {
1572
- if (error instanceof chunkMZKLAHBK_cjs.HavenApiError && error.statusCode === 400) {
1618
+ if (error instanceof chunkZA3NOSO2_cjs.HavenApiError && error.statusCode === 400) {
1573
1619
  return this.transport.get("/task-budgets?status=all");
1574
1620
  }
1575
1621
  throw error;
@@ -1613,6 +1659,9 @@ var AccountReads = class {
1613
1659
  accountAddress: raw.account_address,
1614
1660
  delegateAddress: raw.delegate_address,
1615
1661
  chainId: raw.chain_id,
1662
+ // #4352: a non-empty parseable date → itself; anything else (absent on
1663
+ // an older backend, null when no budget has ended) → null.
1664
+ budgetEndedAt: typeof raw.budget_ended_at === "string" && !Number.isNaN(Date.parse(raw.budget_ended_at)) ? raw.budget_ended_at : null,
1616
1665
  supersededBy: mapSupersession(raw.superseded_by),
1617
1666
  allowances: raw.allowances.map((allowance) => ({
1618
1667
  id: allowance.id,
@@ -1631,6 +1680,9 @@ var AccountReads = class {
1631
1680
  // "unverifiable", not a missing key. The key is absent on the wire
1632
1681
  // when the remaining is 0; that maps to null here too.
1633
1682
  fundsCoverRemaining: allowance.funds_cover_remaining === true || allowance.funds_cover_remaining === false ? allowance.funds_cover_remaining : null,
1683
+ // #4355: a non-empty string → itself; anything else (absent on an
1684
+ // older backend, null when the budget never refills) → null.
1685
+ nextRefillAt: typeof allowance.next_refill_at === "string" && allowance.next_refill_at !== "" ? allowance.next_refill_at : null,
1634
1686
  remainingDisplay: formatRemainingDisplay(allowance.token_address, allowance.token_symbol, allowance.onchain.remaining),
1635
1687
  onchain: {
1636
1688
  amount: allowance.onchain.amount,
@@ -1679,7 +1731,7 @@ var AccountReads = class {
1679
1731
  payment: payment2,
1680
1732
  allowance: null,
1681
1733
  warnings: [{
1682
- code: chunkMZKLAHBK_cjs.AgentPaymentWarningCode.AllowanceCheckUnavailable,
1734
+ code: chunkZA3NOSO2_cjs.AgentPaymentWarningCode.AllowanceCheckUnavailable,
1683
1735
  message: `Could not read the post-purchase allowance/budget for payment ${paymentId} (${detail}). The payment itself succeeded \u2014 the on-chain policy remains the actual spend gate; this only affects the remaining-budget figure reported here.`
1684
1736
  }]
1685
1737
  });
@@ -1772,7 +1824,7 @@ var AccountReads = class {
1772
1824
  */
1773
1825
  async getReceipt(paymentId) {
1774
1826
  const { receipt } = await this.transport.get(`/payments/${paymentId}/receipt`);
1775
- return { receipt, verification: chunkDXBAN4SN_cjs.verifyPaymentReceipt(receipt) };
1827
+ return { receipt, verification: chunk4JTLJVBS_cjs.verifyPaymentReceipt(receipt) };
1776
1828
  }
1777
1829
  async fetchAgent() {
1778
1830
  const raw = await this.transport.get("/machine-payments/agent");
@@ -1808,7 +1860,7 @@ function isWaitTimeout(err) {
1808
1860
  async function waitForSweepTx(tx) {
1809
1861
  let receipt;
1810
1862
  try {
1811
- receipt = await tx.wait(1, chunkMZKLAHBK_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS);
1863
+ receipt = await tx.wait(1, chunkZA3NOSO2_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS);
1812
1864
  } catch (err) {
1813
1865
  if (!isWaitTimeout(err)) throw err;
1814
1866
  return { txHash: tx.hash, confirmation: "unconfirmed" };
@@ -1822,16 +1874,16 @@ var DelegateSweepApi = class {
1822
1874
  }
1823
1875
  options;
1824
1876
  async sweepDelegate() {
1825
- if (!this.options.delegateKey) throw new chunkMZKLAHBK_cjs.HavenSigningError("delegateKey is required for sweepDelegate.");
1877
+ if (!this.options.delegateKey) throw new chunkZA3NOSO2_cjs.HavenSigningError("delegateKey is required for sweepDelegate.");
1826
1878
  const agent = await this.options.getAgent();
1827
- if (!agent.delegateAddress) throw new chunkMZKLAHBK_cjs.HavenApiError("Agent has no delegate address.", 422);
1879
+ if (!agent.delegateAddress) throw new chunkZA3NOSO2_cjs.HavenApiError("Agent has no delegate address.", 422);
1828
1880
  const rpcUrl = this.options.chainRpcs[agent.chainId];
1829
- if (!rpcUrl) throw new chunkMZKLAHBK_cjs.HavenApiError(`chainRpcs[${agent.chainId}] must be configured to sweep the delegate wallet.`, 422);
1881
+ if (!rpcUrl) throw new chunkZA3NOSO2_cjs.HavenApiError(`chainRpcs[${agent.chainId}] must be configured to sweep the delegate wallet.`, 422);
1830
1882
  const provider = createJsonRpcProvider(rpcUrl);
1831
1883
  const wallet = createWallet(this.options.delegateKey, provider);
1832
1884
  const transfers = [];
1833
- if (chunkIKQIIMM6_cjs.isSweepableChain(agent.chainId)) {
1834
- const contract = createErc20Contract(chunkIKQIIMM6_cjs.sweepUsdcAddress(agent.chainId), ["function balanceOf(address) view returns (uint256)", "function transfer(address to, uint256 amount) returns (bool)"], wallet);
1885
+ if (chunkV2ODMLDD_cjs.isSweepableChain(agent.chainId)) {
1886
+ const contract = createErc20Contract(chunkV2ODMLDD_cjs.sweepUsdcAddress(agent.chainId), ["function balanceOf(address) view returns (uint256)", "function transfer(address to, uint256 amount) returns (bool)"], wallet);
1835
1887
  const balance2 = await contract.balanceOf(agent.delegateAddress);
1836
1888
  if (balance2 > 0n) {
1837
1889
  const tx = await contract.transfer(agent.accountAddress, balance2);
@@ -1919,7 +1971,7 @@ function snapshotRequestBody(body) {
1919
1971
  if (body == null) return void 0;
1920
1972
  if (typeof body === "string") return body;
1921
1973
  if (body instanceof URLSearchParams) return body.toString();
1922
- throw new chunkMZKLAHBK_cjs.HavenApiError(
1974
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
1923
1975
  "Quote helpers can only capture resumable request bodies that are strings or URLSearchParams. For streams, blobs, or binary bodies, preserve the original request yourself and call the matching resume method with fresh init.",
1924
1976
  400
1925
1977
  );
@@ -1940,12 +1992,12 @@ function requestInitFromSnapshot(request) {
1940
1992
  };
1941
1993
  }
1942
1994
  function noCompatiblePaymentOptionError(accepts) {
1943
- const erc7710Only = chunkIKQIIMM6_cjs.selectErc7710PaymentOption(accepts) !== null;
1995
+ const erc7710Only = chunkV2ODMLDD_cjs.selectErc7710PaymentOption(accepts) !== null;
1944
1996
  const unsupportedOnly = !erc7710Only && accepts.some(
1945
- (opt) => opt !== null && typeof opt === "object" && !chunkIKQIIMM6_cjs.isErc7710Option(opt) && (chunkIKQIIMM6_cjs.x402AssetTransferMethod(opt) !== null || opt.extra?.paymentFlow !== void 0)
1997
+ (opt) => opt !== null && typeof opt === "object" && !chunkV2ODMLDD_cjs.isErc7710Option(opt) && (chunkV2ODMLDD_cjs.x402AssetTransferMethod(opt) !== null || opt.extra?.paymentFlow !== void 0)
1946
1998
  );
1947
1999
  const offeredSchemes = nonExactSchemesOnly(accepts);
1948
- return new chunkMZKLAHBK_cjs.HavenApiError(
2000
+ return new chunkZA3NOSO2_cjs.HavenApiError(
1949
2001
  "No compatible payment option found in x402 requirements. Haven supports standard x402 exact payments on Base USDC." + (offeredSchemes ? ` The merchant offered only ${offeredSchemes}; Haven pays only the 'exact' scheme. For a request with a body, this often means the body or its Content-Type was missing or invalid: send the full request again (method, body, and Content-Type: application/json for a JSON API).` : erc7710Only ? " The only Haven-compatible option this merchant advertises is tagged extra.assetTransferMethod: 'erc7710' (direct settlement), which this EIP-3009 payment path cannot settle \u2014 the limitation is the settlement scheme, not the asset. Paying this merchant requires a delegation-rail erc7710 flow (settleX402Erc7710, or the hosted MCP purchase tools)." : unsupportedOnly ? " Every option this merchant advertises asks for a transfer method or payment flow Haven cannot construct (for example extra.assetTransferMethod: 'permit2', or an unrecognized extra.paymentFlow). No payment intent was created and no funds moved." : ""),
1950
2002
  400
1951
2003
  );
@@ -1964,15 +2016,15 @@ function nonExactSchemesOnly(accepts) {
1964
2016
  return schemes.map((s) => `'${s}'`).join(", ");
1965
2017
  }
1966
2018
  function buildX402Quote(paymentRequired, request, idempotencyKey, mcpTransport) {
1967
- const standard = chunkIKQIIMM6_cjs.selectStandardPaymentOption(paymentRequired.accepts);
1968
- const option = standard ?? chunkIKQIIMM6_cjs.selectErc7710PaymentOption(paymentRequired.accepts);
2019
+ const standard = chunkV2ODMLDD_cjs.selectStandardPaymentOption(paymentRequired.accepts);
2020
+ const option = standard ?? chunkV2ODMLDD_cjs.selectErc7710PaymentOption(paymentRequired.accepts);
1969
2021
  if (!option) {
1970
2022
  throw noCompatiblePaymentOptionError(paymentRequired.accepts);
1971
2023
  }
1972
- const token = chunkIKQIIMM6_cjs.resolveTokenFromAddress(option.asset, option.network);
2024
+ const token = chunkV2ODMLDD_cjs.resolveTokenFromAddress(option.asset, option.network);
1973
2025
  return {
1974
2026
  rail: "x402",
1975
- idempotencyKey: idempotencyKey ?? chunkIKQIIMM6_cjs.buildX402IdempotencyKey(paymentRequired, option),
2027
+ idempotencyKey: idempotencyKey ?? chunkV2ODMLDD_cjs.buildX402IdempotencyKey(paymentRequired, option),
1976
2028
  paymentRequired,
1977
2029
  accepted: option,
1978
2030
  acceptedScheme: standard ? "standard" : "erc7710",
@@ -1986,8 +2038,8 @@ function buildX402Quote(paymentRequired, request, idempotencyKey, mcpTransport)
1986
2038
  resourceUrlDiffersFromRequest: paymentRequired.resource.url !== request.url,
1987
2039
  description: paymentRequired.resource.description ?? option.description ?? null,
1988
2040
  mimeType: paymentRequired.resource.mimeType ?? option.mimeType ?? null,
1989
- amountAtomic: chunkIKQIIMM6_cjs.x402AuthorizationAmount(option),
1990
- amount: decimalFromUsdcAtomic(chunkIKQIIMM6_cjs.x402AuthorizationAmount(option)),
2041
+ amountAtomic: chunkV2ODMLDD_cjs.x402AuthorizationAmount(option),
2042
+ amount: decimalFromUsdcAtomic(chunkV2ODMLDD_cjs.x402AuthorizationAmount(option)),
1991
2043
  token: token?.symbol ?? "USDC",
1992
2044
  // #1351: null when the asset is unrecognised on this network — the
1993
2045
  // `token` fallback above is a LABEL, not evidence of 6 decimals, and a
@@ -2026,7 +2078,7 @@ function buildX402Receipt(input) {
2026
2078
  payTo: input.merchantTo ?? input.accepted.payTo
2027
2079
  },
2028
2080
  x402: {
2029
- amount: chunkIKQIIMM6_cjs.x402AuthorizationAmount(input.accepted),
2081
+ amount: chunkV2ODMLDD_cjs.x402AuthorizationAmount(input.accepted),
2030
2082
  token: input.token,
2031
2083
  network: input.accepted.network,
2032
2084
  asset: input.accepted.asset,
@@ -2035,7 +2087,7 @@ function buildX402Receipt(input) {
2035
2087
  };
2036
2088
  }
2037
2089
  function buildX402ResumeState(input) {
2038
- const token = chunkIKQIIMM6_cjs.resolveTokenFromAddress(input.accepted.asset, input.accepted.network);
2090
+ const token = chunkV2ODMLDD_cjs.resolveTokenFromAddress(input.accepted.asset, input.accepted.network);
2039
2091
  return {
2040
2092
  rail: "x402",
2041
2093
  paymentId: input.paymentId,
@@ -2046,8 +2098,8 @@ function buildX402ResumeState(input) {
2046
2098
  request: input.request,
2047
2099
  resourceUrl: input.paymentRequired.resource.url,
2048
2100
  description: input.paymentRequired.resource.description ?? input.accepted.description ?? null,
2049
- amountAtomic: chunkIKQIIMM6_cjs.x402AuthorizationAmount(input.accepted),
2050
- amount: decimalFromUsdcAtomic(chunkIKQIIMM6_cjs.x402AuthorizationAmount(input.accepted)),
2101
+ amountAtomic: chunkV2ODMLDD_cjs.x402AuthorizationAmount(input.accepted),
2102
+ amount: decimalFromUsdcAtomic(chunkV2ODMLDD_cjs.x402AuthorizationAmount(input.accepted)),
2051
2103
  token: token?.symbol ?? "USDC",
2052
2104
  asset: input.accepted.asset,
2053
2105
  network: input.accepted.network,
@@ -2056,7 +2108,7 @@ function buildX402ResumeState(input) {
2056
2108
  };
2057
2109
  }
2058
2110
  function attachX402ResumeState(err, paymentRequired, accepted, idempotencyKey, request) {
2059
- if (!(err instanceof chunkMZKLAHBK_cjs.HavenPaymentStateError)) return;
2111
+ if (!(err instanceof chunkZA3NOSO2_cjs.HavenPaymentStateError)) return;
2060
2112
  if (err.state.rail !== "x402") return;
2061
2113
  err.resumeState = buildX402ResumeState({
2062
2114
  paymentId: err.state.paymentId,
@@ -2077,17 +2129,17 @@ function attachResumeState(err, input) {
2077
2129
  }
2078
2130
  function assertCanResumeX402(status, paymentRequired, option) {
2079
2131
  if (status.rail !== "x402") {
2080
- throw new chunkMZKLAHBK_cjs.HavenPaymentStateError(
2132
+ throw new chunkZA3NOSO2_cjs.HavenPaymentStateError(
2081
2133
  `Payment ${status.paymentId} is ${status.rail}, not x402.`,
2082
2134
  409,
2083
2135
  status
2084
2136
  );
2085
2137
  }
2086
- if (status.nextAction !== chunkMZKLAHBK_cjs.AgentPaymentNextAction.RetryOriginalX402Request) {
2087
- throw new chunkMZKLAHBK_cjs.HavenPaymentStateError(status.message, paymentStateStatusCode(status.status, 409), status);
2138
+ if (status.nextAction !== chunkZA3NOSO2_cjs.AgentPaymentNextAction.RetryOriginalX402Request) {
2139
+ throw new chunkZA3NOSO2_cjs.HavenPaymentStateError(status.message, paymentStateStatusCode(status.status, 409), status);
2088
2140
  }
2089
2141
  if (!status.txHash) {
2090
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2142
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2091
2143
  `x402 payment ${status.paymentId} is ready to retry but has no Haven transaction hash.`,
2092
2144
  502,
2093
2145
  status,
@@ -2095,7 +2147,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
2095
2147
  );
2096
2148
  }
2097
2149
  if (status.resourceUrl && status.resourceUrl !== paymentRequired.resource.url) {
2098
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2150
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2099
2151
  "x402 resume request does not match the approved resource URL.",
2100
2152
  409,
2101
2153
  { status, paymentRequired },
@@ -2103,7 +2155,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
2103
2155
  );
2104
2156
  }
2105
2157
  if (status.merchantAddress && !sameAddress(status.merchantAddress, option.payTo)) {
2106
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2158
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2107
2159
  "x402 resume request does not match the approved merchant.",
2108
2160
  409,
2109
2161
  { status, selectedPayment: option },
@@ -2112,7 +2164,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
2112
2164
  }
2113
2165
  const optionChainId = chainIdFromNetwork(option.network);
2114
2166
  if (status.chainId && optionChainId && status.chainId !== optionChainId) {
2115
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2167
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2116
2168
  "x402 resume request does not match the approved network.",
2117
2169
  409,
2118
2170
  { status, selectedPayment: option },
@@ -2120,7 +2172,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
2120
2172
  );
2121
2173
  }
2122
2174
  if (status.token && status.token !== "USDC") {
2123
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2175
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2124
2176
  "x402 resume request does not match the approved token.",
2125
2177
  409,
2126
2178
  { status, selectedPayment: option },
@@ -2128,9 +2180,9 @@ function assertCanResumeX402(status, paymentRequired, option) {
2128
2180
  );
2129
2181
  }
2130
2182
  const approvedAmount = status.amount ? normalizeDecimal(status.amount) : "";
2131
- const requestedAmount = normalizeDecimal(decimalFromUsdcAtomic(chunkIKQIIMM6_cjs.x402AuthorizationAmount(option)));
2183
+ const requestedAmount = normalizeDecimal(decimalFromUsdcAtomic(chunkV2ODMLDD_cjs.x402AuthorizationAmount(option)));
2132
2184
  if (approvedAmount && approvedAmount !== requestedAmount) {
2133
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2185
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2134
2186
  "x402 resume request does not match the approved amount.",
2135
2187
  409,
2136
2188
  { status, selectedPayment: option },
@@ -2186,7 +2238,7 @@ var X402FundingLeg = class {
2186
2238
  const cached = this.receiptCache.get(idempotencyKey);
2187
2239
  if (!cached || cached.expiresAt <= Date.now()) return void 0;
2188
2240
  if (!sameX402TaskBudget(cached.taskBudgetId, taskBudgetId) || !sameX402TaskBudget(cached.subBudgetId, subBudgetId)) {
2189
- throw new chunkMZKLAHBK_cjs.X402TaskBudgetMismatchError(
2241
+ throw new chunkZA3NOSO2_cjs.X402TaskBudgetMismatchError(
2190
2242
  `The x402 idempotency key '${idempotencyKey}' was already used under a different authorizing budget (task '${cached.taskBudgetId ?? "none"}' vs '${taskBudgetId ?? "none"}', sub '${cached.subBudgetId ?? "none"}' vs '${subBudgetId ?? "none"}'). Pass a new idempotencyKey to pay under this budget.`,
2191
2243
  idempotencyKey,
2192
2244
  cached.taskBudgetId,
@@ -2207,7 +2259,7 @@ var X402FundingLeg = class {
2207
2259
  url: paymentRequired.resource.url,
2208
2260
  payTo: this.delegateAddress,
2209
2261
  merchantPayTo: option.payTo,
2210
- amount: chunkIKQIIMM6_cjs.x402AuthorizationAmount(option),
2262
+ amount: chunkV2ODMLDD_cjs.x402AuthorizationAmount(option),
2211
2263
  asset: option.asset,
2212
2264
  network: option.network,
2213
2265
  description: paymentRequired.resource.description,
@@ -2226,17 +2278,17 @@ var X402FundingLeg = class {
2226
2278
  ...subBudgetId ? { subBudgetId } : {}
2227
2279
  });
2228
2280
  const state = paymentStateFromRaw("x402 payment", raw);
2229
- const executedReplay = raw.success && raw.tx_hash ? "idempotency-collision" : state?.nextAction === chunkMZKLAHBK_cjs.AgentPaymentNextAction.RetryOriginalX402Request ? "approval-resume" : null;
2281
+ const executedReplay = raw.success && raw.tx_hash ? "idempotency-collision" : state?.nextAction === chunkZA3NOSO2_cjs.AgentPaymentNextAction.RetryOriginalX402Request ? "approval-resume" : null;
2230
2282
  if (executedReplay) {
2231
2283
  const canFund = await this.delegateCanFund(
2232
2284
  raw.chain_id ?? state?.chainId ?? chainIdFromNetwork(option.network),
2233
2285
  option.asset,
2234
- chunkIKQIIMM6_cjs.x402AuthorizationAmount(option)
2286
+ chunkV2ODMLDD_cjs.x402AuthorizationAmount(option)
2235
2287
  );
2236
2288
  const refuse = executedReplay === "idempotency-collision" ? canFund !== true : canFund === false;
2237
2289
  if (refuse) {
2238
2290
  const settledReceipt = state && executedReplay === "approval-resume" ? this.receiptFromStatus(paymentRequired, option, void 0, state) : this.receiptFromAuthorization(paymentRequired, option, void 0, raw);
2239
- throw new chunkMZKLAHBK_cjs.X402AlreadySettledError(
2291
+ throw new chunkZA3NOSO2_cjs.X402AlreadySettledError(
2240
2292
  canFund === false ? "This x402 payment already settled \u2014 the delegate no longer holds the funds to authorize it again. To buy the same item a second time, pass a distinct `idempotencyKey`; the synthesised key intentionally collapses repeat calls for the same product within a 5-minute window so a retried request cannot pay twice." : "This x402 payment already settled, and whether the delegate can still fund a new authorization could not be verified (no `chainRpcs` entry for this chain). Refusing rather than issue an authorization that may be unfundable. To buy the same item a second time, pass a distinct `idempotencyKey`; to finish an interrupted payment, resume it by `paymentId`.",
2241
2293
  settledReceipt,
2242
2294
  canFund === false ? "settled" : "unverifiable"
@@ -2249,18 +2301,18 @@ var X402FundingLeg = class {
2249
2301
  this.cacheReceipt(idempotencyKey, paymentHeader, receipt2, taskBudgetId, subBudgetId);
2250
2302
  return receipt2;
2251
2303
  }
2252
- if (state?.nextAction === chunkMZKLAHBK_cjs.AgentPaymentNextAction.RetryOriginalX402Request) {
2304
+ if (state?.nextAction === chunkZA3NOSO2_cjs.AgentPaymentNextAction.RetryOriginalX402Request) {
2253
2305
  const receipt2 = this.receiptFromStatus(paymentRequired, option, paymentHeader, state);
2254
2306
  this.cacheReceipt(idempotencyKey, paymentHeader, receipt2, taskBudgetId, subBudgetId);
2255
2307
  return receipt2;
2256
2308
  }
2257
2309
  this.assertSignableAuthorizationState("x402 payment", raw);
2258
2310
  if (!raw.sign_data?.hash) {
2259
- throw new chunkMZKLAHBK_cjs.HavenApiError("No sign_hash returned from x402/authorize", 500, raw);
2311
+ throw chunkZA3NOSO2_cjs.HavenApiError.deterministic("No sign_hash returned from x402/authorize", 500, raw);
2260
2312
  }
2261
2313
  const sig = await this.signForData(raw.sign_data, {
2262
2314
  asset: option.asset,
2263
- amount: chunkIKQIIMM6_cjs.x402AuthorizationAmount(option)
2315
+ amount: chunkV2ODMLDD_cjs.x402AuthorizationAmount(option)
2264
2316
  });
2265
2317
  const execResult = await this.post(
2266
2318
  `/payments/${raw.payment_id}/sign`,
@@ -2295,10 +2347,10 @@ var X402FundingLeg = class {
2295
2347
  */
2296
2348
  async createPaymentHeader(paymentRequired, option, paymentId) {
2297
2349
  if (!this.delegateKey) {
2298
- throw new chunkMZKLAHBK_cjs.HavenSigningError("delegateKey is required to sign x402 payment headers.");
2350
+ throw new chunkZA3NOSO2_cjs.HavenSigningError("delegateKey is required to sign x402 payment headers.");
2299
2351
  }
2300
2352
  const account = accounts.privateKeyToAccount(this.delegateKey);
2301
- const requirements = chunkIKQIIMM6_cjs.toStandardPaymentRequirements(paymentRequired, option);
2353
+ const requirements = chunkV2ODMLDD_cjs.toStandardPaymentRequirements(paymentRequired, option);
2302
2354
  let header;
2303
2355
  if (paymentId) {
2304
2356
  const unsigned = schemes.exact.evm.preparePaymentHeader(
@@ -2306,7 +2358,7 @@ var X402FundingLeg = class {
2306
2358
  paymentRequired.x402Version,
2307
2359
  requirements
2308
2360
  );
2309
- unsigned.payload.authorization.nonce = chunkIKQIIMM6_cjs.deriveX402PaymentNonce(paymentId);
2361
+ unsigned.payload.authorization.nonce = chunkV2ODMLDD_cjs.deriveX402PaymentNonce(paymentId);
2310
2362
  const signed = await schemes.exact.evm.signPaymentHeader(account, requirements, unsigned);
2311
2363
  header = schemes.exact.evm.encodePayment(signed);
2312
2364
  } else {
@@ -2317,15 +2369,15 @@ var X402FundingLeg = class {
2317
2369
  );
2318
2370
  }
2319
2371
  if (paymentRequired.x402Version < 2) return header;
2320
- const payment = chunkIKQIIMM6_cjs.decodeBase64Json(header);
2321
- return chunkIKQIIMM6_cjs.encodeBase64Json(chunkIKQIIMM6_cjs.x402V2PaymentEnvelope(paymentRequired, option, payment.payload));
2372
+ const payment = chunkV2ODMLDD_cjs.decodeBase64Json(header);
2373
+ return chunkV2ODMLDD_cjs.encodeBase64Json(chunkV2ODMLDD_cjs.x402V2PaymentEnvelope(paymentRequired, option, payment.payload));
2322
2374
  }
2323
2375
  // ── Receipt mapping ──────────────────────────────────────────────
2324
2376
  receiptFromAuthorization(paymentRequired, option, paymentHeader, raw, execResult) {
2325
2377
  const txHash = execResult?.tx_hash ?? raw.tx_hash ?? "";
2326
2378
  const chainId = execResult?.chain_id ?? raw.chain_id ?? chainIdFromNetwork(option.network);
2327
2379
  const token = execResult?.token ?? raw.token ?? "USDC";
2328
- const amount = execResult?.amount ?? raw.amount ?? decimalFromUsdcAtomic(chunkIKQIIMM6_cjs.x402AuthorizationAmount(option));
2380
+ const amount = execResult?.amount ?? raw.amount ?? decimalFromUsdcAtomic(chunkV2ODMLDD_cjs.x402AuthorizationAmount(option));
2329
2381
  const to = execResult?.to ?? raw.to ?? this.delegateAddress ?? "";
2330
2382
  const explorerUrl = execResult?.explorer_url ?? raw.explorer_url ?? explorerUrlOrEmpty(chainId, txHash);
2331
2383
  const merchantTo = execResult?.merchant_to ?? raw.merchant_to ?? option.payTo;
@@ -2347,7 +2399,7 @@ var X402FundingLeg = class {
2347
2399
  }
2348
2400
  receiptFromStatus(paymentRequired, option, paymentHeader, status) {
2349
2401
  if (!status.txHash) {
2350
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2402
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2351
2403
  `x402 payment ${status.paymentId} is ready to retry but has no Haven transaction hash.`,
2352
2404
  502,
2353
2405
  status,
@@ -2358,7 +2410,7 @@ var X402FundingLeg = class {
2358
2410
  paymentId: status.paymentId,
2359
2411
  txHash: status.txHash,
2360
2412
  token: status.token || "USDC",
2361
- amount: status.amount || decimalFromUsdcAtomic(chunkIKQIIMM6_cjs.x402AuthorizationAmount(option)),
2413
+ amount: status.amount || decimalFromUsdcAtomic(chunkV2ODMLDD_cjs.x402AuthorizationAmount(option)),
2362
2414
  to: this.delegateAddress ?? "",
2363
2415
  resourceUrl: paymentRequired.resource.url,
2364
2416
  explorerUrl: explorerUrlOrEmpty(status.chainId, status.txHash),
@@ -2378,20 +2430,27 @@ var X402FundingLeg = class {
2378
2430
  * Skipped when `chainRpcs` does not include the chain; in that case Haven's
2379
2431
  * backend has already confirmed on-chain submission and callers accept the
2380
2432
  * small propagation window as a trade-off for not configuring an RPC URL.
2433
+ *
2434
+ * #4470: the two outcomes are typed apart. ethers 6 `waitForTransaction`
2435
+ * REJECTS on its timeout (and on an RPC failure) rather than resolving
2436
+ * null, so that path is `FundingConfirmationUnknownError` — funding may
2437
+ * have moved. A mined receipt with `status !== 1` is `FundingRevertedError`.
2381
2438
  */
2382
2439
  async waitForFundingTx(txHash, chainId, timeoutMs = 3e4) {
2383
2440
  if (!txHash || !chainId) return;
2384
2441
  const rpcUrl = this.chainRpcs[chainId];
2385
2442
  if (!rpcUrl) return;
2386
2443
  const provider = createJsonRpcProvider(rpcUrl);
2387
- const onChainReceipt = await provider.waitForTransaction(txHash, 1, timeoutMs);
2388
- if (!onChainReceipt || onChainReceipt.status !== 1) {
2389
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2390
- "Funding tx did not confirm on-chain within the timeout window.",
2391
- 500,
2392
- { txHash, chainId }
2393
- );
2444
+ let onChainReceipt;
2445
+ try {
2446
+ onChainReceipt = await provider.waitForTransaction(txHash, 1, timeoutMs);
2447
+ } catch (err) {
2448
+ throw new chunkZA3NOSO2_cjs.FundingConfirmationUnknownError(txHash, chainId, err instanceof Error ? err.message : String(err));
2449
+ }
2450
+ if (!onChainReceipt) {
2451
+ throw new chunkZA3NOSO2_cjs.FundingConfirmationUnknownError(txHash, chainId, "no receipt within the timeout window");
2394
2452
  }
2453
+ if (onChainReceipt.status !== 1) throw new chunkZA3NOSO2_cjs.FundingRevertedError(txHash, chainId);
2395
2454
  }
2396
2455
  /**
2397
2456
  * Can the delegate EOA still fund an authorization for `amountAtomic`?
@@ -2435,7 +2494,7 @@ var X402FundingLeg = class {
2435
2494
  };
2436
2495
  function getPaymentHeaderValidBefore(paymentHeader) {
2437
2496
  try {
2438
- const payment = chunkIKQIIMM6_cjs.decodeBase64Json(
2497
+ const payment = chunkV2ODMLDD_cjs.decodeBase64Json(
2439
2498
  paymentHeader
2440
2499
  );
2441
2500
  const payload = payment.payload;
@@ -2490,7 +2549,7 @@ var X402Erc7710 = class {
2490
2549
  */
2491
2550
  async settle(paymentRequired, options = {}) {
2492
2551
  if (!this.delegateKey) {
2493
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
2552
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
2494
2553
  "delegateKey is required for x402 payments. Pass it in the HavenClient config."
2495
2554
  );
2496
2555
  }
@@ -2515,21 +2574,21 @@ var X402Erc7710 = class {
2515
2574
  async prepare(paymentRequired, options = {}) {
2516
2575
  const delegationRail = options.delegationRail ?? (await this.getAgent()).executionRail === "delegation";
2517
2576
  if (!delegationRail) {
2518
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2577
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2519
2578
  "erc7710 settlement requires a delegation-rail account; this one is not on it. Use authorizeX402() for the standard EIP-3009 path.",
2520
2579
  400
2521
2580
  );
2522
2581
  }
2523
- const selection = chunkIKQIIMM6_cjs.selectX402SettlementScheme(paymentRequired.accepts, { delegationRail });
2582
+ const selection = chunkV2ODMLDD_cjs.selectX402SettlementScheme(paymentRequired.accepts, { delegationRail });
2524
2583
  if (!selection || selection.scheme !== "erc7710") {
2525
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2584
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2526
2585
  "This merchant does not advertise an erc7710 settlement option (no accepts[] entry carries extra.assetTransferMethod: 'erc7710'). Use authorizeX402() for the standard EIP-3009 path.",
2527
2586
  400
2528
2587
  );
2529
2588
  }
2530
2589
  const option = selection.option;
2531
2590
  const merchantPayTo = option.payTo;
2532
- const amountAtomic = chunkIKQIIMM6_cjs.x402AuthorizationAmount(option);
2591
+ const amountAtomic = chunkV2ODMLDD_cjs.x402AuthorizationAmount(option);
2533
2592
  const raw = await this.post("/x402", {
2534
2593
  url: options.resourceUrl ?? paymentRequired.resource?.url,
2535
2594
  // #2373: the full 402 challenge, persisted verbatim by the backend
@@ -2573,24 +2632,24 @@ var X402Erc7710 = class {
2573
2632
  ...options.subBudgetId ? { subBudgetId: options.subBudgetId } : {}
2574
2633
  });
2575
2634
  if (!raw.payment_id) {
2576
- throw new chunkMZKLAHBK_cjs.HavenApiError("No payment_id returned from x402/authorize", 500, raw);
2635
+ throw chunkZA3NOSO2_cjs.HavenApiError.deterministic("No payment_id returned from x402/authorize", 500, raw);
2577
2636
  }
2578
2637
  if (raw.status === "confirmed" && raw.tx_hash) {
2579
2638
  const requestedUrl = options.resourceUrl ?? paymentRequired.resource?.url;
2580
2639
  const samePurchase = typeof raw.to === "string" && raw.to.toLowerCase() === merchantPayTo.toLowerCase() && raw.resource_url === requestedUrl;
2581
2640
  if (!samePurchase) {
2582
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2641
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2583
2642
  `Idempotency key already belongs to confirmed payment ${raw.payment_id}, which is not this erc7710 purchase (different payee or resource). Nothing was signed and nothing was charged. Check that payment's status before buying again: a funded but undelivered EIP-3009 payment is recovered, not paid twice. Otherwise use a new idempotency key for this purchase.`,
2584
2643
  409,
2585
2644
  raw,
2586
2645
  raw.payment_id
2587
2646
  );
2588
2647
  }
2589
- throw new chunkMZKLAHBK_cjs.X402Erc7710AlreadySettledError(raw.payment_id, raw.tx_hash, raw);
2648
+ throw new chunkZA3NOSO2_cjs.X402Erc7710AlreadySettledError(raw.payment_id, raw.tx_hash, raw);
2590
2649
  }
2591
2650
  const signData = raw.sign_data;
2592
2651
  if (signData?.signature_scheme !== "eip712_delegation" || !signData.typed_data) {
2593
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2652
+ throw chunkZA3NOSO2_cjs.HavenApiError.deterministic(
2594
2653
  `x402/authorize did not return an erc7710 settlement child (signature_scheme was ${JSON.stringify(signData?.signature_scheme)}). Refusing to sign a payload this path did not ask for.`,
2595
2654
  500,
2596
2655
  raw
@@ -2622,9 +2681,9 @@ var X402Erc7710 = class {
2622
2681
  try {
2623
2682
  settled = await this.post(`/x402/${paymentId}/settle`, { signature });
2624
2683
  } catch (err) {
2625
- const body = err instanceof chunkMZKLAHBK_cjs.HavenApiError ? err.body : void 0;
2626
- if (err instanceof chunkMZKLAHBK_cjs.HavenApiError && err.statusCode === 409 && body?.code === "payment_already_settled" && typeof body.tx_hash === "string") {
2627
- throw new chunkMZKLAHBK_cjs.X402Erc7710AlreadySettledError(
2684
+ const body = err instanceof chunkZA3NOSO2_cjs.HavenApiError ? err.body : void 0;
2685
+ if (err instanceof chunkZA3NOSO2_cjs.HavenApiError && err.statusCode === 409 && body?.code === "payment_already_settled" && typeof body.tx_hash === "string") {
2686
+ throw new chunkZA3NOSO2_cjs.X402Erc7710AlreadySettledError(
2628
2687
  typeof body.payment_id === "string" ? body.payment_id : paymentId,
2629
2688
  body.tx_hash,
2630
2689
  body
@@ -2633,7 +2692,7 @@ var X402Erc7710 = class {
2633
2692
  throw err;
2634
2693
  }
2635
2694
  if (!settled.payment_header) {
2636
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2695
+ throw chunkZA3NOSO2_cjs.HavenApiError.deterministic(
2637
2696
  "x402 settle returned no payment_header \u2014 the merchant cannot be retried.",
2638
2697
  500,
2639
2698
  settled
@@ -2643,9 +2702,9 @@ var X402Erc7710 = class {
2643
2702
  }
2644
2703
  };
2645
2704
  function settlementExpectationFromQuote(settlement) {
2646
- const chainId = chunkMZKLAHBK_cjs.chainIdForNetwork(settlement.network);
2705
+ const chainId = chunkZA3NOSO2_cjs.chainIdForNetwork(settlement.network);
2647
2706
  if (chainId === void 0) {
2648
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
2707
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
2649
2708
  `Refusing to sign the x402 settlement child: the merchant's network ${JSON.stringify(settlement.network)} is not one this SDK can verify a settlement child on.`
2650
2709
  );
2651
2710
  }
@@ -2695,7 +2754,7 @@ function x402ToolReceipt(receipt) {
2695
2754
  };
2696
2755
  }
2697
2756
  function toolError(err) {
2698
- if (err instanceof chunkMZKLAHBK_cjs.HavenPaymentStateError) {
2757
+ if (err instanceof chunkZA3NOSO2_cjs.HavenPaymentStateError) {
2699
2758
  return {
2700
2759
  success: false,
2701
2760
  payment_id: err.state.paymentId,
@@ -2740,7 +2799,7 @@ function toolError(err) {
2740
2799
  error: err.message
2741
2800
  };
2742
2801
  }
2743
- if (err instanceof chunkMZKLAHBK_cjs.HavenApiError) {
2802
+ if (err instanceof chunkZA3NOSO2_cjs.HavenApiError) {
2744
2803
  return {
2745
2804
  success: false,
2746
2805
  status_code: err.statusCode,
@@ -2804,14 +2863,14 @@ var MerchantCompletion = class {
2804
2863
  }
2805
2864
  async retryRequest(url, initialInit, paymentRequired, receipt) {
2806
2865
  if (!receipt.accepted) {
2807
- throw new chunkMZKLAHBK_cjs.HavenApiError("No accepted x402 option was recorded for payment retry", 500);
2866
+ throw chunkZA3NOSO2_cjs.HavenApiError.deterministic("No accepted x402 option was recorded for payment retry", 500);
2808
2867
  }
2809
2868
  if (!receipt.paymentHeader) {
2810
- throw new chunkMZKLAHBK_cjs.HavenApiError("No x402 payment header was returned for payment retry", 500);
2869
+ throw chunkZA3NOSO2_cjs.HavenApiError.deterministic("No x402 payment header was returned for payment retry", 500);
2811
2870
  }
2812
2871
  let retryInit = initialInit;
2813
2872
  if (this.getTaxDeclarationHeader && this.delegateKey) {
2814
- const scheme = chunkIKQIIMM6_cjs.x402PaymentHeaderNamesFor(receipt.paymentHeader);
2873
+ const scheme = chunkV2ODMLDD_cjs.x402PaymentHeaderNamesFor(receipt.paymentHeader);
2815
2874
  const isEip3009 = scheme.length > 1;
2816
2875
  if (isEip3009) {
2817
2876
  const resolved = await this.getTaxDeclarationHeader({
@@ -2861,7 +2920,7 @@ var MerchantCompletion = class {
2861
2920
  delegate_to: receipt.to
2862
2921
  }
2863
2922
  });
2864
- throw new chunkMZKLAHBK_cjs.HavenApiError(
2923
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2865
2924
  "x402 retry failed after Haven funded the delegate wallet; reconciliation may be required. The merchant may still settle late: check the payment status before sweeping the delegate.",
2866
2925
  inBandRejection ? X402_RETRY_REJECTED_STATUS : merchant.merchant_status,
2867
2926
  {
@@ -2891,7 +2950,7 @@ var MerchantCompletion = class {
2891
2950
  merchantStatus: retryResponse.status,
2892
2951
  challengePayload: paymentRequired,
2893
2952
  selectedPayment: receipt.accepted,
2894
- paymentProofHeaderName: chunkIKQIIMM6_cjs.x402PaymentHeaderNamesSent(receipt.paymentHeader),
2953
+ paymentProofHeaderName: chunkV2ODMLDD_cjs.x402PaymentHeaderNamesSent(receipt.paymentHeader),
2895
2954
  paymentProofHeader: receipt.paymentHeader,
2896
2955
  protocolReceiptHeaderName,
2897
2956
  protocolReceiptHeader
@@ -2955,18 +3014,18 @@ var MerchantCompletion = class {
2955
3014
  async resolveCompletionContext(input) {
2956
3015
  const status = await this.getPaymentStatus(input.paymentId);
2957
3016
  if (status.rail !== "x402") {
2958
- throw new chunkMZKLAHBK_cjs.HavenPaymentStateError(
3017
+ throw new chunkZA3NOSO2_cjs.HavenPaymentStateError(
2959
3018
  `Payment ${status.paymentId} is ${status.rail}, not x402.`,
2960
3019
  409,
2961
3020
  status
2962
3021
  );
2963
3022
  }
2964
- const readyForMerchantCompletion = input.noFundingLeg ? status.kind === "payment_intent" && status.status === "submitted" : status.nextAction === chunkMZKLAHBK_cjs.AgentPaymentNextAction.RetryOriginalX402Request || status.kind === "payment_intent" && status.status === "confirmed" && status.phase === chunkMZKLAHBK_cjs.AgentPaymentPhase.PaymentConfirmed && status.nextAction === chunkMZKLAHBK_cjs.AgentPaymentNextAction.None;
3023
+ const readyForMerchantCompletion = input.noFundingLeg ? status.kind === "payment_intent" && status.status === "submitted" : status.nextAction === chunkZA3NOSO2_cjs.AgentPaymentNextAction.RetryOriginalX402Request || status.kind === "payment_intent" && status.status === "confirmed" && status.phase === chunkZA3NOSO2_cjs.AgentPaymentPhase.PaymentConfirmed && status.nextAction === chunkZA3NOSO2_cjs.AgentPaymentNextAction.None;
2965
3024
  if (!readyForMerchantCompletion) {
2966
- throw new chunkMZKLAHBK_cjs.HavenPaymentStateError(status.message, paymentStateStatusCode(status.status, 409), status);
3025
+ throw new chunkZA3NOSO2_cjs.HavenPaymentStateError(status.message, paymentStateStatusCode(status.status, 409), status);
2967
3026
  }
2968
3027
  if (!input.noFundingLeg && !status.txHash) {
2969
- throw new chunkMZKLAHBK_cjs.HavenApiError(
3028
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2970
3029
  `x402 payment ${status.paymentId} is ready for merchant completion but has no Haven transaction hash.`,
2971
3030
  502,
2972
3031
  status,
@@ -2975,7 +3034,7 @@ var MerchantCompletion = class {
2975
3034
  }
2976
3035
  const approvedResourceUrl = status.resourceUrl ?? status.x402?.resourceUrl ?? null;
2977
3036
  if (approvedResourceUrl && approvedResourceUrl !== input.url) {
2978
- throw new chunkMZKLAHBK_cjs.HavenApiError(
3037
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
2979
3038
  "x402 merchant completion does not match the approved resource URL.",
2980
3039
  409,
2981
3040
  { status, url: input.url },
@@ -3019,7 +3078,7 @@ var MerchantCompletion = class {
3019
3078
  * reads as funded and undelivered.
3020
3079
  */
3021
3080
  async paidDeliveryInterrupted(err, url, receipt, paymentHeader, hasBody) {
3022
- const scheme = chunkIKQIIMM6_cjs.x402PaymentHeaderNamesFor(paymentHeader).length > 1 ? "eip3009" : "erc7710";
3081
+ const scheme = chunkV2ODMLDD_cjs.x402PaymentHeaderNamesFor(paymentHeader).length > 1 ? "eip3009" : "erc7710";
3023
3082
  const status = err.redirectStatus ?? 0;
3024
3083
  await this.recordRetryRejected({
3025
3084
  rail: "x402",
@@ -3106,7 +3165,7 @@ var MerchantCompletion = class {
3106
3165
  */
3107
3166
  async reportMerchantOutcome(input) {
3108
3167
  if (!Number.isInteger(input.merchantStatus) || input.merchantStatus < 100 || input.merchantStatus > 599) {
3109
- throw new chunkMZKLAHBK_cjs.HavenApiError(
3168
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
3110
3169
  `merchant_status must be an integer HTTP status from 100 to 599 (received ${input.merchantStatus}).`,
3111
3170
  400,
3112
3171
  void 0,
@@ -3115,7 +3174,7 @@ var MerchantCompletion = class {
3115
3174
  }
3116
3175
  const looksAccepted = input.merchantStatus >= 200 && input.merchantStatus < 300;
3117
3176
  if (looksAccepted !== (input.outcome === "accepted")) {
3118
- throw new chunkMZKLAHBK_cjs.HavenApiError(
3177
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
3119
3178
  `outcome "${input.outcome}" contradicts merchant_status ${input.merchantStatus}: report "accepted" only for a 2xx and "rejected" only for a non-2xx.`,
3120
3179
  400,
3121
3180
  void 0,
@@ -3124,14 +3183,14 @@ var MerchantCompletion = class {
3124
3183
  }
3125
3184
  const status = await this.getPaymentStatus(input.paymentId);
3126
3185
  if (status.rail !== "x402") {
3127
- throw new chunkMZKLAHBK_cjs.HavenPaymentStateError(
3186
+ throw new chunkZA3NOSO2_cjs.HavenPaymentStateError(
3128
3187
  `Payment ${status.paymentId} is ${status.rail}, not x402 \u2014 there is no merchant retry to report.`,
3129
3188
  409,
3130
3189
  status
3131
3190
  );
3132
3191
  }
3133
3192
  if (status.status !== "confirmed" || !status.txHash) {
3134
- throw new chunkMZKLAHBK_cjs.HavenPaymentStateError(
3193
+ throw new chunkZA3NOSO2_cjs.HavenPaymentStateError(
3135
3194
  `Payment ${status.paymentId} has no confirmed Haven funding transaction to anchor a merchant report to (status ${status.status}). ${status.message}`,
3136
3195
  paymentStateStatusCode(status.status, 409),
3137
3196
  status
@@ -3139,7 +3198,7 @@ var MerchantCompletion = class {
3139
3198
  }
3140
3199
  const resourceUrl = status.resourceUrl ?? status.x402?.resourceUrl ?? null;
3141
3200
  if (!resourceUrl) {
3142
- throw new chunkMZKLAHBK_cjs.HavenApiError(
3201
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
3143
3202
  `Payment ${status.paymentId} has no recorded resource URL, so a merchant report cannot be stored.`,
3144
3203
  409,
3145
3204
  status,
@@ -3193,15 +3252,16 @@ var MerchantCompletion = class {
3193
3252
  };
3194
3253
  for (let attempt = 0; ; attempt += 1) {
3195
3254
  const result = await this.postEvidenceOnce(body);
3196
- if (result.outcome !== "retryable" || attempt >= EVIDENCE_RETRY_DELAYS_MS.length) {
3255
+ if (result.outcome !== "retryable" || result.statusCode !== EVIDENCE_RETRYABLE_STATUS || attempt >= EVIDENCE_RETRY_DELAYS_MS.length) {
3197
3256
  return result;
3198
3257
  }
3199
3258
  await this.sleep(EVIDENCE_RETRY_DELAYS_MS[attempt]);
3200
3259
  }
3201
3260
  }
3202
3261
  /**
3203
- * ONE evidence attempt — the body of `reportEvidence`'s loop above. A 503
3204
- * answers `retryable` immediately; the caller decides whether to sleep and
3262
+ * ONE evidence attempt — the body of `reportEvidence`'s loop above. A 503,
3263
+ * or no verdict at all (a non-answer or a 408, #4470), answers `retryable`
3264
+ * immediately; the caller decides whether to sleep and
3205
3265
  * re-attempt (`reportEvidence`, and — #4215 — the local settlement report
3206
3266
  * in `retryRequest`) or hand the outcome to its consumer (#3764 D2, the
3207
3267
  * hosted settlement report).
@@ -3211,8 +3271,9 @@ var MerchantCompletion = class {
3211
3271
  await this.post("/machine-payments/evidence", body);
3212
3272
  return { outcome: "confirmed" };
3213
3273
  } catch (err) {
3214
- const statusCode = err instanceof chunkMZKLAHBK_cjs.HavenApiError ? err.statusCode : void 0;
3215
- if (statusCode !== EVIDENCE_RETRYABLE_STATUS) {
3274
+ const statusCode = err instanceof chunkZA3NOSO2_cjs.HavenApiError ? err.statusCode : void 0;
3275
+ const noVerdict = statusCode === 408 || err instanceof chunkZA3NOSO2_cjs.HavenApiError && err.failureCause?.kind === "no_answer";
3276
+ if (statusCode !== EVIDENCE_RETRYABLE_STATUS && !noVerdict) {
3216
3277
  const reason = refusalReasonFromBody(err);
3217
3278
  const errorCode = refusalErrorCodeFromBody(err);
3218
3279
  return {
@@ -3268,7 +3329,7 @@ var MerchantCompletion = class {
3268
3329
  */
3269
3330
  async reportSettlementEvidence(paymentId, settlementTxHash, options = {}) {
3270
3331
  if (isZeroSettlementTxHash(settlementTxHash)) {
3271
- throw new chunkMZKLAHBK_cjs.HavenZeroSettlementHashError(paymentId);
3332
+ throw new chunkZA3NOSO2_cjs.HavenZeroSettlementHashError(paymentId);
3272
3333
  }
3273
3334
  return this.reportEvidence({
3274
3335
  paymentId,
@@ -3310,19 +3371,19 @@ var MerchantCompletion = class {
3310
3371
  function settlementProofFields(paymentHeader) {
3311
3372
  if (!paymentHeader || !paymentHeader.trim()) return {};
3312
3373
  return {
3313
- paymentProofHeaderName: chunkIKQIIMM6_cjs.x402PaymentHeaderNamesSent(paymentHeader),
3374
+ paymentProofHeaderName: chunkV2ODMLDD_cjs.x402PaymentHeaderNamesSent(paymentHeader),
3314
3375
  paymentProofHeader: paymentHeader
3315
3376
  };
3316
3377
  }
3317
3378
  function refusalReasonFromBody(err) {
3318
- if (!(err instanceof chunkMZKLAHBK_cjs.HavenApiError)) return void 0;
3379
+ if (!(err instanceof chunkZA3NOSO2_cjs.HavenApiError)) return void 0;
3319
3380
  const body = err.body;
3320
3381
  if (body === null || typeof body !== "object" || Array.isArray(body)) return void 0;
3321
3382
  const reason = body.reason;
3322
3383
  return typeof reason === "string" && reason.length > 0 ? reason : void 0;
3323
3384
  }
3324
3385
  function refusalErrorCodeFromBody(err) {
3325
- if (!(err instanceof chunkMZKLAHBK_cjs.HavenApiError)) return void 0;
3386
+ if (!(err instanceof chunkZA3NOSO2_cjs.HavenApiError)) return void 0;
3326
3387
  const body = err.body;
3327
3388
  if (body === null || typeof body !== "object" || Array.isArray(body)) return void 0;
3328
3389
  const code = body.error_code;
@@ -3339,7 +3400,7 @@ function parseMerchantSettlement(header) {
3339
3400
  }
3340
3401
  function parseProtocolReceiptHeader(value) {
3341
3402
  try {
3342
- return chunkIKQIIMM6_cjs.decodeBase64Json(value);
3403
+ return chunkV2ODMLDD_cjs.decodeBase64Json(value);
3343
3404
  } catch {
3344
3405
  try {
3345
3406
  return JSON.parse(value);
@@ -3375,7 +3436,7 @@ function x402TypedDataDigest(typedData) {
3375
3436
  try {
3376
3437
  return viem.hashTypedData(typedData);
3377
3438
  } catch (err) {
3378
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3439
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3379
3440
  `The x402 funding intent carried a sign_data.typed_data that is not a valid EIP-712 payload (needs domain, types, primaryType, message), so its digest cannot be derived and no signer could accept it. Underlying error: ${err instanceof Error ? err.message : String(err)}`
3380
3441
  );
3381
3442
  }
@@ -3490,7 +3551,7 @@ var HavenClient = class {
3490
3551
  this.x402Wallet = config.x402Wallet;
3491
3552
  this.egressPolicy = config.merchantEgress;
3492
3553
  this.merchantTransport = new McpMerchantTransport({ merchantTimeout: config.merchantTimeout, egress: config.merchantEgress });
3493
- this.confirmationTimeout = config.confirmationTimeout ?? chunkMZKLAHBK_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS;
3554
+ this.confirmationTimeout = config.confirmationTimeout ?? chunkZA3NOSO2_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS;
3494
3555
  this.pollingInterval = config.pollingInterval ?? DEFAULT_POLLING_INTERVAL;
3495
3556
  this.chainRpcs = config.chainRpcs ?? {};
3496
3557
  if (this.delegateKey) {
@@ -3571,7 +3632,7 @@ var HavenClient = class {
3571
3632
  */
3572
3633
  async pay(request) {
3573
3634
  if (!this.delegateKey) {
3574
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3635
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3575
3636
  "Cannot use pay() without a delegateKey. Use createIntent() + submitSignature() for manual signing."
3576
3637
  );
3577
3638
  }
@@ -3627,15 +3688,15 @@ var HavenClient = class {
3627
3688
  * on-chain allowance — there is nothing to sign until the user approves.
3628
3689
  */
3629
3690
  async createX402Intent(paymentRequired, options = {}) {
3630
- const option = chunkIKQIIMM6_cjs.selectStandardPaymentOption(paymentRequired.accepts);
3691
+ const option = chunkV2ODMLDD_cjs.selectStandardPaymentOption(paymentRequired.accepts);
3631
3692
  if (!option) {
3632
3693
  throw noCompatiblePaymentOptionError(paymentRequired.accepts);
3633
3694
  }
3634
3695
  const fundingTo = options.delegateAddress ?? (await this.getAgent()).delegateAddress;
3635
3696
  if (!fundingTo) {
3636
- throw new chunkMZKLAHBK_cjs.HavenApiError("Authenticated agent has no delegate address registered.", 502);
3697
+ throw chunkZA3NOSO2_cjs.HavenApiError.deterministic("Authenticated agent has no delegate address registered.", 502);
3637
3698
  }
3638
- const idempotencyKey = options.idempotencyKey ?? chunkIKQIIMM6_cjs.buildX402IdempotencyKey(paymentRequired, option);
3699
+ const idempotencyKey = options.idempotencyKey ?? chunkV2ODMLDD_cjs.buildX402IdempotencyKey(paymentRequired, option);
3639
3700
  const raw = await this.post("/x402", {
3640
3701
  url: paymentRequired.resource.url,
3641
3702
  payTo: fundingTo,
@@ -3646,7 +3707,7 @@ var HavenClient = class {
3646
3707
  // of a silent reroute to the erc7710 settlement branch (the #1358
3647
3708
  // review's open-budget misroute). Legacy-rail backends ignore the field.
3648
3709
  settlementScheme: "eip3009",
3649
- amount: chunkIKQIIMM6_cjs.x402AuthorizationAmount(option),
3710
+ amount: chunkV2ODMLDD_cjs.x402AuthorizationAmount(option),
3650
3711
  asset: option.asset,
3651
3712
  network: option.network,
3652
3713
  description: paymentRequired.resource.description,
@@ -3671,15 +3732,15 @@ var HavenClient = class {
3671
3732
  throwPaymentStateError("x402 payment", raw);
3672
3733
  }
3673
3734
  if (!raw.sign_data?.hash) {
3674
- throw new chunkMZKLAHBK_cjs.HavenApiError("No sign_hash returned from x402/authorize", 500, raw);
3735
+ throw chunkZA3NOSO2_cjs.HavenApiError.deterministic("No sign_hash returned from x402/authorize", 500, raw);
3675
3736
  }
3676
3737
  if (raw.sign_data.signature_scheme !== void 0 && !raw.sign_data.typed_data) {
3677
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3738
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3678
3739
  `This account's x402 funding intent declares signature scheme '${raw.sign_data.signature_scheme}' but carried no typed_data to sign. Refusing to fall back to the bare hash \u2014 the account would reject that signature on-chain. This is a backend contract violation; report it rather than working around it.`
3679
3740
  );
3680
3741
  }
3681
3742
  if (!raw.x402_expected_auth) {
3682
- throw new chunkMZKLAHBK_cjs.HavenApiError("No x402 expected-context binding returned from x402/authorize", 500, raw);
3743
+ throw chunkZA3NOSO2_cjs.HavenApiError.deterministic("No x402 expected-context binding returned from x402/authorize", 500, raw);
3683
3744
  }
3684
3745
  return {
3685
3746
  paymentId: raw.payment_id,
@@ -3690,7 +3751,7 @@ var HavenClient = class {
3690
3751
  accepted: option,
3691
3752
  resourceUrl: paymentRequired.resource.url,
3692
3753
  merchantTo: raw.merchant_to ?? option.payTo,
3693
- amountAtomic: chunkIKQIIMM6_cjs.x402AuthorizationAmount(option),
3754
+ amountAtomic: chunkV2ODMLDD_cjs.x402AuthorizationAmount(option),
3694
3755
  asset: option.asset,
3695
3756
  network: option.network,
3696
3757
  expectedAuth: raw.x402_expected_auth,
@@ -3715,13 +3776,13 @@ var HavenClient = class {
3715
3776
  */
3716
3777
  sign(hash) {
3717
3778
  if (!this.delegateKey) {
3718
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3779
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3719
3780
  "Cannot sign without a delegateKey. Pass the private key in HavenClient config, or sign externally."
3720
3781
  );
3721
3782
  }
3722
3783
  const signature = signHash(this.delegateKey, hash);
3723
3784
  if (!verifySignature(hash, signature, this.delegateAddress)) {
3724
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3785
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3725
3786
  "Local signature verification failed \u2014 recovered address does not match delegate key."
3726
3787
  );
3727
3788
  }
@@ -3739,29 +3800,29 @@ var HavenClient = class {
3739
3800
  */
3740
3801
  async signForData(signData, settlementExpectation, fundingExpectation) {
3741
3802
  if (!this.delegateKey) {
3742
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3803
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3743
3804
  "Cannot sign without a delegateKey. Pass the private key in HavenClient config, or sign externally."
3744
3805
  );
3745
3806
  }
3746
3807
  const scheme = signData.signature_scheme;
3747
3808
  if (scheme === "eip191_userop") {
3748
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3809
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3749
3810
  "The session rail is retired \u2014 'eip191_userop' intents can no longer be signed. Re-onboard the account on the delegation rail."
3750
3811
  );
3751
3812
  }
3752
3813
  if (scheme === "eip712_userop") {
3753
3814
  if (!signData.typed_data) {
3754
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3815
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3755
3816
  "sign_data.signature_scheme is eip712_userop but typed_data is missing \u2014 refusing to sign the bare hash (the account would reject it)."
3756
3817
  );
3757
3818
  }
3758
- chunkMZKLAHBK_cjs.assertUserOpTypedDataBinding(signData.typed_data, signData.hash);
3759
- chunkIKQIIMM6_cjs.assertBoundDirectPaymentUserOp(
3819
+ chunkZA3NOSO2_cjs.assertUserOpTypedDataBinding(signData.typed_data, signData.hash);
3820
+ chunkV2ODMLDD_cjs.assertBoundDirectPaymentUserOp(
3760
3821
  signData.typed_data,
3761
3822
  this.delegateAddress
3762
3823
  );
3763
3824
  if (fundingExpectation) {
3764
- chunkIKQIIMM6_cjs.assertFundingLegPaysDelegate(signData.typed_data, {
3825
+ chunkV2ODMLDD_cjs.assertFundingLegPaysDelegate(signData.typed_data, {
3765
3826
  delegateAddress: this.delegateAddress,
3766
3827
  asset: fundingExpectation.asset,
3767
3828
  amount: fundingExpectation.amount
@@ -3771,24 +3832,24 @@ var HavenClient = class {
3771
3832
  }
3772
3833
  if (scheme === "eip712_delegation") {
3773
3834
  if (!signData.typed_data) {
3774
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3835
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3775
3836
  "sign_data.signature_scheme is eip712_delegation but typed_data is missing \u2014 refusing to sign the bare hash (the settlement would be rejected on redemption)."
3776
3837
  );
3777
3838
  }
3778
3839
  if (!settlementExpectation) {
3779
- throw new chunkIKQIIMM6_cjs.HavenTypedDataRefusedError(
3840
+ throw new chunkV2ODMLDD_cjs.HavenTypedDataRefusedError(
3780
3841
  "Refusing to sign an x402 settlement child without an independent expectation of what it must pay (the merchant's 402). Pay erc7710 merchants through settleX402Erc7710(), which supplies it."
3781
3842
  );
3782
3843
  }
3783
- chunkIKQIIMM6_cjs.assertOwnSettlementChild(signData.typed_data, settlementExpectation, this.delegateAddress);
3844
+ chunkV2ODMLDD_cjs.assertOwnSettlementChild(signData.typed_data, settlementExpectation, this.delegateAddress);
3784
3845
  return signSettlementDelegationTypedData(this.delegateKey, signData.typed_data);
3785
3846
  }
3786
3847
  if (scheme === void 0) {
3787
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3848
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3788
3849
  "sign_data.signature_scheme is required \u2014 the legacy AllowanceModule rail that signed the bare hash is retired (#2850). Refusing to guess a signing scheme."
3789
3850
  );
3790
3851
  }
3791
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
3852
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
3792
3853
  `Unknown sign_data.signature_scheme '${scheme}' \u2014 refusing to guess a signing scheme. Update @haven_ai/sdk.`
3793
3854
  );
3794
3855
  }
@@ -3909,6 +3970,12 @@ var HavenClient = class {
3909
3970
  * degrade-to-warning path and the ledger row would still land while the
3910
3971
  * purchase proceeded.
3911
3972
  *
3973
+ * #4458: an agent whose only budget for the token has ENDED is refused the
3974
+ * same way with `error_code: 'delegation_expired'` and `budget_ended_at`
3975
+ * (ISO 8601) — also thrown, also recorded (`source: 'hosted_prepare'`).
3976
+ * The remedy differs: the owner sets a NEW budget, waiting for a period to
3977
+ * reset cannot help.
3978
+ *
3912
3979
  * #3518: without `merchantTo`, an agent whose budgets for the token are all
3913
3980
  * merchant-locked gets 409 `budget_requires_recipient` (thrown, nothing
3914
3981
  * recorded) naming the pins in `budget_recipient_addresses` — repeat the
@@ -3933,12 +4000,13 @@ var HavenClient = class {
3933
4000
  /**
3934
4001
  * Post-purchase allowance/budget summary for a settled payment (#1310).
3935
4002
  *
3936
- * Reuses the EXACT rail-aware read path {@link getAllowances} / #1306's
3937
- * catalog-purchase preflight `allowance` block use — `GET
3938
- * /machine-payments/allowances`, with delegation-rail values coming from
3939
- * the #1090 `deriveDelegationBudgets`-backed enforcer read, never
4003
+ * Reuses the EXACT rail-aware read path {@link getAllowances} uses —
4004
+ * `GET /machine-payments/allowances`, with delegation-rail values coming
4005
+ * from the #1090 `deriveDelegationBudgets`-backed enforcer read, never
3940
4006
  * `agent_allowances` — so this can never disagree with
3941
- * {@link getAllowances} for the same fixture. The settled token is
4007
+ * {@link getAllowances} for the same fixture. (#1306's catalog-purchase
4008
+ * preflight read the same path until #3054; it now calls
4009
+ * `POST /machine-payments/budget-precheck` instead.) The settled token is
3942
4010
  * resolved from {@link getPaymentStatus} so callers pass only
3943
4011
  * `paymentId`, never a second haven_get_agent-style round trip.
3944
4012
  *
@@ -3979,7 +4047,7 @@ var HavenClient = class {
3979
4047
  */
3980
4048
  async getPaymentStatusWithPostPurchaseAllowance(paymentId) {
3981
4049
  const status = await this.getPaymentStatus(paymentId);
3982
- if (status.rail === chunkMZKLAHBK_cjs.AgentPaymentRail.X402 && status.phase === chunkMZKLAHBK_cjs.AgentPaymentPhase.PaymentConfirmed) {
4050
+ if (status.rail === chunkZA3NOSO2_cjs.AgentPaymentRail.X402 && status.phase === chunkZA3NOSO2_cjs.AgentPaymentPhase.PaymentConfirmed) {
3983
4051
  const { allowance, warnings } = await this.getPostPurchaseAllowanceSummary(paymentId);
3984
4052
  return { ...status, allowance, ...warnings.length > 0 ? { warnings } : {} };
3985
4053
  }
@@ -4230,7 +4298,7 @@ var HavenClient = class {
4230
4298
  }
4231
4299
  await sleep(this.pollingInterval);
4232
4300
  }
4233
- throw new chunkMZKLAHBK_cjs.HavenTimeoutError(paymentId);
4301
+ throw new chunkZA3NOSO2_cjs.HavenTimeoutError(paymentId);
4234
4302
  }
4235
4303
  // ── x402 Protocol Support ────────────────────────────────────────
4236
4304
  /**
@@ -4244,24 +4312,24 @@ var HavenClient = class {
4244
4312
  */
4245
4313
  async authorizeX402(paymentRequired, options = {}) {
4246
4314
  if (!this.delegateKey) {
4247
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
4315
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
4248
4316
  "delegateKey is required for x402 payments. Pass it in the HavenClient config."
4249
4317
  );
4250
4318
  }
4251
4319
  if (!this.delegateAddress) {
4252
- throw new chunkMZKLAHBK_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
4320
+ throw new chunkZA3NOSO2_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
4253
4321
  }
4254
- const option = chunkIKQIIMM6_cjs.selectStandardPaymentOption(paymentRequired.accepts);
4322
+ const option = chunkV2ODMLDD_cjs.selectStandardPaymentOption(paymentRequired.accepts);
4255
4323
  if (!option) {
4256
4324
  throw noCompatiblePaymentOptionError(paymentRequired.accepts);
4257
4325
  }
4258
- const idempotencyKey = options.idempotencyKey ?? chunkIKQIIMM6_cjs.buildX402IdempotencyKey(paymentRequired, option);
4326
+ const idempotencyKey = options.idempotencyKey ?? chunkV2ODMLDD_cjs.buildX402IdempotencyKey(paymentRequired, option);
4259
4327
  const cached = this.fundingLeg.cachedReceipt(idempotencyKey, options.taskBudgetId, options.subBudgetId);
4260
4328
  if (cached) return cached;
4261
4329
  const inFlight = this.inFlightX402.get(idempotencyKey);
4262
4330
  if (inFlight) {
4263
4331
  if (!sameX402TaskBudget(this.inFlightX402TaskBudget.get(idempotencyKey), options.taskBudgetId) || !sameX402TaskBudget(this.inFlightX402SubBudget.get(idempotencyKey), options.subBudgetId)) {
4264
- throw new chunkMZKLAHBK_cjs.X402TaskBudgetMismatchError(
4332
+ throw new chunkZA3NOSO2_cjs.X402TaskBudgetMismatchError(
4265
4333
  `The x402 idempotency key '${idempotencyKey}' has an in-flight payment created under a different authorizing budget (task '${this.inFlightX402TaskBudget.get(idempotencyKey) ?? "none"}' vs '${options.taskBudgetId ?? "none"}', sub '${this.inFlightX402SubBudget.get(idempotencyKey) ?? "none"}' vs '${options.subBudgetId ?? "none"}'). Pass a new idempotencyKey to pay under this budget.`,
4266
4334
  idempotencyKey,
4267
4335
  this.inFlightX402TaskBudget.get(idempotencyKey),
@@ -4316,16 +4384,16 @@ var HavenClient = class {
4316
4384
  if (err instanceof MerchantEgressResponseCapError) throw err;
4317
4385
  body = void 0;
4318
4386
  }
4319
- throw new chunkMZKLAHBK_cjs.X402UnexpectedStatusError(
4387
+ throw new chunkZA3NOSO2_cjs.X402UnexpectedStatusError(
4320
4388
  `Expected an x402 quote response with HTTP 402, got HTTP ${response.status}.`,
4321
4389
  response.status || 400,
4322
4390
  body
4323
4391
  );
4324
4392
  }
4325
4393
  if (response.headers.get("MACHINE-PAYMENT-CHALLENGE")) {
4326
- throw new chunkMZKLAHBK_cjs.HavenApiError("quoteX402 only supports standard x402 Payment Required responses.", 400);
4394
+ throw new chunkZA3NOSO2_cjs.HavenApiError("quoteX402 only supports standard x402 Payment Required responses.", 400);
4327
4395
  }
4328
- const paymentRequired = await chunkIKQIIMM6_cjs.parsePaymentRequiredResponse(response);
4396
+ const paymentRequired = await chunkV2ODMLDD_cjs.parsePaymentRequiredResponse(response);
4329
4397
  const mcpTransport = await this.merchantTransport.detect(url, paymentRequired, response);
4330
4398
  return buildX402Quote(paymentRequired, request, options.idempotencyKey, mcpTransport);
4331
4399
  }
@@ -4343,7 +4411,7 @@ var HavenClient = class {
4343
4411
  const wallet = await this.merchantCompletion.resolveWalletForMerchantCall();
4344
4412
  const sessionId = await this.merchantTransport.initialize(url, init, wallet);
4345
4413
  if (!sessionId) {
4346
- throw new chunkMZKLAHBK_cjs.HavenApiError(
4414
+ throw new chunkZA3NOSO2_cjs.HavenApiError(
4347
4415
  "The merchant did not establish an MCP session before the x402 quote. No payment was created.",
4348
4416
  502,
4349
4417
  { mcpSessionNotEstablished: true }
@@ -4417,18 +4485,18 @@ var HavenClient = class {
4417
4485
  }
4418
4486
  async resumeAuthorizedX402(input) {
4419
4487
  if (!this.delegateKey) {
4420
- throw new chunkMZKLAHBK_cjs.HavenSigningError(
4488
+ throw new chunkZA3NOSO2_cjs.HavenSigningError(
4421
4489
  "delegateKey is required for x402 payments. Pass it in the HavenClient config."
4422
4490
  );
4423
4491
  }
4424
4492
  if (!this.delegateAddress) {
4425
- throw new chunkMZKLAHBK_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
4493
+ throw new chunkZA3NOSO2_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
4426
4494
  }
4427
- const option = chunkIKQIIMM6_cjs.selectStandardPaymentOption(input.paymentRequired.accepts);
4495
+ const option = chunkV2ODMLDD_cjs.selectStandardPaymentOption(input.paymentRequired.accepts);
4428
4496
  if (!option) {
4429
4497
  throw noCompatiblePaymentOptionError(input.paymentRequired.accepts);
4430
4498
  }
4431
- const idempotencyKey = input.idempotencyKey ?? chunkIKQIIMM6_cjs.buildX402IdempotencyKey(input.paymentRequired, option);
4499
+ const idempotencyKey = input.idempotencyKey ?? chunkV2ODMLDD_cjs.buildX402IdempotencyKey(input.paymentRequired, option);
4432
4500
  const cached = this.fundingLeg.cachedReceipt(idempotencyKey, input.taskBudgetId);
4433
4501
  if (cached) return cached;
4434
4502
  const status = await this.getPaymentStatus(input.paymentId);
@@ -4436,10 +4504,10 @@ var HavenClient = class {
4436
4504
  const canFund = await this.fundingLeg.delegateCanFund(
4437
4505
  status.chainId ?? chainIdFromNetwork(option.network),
4438
4506
  option.asset,
4439
- chunkIKQIIMM6_cjs.x402AuthorizationAmount(option)
4507
+ chunkV2ODMLDD_cjs.x402AuthorizationAmount(option)
4440
4508
  );
4441
4509
  if (canFund === false) {
4442
- throw new chunkMZKLAHBK_cjs.X402AlreadySettledError(
4510
+ throw new chunkZA3NOSO2_cjs.X402AlreadySettledError(
4443
4511
  `x402 payment ${status.paymentId} has already settled \u2014 the delegate no longer holds the funds to authorize it again, so there is nothing left to resume.`,
4444
4512
  this.fundingLeg.receiptFromStatus(input.paymentRequired, option, void 0, status),
4445
4513
  "settled"
@@ -4460,13 +4528,13 @@ var HavenClient = class {
4460
4528
  const url = input.url ?? input.request?.url;
4461
4529
  if (!paymentRequired) {
4462
4530
  if (!url) {
4463
- throw new chunkMZKLAHBK_cjs.HavenApiError("x402 resume requires the original URL or a captured request snapshot.", 400);
4531
+ throw new chunkZA3NOSO2_cjs.HavenApiError("x402 resume requires the original URL or a captured request snapshot.", 400);
4464
4532
  }
4465
4533
  const response = await this.merchantTransport.fetch(url, initialInit, this.merchantTransport.budgetFor("quote"), this.merchantTransport.capFor("quote"));
4466
4534
  if (response.status !== 402) {
4467
- throw new chunkMZKLAHBK_cjs.HavenApiError("Expected the original x402 request to return HTTP 402 before resuming.", 400);
4535
+ throw new chunkZA3NOSO2_cjs.HavenApiError("Expected the original x402 request to return HTTP 402 before resuming.", 400);
4468
4536
  }
4469
- paymentRequired = await chunkIKQIIMM6_cjs.parsePaymentRequiredResponse(response);
4537
+ paymentRequired = await chunkV2ODMLDD_cjs.parsePaymentRequiredResponse(response);
4470
4538
  }
4471
4539
  const receipt = await this.resumeAuthorizedX402({
4472
4540
  paymentId: input.paymentId,
@@ -4519,7 +4587,7 @@ var HavenClient = class {
4519
4587
  nativeChallenge = true;
4520
4588
  } else {
4521
4589
  try {
4522
- paymentRequired = await chunkIKQIIMM6_cjs.parsePaymentRequiredResponse(response);
4590
+ paymentRequired = await chunkV2ODMLDD_cjs.parsePaymentRequiredResponse(response);
4523
4591
  } catch (err) {
4524
4592
  if (err instanceof MerchantEgressResponseCapError) throw err;
4525
4593
  return response;
@@ -4530,8 +4598,8 @@ var HavenClient = class {
4530
4598
  if (mcpSessionId) requestInit = this.merchantTransport.withSessionHeaders(requestInit, mcpSessionId);
4531
4599
  }
4532
4600
  const request = snapshotX402Request(url, requestInit);
4533
- const option = chunkIKQIIMM6_cjs.selectStandardPaymentOption(paymentRequired.accepts);
4534
- const idempotencyKey = options.idempotencyKey ?? (option ? chunkIKQIIMM6_cjs.buildX402IdempotencyKey(paymentRequired, option) : void 0);
4601
+ const option = chunkV2ODMLDD_cjs.selectStandardPaymentOption(paymentRequired.accepts);
4602
+ const idempotencyKey = options.idempotencyKey ?? (option ? chunkV2ODMLDD_cjs.buildX402IdempotencyKey(paymentRequired, option) : void 0);
4535
4603
  let receipt;
4536
4604
  try {
4537
4605
  receipt = await this.authorizeX402(paymentRequired, options);
@@ -4661,7 +4729,7 @@ var HavenClient = class {
4661
4729
  txHash: evidenceTxHash,
4662
4730
  resourceUrl: evidenceContext.resourceUrl,
4663
4731
  merchantStatus: surfaced.status,
4664
- paymentProofHeaderName: chunkIKQIIMM6_cjs.x402PaymentHeaderNamesSent(input.paymentHeader),
4732
+ paymentProofHeaderName: chunkV2ODMLDD_cjs.x402PaymentHeaderNamesSent(input.paymentHeader),
4665
4733
  paymentProofHeader: input.paymentHeader,
4666
4734
  protocolReceiptHeaderName: answer.protocolReceiptHeaderName,
4667
4735
  protocolReceiptHeader: answer.protocolReceiptHeader,
@@ -4787,7 +4855,7 @@ var HavenClient = class {
4787
4855
  try {
4788
4856
  raw = await this.get(`/x402/by-idempotency-key/${encodeURIComponent(key)}`);
4789
4857
  } catch (err) {
4790
- if (err instanceof chunkMZKLAHBK_cjs.HavenApiError && err.statusCode === 404) return null;
4858
+ if (err instanceof chunkZA3NOSO2_cjs.HavenApiError && err.statusCode === 404) return null;
4791
4859
  throw err;
4792
4860
  }
4793
4861
  return {
@@ -4963,7 +5031,7 @@ var toolDescriptions = {
4963
5031
  getAgent: {
4964
5032
  summary: "Return the authenticated agent identity AND its live spend authority in one call: Haven wallet, delegate, chain, raw status, spend_authority_readiness, per-token remaining allowance (atomic + human-readable). The recommended first call in a new session.",
4965
5033
  selectionGuidance: "Use this as the session bootstrap, or to confirm identity together with whether the agent has spend authority right now. For per-token detail (configured vs spent vs reset window) use haven_get_allowances.",
4966
- behavior: `Reads identity plus the live spend-authority snapshot \u2014 the active on-chain budget delegation. spend_authority_readiness (readiness is a deprecated alias, same value) is "ready" when at least one token has remaining spend authority, "needs_approval" when the agent is active but has none, and "revoked" when the credential is not active. Readiness is AUTHORITY: it says a budget is live, not that the account holds funds. Each allowances[] row carries fundsCoverRemaining: false when the account's balance cannot back that row's whole remaining budget \u2014 a heads-up to mention to the user, not a refusal (budgets above the balance are a normal setup; an owner may top up weekly) \u2014 and null when the coverage read failed or the remaining figure was not read live; the key is absent when the remaining is 0, and rows for one token are compared alone. It covers hosted identity + on-chain spend authority ONLY \u2014 the hosted server cannot see the LOCAL signer, so "ready" does not mean the signer can start; verify the signer with a signer tool call or connect --doctor. An over-budget payment is declined before any money moves; there is no approval queue \u2014 ask the owner to grant or raise the budget in Haven. allowances[] carries id, tokenAddress, remainingAtomic, remainingDisplay per token. taskBudgets[] rows carry maxAtomic/maxDisplay plus spentAtomic/remainingAtomic/remainingDisplay \u2014 what the chain still allows that budget \u2014 and remainingIsFromChain: false marks a failed read (figures null, never the full cap); only live rows are listed (closed and expired omitted), each with its status (pending | open | closing) and isExpired, so a closing budget stays visible. pendingSubBudgetSignatures[] lists sub-budget rows awaiting YOUR signature, each with its haven_sign next step. Identity fields: id, name, status, accountAddress, delegateAddress, chainId.`,
5034
+ behavior: `Reads identity plus the live spend-authority snapshot \u2014 the active on-chain budget delegation. spend_authority_readiness (readiness is a deprecated alias, same value) is "ready" when at least one token has remaining spend authority, "needs_approval" when the agent is active but has none, and "revoked" when the credential is not active. needs_approval with no allowances[] rows and budgetEndedAt set: the budget ENDED on that date \u2014 ask the owner to set a new one, waiting will not help; with no rows and no budgetEndedAt: nothing approved yet; with rows: spent for this period, refilling at budgetRefillsAt (null: it ends first). Readiness is AUTHORITY \u2014 a budget is live, not that funds are held. Each allowances[] row carries fundsCoverRemaining: false when the account's balance cannot back that row's whole remaining budget \u2014 a heads-up to mention, not a refusal (budgets above the balance are normal; an owner may top up weekly) \u2014 and null when the coverage read failed or the remaining was not read live; the key is absent at remaining 0, and rows for one token are compared alone. Covers hosted identity + on-chain spend authority ONLY \u2014 the hosted server cannot see the LOCAL signer, so "ready" does not mean the signer can start; verify it with a signer tool call or connect --doctor. An over-budget payment is declined before any money moves; there is no approval queue \u2014 ask the owner to grant or raise the budget. allowances[] carries id, tokenAddress, remainingAtomic, remainingDisplay, nextRefillAt per token. taskBudgets[] rows carry maxAtomic/maxDisplay plus spentAtomic/remainingAtomic/remainingDisplay \u2014 what the chain still allows that budget \u2014 and remainingIsFromChain: false marks a failed read (figures null, never the cap); only live rows are listed, each with its status (pending | open | closing) and isExpired. pendingSubBudgetSignatures[] lists sub-budget rows awaiting YOUR signature, with the haven_sign step. Identity fields: id, name, status, accountAddress, delegateAddress, chainId.`,
4967
5035
  nextActionGuidance: ""
4968
5036
  },
4969
5037
  getAllowances: {
@@ -5285,7 +5353,7 @@ You are an AI agent whose user has no Haven account yet, or has one but has not
5285
5353
 
5286
5354
  ## What Haven is, in three sentences
5287
5355
 
5288
- Your user gives you a **budget on their own account** \u2014 not their wallet, and not a key to their funds. The budget is a delegation they sign, enforced on-chain: a payment over it, to the wrong recipient, or past its expiry is refused at execution time, not by a dashboard promise. Haven constructs and relays the payments; you get an agent credential and a signing key made on your machine, and your user can revoke the budget without you and without Haven.
5356
+ Your user gives you a **budget on their own account** \u2014 not their wallet, and not a key to their funds. The budget is a delegation they sign, enforced on-chain: a payment over it, to the wrong recipient, or past its expiry is refused at execution time, not by a dashboard promise. The budget also ENDS on a date your user chooses \u2014 30, 90 (default), 180 or 365 days out \u2014 and that day is enforced on-chain too. When the budget ends, your authority to pay ends with it; ask your user to renew it (a new approval on the agent's page, or a new \`budget grant\`). Haven constructs and relays the payments; you get an agent credential and a signing key made on your machine, and your user can revoke the budget without you and without Haven.
5289
5357
 
5290
5358
  ## The sequence
5291
5359
 
@@ -5358,7 +5426,7 @@ If the approval wait times out, nothing is lost \u2014 your agent is registered
5358
5426
  Call \`haven_get_agent\`, one of the Haven MCP tools the connector wires into your runtime in step 4. It returns identity plus \`spend_authority_readiness\`:
5359
5427
 
5360
5428
  - \`ready\` \u2014 a budget is live: you have the authority to pay. It does not say the account holds funds \u2014 the \`allowances[]\` rows carry \`funds_cover_remaining\`, and \`false\` there is a heads-up to mention to your user, not a refusal.
5361
- - \`needs_approval\` \u2014 the connector finished, nobody approved yet. Ask your user again, in their Haven tab; there is no queue to wait in.
5429
+ - \`needs_approval\` \u2014 no budget can pay. \`allowances[]\` empty with \`budgetEndedAt\` set: your budget ENDED on that date; waiting will not help \u2014 ask your user to set a new one in their Haven tab. \`allowances[]\` empty with \`budgetEndedAt\` null: nobody approved one yet; ask your user again \u2014 there is no queue. Rows, all spent: it refills at \`budgetRefillsAt\`; tell your user, then wait or ask them to raise it (\`null\`: it ends first; ask them to renew it).
5362
5430
  - \`revoked\` \u2014 the credential is not active; ask your user to create a new agent.
5363
5431
 
5364
5432
  \`ready\` covers hosted identity and the budget only, not your local signer. Check that with \`npx -y @haven_ai/connect@<channel> --doctor\`, the same tag your prompt named \u2014 a separate command, so the command-modification rule does not bind it.
@@ -5394,7 +5462,7 @@ Then:
5394
5462
  1. Run \`<packages.cli.one_liner> login\`. That command is the manifest's \`packages.cli.one_liner\` (\`/.well-known/haven.json\`) \u2014 run it as given: \`packages.cli.channel\` serves the full spec. It prints a link and a code and does not need my password \u2014 it must never ask for it. Give me the link straight away and wait for me to approve it in my browser.
5395
5463
  2. Once I have approved, run \`haven agents connect --name <a name you choose> --budget <amount> --token USDC --period <minutes>\` with the budget I tell you. If I have not given you one, ask me before running it. Add \`--run\` to complete the connection in the same step.
5396
5464
  3. ${AGENT_APPROVAL_RELAY_JSON_SENTENCE}
5397
- 4. Once I have approved the budget, verify with the \`haven_get_agent\` tool: \`ready\` means I have given you the authority to pay \u2014 it does not confirm the account holds funds, so if its allowances rows carry \`funds_cover_remaining: false\`, tell me and still try the payment; \`needs_approval\` means my approval has not landed yet.
5465
+ 4. Once I have approved the budget, verify with the \`haven_get_agent\` tool: \`ready\` means I have given you the authority to pay \u2014 it does not confirm the account holds funds, so if its allowances rows carry \`funds_cover_remaining: false\`, tell me and still try the payment; \`needs_approval\` with no allowances rows and \`budgetEndedAt\` set means my budget ended on that date \u2014 tell me, and I will set a new one; with no rows and no \`budgetEndedAt\`, my approval has not landed yet; with rows, the budget is spent \u2014 it refills at \`budgetRefillsAt\` (\`null\`: it ends first), so tell me, and I can raise or renew it.
5398
5466
 
5399
5467
  Two things only I can do: approving that budget with my passkey, and funding the account with USDC \u2014 no ETH, Haven sponsors the gas. Tell me if either is missing rather than working around it.
5400
5468
 
@@ -5514,8 +5582,10 @@ Do not guess the wallet address, network, or budget.
5514
5582
 
5515
5583
  For instant orientation at the start of a session, read the non-secret
5516
5584
  \`agent.json\` the connector wrote to your Haven credential directory (typically
5517
- \`~/.haven/agents/<agent-id>/agent.json\` \u2014 if you don't know the agent id, list
5518
- \`~/.haven/agents/\` to find the folder). It
5585
+ \`~/.haven/agents/<slug>/agent.json\`, where \`<slug>\` is the wiring name of the
5586
+ \`haven-<slug>\` pair \u2014 only a \`--bare\` run, or a \`--replace\` without \`--name\`,
5587
+ names the directory by the agent id instead; if you don't know the folder, list
5588
+ \`~/.haven/agents/\` to find it). It
5519
5589
  holds your agent id, Haven wallet address, network, and *configured* per-token
5520
5590
  budget, and contains no keys \u2014 the fastest way to answer "who am I and what may
5521
5591
  I spend" with no round trip. If that file is absent (some setups don't write
@@ -5536,7 +5606,13 @@ spending:
5536
5606
  the user, not a refusal \u2014 a budget above the balance is a normal setup, so
5537
5607
  still try the payment; \`null\` means the coverage read failed or the remaining
5538
5608
  figure was not read live; the key is absent when the remaining is 0. Rows for
5539
- one token are compared alone.
5609
+ one token are compared alone. \`needs_approval\` with no \`allowances[]\`
5610
+ rows and \`budgetEndedAt\` set means the budget ENDED on that date \u2014 waiting
5611
+ will not help, ask the owner to set a new one; with no rows and no
5612
+ \`budgetEndedAt\`, nobody approved a budget yet; with rows (all at remaining 0) the
5613
+ budget is spent for this period, and \`budgetRefillsAt\` says when it refills
5614
+ (\`null\`: it ends before it refills) \u2014 tell the user, then wait or ask them
5615
+ to raise it.
5540
5616
  - \`mcp__haven__haven_get_allowances\` \u2014 detailed per-token breakdown
5541
5617
  (configured, spent, reset window) when you need more than the summary.
5542
5618
  - \`mcp__haven__haven_check_funds\` \u2014 whether the account actually HOLDS at
@@ -5750,8 +5826,10 @@ for example, an invoice carrying an \`x402_payment_url\` to POST with its
5750
5826
  report it, the merchant's settlement evidence. (A deposit transfer is bound
5751
5827
  to its payee and amount on-chain too; the difference is the record, not
5752
5828
  the binding.)
5753
- - **If the quote says stop, stop.** The quote checks the agent's remaining
5754
- budget at quote time, and it can check a price you state (\`expected_amount\`).
5829
+ - **If the quote says stop, stop.** The hosted quote checks the agent's
5830
+ remaining budget at quote time, and it can check a price you state
5831
+ (\`expected_amount\`). On the local runtime (\`@haven_ai/mcp\`) the quote
5832
+ checks only a price you state; the budget is checked when you pay.
5755
5833
  When it returns \`safe_to_continue: false\` \u2014 the amount exceeds the budget, or
5756
5834
  the price does not match what you expected \u2014 it prefills no cap and names no
5757
5835
  next tool: stop and tell the user. If the x402 challenge itself is wrong (a
@@ -5896,8 +5974,8 @@ only part of it was usable), and an optional \`note\` (max 2000 characters)
5896
5974
  saying what was wrong. It is evidence only: it moves no money, never changes
5897
5975
  \`settled\` or any money field, and works only on your own settled
5898
5976
  payments \u2014 another agent's payment is refused. A re-report replaces your
5899
- earlier verdict; the receipt then carries it beside the payment, so the
5900
- owner does not read a junk delivery as a success.
5977
+ earlier verdict; the receipt then carries it beside the payment, so a junk
5978
+ delivery does not read as a success.
5901
5979
  ### Relay a delivered code or credential to the owner \u2014 immediately, verbatim
5902
5980
 
5903
5981
  If a merchant response carries what the user PAID FOR \u2014 a redemption code, gift
@@ -5969,7 +6047,7 @@ async function discoverMerchantMcpUrl(inputUrl, egress) {
5969
6047
  } catch (err) {
5970
6048
  if (err instanceof MerchantEgressRefusedError || err instanceof MerchantEgressResponseCapError) throw err;
5971
6049
  if (isBodyPhaseTimeout(err)) {
5972
- throw new chunkMZKLAHBK_cjs.MerchantTimeoutError(`Merchant discovery document read timed out after ${timeoutMs}ms.`);
6050
+ throw new chunkZA3NOSO2_cjs.MerchantTimeoutError(`Merchant discovery document read timed out after ${timeoutMs}ms.`);
5973
6051
  }
5974
6052
  continue;
5975
6053
  }
@@ -5988,499 +6066,507 @@ function sameUrl(a, b) {
5988
6066
 
5989
6067
  Object.defineProperty(exports, "DEFAULT_NEXT_TOOL_BY_ACTION", {
5990
6068
  enumerable: true,
5991
- get: function () { return chunkIKQIIMM6_cjs.DEFAULT_NEXT_TOOL_BY_ACTION; }
6069
+ get: function () { return chunkV2ODMLDD_cjs.DEFAULT_NEXT_TOOL_BY_ACTION; }
5992
6070
  });
5993
6071
  Object.defineProperty(exports, "ERC7710_ASSET_TRANSFER_METHOD", {
5994
6072
  enumerable: true,
5995
- get: function () { return chunkIKQIIMM6_cjs.ERC7710_ASSET_TRANSFER_METHOD; }
6073
+ get: function () { return chunkV2ODMLDD_cjs.ERC7710_ASSET_TRANSFER_METHOD; }
5996
6074
  });
5997
6075
  Object.defineProperty(exports, "HAVEN_CLIENT_HEADER", {
5998
6076
  enumerable: true,
5999
- get: function () { return chunkIKQIIMM6_cjs.HAVEN_CLIENT_HEADER; }
6077
+ get: function () { return chunkV2ODMLDD_cjs.HAVEN_CLIENT_HEADER; }
6000
6078
  });
6001
6079
  Object.defineProperty(exports, "HAVEN_MINIMUM_NODE_VERSION", {
6002
6080
  enumerable: true,
6003
- get: function () { return chunkIKQIIMM6_cjs.HAVEN_MINIMUM_NODE_VERSION; }
6081
+ get: function () { return chunkV2ODMLDD_cjs.HAVEN_MINIMUM_NODE_VERSION; }
6004
6082
  });
6005
6083
  Object.defineProperty(exports, "HavenTypedDataRefusedError", {
6006
6084
  enumerable: true,
6007
- get: function () { return chunkIKQIIMM6_cjs.HavenTypedDataRefusedError; }
6085
+ get: function () { return chunkV2ODMLDD_cjs.HavenTypedDataRefusedError; }
6008
6086
  });
6009
6087
  Object.defineProperty(exports, "MAX_TASK_BUDGET_TTL_SECONDS", {
6010
6088
  enumerable: true,
6011
- get: function () { return chunkIKQIIMM6_cjs.MAX_TASK_BUDGET_TTL_SECONDS; }
6089
+ get: function () { return chunkV2ODMLDD_cjs.MAX_TASK_BUDGET_TTL_SECONDS; }
6012
6090
  });
6013
6091
  Object.defineProperty(exports, "NEXT_TOOL_SERVER_NAMES", {
6014
6092
  enumerable: true,
6015
- get: function () { return chunkIKQIIMM6_cjs.NEXT_TOOL_SERVER_NAMES; }
6093
+ get: function () { return chunkV2ODMLDD_cjs.NEXT_TOOL_SERVER_NAMES; }
6016
6094
  });
6017
6095
  Object.defineProperty(exports, "NEXT_TOOL_SERVER_ROLES", {
6018
6096
  enumerable: true,
6019
- get: function () { return chunkIKQIIMM6_cjs.NEXT_TOOL_SERVER_ROLES; }
6097
+ get: function () { return chunkV2ODMLDD_cjs.NEXT_TOOL_SERVER_ROLES; }
6020
6098
  });
6021
6099
  Object.defineProperty(exports, "SDK_CLIENT_IDENTITY", {
6022
6100
  enumerable: true,
6023
- get: function () { return chunkIKQIIMM6_cjs.SDK_CLIENT_IDENTITY; }
6101
+ get: function () { return chunkV2ODMLDD_cjs.SDK_CLIENT_IDENTITY; }
6024
6102
  });
6025
6103
  Object.defineProperty(exports, "SDK_VERSION", {
6026
6104
  enumerable: true,
6027
- get: function () { return chunkIKQIIMM6_cjs.SDK_VERSION; }
6105
+ get: function () { return chunkV2ODMLDD_cjs.SDK_VERSION; }
6028
6106
  });
6029
6107
  Object.defineProperty(exports, "SWEEP_BASE_CHAIN_ID", {
6030
6108
  enumerable: true,
6031
- get: function () { return chunkIKQIIMM6_cjs.SWEEP_BASE_CHAIN_ID; }
6109
+ get: function () { return chunkV2ODMLDD_cjs.SWEEP_BASE_CHAIN_ID; }
6032
6110
  });
6033
6111
  Object.defineProperty(exports, "SWEEP_BASE_SEPOLIA_CHAIN_ID", {
6034
6112
  enumerable: true,
6035
- get: function () { return chunkIKQIIMM6_cjs.SWEEP_BASE_SEPOLIA_CHAIN_ID; }
6113
+ get: function () { return chunkV2ODMLDD_cjs.SWEEP_BASE_SEPOLIA_CHAIN_ID; }
6036
6114
  });
6037
6115
  Object.defineProperty(exports, "SWEEP_BASE_SEPOLIA_USDC_ADDRESS", {
6038
6116
  enumerable: true,
6039
- get: function () { return chunkIKQIIMM6_cjs.SWEEP_BASE_SEPOLIA_USDC_ADDRESS; }
6117
+ get: function () { return chunkV2ODMLDD_cjs.SWEEP_BASE_SEPOLIA_USDC_ADDRESS; }
6040
6118
  });
6041
6119
  Object.defineProperty(exports, "SWEEP_BASE_USDC_ADDRESS", {
6042
6120
  enumerable: true,
6043
- get: function () { return chunkIKQIIMM6_cjs.SWEEP_BASE_USDC_ADDRESS; }
6121
+ get: function () { return chunkV2ODMLDD_cjs.SWEEP_BASE_USDC_ADDRESS; }
6044
6122
  });
6045
6123
  Object.defineProperty(exports, "TRANSFER_WITH_AUTHORIZATION_TYPES", {
6046
6124
  enumerable: true,
6047
- get: function () { return chunkIKQIIMM6_cjs.TRANSFER_WITH_AUTHORIZATION_TYPES; }
6125
+ get: function () { return chunkV2ODMLDD_cjs.TRANSFER_WITH_AUTHORIZATION_TYPES; }
6048
6126
  });
6049
6127
  Object.defineProperty(exports, "TYPED_DATA_NOT_ALLOWED", {
6050
6128
  enumerable: true,
6051
- get: function () { return chunkIKQIIMM6_cjs.TYPED_DATA_NOT_ALLOWED; }
6129
+ get: function () { return chunkV2ODMLDD_cjs.TYPED_DATA_NOT_ALLOWED; }
6052
6130
  });
6053
6131
  Object.defineProperty(exports, "X402PaymentHeaderValidationError", {
6054
6132
  enumerable: true,
6055
- get: function () { return chunkIKQIIMM6_cjs.X402PaymentHeaderValidationError; }
6133
+ get: function () { return chunkV2ODMLDD_cjs.X402PaymentHeaderValidationError; }
6056
6134
  });
6057
6135
  Object.defineProperty(exports, "X402_LEGACY_PAYMENT_HEADER_NAME", {
6058
6136
  enumerable: true,
6059
- get: function () { return chunkIKQIIMM6_cjs.X402_LEGACY_PAYMENT_HEADER_NAME; }
6137
+ get: function () { return chunkV2ODMLDD_cjs.X402_LEGACY_PAYMENT_HEADER_NAME; }
6060
6138
  });
6061
6139
  Object.defineProperty(exports, "X402_MAX_AUTHORIZATION_WINDOW_SECONDS", {
6062
6140
  enumerable: true,
6063
- get: function () { return chunkIKQIIMM6_cjs.X402_MAX_AUTHORIZATION_WINDOW_SECONDS; }
6141
+ get: function () { return chunkV2ODMLDD_cjs.X402_MAX_AUTHORIZATION_WINDOW_SECONDS; }
6064
6142
  });
6065
6143
  Object.defineProperty(exports, "X402_PAYMENT_HEADER_NAME", {
6066
6144
  enumerable: true,
6067
- get: function () { return chunkIKQIIMM6_cjs.X402_PAYMENT_HEADER_NAME; }
6145
+ get: function () { return chunkV2ODMLDD_cjs.X402_PAYMENT_HEADER_NAME; }
6068
6146
  });
6069
6147
  Object.defineProperty(exports, "X402_PAYMENT_HEADER_NAMES_SENT", {
6070
6148
  enumerable: true,
6071
- get: function () { return chunkIKQIIMM6_cjs.X402_PAYMENT_HEADER_NAMES_SENT; }
6149
+ get: function () { return chunkV2ODMLDD_cjs.X402_PAYMENT_HEADER_NAMES_SENT; }
6072
6150
  });
6073
6151
  Object.defineProperty(exports, "X402_PAYMENT_NONCE_TAG", {
6074
6152
  enumerable: true,
6075
- get: function () { return chunkIKQIIMM6_cjs.X402_PAYMENT_NONCE_TAG; }
6153
+ get: function () { return chunkV2ODMLDD_cjs.X402_PAYMENT_NONCE_TAG; }
6076
6154
  });
6077
6155
  Object.defineProperty(exports, "X402_PAYMENT_REQUIRED_HEADER_NAME", {
6078
6156
  enumerable: true,
6079
- get: function () { return chunkIKQIIMM6_cjs.X402_PAYMENT_REQUIRED_HEADER_NAME; }
6157
+ get: function () { return chunkV2ODMLDD_cjs.X402_PAYMENT_REQUIRED_HEADER_NAME; }
6080
6158
  });
6081
6159
  Object.defineProperty(exports, "X402_PAYMENT_RESPONSE_HEADER_NAME", {
6082
6160
  enumerable: true,
6083
- get: function () { return chunkIKQIIMM6_cjs.X402_PAYMENT_RESPONSE_HEADER_NAME; }
6161
+ get: function () { return chunkV2ODMLDD_cjs.X402_PAYMENT_RESPONSE_HEADER_NAME; }
6084
6162
  });
6085
6163
  Object.defineProperty(exports, "X402_SETTLEMENT_FORWARD_MARGIN_SECONDS", {
6086
6164
  enumerable: true,
6087
- get: function () { return chunkIKQIIMM6_cjs.X402_SETTLEMENT_FORWARD_MARGIN_SECONDS; }
6165
+ get: function () { return chunkV2ODMLDD_cjs.X402_SETTLEMENT_FORWARD_MARGIN_SECONDS; }
6088
6166
  });
6089
6167
  Object.defineProperty(exports, "assertBoundDirectPaymentUserOp", {
6090
6168
  enumerable: true,
6091
- get: function () { return chunkIKQIIMM6_cjs.assertBoundDirectPaymentUserOp; }
6169
+ get: function () { return chunkV2ODMLDD_cjs.assertBoundDirectPaymentUserOp; }
6092
6170
  });
6093
6171
  Object.defineProperty(exports, "assertOwnTaskBudgetCloseUserOp", {
6094
6172
  enumerable: true,
6095
- get: function () { return chunkIKQIIMM6_cjs.assertOwnTaskBudgetCloseUserOp; }
6173
+ get: function () { return chunkV2ODMLDD_cjs.assertOwnTaskBudgetCloseUserOp; }
6096
6174
  });
6097
6175
  Object.defineProperty(exports, "assertOwnTaskChild", {
6098
6176
  enumerable: true,
6099
- get: function () { return chunkIKQIIMM6_cjs.assertOwnTaskChild; }
6177
+ get: function () { return chunkV2ODMLDD_cjs.assertOwnTaskChild; }
6100
6178
  });
6101
6179
  Object.defineProperty(exports, "buildSweepAuthorizationMessage", {
6102
6180
  enumerable: true,
6103
- get: function () { return chunkIKQIIMM6_cjs.buildSweepAuthorizationMessage; }
6181
+ get: function () { return chunkV2ODMLDD_cjs.buildSweepAuthorizationMessage; }
6104
6182
  });
6105
6183
  Object.defineProperty(exports, "buildSweepTypedData", {
6106
6184
  enumerable: true,
6107
- get: function () { return chunkIKQIIMM6_cjs.buildSweepTypedData; }
6185
+ get: function () { return chunkV2ODMLDD_cjs.buildSweepTypedData; }
6108
6186
  });
6109
6187
  Object.defineProperty(exports, "buildX402ExpectedMessage", {
6110
6188
  enumerable: true,
6111
- get: function () { return chunkIKQIIMM6_cjs.buildX402ExpectedMessage; }
6189
+ get: function () { return chunkV2ODMLDD_cjs.buildX402ExpectedMessage; }
6112
6190
  });
6113
6191
  Object.defineProperty(exports, "compareNodeVersions", {
6114
6192
  enumerable: true,
6115
- get: function () { return chunkIKQIIMM6_cjs.compareNodeVersions; }
6193
+ get: function () { return chunkV2ODMLDD_cjs.compareNodeVersions; }
6116
6194
  });
6117
6195
  Object.defineProperty(exports, "createNextStepBuilder", {
6118
6196
  enumerable: true,
6119
- get: function () { return chunkIKQIIMM6_cjs.createNextStepBuilder; }
6197
+ get: function () { return chunkV2ODMLDD_cjs.createNextStepBuilder; }
6120
6198
  });
6121
6199
  Object.defineProperty(exports, "decodeBase64Json", {
6122
6200
  enumerable: true,
6123
- get: function () { return chunkIKQIIMM6_cjs.decodeBase64Json; }
6201
+ get: function () { return chunkV2ODMLDD_cjs.decodeBase64Json; }
6124
6202
  });
6125
6203
  Object.defineProperty(exports, "decodeBase64Utf8", {
6126
6204
  enumerable: true,
6127
- get: function () { return chunkIKQIIMM6_cjs.decodeBase64Utf8; }
6205
+ get: function () { return chunkV2ODMLDD_cjs.decodeBase64Utf8; }
6128
6206
  });
6129
6207
  Object.defineProperty(exports, "defaultNextToolFor", {
6130
6208
  enumerable: true,
6131
- get: function () { return chunkIKQIIMM6_cjs.defaultNextToolFor; }
6209
+ get: function () { return chunkV2ODMLDD_cjs.defaultNextToolFor; }
6132
6210
  });
6133
6211
  Object.defineProperty(exports, "deriveX402PaymentNonce", {
6134
6212
  enumerable: true,
6135
- get: function () { return chunkIKQIIMM6_cjs.deriveX402PaymentNonce; }
6213
+ get: function () { return chunkV2ODMLDD_cjs.deriveX402PaymentNonce; }
6136
6214
  });
6137
6215
  Object.defineProperty(exports, "encodeBase64Json", {
6138
6216
  enumerable: true,
6139
- get: function () { return chunkIKQIIMM6_cjs.encodeBase64Json; }
6217
+ get: function () { return chunkV2ODMLDD_cjs.encodeBase64Json; }
6140
6218
  });
6141
6219
  Object.defineProperty(exports, "encodeBase64Utf8", {
6142
6220
  enumerable: true,
6143
- get: function () { return chunkIKQIIMM6_cjs.encodeBase64Utf8; }
6221
+ get: function () { return chunkV2ODMLDD_cjs.encodeBase64Utf8; }
6144
6222
  });
6145
6223
  Object.defineProperty(exports, "encodePaymentProof", {
6146
6224
  enumerable: true,
6147
- get: function () { return chunkIKQIIMM6_cjs.encodePaymentProof; }
6225
+ get: function () { return chunkV2ODMLDD_cjs.encodePaymentProof; }
6148
6226
  });
6149
6227
  Object.defineProperty(exports, "hashDelegation", {
6150
6228
  enumerable: true,
6151
- get: function () { return chunkIKQIIMM6_cjs.hashDelegation; }
6229
+ get: function () { return chunkV2ODMLDD_cjs.hashDelegation; }
6152
6230
  });
6153
6231
  Object.defineProperty(exports, "havenClientIdentity", {
6154
6232
  enumerable: true,
6155
- get: function () { return chunkIKQIIMM6_cjs.havenClientIdentity; }
6233
+ get: function () { return chunkV2ODMLDD_cjs.havenClientIdentity; }
6156
6234
  });
6157
6235
  Object.defineProperty(exports, "isErc7710Option", {
6158
6236
  enumerable: true,
6159
- get: function () { return chunkIKQIIMM6_cjs.isErc7710Option; }
6237
+ get: function () { return chunkV2ODMLDD_cjs.isErc7710Option; }
6160
6238
  });
6161
6239
  Object.defineProperty(exports, "isSupportedNodeVersion", {
6162
6240
  enumerable: true,
6163
- get: function () { return chunkIKQIIMM6_cjs.isSupportedNodeVersion; }
6241
+ get: function () { return chunkV2ODMLDD_cjs.isSupportedNodeVersion; }
6164
6242
  });
6165
6243
  Object.defineProperty(exports, "isSweepableChain", {
6166
6244
  enumerable: true,
6167
- get: function () { return chunkIKQIIMM6_cjs.isSweepableChain; }
6245
+ get: function () { return chunkV2ODMLDD_cjs.isSweepableChain; }
6168
6246
  });
6169
6247
  Object.defineProperty(exports, "isTaskChildTypedData", {
6170
6248
  enumerable: true,
6171
- get: function () { return chunkIKQIIMM6_cjs.isTaskChildTypedData; }
6249
+ get: function () { return chunkV2ODMLDD_cjs.isTaskChildTypedData; }
6172
6250
  });
6173
6251
  Object.defineProperty(exports, "normalizePaymentRequired", {
6174
6252
  enumerable: true,
6175
- get: function () { return chunkIKQIIMM6_cjs.normalizePaymentRequired; }
6253
+ get: function () { return chunkV2ODMLDD_cjs.normalizePaymentRequired; }
6176
6254
  });
6177
6255
  Object.defineProperty(exports, "parseNextTool", {
6178
6256
  enumerable: true,
6179
- get: function () { return chunkIKQIIMM6_cjs.parseNextTool; }
6257
+ get: function () { return chunkV2ODMLDD_cjs.parseNextTool; }
6180
6258
  });
6181
6259
  Object.defineProperty(exports, "parsePaymentRequired", {
6182
6260
  enumerable: true,
6183
- get: function () { return chunkIKQIIMM6_cjs.parsePaymentRequired; }
6261
+ get: function () { return chunkV2ODMLDD_cjs.parsePaymentRequired; }
6184
6262
  });
6185
6263
  Object.defineProperty(exports, "parsePaymentRequiredResponse", {
6186
6264
  enumerable: true,
6187
- get: function () { return chunkIKQIIMM6_cjs.parsePaymentRequiredResponse; }
6265
+ get: function () { return chunkV2ODMLDD_cjs.parsePaymentRequiredResponse; }
6188
6266
  });
6189
6267
  Object.defineProperty(exports, "readClientUpdate", {
6190
6268
  enumerable: true,
6191
- get: function () { return chunkIKQIIMM6_cjs.readClientUpdate; }
6269
+ get: function () { return chunkV2ODMLDD_cjs.readClientUpdate; }
6192
6270
  });
6193
6271
  Object.defineProperty(exports, "renderNextTool", {
6194
6272
  enumerable: true,
6195
- get: function () { return chunkIKQIIMM6_cjs.renderNextTool; }
6273
+ get: function () { return chunkV2ODMLDD_cjs.renderNextTool; }
6196
6274
  });
6197
6275
  Object.defineProperty(exports, "resolveTokenBySymbol", {
6198
6276
  enumerable: true,
6199
- get: function () { return chunkIKQIIMM6_cjs.resolveTokenBySymbol; }
6277
+ get: function () { return chunkV2ODMLDD_cjs.resolveTokenBySymbol; }
6200
6278
  });
6201
6279
  Object.defineProperty(exports, "resolveTokenFromAddress", {
6202
6280
  enumerable: true,
6203
- get: function () { return chunkIKQIIMM6_cjs.resolveTokenFromAddress; }
6281
+ get: function () { return chunkV2ODMLDD_cjs.resolveTokenFromAddress; }
6204
6282
  });
6205
6283
  Object.defineProperty(exports, "selectErc7710PaymentOption", {
6206
6284
  enumerable: true,
6207
- get: function () { return chunkIKQIIMM6_cjs.selectErc7710PaymentOption; }
6285
+ get: function () { return chunkV2ODMLDD_cjs.selectErc7710PaymentOption; }
6208
6286
  });
6209
6287
  Object.defineProperty(exports, "selectPaymentOption", {
6210
6288
  enumerable: true,
6211
- get: function () { return chunkIKQIIMM6_cjs.selectPaymentOption; }
6289
+ get: function () { return chunkV2ODMLDD_cjs.selectPaymentOption; }
6212
6290
  });
6213
6291
  Object.defineProperty(exports, "selectStandardPaymentOption", {
6214
6292
  enumerable: true,
6215
- get: function () { return chunkIKQIIMM6_cjs.selectStandardPaymentOption; }
6293
+ get: function () { return chunkV2ODMLDD_cjs.selectStandardPaymentOption; }
6216
6294
  });
6217
6295
  Object.defineProperty(exports, "selectX402SettlementScheme", {
6218
6296
  enumerable: true,
6219
- get: function () { return chunkIKQIIMM6_cjs.selectX402SettlementScheme; }
6297
+ get: function () { return chunkV2ODMLDD_cjs.selectX402SettlementScheme; }
6220
6298
  });
6221
6299
  Object.defineProperty(exports, "sweepUsdcAddress", {
6222
6300
  enumerable: true,
6223
- get: function () { return chunkIKQIIMM6_cjs.sweepUsdcAddress; }
6301
+ get: function () { return chunkV2ODMLDD_cjs.sweepUsdcAddress; }
6224
6302
  });
6225
6303
  Object.defineProperty(exports, "sweepUsdcDomain", {
6226
6304
  enumerable: true,
6227
- get: function () { return chunkIKQIIMM6_cjs.sweepUsdcDomain; }
6305
+ get: function () { return chunkV2ODMLDD_cjs.sweepUsdcDomain; }
6228
6306
  });
6229
6307
  Object.defineProperty(exports, "toStandardPaymentRequirements", {
6230
6308
  enumerable: true,
6231
- get: function () { return chunkIKQIIMM6_cjs.toStandardPaymentRequirements; }
6309
+ get: function () { return chunkV2ODMLDD_cjs.toStandardPaymentRequirements; }
6232
6310
  });
6233
6311
  Object.defineProperty(exports, "unsupportedNodeVersionMessage", {
6234
6312
  enumerable: true,
6235
- get: function () { return chunkIKQIIMM6_cjs.unsupportedNodeVersionMessage; }
6313
+ get: function () { return chunkV2ODMLDD_cjs.unsupportedNodeVersionMessage; }
6236
6314
  });
6237
6315
  Object.defineProperty(exports, "validateStandardX402PaymentHeader", {
6238
6316
  enumerable: true,
6239
- get: function () { return chunkIKQIIMM6_cjs.validateStandardX402PaymentHeader; }
6317
+ get: function () { return chunkV2ODMLDD_cjs.validateStandardX402PaymentHeader; }
6240
6318
  });
6241
6319
  Object.defineProperty(exports, "x402AssetTransferMethod", {
6242
6320
  enumerable: true,
6243
- get: function () { return chunkIKQIIMM6_cjs.x402AssetTransferMethod; }
6321
+ get: function () { return chunkV2ODMLDD_cjs.x402AssetTransferMethod; }
6244
6322
  });
6245
6323
  Object.defineProperty(exports, "x402AuthorizationAmount", {
6246
6324
  enumerable: true,
6247
- get: function () { return chunkIKQIIMM6_cjs.x402AuthorizationAmount; }
6325
+ get: function () { return chunkV2ODMLDD_cjs.x402AuthorizationAmount; }
6248
6326
  });
6249
6327
  Object.defineProperty(exports, "x402FacilitatorAddresses", {
6250
6328
  enumerable: true,
6251
- get: function () { return chunkIKQIIMM6_cjs.x402FacilitatorAddresses; }
6329
+ get: function () { return chunkV2ODMLDD_cjs.x402FacilitatorAddresses; }
6252
6330
  });
6253
6331
  Object.defineProperty(exports, "x402PaymentHeaderNamesFor", {
6254
6332
  enumerable: true,
6255
- get: function () { return chunkIKQIIMM6_cjs.x402PaymentHeaderNamesFor; }
6333
+ get: function () { return chunkV2ODMLDD_cjs.x402PaymentHeaderNamesFor; }
6256
6334
  });
6257
6335
  Object.defineProperty(exports, "x402RetryHeadersFor", {
6258
6336
  enumerable: true,
6259
- get: function () { return chunkIKQIIMM6_cjs.x402RetryHeadersFor; }
6337
+ get: function () { return chunkV2ODMLDD_cjs.x402RetryHeadersFor; }
6260
6338
  });
6261
6339
  Object.defineProperty(exports, "x402V2PaymentEnvelope", {
6262
6340
  enumerable: true,
6263
- get: function () { return chunkIKQIIMM6_cjs.x402V2PaymentEnvelope; }
6341
+ get: function () { return chunkV2ODMLDD_cjs.x402V2PaymentEnvelope; }
6264
6342
  });
6265
6343
  Object.defineProperty(exports, "RECEIPT_VERSION", {
6266
6344
  enumerable: true,
6267
- get: function () { return chunkDXBAN4SN_cjs.RECEIPT_VERSION; }
6345
+ get: function () { return chunk4JTLJVBS_cjs.RECEIPT_VERSION; }
6268
6346
  });
6269
6347
  Object.defineProperty(exports, "verifyPaymentReceipt", {
6270
6348
  enumerable: true,
6271
- get: function () { return chunkDXBAN4SN_cjs.verifyPaymentReceipt; }
6349
+ get: function () { return chunk4JTLJVBS_cjs.verifyPaymentReceipt; }
6272
6350
  });
6273
6351
  Object.defineProperty(exports, "AGENT_PAYMENT_FAILURE_CODE_VALUES", {
6274
6352
  enumerable: true,
6275
- get: function () { return chunkMZKLAHBK_cjs.AGENT_PAYMENT_FAILURE_CODE_VALUES; }
6353
+ get: function () { return chunkZA3NOSO2_cjs.AGENT_PAYMENT_FAILURE_CODE_VALUES; }
6276
6354
  });
6277
6355
  Object.defineProperty(exports, "AGENT_PAYMENT_NEXT_ACTION_VALUES", {
6278
6356
  enumerable: true,
6279
- get: function () { return chunkMZKLAHBK_cjs.AGENT_PAYMENT_NEXT_ACTION_VALUES; }
6357
+ get: function () { return chunkZA3NOSO2_cjs.AGENT_PAYMENT_NEXT_ACTION_VALUES; }
6280
6358
  });
6281
6359
  Object.defineProperty(exports, "AGENT_PAYMENT_PHASE_VALUES", {
6282
6360
  enumerable: true,
6283
- get: function () { return chunkMZKLAHBK_cjs.AGENT_PAYMENT_PHASE_VALUES; }
6361
+ get: function () { return chunkZA3NOSO2_cjs.AGENT_PAYMENT_PHASE_VALUES; }
6284
6362
  });
6285
6363
  Object.defineProperty(exports, "AGENT_PAYMENT_RAIL_VALUES", {
6286
6364
  enumerable: true,
6287
- get: function () { return chunkMZKLAHBK_cjs.AGENT_PAYMENT_RAIL_VALUES; }
6365
+ get: function () { return chunkZA3NOSO2_cjs.AGENT_PAYMENT_RAIL_VALUES; }
6288
6366
  });
6289
6367
  Object.defineProperty(exports, "AgentPaymentFailureCode", {
6290
6368
  enumerable: true,
6291
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentFailureCode; }
6369
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentFailureCode; }
6292
6370
  });
6293
6371
  Object.defineProperty(exports, "AgentPaymentFailureCodeDescriptions", {
6294
6372
  enumerable: true,
6295
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentFailureCodeDescriptions; }
6373
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentFailureCodeDescriptions; }
6296
6374
  });
6297
6375
  Object.defineProperty(exports, "AgentPaymentFailureCodeSchema", {
6298
6376
  enumerable: true,
6299
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentFailureCodeSchema; }
6377
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentFailureCodeSchema; }
6300
6378
  });
6301
6379
  Object.defineProperty(exports, "AgentPaymentNextAction", {
6302
6380
  enumerable: true,
6303
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentNextAction; }
6381
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentNextAction; }
6304
6382
  });
6305
6383
  Object.defineProperty(exports, "AgentPaymentNextActionDescriptions", {
6306
6384
  enumerable: true,
6307
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentNextActionDescriptions; }
6385
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentNextActionDescriptions; }
6308
6386
  });
6309
6387
  Object.defineProperty(exports, "AgentPaymentNextActionSchema", {
6310
6388
  enumerable: true,
6311
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentNextActionSchema; }
6389
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentNextActionSchema; }
6312
6390
  });
6313
6391
  Object.defineProperty(exports, "AgentPaymentPhase", {
6314
6392
  enumerable: true,
6315
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentPhase; }
6393
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentPhase; }
6316
6394
  });
6317
6395
  Object.defineProperty(exports, "AgentPaymentPhaseDescriptions", {
6318
6396
  enumerable: true,
6319
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentPhaseDescriptions; }
6397
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentPhaseDescriptions; }
6320
6398
  });
6321
6399
  Object.defineProperty(exports, "AgentPaymentPhaseSchema", {
6322
6400
  enumerable: true,
6323
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentPhaseSchema; }
6401
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentPhaseSchema; }
6324
6402
  });
6325
6403
  Object.defineProperty(exports, "AgentPaymentRail", {
6326
6404
  enumerable: true,
6327
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentRail; }
6405
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentRail; }
6328
6406
  });
6329
6407
  Object.defineProperty(exports, "AgentPaymentRailDescriptions", {
6330
6408
  enumerable: true,
6331
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentRailDescriptions; }
6409
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentRailDescriptions; }
6332
6410
  });
6333
6411
  Object.defineProperty(exports, "AgentPaymentRailSchema", {
6334
6412
  enumerable: true,
6335
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentRailSchema; }
6413
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentRailSchema; }
6336
6414
  });
6337
6415
  Object.defineProperty(exports, "AgentPaymentWarningCode", {
6338
6416
  enumerable: true,
6339
- get: function () { return chunkMZKLAHBK_cjs.AgentPaymentWarningCode; }
6417
+ get: function () { return chunkZA3NOSO2_cjs.AgentPaymentWarningCode; }
6340
6418
  });
6341
6419
  Object.defineProperty(exports, "CONNECTOR_PACKAGE_NAME", {
6342
6420
  enumerable: true,
6343
- get: function () { return chunkMZKLAHBK_cjs.CONNECTOR_PACKAGE_NAME; }
6421
+ get: function () { return chunkZA3NOSO2_cjs.CONNECTOR_PACKAGE_NAME; }
6344
6422
  });
6345
6423
  Object.defineProperty(exports, "DEFAULT_CONFIRMATION_TIMEOUT_MS", {
6346
6424
  enumerable: true,
6347
- get: function () { return chunkMZKLAHBK_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS; }
6425
+ get: function () { return chunkZA3NOSO2_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS; }
6348
6426
  });
6349
6427
  Object.defineProperty(exports, "DIRECT_SIGN_CONTEXT_VERSION", {
6350
6428
  enumerable: true,
6351
- get: function () { return chunkMZKLAHBK_cjs.DIRECT_SIGN_CONTEXT_VERSION; }
6429
+ get: function () { return chunkZA3NOSO2_cjs.DIRECT_SIGN_CONTEXT_VERSION; }
6352
6430
  });
6353
6431
  Object.defineProperty(exports, "ENTRY_POINT_V07", {
6354
6432
  enumerable: true,
6355
- get: function () { return chunkMZKLAHBK_cjs.ENTRY_POINT_V07; }
6433
+ get: function () { return chunkZA3NOSO2_cjs.ENTRY_POINT_V07; }
6434
+ });
6435
+ Object.defineProperty(exports, "FundingConfirmationUnknownError", {
6436
+ enumerable: true,
6437
+ get: function () { return chunkZA3NOSO2_cjs.FundingConfirmationUnknownError; }
6438
+ });
6439
+ Object.defineProperty(exports, "FundingRevertedError", {
6440
+ enumerable: true,
6441
+ get: function () { return chunkZA3NOSO2_cjs.FundingRevertedError; }
6356
6442
  });
6357
6443
  Object.defineProperty(exports, "HAVEN_CONNECTOR_CHANNEL", {
6358
6444
  enumerable: true,
6359
- get: function () { return chunkMZKLAHBK_cjs.HAVEN_CONNECTOR_CHANNEL; }
6445
+ get: function () { return chunkZA3NOSO2_cjs.HAVEN_CONNECTOR_CHANNEL; }
6360
6446
  });
6361
6447
  Object.defineProperty(exports, "HYBRID_DELEGATOR_DOMAIN_NAME", {
6362
6448
  enumerable: true,
6363
- get: function () { return chunkMZKLAHBK_cjs.HYBRID_DELEGATOR_DOMAIN_NAME; }
6449
+ get: function () { return chunkZA3NOSO2_cjs.HYBRID_DELEGATOR_DOMAIN_NAME; }
6364
6450
  });
6365
6451
  Object.defineProperty(exports, "HYBRID_DELEGATOR_DOMAIN_VERSION", {
6366
6452
  enumerable: true,
6367
- get: function () { return chunkMZKLAHBK_cjs.HYBRID_DELEGATOR_DOMAIN_VERSION; }
6453
+ get: function () { return chunkZA3NOSO2_cjs.HYBRID_DELEGATOR_DOMAIN_VERSION; }
6368
6454
  });
6369
6455
  Object.defineProperty(exports, "HavenApiError", {
6370
6456
  enumerable: true,
6371
- get: function () { return chunkMZKLAHBK_cjs.HavenApiError; }
6457
+ get: function () { return chunkZA3NOSO2_cjs.HavenApiError; }
6372
6458
  });
6373
6459
  Object.defineProperty(exports, "HavenError", {
6374
6460
  enumerable: true,
6375
- get: function () { return chunkMZKLAHBK_cjs.HavenError; }
6461
+ get: function () { return chunkZA3NOSO2_cjs.HavenError; }
6376
6462
  });
6377
6463
  Object.defineProperty(exports, "HavenPaymentStateError", {
6378
6464
  enumerable: true,
6379
- get: function () { return chunkMZKLAHBK_cjs.HavenPaymentStateError; }
6465
+ get: function () { return chunkZA3NOSO2_cjs.HavenPaymentStateError; }
6380
6466
  });
6381
6467
  Object.defineProperty(exports, "HavenSigningError", {
6382
6468
  enumerable: true,
6383
- get: function () { return chunkMZKLAHBK_cjs.HavenSigningError; }
6469
+ get: function () { return chunkZA3NOSO2_cjs.HavenSigningError; }
6384
6470
  });
6385
6471
  Object.defineProperty(exports, "HavenTimeoutError", {
6386
6472
  enumerable: true,
6387
- get: function () { return chunkMZKLAHBK_cjs.HavenTimeoutError; }
6473
+ get: function () { return chunkZA3NOSO2_cjs.HavenTimeoutError; }
6388
6474
  });
6389
6475
  Object.defineProperty(exports, "HavenUnsupportedSignerVersionError", {
6390
6476
  enumerable: true,
6391
- get: function () { return chunkMZKLAHBK_cjs.HavenUnsupportedSignerVersionError; }
6477
+ get: function () { return chunkZA3NOSO2_cjs.HavenUnsupportedSignerVersionError; }
6392
6478
  });
6393
6479
  Object.defineProperty(exports, "HavenUserOpBindingError", {
6394
6480
  enumerable: true,
6395
- get: function () { return chunkMZKLAHBK_cjs.HavenUserOpBindingError; }
6481
+ get: function () { return chunkZA3NOSO2_cjs.HavenUserOpBindingError; }
6396
6482
  });
6397
6483
  Object.defineProperty(exports, "HavenZeroSettlementHashError", {
6398
6484
  enumerable: true,
6399
- get: function () { return chunkMZKLAHBK_cjs.HavenZeroSettlementHashError; }
6485
+ get: function () { return chunkZA3NOSO2_cjs.HavenZeroSettlementHashError; }
6400
6486
  });
6401
6487
  Object.defineProperty(exports, "MerchantTimeoutError", {
6402
6488
  enumerable: true,
6403
- get: function () { return chunkMZKLAHBK_cjs.MerchantTimeoutError; }
6489
+ get: function () { return chunkZA3NOSO2_cjs.MerchantTimeoutError; }
6404
6490
  });
6405
6491
  Object.defineProperty(exports, "PACKED_USER_OPERATION_FIELDS", {
6406
6492
  enumerable: true,
6407
- get: function () { return chunkMZKLAHBK_cjs.PACKED_USER_OPERATION_FIELDS; }
6493
+ get: function () { return chunkZA3NOSO2_cjs.PACKED_USER_OPERATION_FIELDS; }
6408
6494
  });
6409
6495
  Object.defineProperty(exports, "ROOT_AUTHORITY", {
6410
6496
  enumerable: true,
6411
- get: function () { return chunkMZKLAHBK_cjs.ROOT_AUTHORITY; }
6497
+ get: function () { return chunkZA3NOSO2_cjs.ROOT_AUTHORITY; }
6412
6498
  });
6413
6499
  Object.defineProperty(exports, "SIGNER_UPDATE_FALLBACK", {
6414
6500
  enumerable: true,
6415
- get: function () { return chunkMZKLAHBK_cjs.SIGNER_UPDATE_FALLBACK; }
6501
+ get: function () { return chunkZA3NOSO2_cjs.SIGNER_UPDATE_FALLBACK; }
6416
6502
  });
6417
6503
  Object.defineProperty(exports, "SignerRefusalCode", {
6418
6504
  enumerable: true,
6419
- get: function () { return chunkMZKLAHBK_cjs.SignerRefusalCode; }
6505
+ get: function () { return chunkZA3NOSO2_cjs.SignerRefusalCode; }
6420
6506
  });
6421
6507
  Object.defineProperty(exports, "TASK_SIGN_CONTEXT_VERSION", {
6422
6508
  enumerable: true,
6423
- get: function () { return chunkMZKLAHBK_cjs.TASK_SIGN_CONTEXT_VERSION; }
6509
+ get: function () { return chunkZA3NOSO2_cjs.TASK_SIGN_CONTEXT_VERSION; }
6424
6510
  });
6425
6511
  Object.defineProperty(exports, "X402AlreadySettledError", {
6426
6512
  enumerable: true,
6427
- get: function () { return chunkMZKLAHBK_cjs.X402AlreadySettledError; }
6513
+ get: function () { return chunkZA3NOSO2_cjs.X402AlreadySettledError; }
6428
6514
  });
6429
6515
  Object.defineProperty(exports, "X402Erc7710AlreadySettledError", {
6430
6516
  enumerable: true,
6431
- get: function () { return chunkMZKLAHBK_cjs.X402Erc7710AlreadySettledError; }
6517
+ get: function () { return chunkZA3NOSO2_cjs.X402Erc7710AlreadySettledError; }
6432
6518
  });
6433
6519
  Object.defineProperty(exports, "X402TaskBudgetMismatchError", {
6434
6520
  enumerable: true,
6435
- get: function () { return chunkMZKLAHBK_cjs.X402TaskBudgetMismatchError; }
6521
+ get: function () { return chunkZA3NOSO2_cjs.X402TaskBudgetMismatchError; }
6436
6522
  });
6437
6523
  Object.defineProperty(exports, "X402UnexpectedStatusError", {
6438
6524
  enumerable: true,
6439
- get: function () { return chunkMZKLAHBK_cjs.X402UnexpectedStatusError; }
6525
+ get: function () { return chunkZA3NOSO2_cjs.X402UnexpectedStatusError; }
6440
6526
  });
6441
6527
  Object.defineProperty(exports, "assertUserOpTypedDataBinding", {
6442
6528
  enumerable: true,
6443
- get: function () { return chunkMZKLAHBK_cjs.assertUserOpTypedDataBinding; }
6529
+ get: function () { return chunkZA3NOSO2_cjs.assertUserOpTypedDataBinding; }
6444
6530
  });
6445
6531
  Object.defineProperty(exports, "connectorRerunCommand", {
6446
6532
  enumerable: true,
6447
- get: function () { return chunkMZKLAHBK_cjs.connectorRerunCommand; }
6533
+ get: function () { return chunkZA3NOSO2_cjs.connectorRerunCommand; }
6448
6534
  });
6449
6535
  Object.defineProperty(exports, "connectorSpec", {
6450
6536
  enumerable: true,
6451
- get: function () { return chunkMZKLAHBK_cjs.connectorSpec; }
6537
+ get: function () { return chunkZA3NOSO2_cjs.connectorSpec; }
6452
6538
  });
6453
6539
  Object.defineProperty(exports, "connectorUpgradeCommand", {
6454
6540
  enumerable: true,
6455
- get: function () { return chunkMZKLAHBK_cjs.connectorUpgradeCommand; }
6541
+ get: function () { return chunkZA3NOSO2_cjs.connectorUpgradeCommand; }
6456
6542
  });
6457
6543
  Object.defineProperty(exports, "deriveDelegateAccountAddress", {
6458
6544
  enumerable: true,
6459
- get: function () { return chunkMZKLAHBK_cjs.deriveDelegateAccountAddress; }
6545
+ get: function () { return chunkZA3NOSO2_cjs.deriveDelegateAccountAddress; }
6460
6546
  });
6461
6547
  Object.defineProperty(exports, "isConnectorChannel", {
6462
6548
  enumerable: true,
6463
- get: function () { return chunkMZKLAHBK_cjs.isConnectorChannel; }
6549
+ get: function () { return chunkZA3NOSO2_cjs.isConnectorChannel; }
6464
6550
  });
6465
6551
  Object.defineProperty(exports, "isPackedUserOperationTypedData", {
6466
6552
  enumerable: true,
6467
- get: function () { return chunkMZKLAHBK_cjs.isPackedUserOperationTypedData; }
6553
+ get: function () { return chunkZA3NOSO2_cjs.isPackedUserOperationTypedData; }
6468
6554
  });
6469
6555
  Object.defineProperty(exports, "packedUserOperationHash", {
6470
6556
  enumerable: true,
6471
- get: function () { return chunkMZKLAHBK_cjs.packedUserOperationHash; }
6557
+ get: function () { return chunkZA3NOSO2_cjs.packedUserOperationHash; }
6472
6558
  });
6473
6559
  Object.defineProperty(exports, "resolveConnectorChannel", {
6474
6560
  enumerable: true,
6475
- get: function () { return chunkMZKLAHBK_cjs.resolveConnectorChannel; }
6561
+ get: function () { return chunkZA3NOSO2_cjs.resolveConnectorChannel; }
6476
6562
  });
6477
6563
  Object.defineProperty(exports, "signerUpdateFallback", {
6478
6564
  enumerable: true,
6479
- get: function () { return chunkMZKLAHBK_cjs.signerUpdateFallback; }
6565
+ get: function () { return chunkZA3NOSO2_cjs.signerUpdateFallback; }
6480
6566
  });
6481
6567
  Object.defineProperty(exports, "verifySettlementChild", {
6482
6568
  enumerable: true,
6483
- get: function () { return chunkMZKLAHBK_cjs.verifySettlementChild; }
6569
+ get: function () { return chunkZA3NOSO2_cjs.verifySettlementChild; }
6484
6570
  });
6485
6571
  exports.AGENT_APPROVAL_RELAY_JSON_SENTENCE = AGENT_APPROVAL_RELAY_JSON_SENTENCE;
6486
6572
  exports.AGENT_APPROVAL_RELAY_PROSE_SENTENCE = AGENT_APPROVAL_RELAY_PROSE_SENTENCE;