x402-surface-check 0.2.41 → 0.2.43

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.
@@ -1010,6 +1010,7 @@ function hasFreshnessMetadata(challenge, accept) {
1010
1010
  accept?.expiresAt,
1011
1011
  accept?.validBefore,
1012
1012
  accept?.extra?.expires,
1013
+ accept?.extra?.expiresAt,
1013
1014
  accept?.extra?.validBefore,
1014
1015
  ].some(value => value !== undefined && value !== null && value !== '')
1015
1016
  }
@@ -1020,8 +1021,9 @@ function usesDecimalAmount(accept, result) {
1020
1021
  const amount = String(rawAmount)
1021
1022
  if (amount.includes('.')) return true
1022
1023
  if (accept.maxAmountRequired !== undefined || accept.maxAmount !== undefined) return false
1024
+ if (accept.asset) return false
1023
1025
  if (!accept.asset && (accept.token || result.headers?.['x-payment-token'])) return true
1024
- return result.headers?.['x-payment-amount'] === amount
1026
+ return false
1025
1027
  }
1026
1028
 
1027
1029
  function challengePrice(accept, result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x402-surface-check",
3
- "version": "0.2.41",
3
+ "version": "0.2.43",
4
4
  "description": "No-payment x402 public-surface checker for manifests, OpenAPI specs, and HTTP 402 challenges.",
5
5
  "type": "module",
6
6
  "bin": {