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

subly402-sdk

v0.1.1

Published

Privacy-first x402 client SDK for Solana. Pay paid APIs through a TEE-based vault so on-chain observers never see the buyer-to-provider edge.

Readme

subly402-sdk

Privacy-first x402 client SDK for Solana. Pays paid APIs through a TEE-based vault so on-chain observers never see a direct buyer-to-provider edge.

  • subly402-svm-v1 scheme on top of the x402 HTTP envelope
  • Nitro attestation verification (PCR pinning required by default)
  • Batched vault settlement hides the sender / amount / timing correlation
  • Selective disclosure via hierarchical ElGamal audit records

Install

yarn add subly402-sdk

The default import path is the x402-like Buyer SDK and uses @solana/kit signers. Advanced direct-vault and audit helpers live behind subly402-sdk/vault and subly402-sdk/audit; those optional paths require the legacy Solana/Anchor dependencies.

Quickstart for Buyers

No Subly API key or account registration is required. A buyer only needs a funded Solana signer and the attestation policy for the facilitator they are willing to trust.

import { Subly402Client, wrapFetchWithPayment } from "subly402-sdk";
import { createKeyPairSignerFromBytes } from "@solana/kit";

const secretKeyBytes = Uint8Array.from(/* your 64-byte keypair */);
const signer = await createKeyPairSignerFromBytes(secretKeyBytes, true);

const client = new Subly402Client({
  signer,
  network: "solana:devnet",
  trustedFacilitators: ["https://enclave.example.com"],
  autoDeposit: {
    maxDepositPerRequest: "$0.05",
    deposit: async ({ amount, details }) => {
      // Send a vault deposit transaction for `amount`, then wait until the
      // facilitator observes it. Browser wallets, custodial wallets, and agents
      // can each plug in their own transaction implementation here.
      await depositIntoSublyVault({ amount, mint: details.asset.mint });
    },
  },
  nitroAttestation: {
    policy: {
      version: 1,
      pcrs: {
        "0": "<hex>",
        "1": "<hex>",
        "2": "<hex>",
        "3": "<hex>",
        "8": "<hex>",
      },
      eifSigningCertSha256: "<hex>",
      kmsKeyArnSha256: "<hex>",
      protocol: "subly402-svm-v1",
    },
  },
});

const fetchWithPayment = wrapFetchWithPayment(fetch, client);

const res = await fetchWithPayment("https://paid-api.example.com/resource");
const body = await res.json();

If the server returns HTTP 402, the client automatically:

  1. Downloads and verifies the Nitro attestation (fails closed unless PCR pinning is configured)
  2. Builds and signs the Subly x402 payment payload for the selected Solana payment option
  3. Retries the request with a signed PAYMENT-SIGNATURE
  4. If the vault balance is insufficient and autoDeposit is configured, deposits on demand, signs a fresh payment payload, and retries once more

If autoDeposit is disabled, the buyer must already have spendable balance in the Subly vault for the facilitator. The vault replaces direct buyer-to-seller settlement with batched settlement, which is the privacy layer.

Security defaults

  • verifyNitroAttestationDocument() throws if neither policy.pcrs nor expectedPcrs is configured. Callers who deliberately want to skip PCR pinning must set allowMissingPcrPinning: true.
  • The SDK verifies the enclave TLS public key hash against the attestation document, so a MITM that swaps certificates is rejected.
  • Receipt / withdrawal signatures are Ed25519-signed by the in-enclave vault signer.

See docs/quickstart.md for a full walkthrough and the current privacy threat model.

License

ISC