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

@b402ai/solana

v0.0.24

Published

Private DeFi on Solana — shielded pool + composable adapters + agent-callable surface

Readme

@b402ai/solana

Private DeFi on Solana. Shielded balances + composable adapters + agent-callable surface.

npm install @b402ai/solana

What it does

  • Shield SPL tokens into a private balance
  • Unshield to any public address
  • Private swap through registered adapters (Jupiter on mainnet, mock on devnet)
  • Private lend USDC into Kamino V2 from a shielded note (per-user obligation, mainnet)
  • Private redeem a kUSDC voucher back into a shielded USDC note (mainnet)
  • Read your private balance / per-deposit holdings without leaking ZK plumbing
  • Watch for new private deposits via cursor-based polling
  • Quote swaps via Jupiter Lite API before executing

Quick start

Three-line private swap on mainnet:

import { B402Solana } from '@b402ai/solana';
import { Keypair, PublicKey } from '@solana/web3.js';

const b402 = new B402Solana({ cluster: 'mainnet', rpcUrl, keypair });
await b402.ready();

const USDC = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');
const SOL  = new PublicKey('So11111111111111111111111111111111111111112');

// Move public USDC into the shielded pool (user signs, one-time).
await b402.shield({ mint: USDC, amount: 1_000_000n });

// Private swap. Hosted relayer signs + pays gas; user wallet stays off-chain.
const { signature, outAmount } = await b402.swap({
  inMint: USDC, outMint: SOL, amount: 1_000_000n,
});

Full walkthrough: docs/getting-started.md. Runnable example: examples/quickstart-private-swap.ts.

Lend privately on Kamino

b402.lend() auto-discovers the deepest Kamino reserve for the mint across all 182 LendingMarkets — no static reserve list. Pass market to pin a specific one.

const lend = await b402.lend({ mint: USDC, amount: 1_000_000n });
const redeem = await b402.redeem({ mint: USDC });

Withdraw to a different recipient

// The SOL note from `swap` can land at ANY public address — breaking
// the on-chain edge between depositor and recipient.
await b402.unshield({ to: someOtherWallet, mint: SOL });

For a working scaffold:

npx @b402ai/create-agent my-agent

Agent loop

let cursor: string | undefined;
while (running) {
  const r = await b402.watchIncoming({ cursor });
  cursor = r.cursor;
  for (const d of r.incoming) console.log('new deposit:', d.amount, d.mint);
  await sleep(2_000);
}

MCP

Same surface is exposed as agent-callable MCP tools via @b402ai/solana-mcp — works with Claude Code, Cursor and any MCP runtime.

License

Apache-2.0. See LICENSE.