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

@pelletfi/sdk

v1.7.0

Published

Typed TypeScript client for the Pellet API — open-ledger intelligence on Tempo.

Readme

@pelletfi/sdk

Typed TypeScript client for the Pellet API — open-ledger intelligence on Tempo.

npm install @pelletfi/sdk

Quick start

import { Pellet } from "@pelletfi/sdk";

const pellet = new Pellet();

// Every stablecoin Pellet tracks
const { data: { stablecoins } } = await pellet.stablecoins();

// Per-stable scope is fluent
const usdc = pellet.stablecoin("0x20c000000000000000000000b9537d11c60e8b50");

const { data: peg } = await usdc.peg();
console.log(`USDC.e is at ${peg.current?.price_vs_pathusd} (${peg.current?.spread_bps} bps)`);

const { data: risk } = await usdc.risk();
console.log(`Composite risk: ${risk.composite}/100`);

const { data: roles } = await usdc.roles();
for (const role of roles.roles) {
  for (const h of role.holders) {
    console.log(`${role.role_name}: ${h.holder_label ?? h.holder}`);
  }
}

Reproducibility

Every response includes a meta object with everything you need to independently verify the data:

const { data, meta } = await pellet.stablecoin(addr).peg();

console.log(meta);
// {
//   methodologyVersion: "1.0",
//   computedAt: "2026-04-14T12:00:00Z",
//   method: "peg-aggregates-v1",
//   sourceBlock: 14710001,
//   sourceCall: "quoteSwapExactAmountIn(stable, pathUSD, 1e6)",
//   sourceContracts: ["0xdec0..."],
//   sourceTables: ["peg_samples", "peg_aggregates"],
//   freshnessSec: 60
// }

See pelletfi.com/docs/methodology for the full spec.

Time-travel queries

Peg, risk, reserves, peg-events, and flow-anomalies accept { asOf } to query historical state:

// ISO 8601 timestamp
await pellet.stablecoin(addr).peg({ asOf: "2026-04-13T00:00:00Z" });

// Or a relative duration (most convenient)
await pellet.stablecoin(addr).risk({ asOf: "24h" }); // 24 hours ago
await pellet.stablecoin(addr).reserves({ asOf: "7d" });

// Or a Date / unix seconds
await pellet.stablecoin(addr).pegEvents({ asOf: new Date("2026-04-10") });

The response meta.asOf confirms which frozen slice you got. Risk and reserves time-travel is served from append-only snapshot history — available from when your first cron tick after this was deployed.

Methods

| Method | Returns | | --- | --- | | pellet.stablecoins() | List of all tracked stables with risk inline | | pellet.stablecoin(addr).detail() | Single stablecoin metadata | | pellet.stablecoin(addr).peg() | Current peg + 1h/24h/7d aggregates | | pellet.stablecoin(addr).pegEvents(limit?) | Detected peg-break events timeline | | pellet.stablecoin(addr).risk() | Composite risk score + components | | pellet.stablecoin(addr).reserves() | Backing breakdown by reserve type | | pellet.stablecoin(addr).rewards() | TIP-20 reward pool: effective APY, top funders, distributions | | pellet.stablecoin(addr).roles() | Forensically-derived role holders | | pellet.flows({ hours? }) | Cross-stable flow data | | pellet.flowAnomalies({ limit? }) | Z-score-detected flow anomalies | | pellet.feeEconomics() | Which stables are elected as Tempo fee tokens + revenue share | | pellet.address(addr).lookup() | Address label / entity resolution | | pellet.system.health() | Pellet system health probe | | pellet.system.cronRuns() | Per-pipeline run history + 24h success rate |

Pellet Pro

If you have a Pellet Pro key, pass it on construction:

const pellet = new Pellet({ apiKey: "pk_live_..." });

This unlocks unlimited rate, paid endpoints (briefings) without MPP signing, and webhook subscription management.

MPP-paid endpoints

For pay-per-call access via the Micropayment Protocol (no API key, just an EVM key holding pathUSD), pass a custom fetch implementation built with mppx:

import { Pellet } from "@pelletfi/sdk";
import { Mppx, tempo } from "mppx/client";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const mppx = Mppx.create({ methods: [tempo({ account })] });

const pellet = new Pellet({ fetch: mppx.fetch });

Errors

All API errors throw PelletApiError with status, url, and message:

import { Pellet, PelletApiError } from "@pelletfi/sdk";

try {
  await pellet.stablecoin("0xnotreal").peg();
} catch (e) {
  if (e instanceof PelletApiError) {
    console.log(e.status); // 400
    console.log(e.url);    // https://pelletfi.com/api/v1/stablecoins/0xnotreal/peg
  }
}

Links

MIT License.