{"_id":"@canister-software/x402-icp","_rev":"2-2d954f633910441ddd2d167e2968e55c","name":"@canister-software/x402-icp","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@canister-software/x402-icp","version":"0.1.0","keywords":["x402","icp","internet-computer","icrc2","payments","web3","http-payments","dfinity","canister"],"author":{"name":"Canister Software Inc."},"license":"MIT","_id":"@canister-software/x402-icp@0.1.0","maintainers":[{"name":"enigma876","email":"demaligregg123@gmail.com"}],"homepage":"https://github.com/Canister-Software/x402-icp#readme","bugs":{"url":"https://github.com/Canister-Software/x402-icp/issues"},"dist":{"shasum":"4839a1a0fe6aba4d86ddf462c0f07be2a1d7c76b","tarball":"https://registry.npmjs.org/@canister-software/x402-icp/-/x402-icp-0.1.0.tgz","fileCount":24,"integrity":"sha512-vs/HZ6TIrbgG3L6DaO+Z63M4y4IW0IWRu7rKA3FfBHlr6aUNifHX0EqGIMasSATb6SCB05Cwqc/utwv3/rUlyw==","signatures":[{"sig":"MEQCIALtl9upHUqOCC/kYHIDR2q6BiNBQbfjNa4vjATO3MX6AiBvbr8vLq3Q6HXiHJaErYNzjuUUG3DJrpV2a1wRu8oFYA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37743},"type":"module","engines":{"node":">=18"},"exports":{"./types":{"types":"./dist/types/index.d.ts","import":"./dist/types/index.js"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js"}},"gitHead":"e9319166b1b0f0fd30a928b26ab317e9c180e5c4","scripts":{"lint":"eslint src","build":"tsc","format":"prettier --write src","typecheck":"tsc --noEmit","format:check":"prettier --check src"},"_npmUser":{"name":"enigma876","email":"demaligregg123@gmail.com"},"repository":{"url":"git+https://github.com/Canister-Software/x402-icp.git","type":"git"},"_npmVersion":"11.7.0","description":"x402 payment scheme for Internet Computer (ICP) — ICRC-2 approve/transferFrom","directories":{},"_nodeVersion":"20.19.0","dependencies":{"cborg":"^4.2.0","@noble/hashes":"^1.8.0","@dfinity/agent":"^2.2.0","@dfinity/candid":"^2.2.0","@dfinity/identity":"^2.2.0","@dfinity/principal":"^2.2.0","@dfinity/identity-secp256k1":"^2.4.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.0.0","prettier":"^3.0.0","typescript":"^5.7.0","@types/node":"^22.0.0","eslint-config-prettier":"^10.0.0","@typescript-eslint/parser":"^8.0.0","@typescript-eslint/eslint-plugin":"^8.0.0"},"peerDependencies":{"@x402/core":">=2.4.0"},"_npmOperationalInternal":{"tmp":"tmp/x402-icp_0.1.0_1772491320515_0.16518044980994517","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@canister-software/x402-icp","version":"0.1.1","description":"x402 payment scheme for Internet Computer (ICP) — ICRC-2 approve/transferFrom","type":"module","exports":{"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js"},"./types":{"types":"./dist/types/index.d.ts","import":"./dist/types/index.js"}},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","lint":"eslint src","format":"prettier --write src","format:check":"prettier --check src"},"keywords":["x402","icp","internet-computer","icrc2","payments","web3","http-payments","dfinity","canister"],"engines":{"node":">=18"},"peerDependencies":{"@x402/core":">=2.1.0"},"dependencies":{"@dfinity/agent":"^2.2.0","@dfinity/candid":"^2.2.0","@dfinity/identity":"^2.2.0","@dfinity/identity-secp256k1":"^2.4.1","@dfinity/principal":"^2.2.0","@noble/hashes":"^1.8.0","cborg":"^4.2.0"},"devDependencies":{"@types/node":"^22.0.0","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","eslint":"^9.0.0","eslint-config-prettier":"^10.0.0","prettier":"^3.0.0","typescript":"^5.7.0"},"author":{"name":"Canister Software Inc."},"license":"MIT","homepage":"https://github.com/Canister-Software/x402-icp#readme","bugs":{"url":"https://github.com/Canister-Software/x402-icp/issues"},"repository":{"type":"git","url":"git+https://github.com/Canister-Software/x402-icp.git"},"gitHead":"91260cf60e62388e8f7cad4007bc9eb0b57cc530","_id":"@canister-software/x402-icp@0.1.1","_nodeVersion":"20.19.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-wLk85ZSMzEcXu3fgJ7RuHwI66Z/jGhY4T+dAh8ro90e1pM0eXA+/TyyRyqXePNWDhsILI6r1IGvB9X63vV0N+Q==","shasum":"087a2794c1213feb1b626452498bf382b9c3443b","tarball":"https://registry.npmjs.org/@canister-software/x402-icp/-/x402-icp-0.1.1.tgz","fileCount":24,"unpackedSize":37876,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHAZrNxd7iUmg0v9lsGVwJw4U36MXfP9yNldz7kq31nDAiBBdIzl7Sxb2jW5Z2UphlthT6KDk3fOs9vXR7HJDm5nzA=="}]},"_npmUser":{"name":"enigma876","email":"demaligregg123@gmail.com"},"directories":{},"maintainers":[{"name":"enigma876","email":"demaligregg123@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x402-icp_0.1.1_1772512213778_0.16081917119064215"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-02T22:42:00.408Z","modified":"2026-03-03T04:30:14.112Z","0.1.0":"2026-03-02T22:42:00.673Z","0.1.1":"2026-03-03T04:30:13.963Z"},"bugs":{"url":"https://github.com/Canister-Software/x402-icp/issues"},"author":{"name":"Canister Software Inc."},"license":"MIT","homepage":"https://github.com/Canister-Software/x402-icp#readme","keywords":["x402","icp","internet-computer","icrc2","payments","web3","http-payments","dfinity","canister"],"repository":{"type":"git","url":"git+https://github.com/Canister-Software/x402-icp.git"},"description":"x402 payment scheme for Internet Computer (ICP) — ICRC-2 approve/transferFrom","maintainers":[{"name":"enigma876","email":"demaligregg123@gmail.com"}],"readme":"# @canister-software/x402-icp\n\n[x402](https://x402.org) payment scheme for the [Internet Computer](https://internetcomputer.org) — brings native ICP token payments (ICP, ckUSDC, ckUSDT) to the HTTP 402 standard using ICRC-2 approve/transferFrom.\n\n## Overview\n\nx402 is an open protocol for machine-native HTTP payments. This library adds ICP support to the x402 ecosystem, letting any HTTP resource accept ICP tokens with a single line of middleware — and any client pay automatically using an internet identity.\n\n**Supported assets**\n\n| Symbol | Asset |\n|--------|---------|\n| ICP | `icp:1:ryjl3-tyaaa-aaaaa-aaaba-cai` |\n| ckUSDC | `icp:1:xevnm-gaaaa-aaaar-qafnq-cai` |\n| ckUSDT | `icp:1:cngnf-vqaaa-aaaar-qag4q-cai` |\n\n`icp:1` signifisy the network as \n\n## Installation\n\n```bash\nnpm install @canister-software/x402-icp\n```\n\nRequires `@x402/core >= 2.4.0` as a peer dependency.\n\n## Usage\n\n### Client — paying for a resource\n\n```typescript\nimport { x402Client } from '@x402/core/client'\nimport { wrapFetchWithPayment } from '@x402/fetch'\nimport { registerExactIcpScheme, createPemSigner } from '@canister-software/x402-icp/client'\nimport fs from 'fs'\n\nconst signer = await createPemSigner({\n  pem: fs.readFileSync('identity.pem', 'utf8'),\n})\n\nconst client = new x402Client()\nregisterExactIcpScheme(client, { signer })\n\nconst fetch402 = wrapFetchWithPayment(fetch, client)\nconst res = await fetch402('https://api.example.com/premium')\n```\n\n### Server — protecting a resource\n\n```typescript\nimport { createIcpPaymentRequirements } from '@canister-software/x402-icp/server'\n\nconst requirements = createIcpPaymentRequirements({\n  network: 'icp:1:xevnm-gaaaa-aaaar-qafnq-cai', // ckUSDC\n  amount: '1000000',                              // 1 ckUSDC (6 decimals)\n  payTo: 'your-principal-id',\n})\n```\n\n## Facilitator\n\nA public facilitator for ICP is operated by Canister Software at:\n\n``` \nhttps://facilitator.consensus.canister.software\n```\n\nFull documentation: [docs.canister.software](https://docs.canister.software)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}