{"_id":"@aeon-ai-pay/x402-hono","_rev":"7-5da5c77ace5ca210ed3c3530b101bbbc","name":"@aeon-ai-pay/x402-hono","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.3":{"name":"@aeon-ai-pay/x402-hono","version":"0.0.3","keywords":[],"author":{"name":"Aeon"},"license":"Apache-2.0","_id":"@aeon-ai-pay/x402-hono@0.0.3","maintainers":[{"name":"aeon_project","email":"code@alchemypay.org"}],"homepage":"https://github.com/AEON-Project/A402#readme","bugs":{"url":"https://github.com/AEON-Project/A402/issues"},"dist":{"shasum":"772eb18a9e459727291d70defab7e5d03cb39ffa","tarball":"https://registry.npmjs.org/@aeon-ai-pay/x402-hono/-/x402-hono-0.0.3.tgz","fileCount":8,"integrity":"sha512-SkcbQnAS+P2u5a9kvj4Ya3L5jMIb3uVpwyHHgZTyVx1BoP2QDpyNoLr4vuBvGiAXGJdlu+uQOLg0twaGCWhbpw==","signatures":[{"sig":"MEUCIAP2yIMklEF92Dsm0hyMzrD+FKCD6n0GHr0jsP63/UXOAiEA8/jV10nVXEM/kl1TVJ0IM/+2wa2gpJUC3J1OIGPcgqU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52208},"main":"./dist/cjs/index.js","types":"./dist/index.d.ts","module":"./dist/esm/index.js","exports":{".":{"import":{"types":"./dist/esm/index.d.mts","default":"./dist/esm/index.mjs"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"899671d140eaf0591596f56395b8d45f2bba419f","scripts":{"lint":"eslint . --ext .ts --fix","build":"tsup","start":"tsx --env-file=.env index.ts","watch":"tsc --watch","format":"prettier -c .prettierrc --write \"**/*.{ts,js,cjs,json,md}\"","lint:check":"eslint . --ext .ts","format:check":"prettier -c .prettierrc --check \"**/*.{ts,js,cjs,json,md}\""},"_npmUser":{"name":"aeon_project","email":"code@alchemypay.org"},"repository":{"url":"git+https://github.com/AEON-Project/A402.git","type":"git"},"_npmVersion":"10.8.2","description":"x402 Payment Protocol","directories":{},"_nodeVersion":"20.18.1","dependencies":{"zod":"^3.24.2","hono":"^4.7.1","viem":"^2.21.26","@aeon-ai-pay/x402":"^0.0.20"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.4.0","vite":"^6.2.6","eslint":"^9.24.0","prettier":"3.5.2","@eslint/js":"^9.24.0","typescript":"^5.7.3","@types/node":"^22.13.4","eslint-plugin-jsdoc":"^50.6.9","vite-tsconfig-paths":"^5.1.4","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.6","@typescript-eslint/parser":"^8.29.1","@typescript-eslint/eslint-plugin":"^8.29.1"},"_npmOperationalInternal":{"tmp":"tmp/x402-hono_0.0.3_1760689613433_0.5570593370779882","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@aeon-ai-pay/x402-hono","version":"0.0.4","keywords":[],"author":{"name":"AeonGPT"},"license":"Apache-2.0","_id":"@aeon-ai-pay/x402-hono@0.0.4","maintainers":[{"name":"aeon_project","email":"code@alchemypay.org"}],"homepage":"https://github.com/AEON-Project/A402#readme","bugs":{"url":"https://github.com/AEON-Project/A402/issues"},"dist":{"shasum":"19a86d218ee085ce886f72b4ce5e38203a759468","tarball":"https://registry.npmjs.org/@aeon-ai-pay/x402-hono/-/x402-hono-0.0.4.tgz","fileCount":8,"integrity":"sha512-i5TpxpsqbvLGdQgRHIt/cHMxG1/9fWxPX4PFVWOOi0MLhd1uJjBB1ZyFfd1drBG/uK+WK1QOlL2HDMNj6bOPww==","signatures":[{"sig":"MEUCICq38NhWRsX+FdwY3qyMNkQSLu57XUc7obAewAm48TcGAiEAq9m9qaIfhpWclwlx9rWjs0dK28fNTM6C5bEAOHZ6+ek=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52436},"main":"./dist/cjs/index.js","types":"./dist/index.d.ts","module":"./dist/esm/index.js","exports":{".":{"import":{"types":"./dist/esm/index.d.mts","default":"./dist/esm/index.mjs"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"bd3a75ca77cf058c8aafe04be356b56b0d76f425","scripts":{"lint":"eslint . --ext .ts --fix","build":"tsup","start":"tsx --env-file=.env index.ts","watch":"tsc --watch","format":"prettier -c .prettierrc --write \"**/*.{ts,js,cjs,json,md}\"","lint:check":"eslint . --ext .ts","format:check":"prettier -c .prettierrc --check \"**/*.{ts,js,cjs,json,md}\""},"_npmUser":{"name":"aeon_project","email":"code@alchemypay.org"},"repository":{"url":"git+https://github.com/AEON-Project/A402.git","type":"git"},"_npmVersion":"10.8.2","description":"x402 Payment Protocol","directories":{},"_nodeVersion":"20.18.1","dependencies":{"zod":"^3.24.2","hono":"^4.7.1","viem":"^2.21.26","x402-hono":"^0.6.5","@aeon-ai-pay/x402":"^0.0.21"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.4.0","vite":"^6.2.6","eslint":"^9.24.0","prettier":"3.5.2","@eslint/js":"^9.24.0","typescript":"^5.7.3","@types/node":"^22.13.4","eslint-plugin-jsdoc":"^50.6.9","vite-tsconfig-paths":"^5.1.4","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.6","@typescript-eslint/parser":"^8.29.1","@typescript-eslint/eslint-plugin":"^8.29.1"},"_npmOperationalInternal":{"tmp":"tmp/x402-hono_0.0.4_1760701839241_0.7271687448763544","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@aeon-ai-pay/x402-hono","version":"0.0.5","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/index.d.ts","scripts":{"start":"tsx --env-file=.env index.ts","build":"tsup","watch":"tsc --watch","format":"prettier -c .prettierrc --write \"**/*.{ts,js,cjs,json,md}\"","format:check":"prettier -c .prettierrc --check \"**/*.{ts,js,cjs,json,md}\"","lint":"eslint . --ext .ts --fix","lint:check":"eslint . --ext .ts"},"keywords":[],"license":"Apache-2.0","author":{"name":"AeonGPT"},"repository":{"type":"git","url":"git+https://github.com/AEON-Project/A402.git"},"description":"x402 Payment Protocol","devDependencies":{"@eslint/js":"^9.24.0","@types/node":"^22.13.4","@typescript-eslint/eslint-plugin":"^8.29.1","@typescript-eslint/parser":"^8.29.1","eslint":"^9.24.0","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.6","prettier":"3.5.2","tsup":"^8.4.0","tsx":"^4.19.2","typescript":"^5.7.3","vite":"^6.2.6","vite-tsconfig-paths":"^5.1.4"},"dependencies":{"@aeon-ai-pay/x402":"^0.0.22","hono":"^4.7.1","viem":"^2.21.26","x402-hono":"^0.6.5","zod":"^3.24.2"},"exports":{".":{"import":{"types":"./dist/esm/index.d.mts","default":"./dist/esm/index.mjs"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"_id":"@aeon-ai-pay/x402-hono@0.0.5","gitHead":"4ac5f428d1234c1b6acd6e074d6f9828618d199f","bugs":{"url":"https://github.com/AEON-Project/A402/issues"},"homepage":"https://github.com/AEON-Project/A402#readme","_nodeVersion":"20.18.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-y9O5xP1s+sbI7+fYxTfaOdHHDH64hTFa3OVzDKc3faCnsOdEIYO8kua0lD1ftVMv3w3peBrKmAHmup8FMIfciQ==","shasum":"446443c99981c5a7c4a417b6caeb9cd8e76fc002","tarball":"https://registry.npmjs.org/@aeon-ai-pay/x402-hono/-/x402-hono-0.0.5.tgz","fileCount":8,"unpackedSize":52436,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDJnbTrKv0peIY+VhqhvrdXMHX9+ykkmibztPkbQPwXwQIhAK3qBTsn1OeZ6sYkhYTD8e4bYPLbwPDYrTAfHHJemlmO"}]},"_npmUser":{"name":"aeon_project","email":"code@alchemypay.org"},"directories":{},"maintainers":[{"name":"aeon_project","email":"code@alchemypay.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x402-hono_0.0.5_1760936354463_0.6462076642691779"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-17T08:26:53.367Z","modified":"2025-10-20T04:59:14.876Z","0.0.1":"2025-10-17T08:16:22.669Z","0.0.2":"2025-10-17T08:18:41.111Z","0.0.3":"2025-10-17T08:26:53.626Z","0.0.4":"2025-10-17T11:50:39.437Z","0.0.5":"2025-10-20T04:59:14.639Z"},"bugs":{"url":"https://github.com/AEON-Project/A402/issues"},"author":{"name":"AeonGPT"},"license":"Apache-2.0","homepage":"https://github.com/AEON-Project/A402#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/AEON-Project/A402.git"},"description":"x402 Payment Protocol","maintainers":[{"name":"aeon_project","email":"code@alchemypay.org"}],"readme":"# x402-hono\n\nHono middleware integration for the x402 Payment Protocol. This package allows you to easily add paywall functionality to your Hono applications using the x402 protocol.\n\n## Installation\n\n```bash\nnpm install x402-hono\n```\n\n## Quick Start\n\n```typescript\nimport { Hono } from \"hono\";\nimport { paymentMiddleware, Network } from \"x402-hono\";\n\nconst app = new Hono();\n\n// Configure the payment middleware\napp.use(paymentMiddleware(\n  \"0xYourAddress\",\n  {\n    \"/protected-route\": {\n      price: \"$0.10\",\n      network: \"base-sepolia\",\n      config: {\n        description: \"Access to premium content\",\n      }\n    }\n  }\n));\n\n// Implement your route\napp.get(\"/protected-route\", (c) => {\n  return c.json({ message: \"This content is behind a paywall\" });\n});\n\nserve({\n  fetch: app.fetch,\n  port: 3000\n});\n```\n\n## Configuration\n\nThe `paymentMiddleware` function accepts three parameters:\n\n1. `payTo`: Your receiving address (`0x${string}`)\n2. `routes`: Route configurations for protected endpoints\n3. `facilitator`: (Optional) Configuration for the x402 facilitator service\n\nSee the Middleware Options section below for detailed configuration options.\n\n## Middleware Options\n\nThe middleware supports various configuration options:\n\n### Route Configuration\n\n```typescript\ntype RoutesConfig = Record<string, Price | RouteConfig>;\n\ninterface RouteConfig {\n  price: Price;           // Price in USD or token amount\n  network: Network;       // \"base\" or \"base-sepolia\"\n  config?: PaymentMiddlewareConfig;\n}\n```\n\n### Payment Configuration\n\n```typescript\ninterface PaymentMiddlewareConfig {\n  description?: string;               // Description of the payment\n  mimeType?: string;                  // MIME type of the resource\n  maxTimeoutSeconds?: number;         // Maximum time for payment (default: 60)\n  outputSchema?: Record<string, any>; // JSON schema for the response\n  customPaywallHtml?: string;         // Custom HTML for the paywall\n  resource?: string;                  // Resource URL (defaults to request URL)\n}\n```\n\n### Facilitator Configuration\n\n```typescript\ntype FacilitatorConfig = {\n  url: string;                        // URL of the x402 facilitator service\n  createAuthHeaders?: CreateHeaders;  // Optional function to create authentication headers\n};\n```\n","readmeFilename":"README.md"}