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
|
|
1026
|
+
return false
|
|
1025
1027
|
}
|
|
1026
1028
|
|
|
1027
1029
|
function challengePrice(accept, result) {
|