@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.js CHANGED
@@ -1616,7 +1616,13 @@ var HavenClient = class {
1616
1616
  paymentRequired.x402Version,
1617
1617
  requirements
1618
1618
  );
1619
- return header;
1619
+ if (paymentRequired.x402Version < 2) return header;
1620
+ const payment = decodeBase64Json3(header);
1621
+ return btoa(JSON.stringify({
1622
+ x402Version: paymentRequired.x402Version,
1623
+ accepted: option,
1624
+ payload: payment.payload
1625
+ }));
1620
1626
  }
1621
1627
  cacheX402Receipt(idempotencyKey, paymentHeader, receipt) {
1622
1628
  const expiresAt = getPaymentHeaderValidBefore(paymentHeader);