uvd-x402-sdk 2.75.0 → 2.77.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.
package/dist/index.mjs CHANGED
@@ -1582,13 +1582,13 @@ function chainIdFor(network) {
1582
1582
  if (Number.isFinite(byId) && byId > 0) return getChainById(byId)?.chainId;
1583
1583
  return getChainByName(name)?.chainId;
1584
1584
  }
1585
- function sellerDigestFor(paymentId2, contentHash2, payee, network) {
1585
+ function sellerDigestFor(paymentId2, contentHash2, payee, network, pointer = "") {
1586
1586
  if (isEvmAddress(payee)) {
1587
1587
  const chainId = chainIdFor(network);
1588
1588
  if (!chainId) return void 0;
1589
- return anchorDigest(paymentId2, contentHash2, "", payee, chainId);
1589
+ return anchorDigest(paymentId2, contentHash2, pointer, payee, chainId);
1590
1590
  }
1591
- return anchorDigest(paymentId2, contentHash2, "", ZERO_ADDRESS, 0);
1591
+ return anchorDigest(paymentId2, contentHash2, pointer, ZERO_ADDRESS, 0);
1592
1592
  }
1593
1593
  var ANCHOR_MAX_REQUEST_BYTES = 64 * 1024;
1594
1594
  function toBase64(bytes) {
@@ -1599,6 +1599,11 @@ function toBase64(bytes) {
1599
1599
  }
1600
1600
  return btoa(out);
1601
1601
  }
1602
+ function backendForPointer(pointer) {
1603
+ if (pointer.startsWith("ipfs://")) return "ipfs";
1604
+ if (pointer.startsWith("ar://")) return "arweave";
1605
+ return "s3";
1606
+ }
1602
1607
  async function anchorEvidence(body, opts) {
1603
1608
  try {
1604
1609
  const recipients = [
@@ -1609,14 +1614,35 @@ async function anchorEvidence(body, opts) {
1609
1614
  }
1610
1615
  const blob = sealEvidenceTo(body, recipients, opts.paymentId);
1611
1616
  const hash = contentHash(body);
1617
+ let pointer;
1618
+ if (opts.upload) {
1619
+ try {
1620
+ pointer = await opts.upload(blob);
1621
+ } catch {
1622
+ return { v: 1, skipped: "anchor_failed", stage: "upload" };
1623
+ }
1624
+ if (typeof pointer !== "string" || pointer.trim() === "") {
1625
+ return { v: 1, skipped: "anchor_failed", stage: "upload" };
1626
+ }
1627
+ pointer = pointer.trim();
1628
+ }
1612
1629
  const payload = {
1613
1630
  paymentId: opts.paymentId,
1614
1631
  network: opts.network,
1615
1632
  txHash: opts.txHash,
1616
1633
  payer: opts.payer,
1617
1634
  payee: opts.payee,
1618
- sealed: toBase64(blob),
1619
- backend: "s3",
1635
+ // Exactly one of these. The facilitator dispatches on their presence:
1636
+ // `sealed` -> it hosts and derives the pointer; `pointer` alone -> it uses
1637
+ // yours; neither -> error (x402-rs `dx402/service.rs`).
1638
+ ...pointer !== void 0 ? { pointer } : { sealed: toBase64(blob) },
1639
+ // Declared, not measured. Since x402-rs 2.3.0 the facilitator records
1640
+ // the store that ACTUALLY took the bytes and returns that, so a response
1641
+ // may name a different backend than the request did -- `ipfs` where you
1642
+ // said `s3`, because a deployment whose primary is Pinata wrote there.
1643
+ // That is the facilitator correcting the record, not a mismatch to
1644
+ // assert on.
1645
+ backend: opts.backend ?? (pointer !== void 0 ? backendForPointer(pointer) : "s3"),
1620
1646
  contentHash: hash,
1621
1647
  keyAlg: opts.payerKey.length === 32 ? "ECIES-X25519" : "ECIES-secp256k1",
1622
1648
  mode: "direct",
@@ -1630,7 +1656,7 @@ async function anchorEvidence(body, opts) {
1630
1656
  payload.storage = opts.storage;
1631
1657
  }
1632
1658
  if (opts.sign) {
1633
- const digest = sellerDigestFor(opts.paymentId, hash, opts.payee, opts.network);
1659
+ const digest = sellerDigestFor(opts.paymentId, hash, opts.payee, opts.network, pointer ?? "");
1634
1660
  if (digest === void 0) {
1635
1661
  unsigned = "unknown_chain_id";
1636
1662
  } else {
@@ -1638,7 +1664,7 @@ async function anchorEvidence(body, opts) {
1638
1664
  }
1639
1665
  }
1640
1666
  const wire = JSON.stringify(payload);
1641
- if (new TextEncoder().encode(wire).length > ANCHOR_MAX_REQUEST_BYTES) {
1667
+ if (pointer === void 0 && new TextEncoder().encode(wire).length > ANCHOR_MAX_REQUEST_BYTES) {
1642
1668
  return { v: 1, skipped: "too_large" };
1643
1669
  }
1644
1670
  const base = (opts.facilitator ?? "https://facilitator.ultravioletadao.xyz").replace(
@@ -3721,6 +3747,118 @@ async function buildEscrowPreAuth(wallet, params) {
3721
3747
  });
3722
3748
  }
3723
3749
 
3750
+ // src/backend/facilitator-error.ts
3751
+ var WRITER_LEASE_REASONS = [
3752
+ "holder_unknown",
3753
+ "forwarding_disabled",
3754
+ "forwarded_but_not_writer",
3755
+ "body_unreadable",
3756
+ "forward_failed"
3757
+ ];
3758
+ var REPLAYABLE_LEASE_REASONS = [
3759
+ "holder_unknown",
3760
+ "forwarding_disabled",
3761
+ "forwarded_but_not_writer",
3762
+ "body_unreadable"
3763
+ ];
3764
+ var AMBIGUOUS_LEASE_REASONS = ["forward_failed"];
3765
+ var MAX_RETRY_AFTER_SECONDS = 15;
3766
+ var DEFAULT_RETRY_AFTER_SECONDS = 5;
3767
+ var DEFAULT_FACILITATOR_RETRIES = 2;
3768
+ function isReplayableLeaseReason(reason) {
3769
+ return REPLAYABLE_LEASE_REASONS.includes(reason);
3770
+ }
3771
+ function isAmbiguousLeaseReason(reason) {
3772
+ return AMBIGUOUS_LEASE_REASONS.includes(reason);
3773
+ }
3774
+ function parseRetryAfterSeconds(response) {
3775
+ let raw;
3776
+ try {
3777
+ raw = response?.headers?.get?.("retry-after");
3778
+ } catch {
3779
+ return void 0;
3780
+ }
3781
+ if (raw === null || raw === void 0 || raw === "") return void 0;
3782
+ const seconds = Number(raw);
3783
+ if (!Number.isFinite(seconds) || seconds < 0) return void 0;
3784
+ return Math.min(seconds, MAX_RETRY_AFTER_SECONDS);
3785
+ }
3786
+ function reasonFrom(body) {
3787
+ try {
3788
+ const parsed = JSON.parse(body);
3789
+ if (parsed && typeof parsed === "object" && typeof parsed.reason === "string") {
3790
+ return parsed.reason;
3791
+ }
3792
+ } catch {
3793
+ }
3794
+ return void 0;
3795
+ }
3796
+ async function readFacilitatorError(response) {
3797
+ let body = "";
3798
+ try {
3799
+ body = await response.text();
3800
+ } catch {
3801
+ body = "";
3802
+ }
3803
+ const status = response.status;
3804
+ const reason = reasonFrom(body);
3805
+ const retryable = status === 429 || status === 502 || status === 503 || status === 504;
3806
+ const retryAfterSeconds = retryable ? parseRetryAfterSeconds(response) ?? DEFAULT_RETRY_AFTER_SECONDS : void 0;
3807
+ const safeToReplay = status === 429 || status === 503 && isReplayableLeaseReason(reason);
3808
+ return {
3809
+ error: `Facilitator error: ${status} - ${body}`,
3810
+ status,
3811
+ reason,
3812
+ retryAfterSeconds,
3813
+ retryable,
3814
+ safeToReplay,
3815
+ body
3816
+ };
3817
+ }
3818
+ function failureFields(info) {
3819
+ return {
3820
+ status: info.status,
3821
+ retryable: info.retryable,
3822
+ safeToReplay: info.safeToReplay,
3823
+ ...info.reason !== void 0 ? { reason: info.reason } : {},
3824
+ ...info.retryAfterSeconds !== void 0 ? { retryAfterSeconds: info.retryAfterSeconds } : {}
3825
+ };
3826
+ }
3827
+ function carryFailureFields(source) {
3828
+ return {
3829
+ ...source.status !== void 0 ? { status: source.status } : {},
3830
+ ...source.reason !== void 0 ? { reason: source.reason } : {},
3831
+ ...source.retryable !== void 0 ? { retryable: source.retryable } : {},
3832
+ ...source.retryAfterSeconds !== void 0 ? { retryAfterSeconds: source.retryAfterSeconds } : {},
3833
+ ...source.safeToReplay !== void 0 ? { safeToReplay: source.safeToReplay } : {}
3834
+ };
3835
+ }
3836
+ var defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
3837
+ async function facilitatorFetch(url, init, options) {
3838
+ const retries = options.retries ?? DEFAULT_FACILITATOR_RETRIES;
3839
+ const canReplay = options.canReplay ?? ((info) => info.safeToReplay);
3840
+ const doFetch = options.fetchImpl ?? fetch;
3841
+ const sleep = options.sleepImpl ?? defaultSleep;
3842
+ let attempt = 0;
3843
+ for (; ; ) {
3844
+ const controller = new AbortController();
3845
+ const timeoutId = setTimeout(() => controller.abort(), options.timeoutMs);
3846
+ let response;
3847
+ try {
3848
+ response = await doFetch(url, { ...init, signal: controller.signal });
3849
+ } finally {
3850
+ clearTimeout(timeoutId);
3851
+ }
3852
+ if (response.ok) return { response };
3853
+ const error = await readFacilitatorError(response);
3854
+ if (attempt >= retries || !error.retryable || !canReplay(error)) {
3855
+ return { response, error };
3856
+ }
3857
+ attempt += 1;
3858
+ await sleep((error.retryAfterSeconds ?? DEFAULT_RETRY_AFTER_SECONDS) * 1e3);
3859
+ }
3860
+ }
3861
+
3724
3862
  // src/backend/index.ts
3725
3863
  function parsePaymentHeader(headerValue) {
3726
3864
  if (!headerValue) {
@@ -3827,10 +3965,12 @@ var FacilitatorClient = class {
3827
3965
  baseUrl;
3828
3966
  timeout;
3829
3967
  explicitTimeout;
3968
+ retries;
3830
3969
  constructor(options = {}) {
3831
3970
  this.baseUrl = options.baseUrl || "https://facilitator.ultravioletadao.xyz";
3832
3971
  this.explicitTimeout = options.timeout !== void 0;
3833
3972
  this.timeout = options.timeout || 3e4;
3973
+ this.retries = options.retries;
3834
3974
  }
3835
3975
  /**
3836
3976
  * Get timeout for a specific network, using per-chain defaults when no explicit timeout was set.
@@ -3857,29 +3997,31 @@ var FacilitatorClient = class {
3857
3997
  */
3858
3998
  async verify(paymentHeader, requirements) {
3859
3999
  const body = buildVerifyRequest(paymentHeader, requirements);
3860
- const controller = new AbortController();
3861
- const timeoutId = setTimeout(() => controller.abort(), this.timeout);
3862
4000
  try {
3863
- const response = await fetch(`${this.baseUrl}/verify`, {
3864
- method: "POST",
3865
- headers: { "Content-Type": "application/json" },
3866
- body: JSON.stringify(body),
3867
- signal: controller.signal
3868
- });
3869
- clearTimeout(timeoutId);
3870
- if (!response.ok) {
3871
- const errorText = await response.text();
4001
+ const { response, error } = await facilitatorFetch(
4002
+ `${this.baseUrl}/verify`,
4003
+ {
4004
+ method: "POST",
4005
+ headers: { "Content-Type": "application/json" },
4006
+ body: JSON.stringify(body)
4007
+ },
4008
+ { timeoutMs: this.timeout, retries: this.retries }
4009
+ );
4010
+ if (error) {
3872
4011
  return {
3873
4012
  isValid: false,
3874
- invalidReason: `Facilitator error: ${response.status} - ${errorText}`
4013
+ invalidReason: error.error,
4014
+ ...failureFields(error)
3875
4015
  };
3876
4016
  }
3877
4017
  return await response.json();
3878
4018
  } catch (error) {
3879
- clearTimeout(timeoutId);
3880
4019
  return {
3881
4020
  isValid: false,
3882
- invalidReason: error instanceof Error ? error.message : "Unknown error"
4021
+ invalidReason: error instanceof Error ? error.message : "Unknown error",
4022
+ retryable: true,
4023
+ safeToReplay: false,
4024
+ retryAfterSeconds: DEFAULT_RETRY_AFTER_SECONDS
3883
4025
  };
3884
4026
  }
3885
4027
  }
@@ -3895,21 +4037,21 @@ var FacilitatorClient = class {
3895
4037
  async settle(paymentHeader, requirements) {
3896
4038
  const body = buildSettleRequest(paymentHeader, requirements);
3897
4039
  const settleTimeout = this.getTimeout(requirements.network);
3898
- const controller = new AbortController();
3899
- const timeoutId = setTimeout(() => controller.abort(), settleTimeout);
3900
4040
  try {
3901
- const response = await fetch(`${this.baseUrl}/settle`, {
3902
- method: "POST",
3903
- headers: { "Content-Type": "application/json" },
3904
- body: JSON.stringify(body),
3905
- signal: controller.signal
3906
- });
3907
- clearTimeout(timeoutId);
3908
- if (!response.ok) {
3909
- const errorText = await response.text();
4041
+ const { response, error } = await facilitatorFetch(
4042
+ `${this.baseUrl}/settle`,
4043
+ {
4044
+ method: "POST",
4045
+ headers: { "Content-Type": "application/json" },
4046
+ body: JSON.stringify(body)
4047
+ },
4048
+ { timeoutMs: settleTimeout, retries: this.retries }
4049
+ );
4050
+ if (error) {
3910
4051
  return {
3911
4052
  success: false,
3912
- error: `Facilitator error: ${response.status} - ${errorText}`
4053
+ error: error.error,
4054
+ ...failureFields(error)
3913
4055
  };
3914
4056
  }
3915
4057
  const result = await response.json();
@@ -3950,10 +4092,12 @@ var FacilitatorClient = class {
3950
4092
  payer: result.payer
3951
4093
  };
3952
4094
  } catch (error) {
3953
- clearTimeout(timeoutId);
3954
4095
  return {
3955
4096
  success: false,
3956
- error: error instanceof Error ? error.message : "Unknown error"
4097
+ error: error instanceof Error ? error.message : "Unknown error",
4098
+ retryable: true,
4099
+ safeToReplay: false,
4100
+ retryAfterSeconds: DEFAULT_RETRY_AFTER_SECONDS
3957
4101
  };
3958
4102
  }
3959
4103
  }
@@ -3973,7 +4117,8 @@ var FacilitatorClient = class {
3973
4117
  return {
3974
4118
  verified: false,
3975
4119
  settled: false,
3976
- error: verifyResult.invalidReason
4120
+ error: verifyResult.invalidReason,
4121
+ ...carryFailureFields(verifyResult)
3977
4122
  };
3978
4123
  }
3979
4124
  const settleResult = await this.settle(paymentHeader, requirements);
@@ -3981,7 +4126,8 @@ var FacilitatorClient = class {
3981
4126
  verified: true,
3982
4127
  settled: settleResult.success,
3983
4128
  transactionHash: settleResult.transactionHash,
3984
- error: settleResult.error
4129
+ error: settleResult.error,
4130
+ ...carryFailureFields(settleResult)
3985
4131
  };
3986
4132
  }
3987
4133
  /**
@@ -4383,10 +4529,29 @@ function createVerifiedPaymentState(client, payment, requirements, verifyResult)
4383
4529
  }
4384
4530
  };
4385
4531
  }
4532
+ function respondUnavailable(res, message, failure) {
4533
+ const seconds = Math.max(1, Math.ceil(failure.retryAfterSeconds ?? DEFAULT_RETRY_AFTER_SECONDS));
4534
+ const body = {
4535
+ error: message,
4536
+ reason: failure.reason ?? failure.invalidReason ?? failure.error,
4537
+ retryable: true,
4538
+ retryAfterSeconds: seconds,
4539
+ // False for `forward_failed` and for a bare timeout: the write may already
4540
+ // have landed, so the caller must reconcile before resending.
4541
+ safeToReplay: failure.safeToReplay === true
4542
+ };
4543
+ const staged = res.status(503);
4544
+ if (typeof staged.set === "function") {
4545
+ staged.set({ "Retry-After": String(seconds) }).json(body);
4546
+ return;
4547
+ }
4548
+ staged.json(body);
4549
+ }
4386
4550
  function createPaymentMiddleware(getRequirements, options = {}) {
4387
4551
  const client = new FacilitatorClient({
4388
4552
  baseUrl: options.facilitatorUrl || options.baseUrl,
4389
- timeout: options.timeout
4553
+ timeout: options.timeout,
4554
+ retries: options.retries
4390
4555
  });
4391
4556
  const settlementStrategy = options.settlementStrategy || "before-handler";
4392
4557
  return async (req, res, next) => {
@@ -4401,6 +4566,10 @@ function createPaymentMiddleware(getRequirements, options = {}) {
4401
4566
  const requirements = buildPaymentRequirements(reqOptions);
4402
4567
  const verifyResult = await client.verify(payment, requirements);
4403
4568
  if (!verifyResult.isValid) {
4569
+ if (verifyResult.retryable) {
4570
+ respondUnavailable(res, "Payment verification unavailable", verifyResult);
4571
+ return;
4572
+ }
4404
4573
  res.status(402).json({
4405
4574
  error: "Payment verification failed",
4406
4575
  reason: verifyResult.invalidReason
@@ -4411,6 +4580,10 @@ function createPaymentMiddleware(getRequirements, options = {}) {
4411
4580
  if (settlementStrategy === "before-handler") {
4412
4581
  const settleResult = await req.x402.settle();
4413
4582
  if (!settleResult.success) {
4583
+ if (settleResult.retryable) {
4584
+ respondUnavailable(res, "Payment settlement unavailable", settleResult);
4585
+ return;
4586
+ }
4414
4587
  res.status(500).json({
4415
4588
  error: "Payment settlement failed",
4416
4589
  reason: settleResult.error || "Unknown settlement error"
@@ -4421,10 +4594,25 @@ function createPaymentMiddleware(getRequirements, options = {}) {
4421
4594
  next();
4422
4595
  };
4423
4596
  }
4597
+ function honoUnavailable(c, message, failure) {
4598
+ const seconds = Math.max(1, Math.ceil(failure.retryAfterSeconds ?? DEFAULT_RETRY_AFTER_SECONDS));
4599
+ c.header?.("Retry-After", String(seconds));
4600
+ return c.json(
4601
+ {
4602
+ error: message,
4603
+ reason: failure.reason ?? failure.invalidReason ?? failure.error,
4604
+ retryable: true,
4605
+ retryAfterSeconds: seconds,
4606
+ safeToReplay: failure.safeToReplay === true
4607
+ },
4608
+ 503
4609
+ );
4610
+ }
4424
4611
  function createHonoMiddleware(options) {
4425
4612
  const client = new FacilitatorClient({
4426
4613
  baseUrl: options.facilitatorUrl || options.baseUrl,
4427
- timeout: options.timeout
4614
+ timeout: options.timeout,
4615
+ retries: options.retries
4428
4616
  });
4429
4617
  const settlementStrategy = options.settlementStrategy || "before-handler";
4430
4618
  if (!options.accepts[0]) {
@@ -4464,6 +4652,9 @@ function createHonoMiddleware(options) {
4464
4652
  }
4465
4653
  const verifyResult = await client.verify(parsed, requirement);
4466
4654
  if (!verifyResult.isValid) {
4655
+ if (verifyResult.retryable) {
4656
+ return honoUnavailable(c, "Payment verification unavailable", verifyResult);
4657
+ }
4467
4658
  return c.json({
4468
4659
  error: "Payment verification failed",
4469
4660
  reason: verifyResult.invalidReason
@@ -4474,6 +4665,9 @@ function createHonoMiddleware(options) {
4474
4665
  if (settlementStrategy === "before-handler") {
4475
4666
  const settleResult = await verifiedPayment.settle();
4476
4667
  if (!settleResult.success) {
4668
+ if (settleResult.retryable) {
4669
+ return honoUnavailable(c, "Payment settlement unavailable", settleResult);
4670
+ }
4477
4671
  return c.json({
4478
4672
  error: "Payment settlement failed",
4479
4673
  reason: settleResult.error || "Unknown error"
@@ -4506,6 +4700,6 @@ var ESCROW_TIMEOUT_MS = {
4506
4700
  // Monad: 90s
4507
4701
  };
4508
4702
 
4509
- export { ANCHOR_MAX_REQUEST_BYTES, CAIP2_IDENTIFIERS, CAIP2_TO_CHAIN, ContentHashMismatch, DEFAULT_CHAIN, DEFAULT_CONFIG, DEFAULT_FACILITATOR_URL, DEFAULT_PAYMENT_HEADER, DELEGATE_PREFIX, DX402Error, ESCROW_DEPOSIT_LIMIT_USD, ESCROW_TIER_WINDOWS, EVENT_KINDS, EVIDENCE_HEADER, EnvKeyAdapter, EvidenceSkipped, FACILITATOR_ADDRESSES, FacilitatorClient, KEEPALIVE_INTERVAL_MS, OPERATOR_FEE_BPS, OWSWalletAdapter, PAYMENT_HEADER_NAMES, SMA_WRAP_TARGETS, SSEParser, SUPPORTED_CHAINS, TrafficStreamError, X402Client, X402Error, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, anchorDigest, anchorEvidence, availableBackends, buildEscrowPreAuth, buildPaymentRequirements, buildSettleRequest, buildSettleRequestV2, buildSignatureBase, buildSignatureParams, buildTokenMetadata, buildVerifyRequest, buildVerifyRequestV2, caip2ToChain, chainToCAIP2, computeEscrowNonce, contentHash, convertX402Header, create402Response, createHonoMiddleware, createPaymentHeaders, createPaymentMiddleware, createSignedFetch, createX402Header, createX402V1Header, createX402V2Header, decodeBase64Utf8, decodeX402Header, delegateTarget, dereferencePointer, detectX402Version, paymentId as dx402PaymentId, ed25519ToX25519, encodeBase64Json, encodeBase64Utf8, encodeX402Header, evidenceFromHeaders, evidenceHeader, extractPaymentFromHeaders, fetchNonce, generatePaymentOptions, getAlgorandChains, getChainById, getChainByName, getChainsByNetworkType, getChainsByToken, getCorsHeaders, getEVMChainIds, getEnabledChains, getExplorerAddressUrl, getExplorerTxUrl, getFacilitatorAddress, getNetworkType, getPaymentHeader, getSVMChains, getSuiChains, getSupportedTokens, getTokenByAddress, getTokenConfig, getXRPLChains, isAlgorandChain, isCAIP2Format, isChainSupported, isDelegated, isEndToEnd, isSVMChain, isSuiChain, isTokenSupported, isXRPLChain, matchesFilters, needsAccountWrap, parseEvidenceHeader, parseNetworkIdentifier, parseSealed, parseTrafficEvent, payerKeyFromEvmSignature, payerKeyFromSolanaAddress, paymentChallengeFrom, recoverEvidence, replaySafeTypedData, resolveDelegation, rpcDelegationResolver, sealEvidence, sealEvidenceTo, sealedRoles, sellerDigestFor, signAnchorEd25519, signAnchorEvm, signRequest, signRequestWithSigner, signRequestWithWallet, streamTrafficEvents, unseal, validateAmount, validateRecipient, wrapSignature };
4703
+ export { AMBIGUOUS_LEASE_REASONS, ANCHOR_MAX_REQUEST_BYTES, CAIP2_IDENTIFIERS, CAIP2_TO_CHAIN, ContentHashMismatch, DEFAULT_CHAIN, DEFAULT_CONFIG, DEFAULT_FACILITATOR_RETRIES, DEFAULT_FACILITATOR_URL, DEFAULT_PAYMENT_HEADER, DEFAULT_RETRY_AFTER_SECONDS, DELEGATE_PREFIX, DX402Error, ESCROW_DEPOSIT_LIMIT_USD, ESCROW_TIER_WINDOWS, EVENT_KINDS, EVIDENCE_HEADER, EnvKeyAdapter, EvidenceSkipped, FACILITATOR_ADDRESSES, FacilitatorClient, KEEPALIVE_INTERVAL_MS, MAX_RETRY_AFTER_SECONDS, OPERATOR_FEE_BPS, OWSWalletAdapter, PAYMENT_HEADER_NAMES, REPLAYABLE_LEASE_REASONS, SMA_WRAP_TARGETS, SSEParser, SUPPORTED_CHAINS, TrafficStreamError, WRITER_LEASE_REASONS, X402Client, X402Error, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, anchorDigest, anchorEvidence, availableBackends, buildEscrowPreAuth, buildPaymentRequirements, buildSettleRequest, buildSettleRequestV2, buildSignatureBase, buildSignatureParams, buildTokenMetadata, buildVerifyRequest, buildVerifyRequestV2, caip2ToChain, chainToCAIP2, computeEscrowNonce, contentHash, convertX402Header, create402Response, createHonoMiddleware, createPaymentHeaders, createPaymentMiddleware, createSignedFetch, createX402Header, createX402V1Header, createX402V2Header, decodeBase64Utf8, decodeX402Header, delegateTarget, dereferencePointer, detectX402Version, paymentId as dx402PaymentId, ed25519ToX25519, encodeBase64Json, encodeBase64Utf8, encodeX402Header, evidenceFromHeaders, evidenceHeader, extractPaymentFromHeaders, facilitatorFetch, fetchNonce, generatePaymentOptions, getAlgorandChains, getChainById, getChainByName, getChainsByNetworkType, getChainsByToken, getCorsHeaders, getEVMChainIds, getEnabledChains, getExplorerAddressUrl, getExplorerTxUrl, getFacilitatorAddress, getNetworkType, getPaymentHeader, getSVMChains, getSuiChains, getSupportedTokens, getTokenByAddress, getTokenConfig, getXRPLChains, isAlgorandChain, isAmbiguousLeaseReason, isCAIP2Format, isChainSupported, isDelegated, isEndToEnd, isReplayableLeaseReason, isSVMChain, isSuiChain, isTokenSupported, isXRPLChain, matchesFilters, needsAccountWrap, parseEvidenceHeader, parseNetworkIdentifier, parseRetryAfterSeconds, parseSealed, parseTrafficEvent, payerKeyFromEvmSignature, payerKeyFromSolanaAddress, paymentChallengeFrom, readFacilitatorError, recoverEvidence, replaySafeTypedData, resolveDelegation, rpcDelegationResolver, sealEvidence, sealEvidenceTo, sealedRoles, sellerDigestFor, signAnchorEd25519, signAnchorEvm, signRequest, signRequestWithSigner, signRequestWithWallet, streamTrafficEvents, unseal, validateAmount, validateRecipient, wrapSignature };
4510
4704
  //# sourceMappingURL=index.mjs.map
4511
4705
  //# sourceMappingURL=index.mjs.map