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

@peltier/core

v0.2.0

Published

Peltier protocol core — payment flows, EIP-712 signing, stealth derivation, API client, webhook + x402 primitives. React-free; runs in Node 18+, Bun, Deno, edge, browsers, and React Native.

Readme

@peltier/core

npm license

Any ERC-20 on any chain → USDC at your destination. This is the React-free protocol core every other Peltier package builds on: payment flow primitives, a fetch-based API client, EIP-712 signing, stealth-address derivation, webhook verification, and x402 wire types.

No React, no DOM, no node: imports — runs in Node 18+, Bun, Deno, edge runtimes, browsers, and React Native.

npm install @peltier/core viem

Which package do I want?

| You are building | Install | |---|---| | A backend (402 gate, webhooks, subscriptions) | @peltier/node — re-exports all of core | | A React web app | @peltier/react — widgets + hooks | | A React Native app | @peltier/react-native — RN widgets + hooks | | Anything else (CLI, agent, worker, custom UI) | this package |

Quickstart

import { createPeltierClient } from '@peltier/core'

const peltier = createPeltierClient({
  apiUrl: 'https://api.peltier.dev',
  publishableKey: 'pk_live_…', // or secretKey: 'sk_live_…' on a server
})

// Register a deposit session, then watch it settle
const session = await peltier.registerSession({ /* … */ })
peltier.watchSession(session.id, (update) => {
  console.log(update.status)
})

Every session / merchant / subscription method is bound to the one config object. The free functions (registerSession, watchSession, getQuote, createPaymentSession, …) remain exported as the low-level escape hatch — same behavior, explicit apiUrl argument.

What's inside

  • Flow primitives — deposit, request/receive (createRequestSession, buildOpenTokenIntent), send, and stealth flows; createBurnerWallet for ephemeral depositor keys.
  • API clientcreatePeltierClient plus free functions: registerSession, commitIntent, getQuote, fetchBalances, createPaymentSession, watchSession (SSE with automatic reconnect + polling fallback), and more.
  • EIP-712 signingsignIntent, signRefund, signStandingRefund, typed-data builders (intentTypedData, refundTypedData) that byte-match the on-chain PeltierDelegate contracts.
  • Stealth addresses — meta-address derivation, announcements, and withdrawal helpers for EVM and Solana (StealthMetaAddress, StealthKeys).
  • WebhooksverifyWebhookSignature(payload, signature, secret) (async) and verifyWebhookSignatureDetailed returning { ok, reason }.
  • x402parse402 and the X402Body / X402Accepts wire types for agent-side handling of HTTP 402 payment challenges.
  • SubscriptionssubscriptionTypedData, subscriptionId, and the typed REST surface for recurring on-chain charges.
  • Test mode — Stripe-style key parity: pk_test_ / sk_test_ keys route to testnets automatically (keyMode, chainsForMode, TESTNET_CHAINS).

Error handling

Every API call throws a typed PeltierApiError instead of a bare Error:

import { isPeltierApiError } from '@peltier/core'

try {
  await peltier.getSession(id)
} catch (err) {
  if (isPeltierApiError(err)) {
    // err.status, err.endpoint, err.kind: 'http' | 'network' | 'timeout' | 'parse'
  }
}

Every call also accepts trailing opts?: { timeoutMs?, signal?, fetch? } — default timeout 30 s.

Supported chains

Mainnet: Ethereum, Arbitrum, Base, Optimism, Polygon, Monad, HyperEVM (destination-only), and Solana (deposit source + settlement destination). Each EVM chain has a testnet counterpart reached automatically with pk_test_ / sk_test_ keys. Full matrix: peltier.dev/docs/supported-chains.

Docs

Full documentation lives at peltier.dev/docs.

License

MIT