wolverine-ai 5.5.1 → 5.5.2
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 +1 -1
- package/src/brain/brain.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wolverine-ai",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.2",
|
|
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": {
|
package/src/brain/brain.js
CHANGED
|
@@ -194,7 +194,7 @@ const SEED_DOCS = [
|
|
|
194
194
|
metadata: { topic: "x402-paid-apis" },
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
|
-
text: "x402 examples — making a paid API is as simple as adding a route. FREE route: fastify.get('/api/data', async (req) => { return getData(); }). PAID route: fastify.get('/api/premium', { config: { x402: { price: '$0.01' } } }, async (req) => { return { data: 'premium', paid: req.x402.amount, txHash: req.x402.txHash }; }). CREDIT PURCHASE: fastify.post('/buy', { config: { x402: { variable: true, min: '$1', max: '$10000', priceField: 'dollars' } } }, async (req) => { const credits = parseFloat(req.x402.amount.replace('$','')) * 100; return { credits, txHash: req.x402.txHash }; }). Frontend integration: sign EIP-3009 TransferWithAuthorization with eth_signTypedData_v4
|
|
197
|
+
text: "x402 examples — making a paid API is as simple as adding a route. FREE route: fastify.get('/api/data', async (req) => { return getData(); }). PAID route: fastify.get('/api/premium', { config: { x402: { price: '$0.01' } } }, async (req) => { return { data: 'premium', paid: req.x402.amount, txHash: req.x402.txHash }; }). CREDIT PURCHASE: fastify.post('/buy', { config: { x402: { variable: true, min: '$1', max: '$10000', priceField: 'dollars' } } }, async (req) => { const credits = parseFloat(req.x402.amount.replace('$','')) * 100; return { credits, txHash: req.x402.txHash }; }). Frontend integration: sign EIP-3009 TransferWithAuthorization with eth_signTypedData_v4. v2 payload format: { x402Version: 2, payload: { authorization: { from, to, value (decimal string), validAfter (string), validBefore (string), nonce (0x hex) }, signature }, accepted: { scheme: 'exact', network: 'eip155:8453', amount: usdcAtomicUnits, asset: USDC_ADDRESS, payTo: receiverAddress, maxTimeoutSeconds: 60, extra: { name: 'USD Coin', version: '2' } } }. CRITICAL: the 'accepted' field is required for v2 — it contains the payment requirements the client accepted. Without it the facilitator returns 400 'paymentPayload is invalid'. Base64 encode the payload and send as X-PAYMENT header. Values MUST be decimal strings ('1000000' for $1) NOT hex. validAfter = String(now - 600), validBefore = String(now + 300). Both verify + settle happen in preHandler BEFORE handler runs. Handler only executes after USDC moves on-chain. req.x402 = { paid: true, amount: '$5.00', from: '0x...', txHash: '0x...', settled: true }.",
|
|
198
198
|
metadata: { topic: "x402-examples" },
|
|
199
199
|
},
|
|
200
200
|
{
|