@agentcash/router 1.1.9 → 1.1.10

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 CHANGED
@@ -662,7 +662,14 @@ async function verifyX402Payment(opts) {
662
662
  if (!matching) {
663
663
  return invalidPaymentVerification();
664
664
  }
665
- const verify = await server.verifyPayment(payload, matching);
665
+ let verify;
666
+ try {
667
+ verify = await server.verifyPayment(payload, matching);
668
+ } catch (err) {
669
+ const sc = err.statusCode;
670
+ if (sc && sc >= 400 && sc < 500) return invalidPaymentVerification();
671
+ throw err;
672
+ }
666
673
  if (!verify.isValid) return invalidPaymentVerification();
667
674
  return {
668
675
  valid: true,
package/dist/index.js CHANGED
@@ -623,7 +623,14 @@ async function verifyX402Payment(opts) {
623
623
  if (!matching) {
624
624
  return invalidPaymentVerification();
625
625
  }
626
- const verify = await server.verifyPayment(payload, matching);
626
+ let verify;
627
+ try {
628
+ verify = await server.verifyPayment(payload, matching);
629
+ } catch (err) {
630
+ const sc = err.statusCode;
631
+ if (sc && sc >= 400 && sc < 500) return invalidPaymentVerification();
632
+ throw err;
633
+ }
627
634
  if (!verify.isValid) return invalidPaymentVerification();
628
635
  return {
629
636
  valid: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentcash/router",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "Unified route builder for Next.js App Router APIs with x402, MPP, SIWX, and API key auth",
5
5
  "type": "module",
6
6
  "exports": {