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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@reap-protocol/sdk

v0.1.3

Published

**The official TypeScript/Node.js SDK for the Reap Protocol: The Agentic Commerce Grid.**

Readme

@reap-protocol/sdk

The official TypeScript/Node.js SDK for the Reap Protocol: The Agentic Commerce Grid.

The Reap Protocol enables AI Agents to search for products, register them on-chain, and execute atomic purchases without needing to understand smart contract ABIs. It acts as the bridge between Web2 products data and Web3 commerce settlement.

📦 Installation

npm install @reap-protocol/sdk ethers axios

🚀 Quick Start

This example demonstrates the full Agentic Commerce Loop: Identity -> Discovery -> Settlement.

1. Setup

If using TypeScript, ensure your tsconfig.json targets ES2020 or higher.

2. The Agent Code (agent.ts)

import { ReapClient } from "@reap-protocol/sdk";

// Load your private key securely
const PRIVATE_KEY = process.env.MY_WALLET_KEY || "";

async function main() {
  // 1. Initialize the Agent
  // (Points to official middleware by default)
  const client = new ReapClient(PRIVATE_KEY);
  console.log("🤖 Agent Online");

  try {
    // 2. Identity (One-time setup)
    // Registers your wallet as an authorized Agent on the Protocol
    console.log("🆔 Checking Identity...");
    await client.registerIdentity();

    // 3. JIT Stocking (Discovery)
    // Searches Web2 (Reap Deals), registers items on-chain, and returns inventory
    console.log("📦 Stocking Shelf with 'Gaming Laptop'...");
    const result = await client.stockShelf("Gaming Laptop");
    
    const inventory = result.items;
    console.log(`   🔍 Found ${inventory.length} items on-chain.`);

    if (inventory.length > 0) {
        // 4. Decision Logic
        // Example: Pick the first available item
        const target = inventory[0];
        console.log(`   🎯 Selected: ${target.name} ($${target.price})`);
        console.log(`      ID: ${target.id}`);

        // 5. Agentic Cart (Settlement)
        // Automatically approves USDC and executes the atomic purchase
        console.log("💸 Buying Item...");
        const receipt = await client.buyProduct(target.id);
        
        if (receipt) {
            console.log(`🎉 SUCCESS! Transaction Hash: ${receipt.hash}`);
        }
    } else {
        console.log("❌ No items found.");
    }

  } catch (e: any) {
    console.error("❌ Error:", e.message);
  }
}

main();

3. Run It

# Install execution tools if you haven't already
npm install --save-dev ts-node typescript @types/node

# Run
npx ts-node agent.ts

🔧 Configuration

You can override defaults for custom RPCs or self-hosted middleware.

const client = new ReapClient(
  "YOUR_PRIVATE_KEY",
  "https://base-sepolia.g.alchemy.com/v2/YOUR_KEY", // Custom RPC
  "https://api.reap.deals"    // Middleware URL
);

✨ Features

  • JIT Stocking: "Just-In-Time" inventory system. If an agent searches for an item not yet on the blockchain, the Protocol indexes it in real-time.
  • Agentic Cart: Automatically routes purchases through the Protocol's batch processor.
  • Protocol Negotiation: Built-in support for HTTP 402 Payment Negotiation loops.
  • Gas Optimized: Checks on-chain state before sending registration transactions.

License

MIT