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

@tanakayuto/intmax402-express

v0.3.4

Published

Express middleware for [intmax402](https://github.com/zaq2989/intmax402) — wallet-based authentication and INTMAX L2 micropayments for Express apps.

Readme

@tanakayuto/intmax402-express

Express middleware for intmax402 — wallet-based authentication and INTMAX L2 micropayments for Express apps.

Install

npm install @tanakayuto/intmax402-express

Usage

Identity Mode

Require wallet ownership proof — no payment, no blockchain node needed.

import express from 'express'
import { intmax402 } from '@tanakayuto/intmax402-express'

const app = express()

app.use('/protected', intmax402({
  mode: 'identity',
  secret: process.env.INTMAX402_SECRET!,
}))

app.get('/protected', (req, res) => {
  res.json({ message: 'Access granted', address: req.intmax402?.address })
})

app.listen(3000)

Payment Mode

Require an INTMAX L2 transfer before granting access.

import express from 'express'
import { intmax402 } from '@tanakayuto/intmax402-express'

const app = express()

app.use('/api/premium', intmax402({
  mode: 'payment',
  secret: process.env.INTMAX402_SECRET!,
  serverAddress: process.env.INTMAX_ADDRESS!,
  amount: '1000000000000000',  // 0.001 ETH in wei
  environment: 'mainnet',
  ethPrivateKey: process.env.ETH_PRIVATE_KEY!,
}))

app.get('/api/premium', (req, res) => {
  res.json({
    message: 'Payment verified!',
    paidBy: req.intmax402?.address,
    txHash: req.intmax402?.txHash,
  })
})

app.listen(3000)

API Reference

intmax402(config)

Returns an Express RequestHandler middleware.

On success, populates req.intmax402:

req.intmax402 = {
  address: string,   // verified Ethereum address
  verified: boolean, // always true
  txHash?: string,   // payment mode only — INTMAX transfer digest
}

Config Options

| Option | Type | Required | Description | |---|---|---|---| | mode | 'identity' \| 'payment' | ✅ | Authentication mode | | secret | string | ✅ | HMAC secret for nonce generation (keep private) | | serverAddress | string | payment | Your INTMAX L2 address to receive payments | | amount | string | payment | Required payment in token smallest unit (wei for ETH) | | ethPrivateKey | string | payment† | Ethereum private key — auto-initializes the INTMAX payment verifier (v0.3.1+) | | environment | 'mainnet' \| 'testnet' | — | Network environment. Default: 'mainnet' | | l1RpcUrl | string | — | Custom L1 RPC URL override | | allowList | string[] | — | Identity mode: restrict to specific addresses | | bindIp | boolean | — | Bind nonce to client IP. Default false (recommended for AI agents) | | tokenAddress | string | — | ERC-20 token for payment. Default: native ETH |

ethPrivateKey auto-initializes the payment verifier on first use. If not provided, call initPaymentVerifier() manually before handling requests.

HTTP Responses

| Scenario | Status | Description | |---|---|---| | No Authorization header | 401 (identity) / 402 (payment) | Returns WWW-Authenticate header with nonce | | Invalid signature | 401 | Signature verification failed | | Address not in allowList | 403 | Access denied by allowlist | | Payment not verified | 402 | Transfer not found or amount/recipient mismatch | | INTMAX network down | 503 | Payment verifier temporarily unavailable | | Auth verified | calls next() | req.intmax402 is populated |

Additional Exports

import {
  intmax402,
  verifySignature,
  initPaymentVerifier,
  verifyPayment,
  getPaymentVerifierAddress,
} from '@tanakayuto/intmax402-express'

initPaymentVerifier(config)

Manually initialize the INTMAX payment verifier (call once at server startup).

import { initPaymentVerifier } from '@tanakayuto/intmax402-express'

await initPaymentVerifier({
  eth_private_key: process.env.ETH_PRIVATE_KEY as `0x${string}`,
  environment: 'mainnet', // or 'testnet'
})

verifySignature(signature, nonce, address)

Low-level utility to verify an Ethereum signature against a nonce.

Returns: boolean

Network

| Environment | Network | Notes | |---|---|---| | mainnet (default) | Ethereum mainnet + Scroll | Production use | | testnet | Sepolia + Scroll Sepolia | Fund wallet at testnet.intmax.io |

License

MIT