{"_id":"@abstract-foundation/mpp","_rev":"4-ea084e14102e9641fd75bd2c8dcef00c","name":"@abstract-foundation/mpp","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.2":{"name":"@abstract-foundation/mpp","version":"0.1.2","_id":"@abstract-foundation/mpp@0.1.2","maintainers":[{"name":"cygaardev","email":"t@cubelabs.xyz"},{"name":"coffeexcoin","email":"coffee@cubelabs.xyz"},{"name":"jarrodwatts","email":"jarrodwatts16@gmail.com"}],"homepage":"https://github.com/Abstract-Foundation/mpp-abstract/tree/main/packages/mpp","bugs":{"url":"https://github.com/Abstract-Foundation/mpp-abstract/issues"},"dist":{"shasum":"afb19f2904c38708ab7212890d738fead7140624","tarball":"https://registry.npmjs.org/@abstract-foundation/mpp/-/mpp-0.1.2.tgz","fileCount":41,"integrity":"sha512-n4iS81Zvw0pOV2Vezn2zg2dHD4PKD96jxDzEcttlXN1ZKwnS9EYuKWbHzdxz93HuE+FMoJ7WGeYIF0HcdrMX+g==","signatures":[{"sig":"MEUCIGeRd5niApOuExax1Wrlf2UlEjpnruExfy8wKV7ur2rEAiEA+20m3n9LDQUHGfsz/SVdrYJvXdIZP7DzJMAcYKQ+K50=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":147998},"main":"./dist/index.js","type":"module","_from":"file:abstract-foundation-mpp-0.1.2.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./client":{"types":"./dist/client/index.d.ts","default":"./dist/client/index.js"},"./server":{"types":"./dist/server/index.d.ts","default":"./dist/server/index.js"}},"scripts":{"dev":"tsc --watch","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"coffeexcoin","email":"coffee@cubelabs.xyz"},"_resolved":"/Users/coffee/code/abstract/mpp-abstract/abstract-foundation-mpp-0.1.2.tgz","_integrity":"sha512-n4iS81Zvw0pOV2Vezn2zg2dHD4PKD96jxDzEcttlXN1ZKwnS9EYuKWbHzdxz93HuE+FMoJ7WGeYIF0HcdrMX+g==","repository":{"url":"git+https://github.com/Abstract-Foundation/mpp-abstract.git","type":"git","directory":"packages/mpp"},"_npmVersion":"10.9.3","description":"MPP payment method plugin for Abstract chain — ERC-3009 charge + ERC-20 session escrow","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","mppx":"^0.4.9","viem":"^2.38.6","typescript":"^5.8.2","@types/node":"^25.5.0"},"peerDependencies":{"zod":"^4.3.6","mppx":"^0.4.9","viem":"^2.38.6"},"_npmOperationalInternal":{"tmp":"tmp/mpp_0.1.2_1774479698780_0.2325967121159218","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@abstract-foundation/mpp","version":"0.1.4","license":"MIT","_id":"@abstract-foundation/mpp@0.1.4","maintainers":[{"name":"cygaardev","email":"t@cubelabs.xyz"},{"name":"coffeexcoin","email":"coffee@cubelabs.xyz"},{"name":"jarrodwatts","email":"jarrodwatts16@gmail.com"}],"homepage":"https://github.com/Abstract-Foundation/mpp-abstract/tree/main/packages/mpp","bugs":{"url":"https://github.com/Abstract-Foundation/mpp-abstract/issues"},"dist":{"shasum":"475748fde6e3813d42a96040b7c6e92cbaa745ec","tarball":"https://registry.npmjs.org/@abstract-foundation/mpp/-/mpp-0.1.4.tgz","fileCount":43,"integrity":"sha512-+GOyoIMZEHh5nVycgVfxwtlE0TpEiUzsLAtGNTX4ZZwC9jwQrJ1vXGyoVPCNhdoPmkJjWndobcmbe6d+f5gJig==","signatures":[{"sig":"MEYCIQDHKry2VpmNT5MhrLIXANIj92/JmrcmZmxp6R06nPFufgIhAKbww8QAalKA+u3HGBHls0FO1Lby3k8De7orWMP0nGt0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@abstract-foundation%2fmpp@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":151969},"main":"./dist/index.js","type":"module","_from":"file:abstract-foundation-mpp-0.1.4.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./client":{"types":"./dist/client/index.d.ts","default":"./dist/client/index.js"},"./server":{"types":"./dist/server/index.d.ts","default":"./dist/server/index.js"}},"scripts":{"dev":"tsc --watch","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1f3d2768-e027-4000-b51a-fa1be52ba8e6"}},"_resolved":"/tmp/fddd77c8e6acb5b0722e9c4137b2c491/abstract-foundation-mpp-0.1.4.tgz","_integrity":"sha512-+GOyoIMZEHh5nVycgVfxwtlE0TpEiUzsLAtGNTX4ZZwC9jwQrJ1vXGyoVPCNhdoPmkJjWndobcmbe6d+f5gJig==","repository":{"url":"git+https://github.com/Abstract-Foundation/mpp-abstract.git","type":"git","directory":"packages/mpp"},"_npmVersion":"11.9.0","description":"MPP payment method plugin for Abstract chain — ERC-3009 charge + ERC-20 session escrow","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","mppx":"^0.4.9","viem":"^2.38.6","typescript":"^5.8.2","@types/node":"^25.5.0"},"peerDependencies":{"zod":"^4.3.6","mppx":"^0.4.9","viem":"^2.38.6"},"_npmOperationalInternal":{"tmp":"tmp/mpp_0.1.4_1774488455618_0.3457680188913852","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@abstract-foundation/mpp","version":"0.1.5","license":"MIT","_id":"@abstract-foundation/mpp@0.1.5","maintainers":[{"name":"cygaardev","email":"t@cubelabs.xyz"},{"name":"coffeexcoin","email":"coffee@cubelabs.xyz"},{"name":"jarrodwatts","email":"jarrodwatts16@gmail.com"}],"homepage":"https://github.com/Abstract-Foundation/abstract-packages/tree/main/packages/mpp","bugs":{"url":"https://github.com/Abstract-Foundation/abstract-packages/issues"},"dist":{"shasum":"1aecb50c7e5747f7f8af6c35beb211f09528e0d7","tarball":"https://registry.npmjs.org/@abstract-foundation/mpp/-/mpp-0.1.5.tgz","fileCount":43,"integrity":"sha512-bkMxo8UmGU0i5mMllTmeBpBjdxwS6v5Ce3ifMRlSjM7uLr8V0z7NgxWeXB5stNzBzWyyxMosGnU2Uz+jCZiGYw==","signatures":[{"sig":"MEQCICS+e+CGVg+8WBkZFdllrDxh2w9/EOQGWKfU1dNn8neXAiAvzcAia6oEE6V6zcAsH1UWpWNi93X71hK6GwTX2FCsxg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@abstract-foundation%2fmpp@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":152090},"main":"./dist/index.js","type":"module","_from":"file:abstract-foundation-mpp-0.1.5.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./client":{"types":"./dist/client/index.d.ts","default":"./dist/client/index.js"},"./server":{"types":"./dist/server/index.d.ts","default":"./dist/server/index.js"}},"scripts":{"dev":"tsc --watch","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8582bd1e-9240-4957-afef-79c41a249865"}},"_resolved":"/tmp/1c1ecb86a00ae1089c812f78c1738e27/abstract-foundation-mpp-0.1.5.tgz","_integrity":"sha512-bkMxo8UmGU0i5mMllTmeBpBjdxwS6v5Ce3ifMRlSjM7uLr8V0z7NgxWeXB5stNzBzWyyxMosGnU2Uz+jCZiGYw==","repository":{"url":"git+https://github.com/Abstract-Foundation/abstract-packages.git","type":"git","directory":"packages/mpp"},"_npmVersion":"11.11.0","description":"MPP payment method plugin for Abstract chain — ERC-3009 charge + ERC-20 session escrow","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","mppx":"^0.4.9","viem":"^2.46.2","typescript":"^5.8.2","@types/node":"^25.5.0"},"peerDependencies":{"zod":"^4.3.6","mppx":"^0.4.9","viem":"^2.46.2"},"_npmOperationalInternal":{"tmp":"tmp/mpp_0.1.5_1776523680502_0.6026200566717617","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@abstract-foundation/mpp","version":"0.1.6","license":"MIT","description":"MPP payment method plugin for Abstract chain — ERC-3009 charge + ERC-20 session escrow","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./client":{"types":"./dist/client/index.d.ts","default":"./dist/client/index.js"},"./server":{"types":"./dist/server/index.d.ts","default":"./dist/server/index.js"}},"publishConfig":{"access":"public","provenance":true},"repository":{"type":"git","url":"git+https://github.com/Abstract-Foundation/abstract-packages.git","directory":"packages/mpp"},"bugs":{"url":"https://github.com/Abstract-Foundation/abstract-packages/issues"},"homepage":"https://github.com/Abstract-Foundation/abstract-packages/tree/main/packages/mpp","peerDependencies":{"mppx":"^0.4.9","viem":"^2.46.2","zod":"^4.3.6"},"devDependencies":{"@types/node":"^25.5.0","mppx":"^0.4.9","typescript":"^5.8.2","viem":"^2.46.2","zod":"^4.3.6"},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","dev":"tsc --watch"},"_id":"@abstract-foundation/mpp@0.1.6","_integrity":"sha512-I9R1vO6HW2h1/jTg9OlphXfVe6lov1cv1ppKFJLQe8PPsqfbY1Qlhj0i5hyeq8enq6K4aeLNzt8WivtgoPAL5A==","_resolved":"/tmp/c3d39850aa376e984f63c3175495574c/abstract-foundation-mpp-0.1.6.tgz","_from":"file:abstract-foundation-mpp-0.1.6.tgz","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-I9R1vO6HW2h1/jTg9OlphXfVe6lov1cv1ppKFJLQe8PPsqfbY1Qlhj0i5hyeq8enq6K4aeLNzt8WivtgoPAL5A==","shasum":"80208a5a61bd9c28d71e5ff8d792a67ec5d46dbc","tarball":"https://registry.npmjs.org/@abstract-foundation/mpp/-/mpp-0.1.6.tgz","fileCount":43,"unpackedSize":152090,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@abstract-foundation%2fmpp@0.1.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDwNTsZg+ftAjC5gErMjj1S56oP5YlQ/ZyRFGKrhcijRwIgTwPFWBc7BpoyXsJjGozU3gOJVKdbcRF+hSiNDJLpNYE="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8582bd1e-9240-4957-afef-79c41a249865"}},"directories":{},"maintainers":[{"name":"cygaardev","email":"t@cubelabs.xyz"},{"name":"coffeexcoin","email":"coffee@cubelabs.xyz"},{"name":"jarrodwatts","email":"jarrodwatts16@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mpp_0.1.6_1776528699708_0.2548461569555849"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-25T23:01:38.710Z","modified":"2026-04-18T16:11:40.205Z","0.1.2":"2026-03-25T23:01:38.945Z","0.1.4":"2026-03-26T01:27:35.819Z","0.1.5":"2026-04-18T14:48:00.659Z","0.1.6":"2026-04-18T16:11:39.851Z"},"bugs":{"url":"https://github.com/Abstract-Foundation/abstract-packages/issues"},"license":"MIT","homepage":"https://github.com/Abstract-Foundation/abstract-packages/tree/main/packages/mpp","repository":{"type":"git","url":"git+https://github.com/Abstract-Foundation/abstract-packages.git","directory":"packages/mpp"},"description":"MPP payment method plugin for Abstract chain — ERC-3009 charge + ERC-20 session escrow","maintainers":[{"name":"cygaardev","email":"t@cubelabs.xyz"},{"name":"coffeexcoin","email":"coffee@cubelabs.xyz"},{"name":"jarrodwatts","email":"jarrodwatts16@gmail.com"}],"readme":"# @abstract-foundation/mpp\n\n[MPP](https://github.com/anthropics/mppx) payment method plugin for the [Abstract](https://abs.xyz) blockchain. Enables paid API access via two settlement mechanisms: one-time ERC-3009 charges and ERC-20 payment channel sessions.\n\n## Install\n\n```bash\nnpm install @abstract-foundation/mpp mppx viem zod\n```\n\n## How it works\n\nBoth payment methods follow the same HTTP protocol:\n\n1. Client requests a resource\n2. Server responds `402 Payment Required` with `WWW-Authenticate: Payment method=\"abstract\"`\n3. Client signs and retries with `Authorization: Payment <credential>`\n4. Server verifies, settles on-chain, responds `200 OK` with `Payment-Receipt`\n\nThe `mppx` framework handles the 402 negotiation loop. This package implements the Abstract-specific signing and settlement logic on top.\n\n## Payment methods\n\n### Charge (ERC-3009)\n\nOne-time payments. The client signs ERC-3009 `TransferWithAuthorization` typed data — no transaction from the client side. The server broadcasts `transferWithAuthorization()` on USDC.e, paying gas (optionally via an Abstract paymaster).\n\n### Session (Payment channels)\n\nStreaming payments via `AbstractStreamChannel.sol`. The client opens a channel once (approve + `open()`), depositing USDC.e into escrow. Each subsequent request exchanges a signed EIP-712 voucher with a cumulative amount. The server accumulates the highest voucher and calls `settle()` or `close()` to finalize.\n\n## Usage\n\n### Server\n\n```ts\nimport { Mppx } from 'mppx/server'\nimport { abstract } from '@abstract-foundation/mpp/server'\nimport { privateKeyToAccount } from 'viem/accounts'\n\nconst mppx = Mppx.create({\n  methods: [\n    abstract.charge({\n      account: privateKeyToAccount(process.env.SERVER_PRIVATE_KEY),\n      recipient: '0xYourRecipientAddress',\n      amount: '0.01',\n      testnet: true,\n    }),\n    abstract.session({\n      account: privateKeyToAccount(process.env.SERVER_PRIVATE_KEY),\n      recipient: '0xYourRecipientAddress',\n      amount: '0.001',\n      suggestedDeposit: '1',\n      testnet: true,\n    }),\n  ],\n  secretKey: process.env.MPP_SECRET_KEY,\n})\n```\n\n### Client\n\n```ts\nimport { abstractCharge, abstractSession } from '@abstract-foundation/mpp/client'\nimport { privateKeyToAccount } from 'viem/accounts'\n\nconst account = privateKeyToAccount('0x...')\n\nconst charge = abstractCharge({ account })\nconst session = abstractSession({ account, deposit: '10' })\n```\n\nBoth return `mppx` method objects that plug directly into the `mppx` client.\n\n## Exports\n\n| Entry point | Description |\n|---|---|\n| `@abstract-foundation/mpp` | All exports (client + server + constants) |\n| `@abstract-foundation/mpp/client` | Client-side charge and session methods |\n| `@abstract-foundation/mpp/server` | Server-side charge and session handlers |\n\n## Chain support\n\n| | Testnet (11124) | Mainnet (2741) |\n|---|---|---|\n| USDC.e | `0xbd28...008C61` | `0x84A7...987e1` |\n| AbstractStreamChannel | `0x2963...0923c` | `0x2963...0923c` |\n\nThe plugin defaults to mainnet. Pass `testnet: true` on the server or let the server challenge dictate the chain on the client.\n\n## Paymaster support\n\nAbstract uses ZKsync-native paymasters. Pass `paymasterAddress` to sponsor gas:\n\n```ts\nabstract.charge({\n  account,\n  recipient: '0x...',\n  amount: '0.01',\n  paymasterAddress: '0xYourPaymasterContract',\n})\n```\n\n## Smart wallet support\n\nClient-side signing supports both EOA and ERC-1271 smart wallets via `viem`'s typed data signing.\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}