@haven_ai/sdk 0.0.0-dev.202610072011.b5e9906 → 0.0.0-dev.202610081237.5ad1a37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkGABPEVWW_cjs = require('./chunk-GABPEVWW.cjs');
3
+ var chunkDART3SSC_cjs = require('./chunk-DART3SSC.cjs');
4
4
  var chunkVI3F5N5B_cjs = require('./chunk-VI3F5N5B.cjs');
5
5
  var chunkC3R4GLKO_cjs = require('./chunk-C3R4GLKO.cjs');
6
6
  var viem = require('viem');
@@ -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 = chunkGABPEVWW_cjs.HAVEN_CLIENT_HEADER.toLowerCase();
65
+ const target = chunkDART3SSC_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 ?? chunkGABPEVWW_cjs.SDK_CLIENT_IDENTITY;
81
+ this.clientIdentity = config.clientIdentity ?? chunkDART3SSC_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 = chunkGABPEVWW_cjs.readClientUpdate(data.client_update);
94
+ const hint = chunkDART3SSC_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
- [chunkGABPEVWW_cjs.HAVEN_CLIENT_HEADER]: this.clientIdentity
127
+ [chunkDART3SSC_cjs.HAVEN_CLIENT_HEADER]: this.clientIdentity
128
128
  },
129
129
  body: body ? JSON.stringify(body) : void 0,
130
130
  signal: controller.signal
@@ -174,7 +174,7 @@ async function fetchUnsignedTaxDeclaration(client) {
174
174
  );
175
175
  }
176
176
  async function resolveTaxDeclarationHeader(client, input) {
177
- if (chunkGABPEVWW_cjs.isErc7710Option(input.accepted)) {
177
+ if (chunkDART3SSC_cjs.isErc7710Option(input.accepted)) {
178
178
  return { header: void 0 };
179
179
  }
180
180
  let content;
@@ -186,7 +186,7 @@ async function resolveTaxDeclarationHeader(client, input) {
186
186
  if (!content.available) {
187
187
  return { header: void 0 };
188
188
  }
189
- const signed = chunkGABPEVWW_cjs.buildSignedTaxDeclaration({
189
+ const signed = chunkDART3SSC_cjs.buildSignedTaxDeclaration({
190
190
  content: content.declaration,
191
191
  network: input.accepted.network,
192
192
  delegateKey: input.delegateKey
@@ -195,19 +195,19 @@ async function resolveTaxDeclarationHeader(client, input) {
195
195
  `[haven-sdk] signing x402 tax declaration taxId=${JSON.stringify(content.declaration.taxId)} jurisdiction=${JSON.stringify(content.declaration.jurisdiction)} principalId=${signed.declaration.principalId}
196
196
  `
197
197
  );
198
- return { header: chunkGABPEVWW_cjs.encodeTaxDeclarationHeader(signed) };
198
+ return { header: chunkDART3SSC_cjs.encodeTaxDeclarationHeader(signed) };
199
199
  }
200
200
  function withTaxDeclarationHeader(init, header) {
201
201
  if (!header) {
202
- if (init?.headers && new Headers(init.headers).has(chunkGABPEVWW_cjs.X_TAX_DECLARATION_HEADER)) {
202
+ if (init?.headers && new Headers(init.headers).has(chunkDART3SSC_cjs.X_TAX_DECLARATION_HEADER)) {
203
203
  const headers2 = new Headers(init.headers);
204
- headers2.delete(chunkGABPEVWW_cjs.X_TAX_DECLARATION_HEADER);
204
+ headers2.delete(chunkDART3SSC_cjs.X_TAX_DECLARATION_HEADER);
205
205
  return { ...init, headers: headers2 };
206
206
  }
207
207
  return init ?? {};
208
208
  }
209
209
  const headers = new Headers(init?.headers);
210
- headers.set(chunkGABPEVWW_cjs.X_TAX_DECLARATION_HEADER, header);
210
+ headers.set(chunkDART3SSC_cjs.X_TAX_DECLARATION_HEADER, header);
211
211
  return { ...init, headers };
212
212
  }
213
213
 
@@ -956,8 +956,8 @@ var McpMerchantTransport = class {
956
956
  async deliverPayment(url, init, paymentHeader) {
957
957
  assertSecureX402RetryTarget(url);
958
958
  const headers = new Headers(init?.headers);
959
- const send = chunkGABPEVWW_cjs.x402PaymentHeaderNamesFor(paymentHeader);
960
- for (const name of chunkGABPEVWW_cjs.X402_PAYMENT_HEADER_NAMES) {
959
+ const send = chunkDART3SSC_cjs.x402PaymentHeaderNamesFor(paymentHeader);
960
+ for (const name of chunkDART3SSC_cjs.X402_PAYMENT_HEADER_NAMES) {
961
961
  if (send.includes(name)) headers.set(name, paymentHeader);
962
962
  else headers.delete(name);
963
963
  }
@@ -1044,7 +1044,7 @@ function mcpToolResultOf(value) {
1044
1044
  function extractMcpPaymentRequired(toolResult) {
1045
1045
  if (toolResult.isError !== true) return void 0;
1046
1046
  if (isRecord(toolResult.structuredContent)) {
1047
- const parsed = chunkGABPEVWW_cjs.normalizePaymentRequired(toolResult.structuredContent);
1047
+ const parsed = chunkDART3SSC_cjs.normalizePaymentRequired(toolResult.structuredContent);
1048
1048
  if (parsed) return parsed;
1049
1049
  }
1050
1050
  if (Array.isArray(toolResult.content)) {
@@ -1056,7 +1056,7 @@ function extractMcpPaymentRequired(toolResult) {
1056
1056
  } catch {
1057
1057
  continue;
1058
1058
  }
1059
- const parsed = chunkGABPEVWW_cjs.normalizePaymentRequired(candidate);
1059
+ const parsed = chunkDART3SSC_cjs.normalizePaymentRequired(candidate);
1060
1060
  if (parsed) return parsed;
1061
1061
  }
1062
1062
  }
@@ -1080,7 +1080,7 @@ function withMcpPaymentMeta(init, paymentHeader) {
1080
1080
  if (!request) return init;
1081
1081
  let envelope;
1082
1082
  try {
1083
- envelope = chunkGABPEVWW_cjs.decodeBase64Json(paymentHeader);
1083
+ envelope = chunkDART3SSC_cjs.decodeBase64Json(paymentHeader);
1084
1084
  } catch {
1085
1085
  return init;
1086
1086
  }
@@ -1096,7 +1096,7 @@ function withMcpPaymentMeta(init, paymentHeader) {
1096
1096
  };
1097
1097
  }
1098
1098
  function encodeMcpSettlementReceipt(settlement) {
1099
- return chunkGABPEVWW_cjs.encodeBase64Json(settlement);
1099
+ return chunkDART3SSC_cjs.encodeBase64Json(settlement);
1100
1100
  }
1101
1101
  function parseJsonRpcToolsCall(body) {
1102
1102
  if (typeof body !== "string") return void 0;
@@ -1214,7 +1214,7 @@ function deriveReadiness(status, allowances) {
1214
1214
  return allowances.some((allowance) => safeBigInt(allowance.remainingAtomic) > 0n) ? "ready" : "needs_approval";
1215
1215
  }
1216
1216
  function formatRemainingDisplay(tokenAddress, tokenSymbol, remainingAtomic) {
1217
- const token = chunkGABPEVWW_cjs.resolveTokenFromAddress(tokenAddress);
1217
+ const token = chunkDART3SSC_cjs.resolveTokenFromAddress(tokenAddress);
1218
1218
  return token ? `${formatAtomicAmount(safeBigInt(remainingAtomic), token.decimals)} ${tokenSymbol}` : `${remainingAtomic} ${tokenSymbol} (atomic; unknown decimals)`;
1219
1219
  }
1220
1220
  function formatTokenAmount(atomic, decimals) {
@@ -1290,7 +1290,7 @@ function summarizePendingSubBudget(row) {
1290
1290
  };
1291
1291
  }
1292
1292
  function summarizeTaskBudget(taskBudget) {
1293
- const token = chunkGABPEVWW_cjs.resolveTokenFromAddress(taskBudget.tokenAddress);
1293
+ const token = chunkDART3SSC_cjs.resolveTokenFromAddress(taskBudget.tokenAddress);
1294
1294
  const maxDisplay = token ? `${formatAtomicAmount(safeBigInt(taskBudget.maxAtomic), token.decimals)} ${token.symbol}` : `${taskBudget.maxAtomic} (atomic; unknown decimals)`;
1295
1295
  const spendDisplay = (atomic) => {
1296
1296
  if (atomic === null) return null;
@@ -1675,8 +1675,8 @@ var DelegateSweepApi = class {
1675
1675
  const provider = createJsonRpcProvider(rpcUrl);
1676
1676
  const wallet = createWallet(this.options.delegateKey, provider);
1677
1677
  const transfers = [];
1678
- if (chunkGABPEVWW_cjs.isSweepableChain(agent.chainId)) {
1679
- const contract = createErc20Contract(chunkGABPEVWW_cjs.sweepUsdcAddress(agent.chainId), ["function balanceOf(address) view returns (uint256)", "function transfer(address to, uint256 amount) returns (bool)"], wallet);
1678
+ if (chunkDART3SSC_cjs.isSweepableChain(agent.chainId)) {
1679
+ const contract = createErc20Contract(chunkDART3SSC_cjs.sweepUsdcAddress(agent.chainId), ["function balanceOf(address) view returns (uint256)", "function transfer(address to, uint256 amount) returns (bool)"], wallet);
1680
1680
  const balance2 = await contract.balanceOf(agent.delegateAddress);
1681
1681
  if (balance2 > 0n) {
1682
1682
  const tx = await contract.transfer(agent.accountAddress, balance2);
@@ -1785,9 +1785,9 @@ function requestInitFromSnapshot(request) {
1785
1785
  };
1786
1786
  }
1787
1787
  function noCompatiblePaymentOptionError(accepts) {
1788
- const erc7710Only = chunkGABPEVWW_cjs.selectErc7710PaymentOption(accepts) !== null;
1788
+ const erc7710Only = chunkDART3SSC_cjs.selectErc7710PaymentOption(accepts) !== null;
1789
1789
  const unsupportedOnly = !erc7710Only && accepts.some(
1790
- (opt) => opt !== null && typeof opt === "object" && !chunkGABPEVWW_cjs.isErc7710Option(opt) && (chunkGABPEVWW_cjs.x402AssetTransferMethod(opt) !== null || opt.extra?.paymentFlow !== void 0)
1790
+ (opt) => opt !== null && typeof opt === "object" && !chunkDART3SSC_cjs.isErc7710Option(opt) && (chunkDART3SSC_cjs.x402AssetTransferMethod(opt) !== null || opt.extra?.paymentFlow !== void 0)
1791
1791
  );
1792
1792
  const offeredSchemes = nonExactSchemesOnly(accepts);
1793
1793
  return new chunkC3R4GLKO_cjs.HavenApiError(
@@ -1809,15 +1809,15 @@ function nonExactSchemesOnly(accepts) {
1809
1809
  return schemes.map((s) => `'${s}'`).join(", ");
1810
1810
  }
1811
1811
  function buildX402Quote(paymentRequired, request, idempotencyKey, mcpTransport) {
1812
- const standard = chunkGABPEVWW_cjs.selectStandardPaymentOption(paymentRequired.accepts);
1813
- const option = standard ?? chunkGABPEVWW_cjs.selectErc7710PaymentOption(paymentRequired.accepts);
1812
+ const standard = chunkDART3SSC_cjs.selectStandardPaymentOption(paymentRequired.accepts);
1813
+ const option = standard ?? chunkDART3SSC_cjs.selectErc7710PaymentOption(paymentRequired.accepts);
1814
1814
  if (!option) {
1815
1815
  throw noCompatiblePaymentOptionError(paymentRequired.accepts);
1816
1816
  }
1817
- const token = chunkGABPEVWW_cjs.resolveTokenFromAddress(option.asset, option.network);
1817
+ const token = chunkDART3SSC_cjs.resolveTokenFromAddress(option.asset, option.network);
1818
1818
  return {
1819
1819
  rail: "x402",
1820
- idempotencyKey: idempotencyKey ?? chunkGABPEVWW_cjs.buildX402IdempotencyKey(paymentRequired, option),
1820
+ idempotencyKey: idempotencyKey ?? chunkDART3SSC_cjs.buildX402IdempotencyKey(paymentRequired, option),
1821
1821
  paymentRequired,
1822
1822
  accepted: option,
1823
1823
  acceptedScheme: standard ? "standard" : "erc7710",
@@ -1831,8 +1831,8 @@ function buildX402Quote(paymentRequired, request, idempotencyKey, mcpTransport)
1831
1831
  resourceUrlDiffersFromRequest: paymentRequired.resource.url !== request.url,
1832
1832
  description: paymentRequired.resource.description ?? option.description ?? null,
1833
1833
  mimeType: paymentRequired.resource.mimeType ?? option.mimeType ?? null,
1834
- amountAtomic: chunkGABPEVWW_cjs.x402AuthorizationAmount(option),
1835
- amount: decimalFromUsdcAtomic(chunkGABPEVWW_cjs.x402AuthorizationAmount(option)),
1834
+ amountAtomic: chunkDART3SSC_cjs.x402AuthorizationAmount(option),
1835
+ amount: decimalFromUsdcAtomic(chunkDART3SSC_cjs.x402AuthorizationAmount(option)),
1836
1836
  token: token?.symbol ?? "USDC",
1837
1837
  // #1351: null when the asset is unrecognised on this network — the
1838
1838
  // `token` fallback above is a LABEL, not evidence of 6 decimals, and a
@@ -1871,7 +1871,7 @@ function buildX402Receipt(input) {
1871
1871
  payTo: input.merchantTo ?? input.accepted.payTo
1872
1872
  },
1873
1873
  x402: {
1874
- amount: chunkGABPEVWW_cjs.x402AuthorizationAmount(input.accepted),
1874
+ amount: chunkDART3SSC_cjs.x402AuthorizationAmount(input.accepted),
1875
1875
  token: input.token,
1876
1876
  network: input.accepted.network,
1877
1877
  asset: input.accepted.asset,
@@ -1880,7 +1880,7 @@ function buildX402Receipt(input) {
1880
1880
  };
1881
1881
  }
1882
1882
  function buildX402ResumeState(input) {
1883
- const token = chunkGABPEVWW_cjs.resolveTokenFromAddress(input.accepted.asset, input.accepted.network);
1883
+ const token = chunkDART3SSC_cjs.resolveTokenFromAddress(input.accepted.asset, input.accepted.network);
1884
1884
  return {
1885
1885
  rail: "x402",
1886
1886
  paymentId: input.paymentId,
@@ -1891,8 +1891,8 @@ function buildX402ResumeState(input) {
1891
1891
  request: input.request,
1892
1892
  resourceUrl: input.paymentRequired.resource.url,
1893
1893
  description: input.paymentRequired.resource.description ?? input.accepted.description ?? null,
1894
- amountAtomic: chunkGABPEVWW_cjs.x402AuthorizationAmount(input.accepted),
1895
- amount: decimalFromUsdcAtomic(chunkGABPEVWW_cjs.x402AuthorizationAmount(input.accepted)),
1894
+ amountAtomic: chunkDART3SSC_cjs.x402AuthorizationAmount(input.accepted),
1895
+ amount: decimalFromUsdcAtomic(chunkDART3SSC_cjs.x402AuthorizationAmount(input.accepted)),
1896
1896
  token: token?.symbol ?? "USDC",
1897
1897
  asset: input.accepted.asset,
1898
1898
  network: input.accepted.network,
@@ -1973,7 +1973,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
1973
1973
  );
1974
1974
  }
1975
1975
  const approvedAmount = status.amount ? normalizeDecimal(status.amount) : "";
1976
- const requestedAmount = normalizeDecimal(decimalFromUsdcAtomic(chunkGABPEVWW_cjs.x402AuthorizationAmount(option)));
1976
+ const requestedAmount = normalizeDecimal(decimalFromUsdcAtomic(chunkDART3SSC_cjs.x402AuthorizationAmount(option)));
1977
1977
  if (approvedAmount && approvedAmount !== requestedAmount) {
1978
1978
  throw new chunkC3R4GLKO_cjs.HavenApiError(
1979
1979
  "x402 resume request does not match the approved amount.",
@@ -2052,7 +2052,7 @@ var X402FundingLeg = class {
2052
2052
  url: paymentRequired.resource.url,
2053
2053
  payTo: this.delegateAddress,
2054
2054
  merchantPayTo: option.payTo,
2055
- amount: chunkGABPEVWW_cjs.x402AuthorizationAmount(option),
2055
+ amount: chunkDART3SSC_cjs.x402AuthorizationAmount(option),
2056
2056
  asset: option.asset,
2057
2057
  network: option.network,
2058
2058
  description: paymentRequired.resource.description,
@@ -2076,7 +2076,7 @@ var X402FundingLeg = class {
2076
2076
  const canFund = await this.delegateCanFund(
2077
2077
  raw.chain_id ?? state?.chainId ?? chainIdFromNetwork(option.network),
2078
2078
  option.asset,
2079
- chunkGABPEVWW_cjs.x402AuthorizationAmount(option)
2079
+ chunkDART3SSC_cjs.x402AuthorizationAmount(option)
2080
2080
  );
2081
2081
  const refuse = executedReplay === "idempotency-collision" ? canFund !== true : canFund === false;
2082
2082
  if (refuse) {
@@ -2105,7 +2105,7 @@ var X402FundingLeg = class {
2105
2105
  }
2106
2106
  const sig = await this.signForData(raw.sign_data, {
2107
2107
  asset: option.asset,
2108
- amount: chunkGABPEVWW_cjs.x402AuthorizationAmount(option)
2108
+ amount: chunkDART3SSC_cjs.x402AuthorizationAmount(option)
2109
2109
  });
2110
2110
  const execResult = await this.post(
2111
2111
  `/payments/${raw.payment_id}/sign`,
@@ -2128,22 +2128,22 @@ var X402FundingLeg = class {
2128
2128
  throw new chunkC3R4GLKO_cjs.HavenSigningError("delegateKey is required to sign x402 payment headers.");
2129
2129
  }
2130
2130
  const account = accounts.privateKeyToAccount(this.delegateKey);
2131
- const requirements = chunkGABPEVWW_cjs.toStandardPaymentRequirements(paymentRequired, option);
2131
+ const requirements = chunkDART3SSC_cjs.toStandardPaymentRequirements(paymentRequired, option);
2132
2132
  const header = await schemes.exact.evm.createPaymentHeader(
2133
2133
  account,
2134
2134
  paymentRequired.x402Version,
2135
2135
  requirements
2136
2136
  );
2137
2137
  if (paymentRequired.x402Version < 2) return header;
2138
- const payment = chunkGABPEVWW_cjs.decodeBase64Json(header);
2139
- return chunkGABPEVWW_cjs.encodeBase64Json(chunkGABPEVWW_cjs.x402V2PaymentEnvelope(paymentRequired, option, payment.payload));
2138
+ const payment = chunkDART3SSC_cjs.decodeBase64Json(header);
2139
+ return chunkDART3SSC_cjs.encodeBase64Json(chunkDART3SSC_cjs.x402V2PaymentEnvelope(paymentRequired, option, payment.payload));
2140
2140
  }
2141
2141
  // ── Receipt mapping ──────────────────────────────────────────────
2142
2142
  receiptFromAuthorization(paymentRequired, option, paymentHeader, raw, execResult) {
2143
2143
  const txHash = execResult?.tx_hash ?? raw.tx_hash ?? "";
2144
2144
  const chainId = execResult?.chain_id ?? raw.chain_id ?? chainIdFromNetwork(option.network);
2145
2145
  const token = execResult?.token ?? raw.token ?? "USDC";
2146
- const amount = execResult?.amount ?? raw.amount ?? decimalFromUsdcAtomic(chunkGABPEVWW_cjs.x402AuthorizationAmount(option));
2146
+ const amount = execResult?.amount ?? raw.amount ?? decimalFromUsdcAtomic(chunkDART3SSC_cjs.x402AuthorizationAmount(option));
2147
2147
  const to = execResult?.to ?? raw.to ?? this.delegateAddress ?? "";
2148
2148
  const explorerUrl = execResult?.explorer_url ?? raw.explorer_url ?? explorerUrlOrEmpty(chainId, txHash);
2149
2149
  const merchantTo = execResult?.merchant_to ?? raw.merchant_to ?? option.payTo;
@@ -2176,7 +2176,7 @@ var X402FundingLeg = class {
2176
2176
  paymentId: status.paymentId,
2177
2177
  txHash: status.txHash,
2178
2178
  token: status.token || "USDC",
2179
- amount: status.amount || decimalFromUsdcAtomic(chunkGABPEVWW_cjs.x402AuthorizationAmount(option)),
2179
+ amount: status.amount || decimalFromUsdcAtomic(chunkDART3SSC_cjs.x402AuthorizationAmount(option)),
2180
2180
  to: this.delegateAddress ?? "",
2181
2181
  resourceUrl: paymentRequired.resource.url,
2182
2182
  explorerUrl: explorerUrlOrEmpty(status.chainId, status.txHash),
@@ -2253,7 +2253,7 @@ var X402FundingLeg = class {
2253
2253
  };
2254
2254
  function getPaymentHeaderValidBefore(paymentHeader) {
2255
2255
  try {
2256
- const payment = chunkGABPEVWW_cjs.decodeBase64Json(
2256
+ const payment = chunkDART3SSC_cjs.decodeBase64Json(
2257
2257
  paymentHeader
2258
2258
  );
2259
2259
  const payload = payment.payload;
@@ -2338,7 +2338,7 @@ var X402Erc7710 = class {
2338
2338
  400
2339
2339
  );
2340
2340
  }
2341
- const selection = chunkGABPEVWW_cjs.selectX402SettlementScheme(paymentRequired.accepts, { delegationRail });
2341
+ const selection = chunkDART3SSC_cjs.selectX402SettlementScheme(paymentRequired.accepts, { delegationRail });
2342
2342
  if (!selection || selection.scheme !== "erc7710") {
2343
2343
  throw new chunkC3R4GLKO_cjs.HavenApiError(
2344
2344
  "This merchant does not advertise an erc7710 settlement option (no accepts[] entry carries extra.assetTransferMethod: 'erc7710'). Use authorizeX402() for the standard EIP-3009 path.",
@@ -2347,7 +2347,7 @@ var X402Erc7710 = class {
2347
2347
  }
2348
2348
  const option = selection.option;
2349
2349
  const merchantPayTo = option.payTo;
2350
- const amountAtomic = chunkGABPEVWW_cjs.x402AuthorizationAmount(option);
2350
+ const amountAtomic = chunkDART3SSC_cjs.x402AuthorizationAmount(option);
2351
2351
  const raw = await this.post("/x402", {
2352
2352
  url: options.resourceUrl ?? paymentRequired.resource?.url,
2353
2353
  // #2373: the full 402 challenge, persisted verbatim by the backend
@@ -2576,6 +2576,9 @@ function toolError(err) {
2576
2576
  var MERCHANT_BODY_SNIPPET_LIMIT = 1e3;
2577
2577
  var EVIDENCE_RETRY_DELAYS_MS = [1e3, 2e3, 4e3];
2578
2578
  var EVIDENCE_RETRYABLE_STATUS = 503;
2579
+ function isWellFormedSettlementTxHash(hash) {
2580
+ return typeof hash === "string" && /^0x[0-9a-fA-F]{64}$/.test(hash);
2581
+ }
2579
2582
  var MerchantCompletion = class {
2580
2583
  post;
2581
2584
  merchantTransport;
@@ -2606,7 +2609,7 @@ var MerchantCompletion = class {
2606
2609
  }
2607
2610
  let retryInit = initialInit;
2608
2611
  if (this.getTaxDeclarationHeader && this.delegateKey) {
2609
- const scheme = chunkGABPEVWW_cjs.x402PaymentHeaderNamesFor(receipt.paymentHeader);
2612
+ const scheme = chunkDART3SSC_cjs.x402PaymentHeaderNamesFor(receipt.paymentHeader);
2610
2613
  const isEip3009 = scheme.length > 1;
2611
2614
  if (isEip3009) {
2612
2615
  const resolved = await this.getTaxDeclarationHeader({
@@ -2671,11 +2674,15 @@ var MerchantCompletion = class {
2671
2674
  merchantStatus: retryResponse.status,
2672
2675
  challengePayload: paymentRequired,
2673
2676
  selectedPayment: receipt.accepted,
2674
- paymentProofHeaderName: chunkGABPEVWW_cjs.x402PaymentHeaderNamesSent(receipt.paymentHeader),
2677
+ paymentProofHeaderName: chunkDART3SSC_cjs.x402PaymentHeaderNamesSent(receipt.paymentHeader),
2675
2678
  paymentProofHeader: receipt.paymentHeader,
2676
2679
  protocolReceiptHeaderName,
2677
2680
  protocolReceiptHeader
2678
2681
  });
2682
+ const settlementCandidate = merchantSettlement.settlementTxHash;
2683
+ if (settlementCandidate && isWellFormedSettlementTxHash(settlementCandidate) && !isZeroSettlementTxHash(settlementCandidate) && settlementCandidate.toLowerCase() !== receipt.txHash.toLowerCase()) {
2684
+ await this.reportSettlementEvidenceOnce(receipt.paymentId, settlementCandidate);
2685
+ }
2679
2686
  await this.reportMerchantReceipt(receipt.paymentId, retryResponse);
2680
2687
  return retryResponse;
2681
2688
  }
@@ -2900,25 +2907,34 @@ var MerchantCompletion = class {
2900
2907
  protocolReceiptPayload: input.protocolReceiptHeader ? parseProtocolReceiptHeader(input.protocolReceiptHeader) : void 0
2901
2908
  };
2902
2909
  for (let attempt = 0; ; attempt += 1) {
2903
- try {
2904
- await this.post("/machine-payments/evidence", body);
2905
- return { outcome: "confirmed" };
2906
- } catch (err) {
2907
- const statusCode = err instanceof chunkC3R4GLKO_cjs.HavenApiError ? err.statusCode : void 0;
2908
- const retryable = statusCode === EVIDENCE_RETRYABLE_STATUS;
2909
- if (!retryable) {
2910
- const reason = refusalReasonFromBody(err);
2911
- return {
2912
- outcome: "refused",
2913
- statusCode: statusCode ?? 0,
2914
- ...reason ? { reason } : {}
2915
- };
2916
- }
2917
- if (attempt >= EVIDENCE_RETRY_DELAYS_MS.length) {
2918
- return { outcome: "retryable", statusCode };
2919
- }
2920
- await this.sleep(EVIDENCE_RETRY_DELAYS_MS[attempt]);
2910
+ const result = await this.postEvidenceOnce(body);
2911
+ if (result.outcome !== "retryable" || attempt >= EVIDENCE_RETRY_DELAYS_MS.length) {
2912
+ return result;
2913
+ }
2914
+ await this.sleep(EVIDENCE_RETRY_DELAYS_MS[attempt]);
2915
+ }
2916
+ }
2917
+ /**
2918
+ * ONE evidence attempt — the body of `reportEvidence`'s loop above, and the
2919
+ * whole of the #3764 settlement report below. A 503 answers `retryable`
2920
+ * immediately; the caller decides whether to sleep and re-attempt
2921
+ * (`reportEvidence`) or hand the outcome to its consumer (#3764 D2).
2922
+ */
2923
+ async postEvidenceOnce(body) {
2924
+ try {
2925
+ await this.post("/machine-payments/evidence", body);
2926
+ return { outcome: "confirmed" };
2927
+ } catch (err) {
2928
+ const statusCode = err instanceof chunkC3R4GLKO_cjs.HavenApiError ? err.statusCode : void 0;
2929
+ if (statusCode !== EVIDENCE_RETRYABLE_STATUS) {
2930
+ const reason = refusalReasonFromBody(err);
2931
+ return {
2932
+ outcome: "refused",
2933
+ statusCode: statusCode ?? 0,
2934
+ ...reason ? { reason } : {}
2935
+ };
2921
2936
  }
2937
+ return { outcome: "retryable", statusCode };
2922
2938
  }
2923
2939
  }
2924
2940
  /**
@@ -2963,6 +2979,27 @@ var MerchantCompletion = class {
2963
2979
  txHash: settlementTxHash
2964
2980
  });
2965
2981
  }
2982
+ /**
2983
+ * #3764: report the merchant's OWN EIP-3009 settlement transaction right
2984
+ * after a completed purchase — the second leg of a payment that already has
2985
+ * a funding-evidence row. Same endpoint and payload shape as
2986
+ * `reportSettlementEvidence` above, but with #3764's D2 budget: exactly ONE
2987
+ * attempt, no `EVIDENCE_RETRY_DELAYS_MS` backoff. The resource is already
2988
+ * paid for and delivered, so a retryable answer must not stretch the
2989
+ * completed purchase — the HOSTED tools hand the outcome to the agent
2990
+ * (`settlementEvidenceOutcome` → `haven_report_settlement_evidence`), and
2991
+ * the local caller swallows it by design (D1). Callers validate the hash
2992
+ * before this call (well-formed, non-zero, different from the funding hash
2993
+ * case-insensitively), so there is no client-side refusal here — the
2994
+ * backend verifies on-chain and is the only judge.
2995
+ */
2996
+ async reportSettlementEvidenceOnce(paymentId, settlementTxHash) {
2997
+ return this.postEvidenceOnce({
2998
+ paymentId,
2999
+ rail: "x402",
3000
+ txHash: settlementTxHash
3001
+ });
3002
+ }
2966
3003
  };
2967
3004
  function refusalReasonFromBody(err) {
2968
3005
  if (!(err instanceof chunkC3R4GLKO_cjs.HavenApiError)) return void 0;
@@ -2982,7 +3019,7 @@ function parseMerchantSettlement(header) {
2982
3019
  }
2983
3020
  function parseProtocolReceiptHeader(value) {
2984
3021
  try {
2985
- return chunkGABPEVWW_cjs.decodeBase64Json(value);
3022
+ return chunkDART3SSC_cjs.decodeBase64Json(value);
2986
3023
  } catch {
2987
3024
  try {
2988
3025
  return JSON.parse(value);
@@ -3238,7 +3275,7 @@ var HavenClient = class {
3238
3275
  * on-chain allowance — there is nothing to sign until the user approves.
3239
3276
  */
3240
3277
  async createX402Intent(paymentRequired, options = {}) {
3241
- const option = chunkGABPEVWW_cjs.selectStandardPaymentOption(paymentRequired.accepts);
3278
+ const option = chunkDART3SSC_cjs.selectStandardPaymentOption(paymentRequired.accepts);
3242
3279
  if (!option) {
3243
3280
  throw noCompatiblePaymentOptionError(paymentRequired.accepts);
3244
3281
  }
@@ -3246,7 +3283,7 @@ var HavenClient = class {
3246
3283
  if (!fundingTo) {
3247
3284
  throw new chunkC3R4GLKO_cjs.HavenApiError("Authenticated agent has no delegate address registered.", 502);
3248
3285
  }
3249
- const idempotencyKey = options.idempotencyKey ?? chunkGABPEVWW_cjs.buildX402IdempotencyKey(paymentRequired, option);
3286
+ const idempotencyKey = options.idempotencyKey ?? chunkDART3SSC_cjs.buildX402IdempotencyKey(paymentRequired, option);
3250
3287
  const raw = await this.post("/x402", {
3251
3288
  url: paymentRequired.resource.url,
3252
3289
  payTo: fundingTo,
@@ -3257,7 +3294,7 @@ var HavenClient = class {
3257
3294
  // of a silent reroute to the erc7710 settlement branch (the #1358
3258
3295
  // review's open-budget misroute). Legacy-rail backends ignore the field.
3259
3296
  settlementScheme: "eip3009",
3260
- amount: chunkGABPEVWW_cjs.x402AuthorizationAmount(option),
3297
+ amount: chunkDART3SSC_cjs.x402AuthorizationAmount(option),
3261
3298
  asset: option.asset,
3262
3299
  network: option.network,
3263
3300
  description: paymentRequired.resource.description,
@@ -3301,7 +3338,7 @@ var HavenClient = class {
3301
3338
  accepted: option,
3302
3339
  resourceUrl: paymentRequired.resource.url,
3303
3340
  merchantTo: raw.merchant_to ?? option.payTo,
3304
- amountAtomic: chunkGABPEVWW_cjs.x402AuthorizationAmount(option),
3341
+ amountAtomic: chunkDART3SSC_cjs.x402AuthorizationAmount(option),
3305
3342
  asset: option.asset,
3306
3343
  network: option.network,
3307
3344
  expectedAuth: raw.x402_expected_auth,
@@ -3367,12 +3404,12 @@ var HavenClient = class {
3367
3404
  );
3368
3405
  }
3369
3406
  chunkC3R4GLKO_cjs.assertUserOpTypedDataBinding(signData.typed_data, signData.hash);
3370
- chunkGABPEVWW_cjs.assertBoundDirectPaymentUserOp(
3407
+ chunkDART3SSC_cjs.assertBoundDirectPaymentUserOp(
3371
3408
  signData.typed_data,
3372
3409
  this.delegateAddress
3373
3410
  );
3374
3411
  if (fundingExpectation) {
3375
- chunkGABPEVWW_cjs.assertFundingLegPaysDelegate(signData.typed_data, {
3412
+ chunkDART3SSC_cjs.assertFundingLegPaysDelegate(signData.typed_data, {
3376
3413
  delegateAddress: this.delegateAddress,
3377
3414
  asset: fundingExpectation.asset,
3378
3415
  amount: fundingExpectation.amount
@@ -3387,11 +3424,11 @@ var HavenClient = class {
3387
3424
  );
3388
3425
  }
3389
3426
  if (!settlementExpectation) {
3390
- throw new chunkGABPEVWW_cjs.HavenTypedDataRefusedError(
3427
+ throw new chunkDART3SSC_cjs.HavenTypedDataRefusedError(
3391
3428
  "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."
3392
3429
  );
3393
3430
  }
3394
- chunkGABPEVWW_cjs.assertOwnSettlementChild(signData.typed_data, settlementExpectation, this.delegateAddress);
3431
+ chunkDART3SSC_cjs.assertOwnSettlementChild(signData.typed_data, settlementExpectation, this.delegateAddress);
3395
3432
  return signSettlementDelegationTypedData(this.delegateKey, signData.typed_data);
3396
3433
  }
3397
3434
  if (scheme === void 0) {
@@ -3860,11 +3897,11 @@ var HavenClient = class {
3860
3897
  if (!this.delegateAddress) {
3861
3898
  throw new chunkC3R4GLKO_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
3862
3899
  }
3863
- const option = chunkGABPEVWW_cjs.selectStandardPaymentOption(paymentRequired.accepts);
3900
+ const option = chunkDART3SSC_cjs.selectStandardPaymentOption(paymentRequired.accepts);
3864
3901
  if (!option) {
3865
3902
  throw noCompatiblePaymentOptionError(paymentRequired.accepts);
3866
3903
  }
3867
- const idempotencyKey = options.idempotencyKey ?? chunkGABPEVWW_cjs.buildX402IdempotencyKey(paymentRequired, option);
3904
+ const idempotencyKey = options.idempotencyKey ?? chunkDART3SSC_cjs.buildX402IdempotencyKey(paymentRequired, option);
3868
3905
  const cached = this.fundingLeg.cachedReceipt(idempotencyKey, options.taskBudgetId, options.subBudgetId);
3869
3906
  if (cached) return cached;
3870
3907
  const inFlight = this.inFlightX402.get(idempotencyKey);
@@ -3934,7 +3971,7 @@ var HavenClient = class {
3934
3971
  if (response.headers.get("MACHINE-PAYMENT-CHALLENGE")) {
3935
3972
  throw new chunkC3R4GLKO_cjs.HavenApiError("quoteX402 only supports standard x402 Payment Required responses.", 400);
3936
3973
  }
3937
- const paymentRequired = await chunkGABPEVWW_cjs.parsePaymentRequiredResponse(response);
3974
+ const paymentRequired = await chunkDART3SSC_cjs.parsePaymentRequiredResponse(response);
3938
3975
  const mcpTransport = await this.merchantTransport.detect(url, paymentRequired, response);
3939
3976
  return buildX402Quote(paymentRequired, request, options.idempotencyKey, mcpTransport);
3940
3977
  }
@@ -4033,11 +4070,11 @@ var HavenClient = class {
4033
4070
  if (!this.delegateAddress) {
4034
4071
  throw new chunkC3R4GLKO_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
4035
4072
  }
4036
- const option = chunkGABPEVWW_cjs.selectStandardPaymentOption(input.paymentRequired.accepts);
4073
+ const option = chunkDART3SSC_cjs.selectStandardPaymentOption(input.paymentRequired.accepts);
4037
4074
  if (!option) {
4038
4075
  throw noCompatiblePaymentOptionError(input.paymentRequired.accepts);
4039
4076
  }
4040
- const idempotencyKey = input.idempotencyKey ?? chunkGABPEVWW_cjs.buildX402IdempotencyKey(input.paymentRequired, option);
4077
+ const idempotencyKey = input.idempotencyKey ?? chunkDART3SSC_cjs.buildX402IdempotencyKey(input.paymentRequired, option);
4041
4078
  const cached = this.fundingLeg.cachedReceipt(idempotencyKey, input.taskBudgetId);
4042
4079
  if (cached) return cached;
4043
4080
  const status = await this.getPaymentStatus(input.paymentId);
@@ -4045,7 +4082,7 @@ var HavenClient = class {
4045
4082
  const canFund = await this.fundingLeg.delegateCanFund(
4046
4083
  status.chainId ?? chainIdFromNetwork(option.network),
4047
4084
  option.asset,
4048
- chunkGABPEVWW_cjs.x402AuthorizationAmount(option)
4085
+ chunkDART3SSC_cjs.x402AuthorizationAmount(option)
4049
4086
  );
4050
4087
  if (canFund === false) {
4051
4088
  throw new chunkC3R4GLKO_cjs.X402AlreadySettledError(
@@ -4075,7 +4112,7 @@ var HavenClient = class {
4075
4112
  if (response.status !== 402) {
4076
4113
  throw new chunkC3R4GLKO_cjs.HavenApiError("Expected the original x402 request to return HTTP 402 before resuming.", 400);
4077
4114
  }
4078
- paymentRequired = await chunkGABPEVWW_cjs.parsePaymentRequiredResponse(response);
4115
+ paymentRequired = await chunkDART3SSC_cjs.parsePaymentRequiredResponse(response);
4079
4116
  }
4080
4117
  const receipt = await this.resumeAuthorizedX402({
4081
4118
  paymentId: input.paymentId,
@@ -4128,7 +4165,7 @@ var HavenClient = class {
4128
4165
  nativeChallenge = true;
4129
4166
  } else {
4130
4167
  try {
4131
- paymentRequired = await chunkGABPEVWW_cjs.parsePaymentRequiredResponse(response);
4168
+ paymentRequired = await chunkDART3SSC_cjs.parsePaymentRequiredResponse(response);
4132
4169
  } catch (err) {
4133
4170
  if (err instanceof MerchantEgressResponseCapError) throw err;
4134
4171
  return response;
@@ -4139,8 +4176,8 @@ var HavenClient = class {
4139
4176
  if (mcpSessionId) requestInit = this.merchantTransport.withSessionHeaders(requestInit, mcpSessionId);
4140
4177
  }
4141
4178
  const request = snapshotX402Request(url, requestInit);
4142
- const option = chunkGABPEVWW_cjs.selectStandardPaymentOption(paymentRequired.accepts);
4143
- const idempotencyKey = options.idempotencyKey ?? (option ? chunkGABPEVWW_cjs.buildX402IdempotencyKey(paymentRequired, option) : void 0);
4179
+ const option = chunkDART3SSC_cjs.selectStandardPaymentOption(paymentRequired.accepts);
4180
+ const idempotencyKey = options.idempotencyKey ?? (option ? chunkDART3SSC_cjs.buildX402IdempotencyKey(paymentRequired, option) : void 0);
4144
4181
  let receipt;
4145
4182
  try {
4146
4183
  receipt = await this.authorizeX402(paymentRequired, options);
@@ -4239,6 +4276,7 @@ var HavenClient = class {
4239
4276
  const settlement = parseMerchantSettlement(protocolReceiptHeader ?? null);
4240
4277
  const merchantAccepted = surfaced.ok && inBandChallenge === void 0 && metaSettlement?.success !== false;
4241
4278
  let evidenceOutcome;
4279
+ let settlementEvidenceOutcome;
4242
4280
  if (!merchantAccepted) {
4243
4281
  if (!input.noFundingLeg && fundingTxHash) {
4244
4282
  await this.merchantCompletion.recordRetryRejected({
@@ -4267,12 +4305,21 @@ var HavenClient = class {
4267
4305
  txHash: evidenceTxHash,
4268
4306
  resourceUrl: evidenceContext.resourceUrl,
4269
4307
  merchantStatus: surfaced.status,
4270
- paymentProofHeaderName: chunkGABPEVWW_cjs.x402PaymentHeaderNamesSent(input.paymentHeader),
4308
+ paymentProofHeaderName: chunkDART3SSC_cjs.x402PaymentHeaderNamesSent(input.paymentHeader),
4271
4309
  paymentProofHeader: input.paymentHeader,
4272
4310
  protocolReceiptHeaderName,
4273
4311
  protocolReceiptHeader
4274
4312
  });
4275
4313
  }
4314
+ if (!input.noFundingLeg) {
4315
+ const settlementCandidate = settlement.settlementTxHash;
4316
+ if (settlementCandidate && isWellFormedSettlementTxHash(settlementCandidate) && !isZeroSettlementTxHash(settlementCandidate) && fundingTxHash && settlementCandidate.toLowerCase() !== fundingTxHash.toLowerCase()) {
4317
+ settlementEvidenceOutcome = await this.merchantCompletion.reportSettlementEvidenceOnce(
4318
+ evidenceContext.paymentId,
4319
+ settlementCandidate
4320
+ );
4321
+ }
4322
+ }
4276
4323
  await this.merchantCompletion.reportMerchantReceipt(evidenceContext.paymentId, surfaced);
4277
4324
  }
4278
4325
  return {
@@ -4281,7 +4328,8 @@ var HavenClient = class {
4281
4328
  body,
4282
4329
  // #3155 review S3: a transaction beside a rejection is not a settlement.
4283
4330
  settlementTxHash: merchantAccepted ? settlement.settlementTxHash ?? void 0 : void 0,
4284
- evidenceOutcome
4331
+ evidenceOutcome,
4332
+ settlementEvidenceOutcome
4285
4333
  };
4286
4334
  }
4287
4335
  /**
@@ -5212,7 +5260,8 @@ wallet signs in as the wallet that paid, moving no funds. NEVER follow a
5212
5260
  redirect with \`SIGN-IN-WITH-X\` (or a resulting session token) attached; if
5213
5261
  the final origin differs, re-sign there. On THIS path Haven never sends the
5214
5262
  paid request (it sends only unpaid probes):
5215
- \`mcp__haven-signer__haven_sign_x402\` returns both
5263
+ on the **EIP-3009** scheme (the pay result names
5264
+ \`mcp__haven-signer__haven_sign_x402\`), that tool returns both
5216
5265
  \`signature\` and \`payment_header\`; relay \`signature\` with
5217
5266
  \`mcp__haven__haven_submit\`, then retry the paywalled URL yourself with
5218
5267
  \`payment_header\`. Do not pass that call's \`x402_binding\` to
@@ -5223,10 +5272,24 @@ merchant answered: \`mcp__haven__haven_report_x402_outcome\` with the
5223
5272
  and the \`merchant_status\` you got. Because Haven never sent that paid
5224
5273
  request, this is the only way it can learn the purchase failed \u2014 without it a
5225
5274
  failed purchase reads as complete for fifteen minutes. If the merchant's
5226
- \`PAYMENT-RESPONSE\` header names a \`transaction\`, also pass it to
5227
- \`mcp__haven__haven_report_settlement_evidence\` (\`payment_id\`,
5228
- \`settlement_tx_hash\`): Haven verifies it on-chain, and the receipt then shows
5229
- the merchant's settlement, not only the funding transaction. (The SDK's own
5275
+ \`PAYMENT-RESPONSE\` header names a \`transaction\`, pass that raw header as
5276
+ \`payment_response\` on the SAME \`mcp__haven__haven_report_x402_outcome\`
5277
+ call: Haven decodes it, verifies the settlement on-chain, and the receipt then
5278
+ shows the merchant's settlement, not only the funding transaction. Call
5279
+ \`mcp__haven__haven_report_settlement_evidence\` only when the outcome answer
5280
+ names it as the next step. On the **erc7710** scheme (the pay result says
5281
+ \`settlement_scheme: "erc7710"\`), sign with \`mcp__haven-signer__haven_sign\`,
5282
+ then \`mcp__haven__haven_submit\` with \`settlement_scheme: "erc7710"\`
5283
+ returns the \`payment_header\`; retry the merchant yourself with it as
5284
+ \`PAYMENT-SIGNATURE\` only, then record the merchant's settlement with
5285
+ \`mcp__haven__haven_report_settlement_evidence\`: \`payment_id\` plus
5286
+ \`settlement_tx_hash\`, the \`transaction\` in the merchant's base64
5287
+ \`PAYMENT-RESPONSE\` (decode it). \`mcp__haven__haven_report_x402_outcome\`
5288
+ does not apply on erc7710 \u2014 there is no Haven funding transaction to anchor it
5289
+ to, so it refuses while the payment is unconfirmed. If the merchant refuses an erc7710 retry, do not re-quote at once: it
5290
+ may already have redeemed the authorization, so check
5291
+ \`mcp__haven__haven_get_payment_status\` after the payment window and re-quote
5292
+ only if it shows no settlement. (The SDK's own
5230
5293
  \`haven_pay_x402\` tool does perform the merchant retry itself; that tool is
5231
5294
  not part of the hosted MCP surface.) On this SDK path, when the owner opted the
5232
5295
  agent in, the paid EIP-3009 retry also carries the agent-signed buyer tax
@@ -5452,271 +5515,271 @@ function sameUrl(a, b) {
5452
5515
 
5453
5516
  Object.defineProperty(exports, "DEFAULT_NEXT_TOOL_BY_ACTION", {
5454
5517
  enumerable: true,
5455
- get: function () { return chunkGABPEVWW_cjs.DEFAULT_NEXT_TOOL_BY_ACTION; }
5518
+ get: function () { return chunkDART3SSC_cjs.DEFAULT_NEXT_TOOL_BY_ACTION; }
5456
5519
  });
5457
5520
  Object.defineProperty(exports, "ERC7710_ASSET_TRANSFER_METHOD", {
5458
5521
  enumerable: true,
5459
- get: function () { return chunkGABPEVWW_cjs.ERC7710_ASSET_TRANSFER_METHOD; }
5522
+ get: function () { return chunkDART3SSC_cjs.ERC7710_ASSET_TRANSFER_METHOD; }
5460
5523
  });
5461
5524
  Object.defineProperty(exports, "HAVEN_CLIENT_HEADER", {
5462
5525
  enumerable: true,
5463
- get: function () { return chunkGABPEVWW_cjs.HAVEN_CLIENT_HEADER; }
5526
+ get: function () { return chunkDART3SSC_cjs.HAVEN_CLIENT_HEADER; }
5464
5527
  });
5465
5528
  Object.defineProperty(exports, "HAVEN_MINIMUM_NODE_VERSION", {
5466
5529
  enumerable: true,
5467
- get: function () { return chunkGABPEVWW_cjs.HAVEN_MINIMUM_NODE_VERSION; }
5530
+ get: function () { return chunkDART3SSC_cjs.HAVEN_MINIMUM_NODE_VERSION; }
5468
5531
  });
5469
5532
  Object.defineProperty(exports, "HavenTypedDataRefusedError", {
5470
5533
  enumerable: true,
5471
- get: function () { return chunkGABPEVWW_cjs.HavenTypedDataRefusedError; }
5534
+ get: function () { return chunkDART3SSC_cjs.HavenTypedDataRefusedError; }
5472
5535
  });
5473
5536
  Object.defineProperty(exports, "MAX_TASK_BUDGET_TTL_SECONDS", {
5474
5537
  enumerable: true,
5475
- get: function () { return chunkGABPEVWW_cjs.MAX_TASK_BUDGET_TTL_SECONDS; }
5538
+ get: function () { return chunkDART3SSC_cjs.MAX_TASK_BUDGET_TTL_SECONDS; }
5476
5539
  });
5477
5540
  Object.defineProperty(exports, "NEXT_TOOL_SERVER_NAMES", {
5478
5541
  enumerable: true,
5479
- get: function () { return chunkGABPEVWW_cjs.NEXT_TOOL_SERVER_NAMES; }
5542
+ get: function () { return chunkDART3SSC_cjs.NEXT_TOOL_SERVER_NAMES; }
5480
5543
  });
5481
5544
  Object.defineProperty(exports, "NEXT_TOOL_SERVER_ROLES", {
5482
5545
  enumerable: true,
5483
- get: function () { return chunkGABPEVWW_cjs.NEXT_TOOL_SERVER_ROLES; }
5546
+ get: function () { return chunkDART3SSC_cjs.NEXT_TOOL_SERVER_ROLES; }
5484
5547
  });
5485
5548
  Object.defineProperty(exports, "SDK_CLIENT_IDENTITY", {
5486
5549
  enumerable: true,
5487
- get: function () { return chunkGABPEVWW_cjs.SDK_CLIENT_IDENTITY; }
5550
+ get: function () { return chunkDART3SSC_cjs.SDK_CLIENT_IDENTITY; }
5488
5551
  });
5489
5552
  Object.defineProperty(exports, "SDK_VERSION", {
5490
5553
  enumerable: true,
5491
- get: function () { return chunkGABPEVWW_cjs.SDK_VERSION; }
5554
+ get: function () { return chunkDART3SSC_cjs.SDK_VERSION; }
5492
5555
  });
5493
5556
  Object.defineProperty(exports, "SWEEP_BASE_CHAIN_ID", {
5494
5557
  enumerable: true,
5495
- get: function () { return chunkGABPEVWW_cjs.SWEEP_BASE_CHAIN_ID; }
5558
+ get: function () { return chunkDART3SSC_cjs.SWEEP_BASE_CHAIN_ID; }
5496
5559
  });
5497
5560
  Object.defineProperty(exports, "SWEEP_BASE_SEPOLIA_CHAIN_ID", {
5498
5561
  enumerable: true,
5499
- get: function () { return chunkGABPEVWW_cjs.SWEEP_BASE_SEPOLIA_CHAIN_ID; }
5562
+ get: function () { return chunkDART3SSC_cjs.SWEEP_BASE_SEPOLIA_CHAIN_ID; }
5500
5563
  });
5501
5564
  Object.defineProperty(exports, "SWEEP_BASE_SEPOLIA_USDC_ADDRESS", {
5502
5565
  enumerable: true,
5503
- get: function () { return chunkGABPEVWW_cjs.SWEEP_BASE_SEPOLIA_USDC_ADDRESS; }
5566
+ get: function () { return chunkDART3SSC_cjs.SWEEP_BASE_SEPOLIA_USDC_ADDRESS; }
5504
5567
  });
5505
5568
  Object.defineProperty(exports, "SWEEP_BASE_USDC_ADDRESS", {
5506
5569
  enumerable: true,
5507
- get: function () { return chunkGABPEVWW_cjs.SWEEP_BASE_USDC_ADDRESS; }
5570
+ get: function () { return chunkDART3SSC_cjs.SWEEP_BASE_USDC_ADDRESS; }
5508
5571
  });
5509
5572
  Object.defineProperty(exports, "TRANSFER_WITH_AUTHORIZATION_TYPES", {
5510
5573
  enumerable: true,
5511
- get: function () { return chunkGABPEVWW_cjs.TRANSFER_WITH_AUTHORIZATION_TYPES; }
5574
+ get: function () { return chunkDART3SSC_cjs.TRANSFER_WITH_AUTHORIZATION_TYPES; }
5512
5575
  });
5513
5576
  Object.defineProperty(exports, "TYPED_DATA_NOT_ALLOWED", {
5514
5577
  enumerable: true,
5515
- get: function () { return chunkGABPEVWW_cjs.TYPED_DATA_NOT_ALLOWED; }
5578
+ get: function () { return chunkDART3SSC_cjs.TYPED_DATA_NOT_ALLOWED; }
5516
5579
  });
5517
5580
  Object.defineProperty(exports, "X402PaymentHeaderValidationError", {
5518
5581
  enumerable: true,
5519
- get: function () { return chunkGABPEVWW_cjs.X402PaymentHeaderValidationError; }
5582
+ get: function () { return chunkDART3SSC_cjs.X402PaymentHeaderValidationError; }
5520
5583
  });
5521
5584
  Object.defineProperty(exports, "X402_LEGACY_PAYMENT_HEADER_NAME", {
5522
5585
  enumerable: true,
5523
- get: function () { return chunkGABPEVWW_cjs.X402_LEGACY_PAYMENT_HEADER_NAME; }
5586
+ get: function () { return chunkDART3SSC_cjs.X402_LEGACY_PAYMENT_HEADER_NAME; }
5524
5587
  });
5525
5588
  Object.defineProperty(exports, "X402_MAX_AUTHORIZATION_WINDOW_SECONDS", {
5526
5589
  enumerable: true,
5527
- get: function () { return chunkGABPEVWW_cjs.X402_MAX_AUTHORIZATION_WINDOW_SECONDS; }
5590
+ get: function () { return chunkDART3SSC_cjs.X402_MAX_AUTHORIZATION_WINDOW_SECONDS; }
5528
5591
  });
5529
5592
  Object.defineProperty(exports, "X402_PAYMENT_HEADER_NAME", {
5530
5593
  enumerable: true,
5531
- get: function () { return chunkGABPEVWW_cjs.X402_PAYMENT_HEADER_NAME; }
5594
+ get: function () { return chunkDART3SSC_cjs.X402_PAYMENT_HEADER_NAME; }
5532
5595
  });
5533
5596
  Object.defineProperty(exports, "X402_PAYMENT_HEADER_NAMES_SENT", {
5534
5597
  enumerable: true,
5535
- get: function () { return chunkGABPEVWW_cjs.X402_PAYMENT_HEADER_NAMES_SENT; }
5598
+ get: function () { return chunkDART3SSC_cjs.X402_PAYMENT_HEADER_NAMES_SENT; }
5536
5599
  });
5537
5600
  Object.defineProperty(exports, "X402_PAYMENT_REQUIRED_HEADER_NAME", {
5538
5601
  enumerable: true,
5539
- get: function () { return chunkGABPEVWW_cjs.X402_PAYMENT_REQUIRED_HEADER_NAME; }
5602
+ get: function () { return chunkDART3SSC_cjs.X402_PAYMENT_REQUIRED_HEADER_NAME; }
5540
5603
  });
5541
5604
  Object.defineProperty(exports, "X402_PAYMENT_RESPONSE_HEADER_NAME", {
5542
5605
  enumerable: true,
5543
- get: function () { return chunkGABPEVWW_cjs.X402_PAYMENT_RESPONSE_HEADER_NAME; }
5606
+ get: function () { return chunkDART3SSC_cjs.X402_PAYMENT_RESPONSE_HEADER_NAME; }
5544
5607
  });
5545
5608
  Object.defineProperty(exports, "X402_SETTLEMENT_FORWARD_MARGIN_SECONDS", {
5546
5609
  enumerable: true,
5547
- get: function () { return chunkGABPEVWW_cjs.X402_SETTLEMENT_FORWARD_MARGIN_SECONDS; }
5610
+ get: function () { return chunkDART3SSC_cjs.X402_SETTLEMENT_FORWARD_MARGIN_SECONDS; }
5548
5611
  });
5549
5612
  Object.defineProperty(exports, "assertBoundDirectPaymentUserOp", {
5550
5613
  enumerable: true,
5551
- get: function () { return chunkGABPEVWW_cjs.assertBoundDirectPaymentUserOp; }
5614
+ get: function () { return chunkDART3SSC_cjs.assertBoundDirectPaymentUserOp; }
5552
5615
  });
5553
5616
  Object.defineProperty(exports, "assertOwnTaskBudgetCloseUserOp", {
5554
5617
  enumerable: true,
5555
- get: function () { return chunkGABPEVWW_cjs.assertOwnTaskBudgetCloseUserOp; }
5618
+ get: function () { return chunkDART3SSC_cjs.assertOwnTaskBudgetCloseUserOp; }
5556
5619
  });
5557
5620
  Object.defineProperty(exports, "assertOwnTaskChild", {
5558
5621
  enumerable: true,
5559
- get: function () { return chunkGABPEVWW_cjs.assertOwnTaskChild; }
5622
+ get: function () { return chunkDART3SSC_cjs.assertOwnTaskChild; }
5560
5623
  });
5561
5624
  Object.defineProperty(exports, "buildSweepAuthorizationMessage", {
5562
5625
  enumerable: true,
5563
- get: function () { return chunkGABPEVWW_cjs.buildSweepAuthorizationMessage; }
5626
+ get: function () { return chunkDART3SSC_cjs.buildSweepAuthorizationMessage; }
5564
5627
  });
5565
5628
  Object.defineProperty(exports, "buildSweepTypedData", {
5566
5629
  enumerable: true,
5567
- get: function () { return chunkGABPEVWW_cjs.buildSweepTypedData; }
5630
+ get: function () { return chunkDART3SSC_cjs.buildSweepTypedData; }
5568
5631
  });
5569
5632
  Object.defineProperty(exports, "buildX402ExpectedMessage", {
5570
5633
  enumerable: true,
5571
- get: function () { return chunkGABPEVWW_cjs.buildX402ExpectedMessage; }
5634
+ get: function () { return chunkDART3SSC_cjs.buildX402ExpectedMessage; }
5572
5635
  });
5573
5636
  Object.defineProperty(exports, "compareNodeVersions", {
5574
5637
  enumerable: true,
5575
- get: function () { return chunkGABPEVWW_cjs.compareNodeVersions; }
5638
+ get: function () { return chunkDART3SSC_cjs.compareNodeVersions; }
5576
5639
  });
5577
5640
  Object.defineProperty(exports, "createNextStepBuilder", {
5578
5641
  enumerable: true,
5579
- get: function () { return chunkGABPEVWW_cjs.createNextStepBuilder; }
5642
+ get: function () { return chunkDART3SSC_cjs.createNextStepBuilder; }
5580
5643
  });
5581
5644
  Object.defineProperty(exports, "decodeBase64Json", {
5582
5645
  enumerable: true,
5583
- get: function () { return chunkGABPEVWW_cjs.decodeBase64Json; }
5646
+ get: function () { return chunkDART3SSC_cjs.decodeBase64Json; }
5584
5647
  });
5585
5648
  Object.defineProperty(exports, "decodeBase64Utf8", {
5586
5649
  enumerable: true,
5587
- get: function () { return chunkGABPEVWW_cjs.decodeBase64Utf8; }
5650
+ get: function () { return chunkDART3SSC_cjs.decodeBase64Utf8; }
5588
5651
  });
5589
5652
  Object.defineProperty(exports, "defaultNextToolFor", {
5590
5653
  enumerable: true,
5591
- get: function () { return chunkGABPEVWW_cjs.defaultNextToolFor; }
5654
+ get: function () { return chunkDART3SSC_cjs.defaultNextToolFor; }
5592
5655
  });
5593
5656
  Object.defineProperty(exports, "encodeBase64Json", {
5594
5657
  enumerable: true,
5595
- get: function () { return chunkGABPEVWW_cjs.encodeBase64Json; }
5658
+ get: function () { return chunkDART3SSC_cjs.encodeBase64Json; }
5596
5659
  });
5597
5660
  Object.defineProperty(exports, "encodeBase64Utf8", {
5598
5661
  enumerable: true,
5599
- get: function () { return chunkGABPEVWW_cjs.encodeBase64Utf8; }
5662
+ get: function () { return chunkDART3SSC_cjs.encodeBase64Utf8; }
5600
5663
  });
5601
5664
  Object.defineProperty(exports, "encodePaymentProof", {
5602
5665
  enumerable: true,
5603
- get: function () { return chunkGABPEVWW_cjs.encodePaymentProof; }
5666
+ get: function () { return chunkDART3SSC_cjs.encodePaymentProof; }
5604
5667
  });
5605
5668
  Object.defineProperty(exports, "hashDelegation", {
5606
5669
  enumerable: true,
5607
- get: function () { return chunkGABPEVWW_cjs.hashDelegation; }
5670
+ get: function () { return chunkDART3SSC_cjs.hashDelegation; }
5608
5671
  });
5609
5672
  Object.defineProperty(exports, "havenClientIdentity", {
5610
5673
  enumerable: true,
5611
- get: function () { return chunkGABPEVWW_cjs.havenClientIdentity; }
5674
+ get: function () { return chunkDART3SSC_cjs.havenClientIdentity; }
5612
5675
  });
5613
5676
  Object.defineProperty(exports, "isErc7710Option", {
5614
5677
  enumerable: true,
5615
- get: function () { return chunkGABPEVWW_cjs.isErc7710Option; }
5678
+ get: function () { return chunkDART3SSC_cjs.isErc7710Option; }
5616
5679
  });
5617
5680
  Object.defineProperty(exports, "isSupportedNodeVersion", {
5618
5681
  enumerable: true,
5619
- get: function () { return chunkGABPEVWW_cjs.isSupportedNodeVersion; }
5682
+ get: function () { return chunkDART3SSC_cjs.isSupportedNodeVersion; }
5620
5683
  });
5621
5684
  Object.defineProperty(exports, "isSweepableChain", {
5622
5685
  enumerable: true,
5623
- get: function () { return chunkGABPEVWW_cjs.isSweepableChain; }
5686
+ get: function () { return chunkDART3SSC_cjs.isSweepableChain; }
5624
5687
  });
5625
5688
  Object.defineProperty(exports, "isTaskChildTypedData", {
5626
5689
  enumerable: true,
5627
- get: function () { return chunkGABPEVWW_cjs.isTaskChildTypedData; }
5690
+ get: function () { return chunkDART3SSC_cjs.isTaskChildTypedData; }
5628
5691
  });
5629
5692
  Object.defineProperty(exports, "normalizePaymentRequired", {
5630
5693
  enumerable: true,
5631
- get: function () { return chunkGABPEVWW_cjs.normalizePaymentRequired; }
5694
+ get: function () { return chunkDART3SSC_cjs.normalizePaymentRequired; }
5632
5695
  });
5633
5696
  Object.defineProperty(exports, "parseNextTool", {
5634
5697
  enumerable: true,
5635
- get: function () { return chunkGABPEVWW_cjs.parseNextTool; }
5698
+ get: function () { return chunkDART3SSC_cjs.parseNextTool; }
5636
5699
  });
5637
5700
  Object.defineProperty(exports, "parsePaymentRequired", {
5638
5701
  enumerable: true,
5639
- get: function () { return chunkGABPEVWW_cjs.parsePaymentRequired; }
5702
+ get: function () { return chunkDART3SSC_cjs.parsePaymentRequired; }
5640
5703
  });
5641
5704
  Object.defineProperty(exports, "parsePaymentRequiredResponse", {
5642
5705
  enumerable: true,
5643
- get: function () { return chunkGABPEVWW_cjs.parsePaymentRequiredResponse; }
5706
+ get: function () { return chunkDART3SSC_cjs.parsePaymentRequiredResponse; }
5644
5707
  });
5645
5708
  Object.defineProperty(exports, "readClientUpdate", {
5646
5709
  enumerable: true,
5647
- get: function () { return chunkGABPEVWW_cjs.readClientUpdate; }
5710
+ get: function () { return chunkDART3SSC_cjs.readClientUpdate; }
5648
5711
  });
5649
5712
  Object.defineProperty(exports, "renderNextTool", {
5650
5713
  enumerable: true,
5651
- get: function () { return chunkGABPEVWW_cjs.renderNextTool; }
5714
+ get: function () { return chunkDART3SSC_cjs.renderNextTool; }
5652
5715
  });
5653
5716
  Object.defineProperty(exports, "resolveTokenBySymbol", {
5654
5717
  enumerable: true,
5655
- get: function () { return chunkGABPEVWW_cjs.resolveTokenBySymbol; }
5718
+ get: function () { return chunkDART3SSC_cjs.resolveTokenBySymbol; }
5656
5719
  });
5657
5720
  Object.defineProperty(exports, "resolveTokenFromAddress", {
5658
5721
  enumerable: true,
5659
- get: function () { return chunkGABPEVWW_cjs.resolveTokenFromAddress; }
5722
+ get: function () { return chunkDART3SSC_cjs.resolveTokenFromAddress; }
5660
5723
  });
5661
5724
  Object.defineProperty(exports, "selectErc7710PaymentOption", {
5662
5725
  enumerable: true,
5663
- get: function () { return chunkGABPEVWW_cjs.selectErc7710PaymentOption; }
5726
+ get: function () { return chunkDART3SSC_cjs.selectErc7710PaymentOption; }
5664
5727
  });
5665
5728
  Object.defineProperty(exports, "selectPaymentOption", {
5666
5729
  enumerable: true,
5667
- get: function () { return chunkGABPEVWW_cjs.selectPaymentOption; }
5730
+ get: function () { return chunkDART3SSC_cjs.selectPaymentOption; }
5668
5731
  });
5669
5732
  Object.defineProperty(exports, "selectStandardPaymentOption", {
5670
5733
  enumerable: true,
5671
- get: function () { return chunkGABPEVWW_cjs.selectStandardPaymentOption; }
5734
+ get: function () { return chunkDART3SSC_cjs.selectStandardPaymentOption; }
5672
5735
  });
5673
5736
  Object.defineProperty(exports, "selectX402SettlementScheme", {
5674
5737
  enumerable: true,
5675
- get: function () { return chunkGABPEVWW_cjs.selectX402SettlementScheme; }
5738
+ get: function () { return chunkDART3SSC_cjs.selectX402SettlementScheme; }
5676
5739
  });
5677
5740
  Object.defineProperty(exports, "sweepUsdcAddress", {
5678
5741
  enumerable: true,
5679
- get: function () { return chunkGABPEVWW_cjs.sweepUsdcAddress; }
5742
+ get: function () { return chunkDART3SSC_cjs.sweepUsdcAddress; }
5680
5743
  });
5681
5744
  Object.defineProperty(exports, "sweepUsdcDomain", {
5682
5745
  enumerable: true,
5683
- get: function () { return chunkGABPEVWW_cjs.sweepUsdcDomain; }
5746
+ get: function () { return chunkDART3SSC_cjs.sweepUsdcDomain; }
5684
5747
  });
5685
5748
  Object.defineProperty(exports, "toStandardPaymentRequirements", {
5686
5749
  enumerable: true,
5687
- get: function () { return chunkGABPEVWW_cjs.toStandardPaymentRequirements; }
5750
+ get: function () { return chunkDART3SSC_cjs.toStandardPaymentRequirements; }
5688
5751
  });
5689
5752
  Object.defineProperty(exports, "unsupportedNodeVersionMessage", {
5690
5753
  enumerable: true,
5691
- get: function () { return chunkGABPEVWW_cjs.unsupportedNodeVersionMessage; }
5754
+ get: function () { return chunkDART3SSC_cjs.unsupportedNodeVersionMessage; }
5692
5755
  });
5693
5756
  Object.defineProperty(exports, "validateStandardX402PaymentHeader", {
5694
5757
  enumerable: true,
5695
- get: function () { return chunkGABPEVWW_cjs.validateStandardX402PaymentHeader; }
5758
+ get: function () { return chunkDART3SSC_cjs.validateStandardX402PaymentHeader; }
5696
5759
  });
5697
5760
  Object.defineProperty(exports, "x402AssetTransferMethod", {
5698
5761
  enumerable: true,
5699
- get: function () { return chunkGABPEVWW_cjs.x402AssetTransferMethod; }
5762
+ get: function () { return chunkDART3SSC_cjs.x402AssetTransferMethod; }
5700
5763
  });
5701
5764
  Object.defineProperty(exports, "x402AuthorizationAmount", {
5702
5765
  enumerable: true,
5703
- get: function () { return chunkGABPEVWW_cjs.x402AuthorizationAmount; }
5766
+ get: function () { return chunkDART3SSC_cjs.x402AuthorizationAmount; }
5704
5767
  });
5705
5768
  Object.defineProperty(exports, "x402FacilitatorAddresses", {
5706
5769
  enumerable: true,
5707
- get: function () { return chunkGABPEVWW_cjs.x402FacilitatorAddresses; }
5770
+ get: function () { return chunkDART3SSC_cjs.x402FacilitatorAddresses; }
5708
5771
  });
5709
5772
  Object.defineProperty(exports, "x402PaymentHeaderNamesFor", {
5710
5773
  enumerable: true,
5711
- get: function () { return chunkGABPEVWW_cjs.x402PaymentHeaderNamesFor; }
5774
+ get: function () { return chunkDART3SSC_cjs.x402PaymentHeaderNamesFor; }
5712
5775
  });
5713
5776
  Object.defineProperty(exports, "x402RetryHeadersFor", {
5714
5777
  enumerable: true,
5715
- get: function () { return chunkGABPEVWW_cjs.x402RetryHeadersFor; }
5778
+ get: function () { return chunkDART3SSC_cjs.x402RetryHeadersFor; }
5716
5779
  });
5717
5780
  Object.defineProperty(exports, "x402V2PaymentEnvelope", {
5718
5781
  enumerable: true,
5719
- get: function () { return chunkGABPEVWW_cjs.x402V2PaymentEnvelope; }
5782
+ get: function () { return chunkDART3SSC_cjs.x402V2PaymentEnvelope; }
5720
5783
  });
5721
5784
  Object.defineProperty(exports, "RECEIPT_VERSION", {
5722
5785
  enumerable: true,