@haven_ai/sdk 0.1.8 → 0.1.9
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 +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1618,7 +1618,13 @@ var HavenClient = class {
|
|
|
1618
1618
|
paymentRequired.x402Version,
|
|
1619
1619
|
requirements
|
|
1620
1620
|
);
|
|
1621
|
-
return header;
|
|
1621
|
+
if (paymentRequired.x402Version < 2) return header;
|
|
1622
|
+
const payment = decodeBase64Json3(header);
|
|
1623
|
+
return btoa(JSON.stringify({
|
|
1624
|
+
x402Version: paymentRequired.x402Version,
|
|
1625
|
+
accepted: option,
|
|
1626
|
+
payload: payment.payload
|
|
1627
|
+
}));
|
|
1622
1628
|
}
|
|
1623
1629
|
cacheX402Receipt(idempotencyKey, paymentHeader, receipt) {
|
|
1624
1630
|
const expiresAt = getPaymentHeaderValidBefore(paymentHeader);
|