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

@kweela/fiber-ledger

v0.1.6

Published

A CKB ledger with Fiber payment channels: embedded wallets, capacity and xUDT balances, and off-chain settlement

Downloads

1,085

Readme

Fiber Ledger by Kweela

Downloads Deploy Documentation CI

A utility for building wallets, balances, transfers, deposits and withdrawals on Nervos CKB, with optional fast payments over Fiber.

It keeps CKB and Fiber implementation details inside the package so applications can work with a compact ledger API instead of dealing directly with cells, locks, scripts, transaction construction, signing, fees, RPC calls or payment channels.

It implements the @kweela/ledger interface, which it also depends on at runtime.

📖 Documentation

Install

pnpm add @kweela/ledger @kweela/fiber-ledger

Node 20 or newer is required.

React applications that connect browser or mobile wallets also install the connector peer:

pnpm add @ckb-ccc/connector-react react

Basic usage

import { createFiberLedger } from '@kweela/fiber-ledger'
import { Amount } from '@kweela/ledger'

const ledger = createFiberLedger({
  network: 'mainnet',

  fiber: {
    url: process.env.FIBER_RPC_URL,
    routeFor: lookUpFiberNode,
  },
})

Create a wallet. Its reference is its CKB address, and the custody material it returns is the application's to store.

const wallet = await ledger.createWallet({
  ownerKey: user.id,
  idempotencyKey: `wallet:${user.id}`,
})

await store.saveEncrypted(wallet.reference, wallet.secret)

Read operations only need the reference.

const balance = await ledger.balance({
  reference: wallet.reference,
})

Operations that spend require the corresponding secret.

await ledger.transfer({
  from: {
    reference: wallet.reference,
    secret: await store.openSecret(wallet.reference),
  },

  to: {
    address: recipient,
  },

  amount: Amount.units('100', ledger.asset),

  idempotencyKey: `payment:${payment.id}`,
})

Submitting a CKB transaction does not immediately make it final.

const status = await ledger.settlement({
  reference: transaction.reference,
})
// 'submitted' until it reaches the configured confirmation depth, then 'settled'

The ledger handles the CKB and Fiber-specific work internally and exposes a small set of operations for the application.

What else it does

  • Asset modes — native CKB, or a token stored on CKB through xUDT or sUDT
  • Wallets and custody — creating, importing, exporting, and wallets controlled elsewhere
  • React wallet connector — JoyID, Neuron, compatible wallets, approval requests, and lifecycle events
  • Fiber — fast off-chain payments, and falling back to the chain when no route exists
  • Idempotency — making retries safe before moving real value
  • Errors — the fixed set of failures CKB and Fiber conditions are translated into

Development

pnpm test     # unit tests; no CKB or Fiber node required
pnpm check    # lint, type check, tests and the production build
pnpm docs:dev # the documentation site

Tests that interact with a real CKB environment require a configured node and funded test wallet.

FIBER_LEDGER_TEST_URL=http://127.0.0.1:8114 \
FIBER_LEDGER_TEST_FAUCET_KEY=0x... \
pnpm test

When the required environment is unavailable, they report themselves as skipped rather than silently passing.

License

MIT