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

@katanga/sdk-buyer

v0.2.0

Published

Buyer agent SDK for the Katanga agent-to-agent marketplace protocol on Flare Network.

Readme

@katanga/sdk-buyer

Buyer agent SDK for the Katanga agent-to-agent marketplace protocol on Flare Network.

Install

npm install @katanga/sdk-buyer

Usage

import { BuyerAgent, ManualDemandAdapter } from "@katanga/sdk-buyer";

const agent = new BuyerAgent({
  publicClient,
  walletClient,
  marketAddress: "0x...",
  escrowAddress: "0x...",
  reputationAddress: "0x...",
  paymentToken: "0x...",
  fdcNetwork: "coston2", // Enable XRP purchases via FDC
  purchasing: {
    maxOrderValueUSD: 1000,
    maxDailySpendUSD: 10000,
    autoConfirmDeliveryDays: 12,
  },
});

// Discover listings
const results = await agent.discover({
  category: "electronics",
  maxPriceUSD: 100,
  minReputationScore: 10,
});

// Purchase with EVM token
const escrowId = await agent.purchase(
  results[0].listing.id, 1n,
  "123 Main St, Austin TX", parseUnits("50", 6),
);

// OR purchase with native XRP via FDC (~3-5 min attestation)
const { escrowId, fdcRoundId } = await agent.purchaseViaXrp(
  results[0].listing.id, 1n,
  "123 Main St, Austin TX", "XRPL_TX_HASH...",
);

Settlement Rails

| Rail | Method | Time | Description | |------|--------|------|-------------| | EVM | purchase() | ~30s | ERC-20 token (eUSDT) on Flare | | x402 | purchaseViaX402() | ~30s | XRPL via HTTP facilitator | | FDC | purchaseViaXrp() | ~3-5 min | Native XRP verified on-chain via Flare Data Connector |

Demand Loop (Autonomous Purchasing)

const agent = new BuyerAgent({
  // ...config
  demandSource: new ManualDemandAdapter({ filePath: "./demand.json" }),
});

// Start autonomous purchasing
await agent.startDemandLoop();
// Agent now: polls demand signals → discovers listings → filters by rules →
// purchases → reports back → auto-confirms delivery after N days

Demand Adapters

| Adapter | Description | |---------|-------------| | ManualDemandAdapter | In-memory queue or JSON file. For testing and simple integrations. | | WebhookDemandAdapter | HTTP webhook receiver. For ERP/WMS push integration. |

Runner

Deploy as a long-running service:

KATANGA_CHAIN_ID=114 \
KATANGA_PRIVATE_KEY=0x... \
KATANGA_PAYMENT_TOKEN=0xC1A5B41... \
KATANGA_DEMAND_SOURCE=manual \
KATANGA_DEMAND_FILE=./demand-signals.json \
KATANGA_FDC_NETWORK=coston2 \
pnpm runner

Agent Features

  • Demand loop — polls ManualDemandAdapter or WebhookDemandAdapter for purchase signals
  • Supplier scoring — 40% price + 60% reputation composite score
  • Budget enforcement — max order value, daily spend cap, supplier allow/block lists
  • Auto-confirm delivery — hourly check, confirms after autoConfirmDeliveryDays with on-chain state verification
  • FDC XRP purchases — full Flare Data Connector flow (request → wait → retrieve proof → on-chain verify)
  • x402 settlement — XRPL facilitator-based payment alternative

License

MIT