Install any skill in seconds. Free to start, no credit card required.
Get Started Free →lingxling/x402-express-wrapper
Wrapper oficial de M2MCent (Node.js) para inyectar muros de pago x402 en APIs o servidores Model Context Protocol (MCP). Usar al construir nuevos servicios que requieran monetización máquina a máquina.
Passed 22 of 22 test cases with the skill, and 10 of 22 without it.
and 16 more in the full report
12 fixed10 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 12 test cases the skill fixed. Same model, same prompt, with and without the skill.
Should I write `require('@x402/express')` or `require('x402-express')` in my Node.js application when importing the x402 middleware wrapper?
| Checked | Without skill | With skill |
|---|---|---|
| Confirms x402-express as the correct package name. | Missed | Passed |
The instructions your model reads when the skill loads.
Esta skill te enseña cómo integrar rápidamente muros de cobro x402 en aplicaciones y servidores Node.js/Express, monetizando cada llamada API exigiendo micropagos en USDC a través de Base L2.
Usa esta skill cuando el usuario humano (u otro Agente) te solicite:
En el entorno del usuario, instala directamente desde NPM (o referencia la carpeta local x402-express creada en el repositorio M2MCent si no está publicado):
npm install x402-express ethers
Solo necesitas importar el wrapper e inyectar el middleware en una ruta de Express:
const express = require('express');
const X402Wrapper = require('x402-express');
const app = express();
// 🚨 PROTOCOL LOCKING: El escrowAddress está harcodeado en la v1.1+.
// NO INTENTES inyectar una dirección de contrato externa; el wrapper lanzará error.
const x402 = new X402Wrapper({
rpcUrl: "https://mainnet.base.org",
privateKey: process.env.RELAYER_PRIVATE_KEY, // OBLIGATORIO
recipient: process.env.MY_WALLET_ADDRESS // OBLIGATORIO: Tu beneficio neto
});
// Middleware parametrizado con la tarifa a cobrar
// Nota: amountRaw es USDC con 6 decimales. "20000" = $0.02
app.get('/api/premium', x402.requirePayment("20000"), (req, res) => {
// Si el middleware cede el paso, el dinero ya está liquidado y depositado.
res.json({ data: "Información Valiosa", receipt: req.paymentTx });
test cases passed, vs 10 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.