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

@cdr-kit/core

v0.7.4

Published

Typed TS SDK for Story CDR: condition encoders, the CdrKitVault flow, and the 2-step pay->access helpers.

Downloads

83

Readme

@cdr-kit/core

Typed TypeScript SDK for Story CDR — condition encoders, the CdrKitVault flow, file storage adapters, error taxonomy + status union, mock kit.

This is the package every other cdr-kit package consumes. Everything is tree-shakable, every external integration is a lazy-loaded peer (Vite/Rollup-safe via new Function("s", "return import(s)")).


Install

pnpm add @cdr-kit/core viem

Mock mode (zero wallet, zero chain — tests + demos + docs)

import { createMockCdrKit } from "@cdr-kit/core";

const kit = createMockCdrKit({ threshold: 5, readDelayMs: 2400 });
const { uuid } = await kit.createVault({ data: new TextEncoder().encode("secret") });
const bytes = await kit.accessVault({
  uuid,
  onProgress: (p) => console.log(p.collected, "/", p.threshold),
});

Same status machine, same progress events as the live client. Used internally by cdrkit.xyz's docs demos.


Live (Aeneid testnet)

import { createCdrKitClient, createVault, accessVault } from "@cdr-kit/core";
import { aeneid } from "@cdr-kit/contracts";

const client = createCdrKitClient({
  privateKey: process.env.WALLET_PRIVATE_KEY as `0x${string}`,
  rpcUrl: "https://aeneid.storyrpc.io",
});

const txHash = await createVault(client, {
  readConditionAddr: aeneid.openCondition,
  readConfig: "0x",
  valueWei: 0n,
});
// ... read uuid from VaultCreated event, then:
const bytes = await accessVault(client, { uuid });

File storage adapters

Six production-ready adapters + 2 utility:

import {
  createPinataStorage,
  createSupabaseStorage,
  createIpfsStorage,
  createS3Storage,
  createStorachaStorage,
  createHeliaStorage,
  createMemoryStorage,
  createReadOnlyGatewayStorage,
  uploadFile,
  downloadFile,
} from "@cdr-kit/core";

// upload a >1KB payload (IPFS + CDR vault, single helper)
const { uuid, cid } = await uploadFile(client, {
  content: bytes,
  storage: createSupabaseStorage({ supabaseUrl, key, bucket: "cdr" }),
  readConditionAddr: aeneid.openCondition,
});

// read it back — pass skipCidVerification:true for non-IPFS storage handles
const { content } = await downloadFile(client, {
  uuid,
  storage,
  skipCidVerification: true,  // required for Supabase paths, S3 keys, …
});

0.7.1 note: downloadFile accepts skipCidVerification?: boolean. Pass true for Supabase / S3 / any non-IPFS handle — the SDK's default multibase CID check throws on arbitrary path strings.


Condition encoders

All Zod-validated — bad period / price / address inputs reject before tx:

import {
  encodeSubscriptionConfig,
  encodeTierGateConfig,
  encodeTierGateAux,
  encodeComposableConfig,
  encodeComposableAux,
  encodeTimeWindowConfig,
  encodeDeadManConfig,
  encodeEscrowConfig,
  encodeMultiSigConfig,
} from "@cdr-kit/core";

Errors + status

  • CdrError + CdrErrors factory — typed error class with discriminated code + cause chain
  • matchCdrStatus(status, handlers) — exhaustive switch over idle | connecting | paying | collecting-partials | ready | error | empty

Peer dependencies

  • viem ≥ 2.21
  • @cdr-kit/contracts ≥ 0.7.0
  • @piplabs/cdr-sdk (vendored transitive)
  • Optional: @aws-sdk/client-s3, @storacha/client, helia + @helia/unixfs — only if you use the corresponding adapter

Links