@blockrun/clawrouter 0.8.19 → 0.8.20

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
@@ -2451,8 +2451,28 @@ function transformPaymentError(errorBody) {
2451
2451
  });
2452
2452
  }
2453
2453
  }
2454
+ if (innerJson.invalidReason === "invalid_payload") {
2455
+ return JSON.stringify({
2456
+ error: {
2457
+ message: "Payment signature invalid. This may be a temporary issue.",
2458
+ type: "invalid_payload",
2459
+ help: "Try again. If this persists, reinstall ClawRouter: curl -fsSL https://blockrun.ai/ClawRouter-update | bash"
2460
+ }
2461
+ });
2462
+ }
2454
2463
  }
2455
2464
  }
2465
+ if (parsed.error === "Settlement failed" || parsed.details?.includes("Settlement failed")) {
2466
+ const details = parsed.details || "";
2467
+ const gasError = details.includes("unable to estimate gas");
2468
+ return JSON.stringify({
2469
+ error: {
2470
+ message: gasError ? "Payment failed: network congestion or gas issue. Try again." : "Payment settlement failed. Try again in a moment.",
2471
+ type: "settlement_failed",
2472
+ help: "This is usually temporary. If it persists, try: /model free"
2473
+ }
2474
+ });
2475
+ }
2456
2476
  } catch {
2457
2477
  }
2458
2478
  return errorBody;