wolverine-ai 5.3.0 → 5.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wolverine-ai",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "description": "Self-healing Node.js server framework powered by AI. Catches crashes, diagnoses errors, generates fixes, verifies, and restarts — automatically.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -43,10 +43,10 @@ async function x402Plugin(fastify, opts) {
43
43
  } catch {}
44
44
  }
45
45
 
46
- // Initialize facilitator from @coinbase/x402
46
+ // Initialize facilitator from @coinbase/x402 (ESM packages, need dynamic import)
47
47
  try {
48
- const { facilitator } = require("@coinbase/x402");
49
- const { useFacilitator } = require("x402/verify");
48
+ const { facilitator } = await import("@coinbase/x402");
49
+ const { useFacilitator } = await import("x402/verify");
50
50
  _facilitatorClient = useFacilitator(facilitator);
51
51
  console.log(` 💰 x402: facilitator loaded (@coinbase/x402)`);
52
52
  } catch (err) {
@@ -98,7 +98,7 @@ async function x402Plugin(fastify, opts) {
98
98
  const paymentHeader = request.headers["x-payment"] || request.headers["payment-signature"];
99
99
 
100
100
  // Build payment requirements (v1 format matching @coinbase/x402)
101
- const { getAddress } = require("viem");
101
+ const { getAddress } = await import("viem");
102
102
  const paymentRequirements = {
103
103
  scheme: "exact",
104
104
  network: _network,
@@ -130,7 +130,7 @@ async function x402Plugin(fastify, opts) {
130
130
  // Decode payment
131
131
  let decodedPayment;
132
132
  try {
133
- const { exact } = require("x402/schemes");
133
+ const { exact } = await import("x402/schemes");
134
134
  const libraryDecoded = exact.evm.decodePayment(paymentHeader);
135
135
 
136
136
  // Parse raw payload for metadata
@@ -186,7 +186,7 @@ async function x402Plugin(fastify, opts) {
186
186
  const decodedPayment = { x402Version: raw.x402Version || 1, scheme: raw.scheme || "exact", network: raw.network || _network, payload: libraryDecoded.payload };
187
187
 
188
188
  const userValue = decodedPayment.payload.authorization.value;
189
- const { getAddress } = require("viem");
189
+ const { getAddress } = await import("viem");
190
190
  const requirements = {
191
191
  scheme: "exact", network: _network, maxAmountRequired: userValue,
192
192
  resource: `${request.method} ${request.url}`, description: "", mimeType: "application/json",