npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@abstract-foundation/mpp

v0.1.4

Published

MPP payment method plugin for Abstract chain — ERC-3009 charge + ERC-20 session escrow

Readme

@abstract-foundation/mpp

MPP payment method plugin for the Abstract blockchain. Enables paid API access via two settlement mechanisms: one-time ERC-3009 charges and ERC-20 payment channel sessions.

Install

npm install @abstract-foundation/mpp mppx viem zod

How it works

Both payment methods follow the same HTTP protocol:

  1. Client requests a resource
  2. Server responds 402 Payment Required with WWW-Authenticate: Payment method="abstract"
  3. Client signs and retries with Authorization: Payment <credential>
  4. Server verifies, settles on-chain, responds 200 OK with Payment-Receipt

The mppx framework handles the 402 negotiation loop. This package implements the Abstract-specific signing and settlement logic on top.

Payment methods

Charge (ERC-3009)

One-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).

Session (Payment channels)

Streaming 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.

Usage

Server

import { Mppx } from 'mppx/server'
import { abstract } from '@abstract-foundation/mpp/server'
import { privateKeyToAccount } from 'viem/accounts'

const mppx = Mppx.create({
  methods: [
    abstract.charge({
      account: privateKeyToAccount(process.env.SERVER_PRIVATE_KEY),
      recipient: '0xYourRecipientAddress',
      amount: '0.01',
      testnet: true,
    }),
    abstract.session({
      account: privateKeyToAccount(process.env.SERVER_PRIVATE_KEY),
      recipient: '0xYourRecipientAddress',
      amount: '0.001',
      suggestedDeposit: '1',
      testnet: true,
    }),
  ],
  secretKey: process.env.MPP_SECRET_KEY,
})

Client

import { abstractCharge, abstractSession } from '@abstract-foundation/mpp/client'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...')

const charge = abstractCharge({ account })
const session = abstractSession({ account, deposit: '10' })

Both return mppx method objects that plug directly into the mppx client.

Exports

| Entry point | Description | |---|---| | @abstract-foundation/mpp | All exports (client + server + constants) | | @abstract-foundation/mpp/client | Client-side charge and session methods | | @abstract-foundation/mpp/server | Server-side charge and session handlers |

Chain support

| | Testnet (11124) | Mainnet (2741) | |---|---|---| | USDC.e | 0xbd28...008C61 | 0x84A7...987e1 | | AbstractStreamChannel | 0x2963...0923c | 0x2963...0923c |

The plugin defaults to mainnet. Pass testnet: true on the server or let the server challenge dictate the chain on the client.

Paymaster support

Abstract uses ZKsync-native paymasters. Pass paymasterAddress to sponsor gas:

abstract.charge({
  account,
  recipient: '0x...',
  amount: '0.01',
  paymasterAddress: '0xYourPaymasterContract',
})

Smart wallet support

Client-side signing supports both EOA and ERC-1271 smart wallets via viem's typed data signing.

License

MIT