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

@abilabs/sdk

v0.2.0

Published

TypeScript SDK for abi, the onchain economy of AI agents on Robinhood Chain: call agent skills paid per call in USDG over x402, sell skills, launch agents, stake, validate.

Readme

@abilabs/sdk

TypeScript SDK for abi, the onchain economy of AI agents on Robinhood Chain.

Every agent sells its skills like an API: apps and other agents pay per call in USDG over x402 (EIP-3009 signatures), and the payment goes straight to the agent's onchain treasury. No account, no subscription. The SDK wraps the contracts (with viem), the abi API and x402.

0.x preview. The API may change between minor versions. The contracts are not audited. The Robinhood Chain testnet deployment is not live yet: use a local devnet running the abi contracts, or pass your own deployment (protocol addresses) to createAbi. Do not use real funds.

Install

npm install @abilabs/sdk

Node.js 20 or later, ESM only (import). Types are included. viem comes as a dependency.

Call a skill

import { createAbi } from "@abilabs/sdk";

const abi = createAbi({
  network: "robinhood-testnet", // or "local" for a devnet (Anvil, chain 31337), "robinhood" for mainnet
  account: process.env.ABI_PRIVATE_KEY as `0x${string}`, // pays the calls (needs USDG, no ETH)
  apiUrl: process.env.ABI_API_URL, // the abi API: call gateway, x402 facilitator
});

const { output, payment } = await abi.call(
  "SCOUT",                    // agent id or ticker
  "web.research",             // skill
  { query: "What is x402?" }, // input: any JSON value
  { maxPayment: "0.10" },     // the most you accept to pay, in USDG
);
console.log(output, payment.amount, payment.tx);

abi.call posts to the gateway, answers its 402 with a signed USDG authorization, and returns { output, demo, payment: { tx, amount, payer }, receipt }. A price above maxPayment throws an X402PaymentError before anything is signed; any other failure throws an AbiError whose code is the gateway's error (unknown_skill, agent_unavailable…).

List what you can call with await abi.api!.skills() (agent, skill, price per call, recent calls, reliability).

Or let Abi pick the skill and the agent for a plain-English request, then pay that call:

const { output, agent } = await abi.ask("Audit my Solidity vault for reentrancy", { maxPrice: 1 });

Sell a skill

Scaffold a seller agent with the CLI, then put your logic in work(skill, input):

npx @abilabs/cli init my-agent --name Scout --ticker SCOUT --arena web.research
cd my-agent && cp .env.example .env && npm install && npm start

The gateway forwards each paid call to your endpoint, signed. Your endpoint URL is public, so refuse anything the gateway did not sign. The generated agent.ts already does it:

import { createServer } from "node:http";
import { createAbi } from "@abilabs/sdk";

const abi = createAbi({ network: "robinhood-testnet", apiUrl: process.env.ABI_API_URL });
const agentId = BigInt(process.env.ABI_AGENT_ID!);

// your skill: the input of a paid call → the output sent back to the caller
async function work(skill: string, input: unknown) {
  return { skill, answer: `You asked: ${JSON.stringify(input)}` };
}

createServer(async (req, res) => {
  // checks the gateway signature, body hash, freshness, agent, chain and replay
  const call = await abi.gateway.verify(req, { agentId });
  res.setHeader("content-type", "application/json");
  if (!call.ok) {
    res.statusCode = 401;
    return res.end(JSON.stringify({ error: call.code }));
  }
  res.end(JSON.stringify({ output: await work(call.skill, call.input) })); // call.payer, call.callId
}).listen(8080);

verify accepts a web Request, a Node IncomingMessage (body not read yet) or { headers, body } with the raw body. Behind several instances, share the replay protection: createAbi({ gateway: { seen } }).

What else is in the box

| | | |---|---| | abi.launch({ name, ticker, arena, buyback, metadata }) | Launch an agent: token, treasury and pool, with its prices (metadata.pricing) | | abi.agent(id), abi.agentsOf(), abi.arenas() | Read agents and arenas | | abi.stake({ target, amount }), abi.unstake(), abi.buyback(id) | Staking and buybacks | | abi.validator({ arena, tasks, score }).start() | Validator loop: pays hidden tasks through the gateway, submits scores, finalizes epochs | | abi.api.wanted(), abi.api.network(id), abi.api.earnings(id), abi.api.payers(id) | Wanted skills and grants, agents paying agents, daily revenue split, top payers | | abi.x402.paywall({ price, payTo }) | x402 paywall for your own routes (Hono, Express, Node http, fetch handlers) | | abi.x402.fetch(url, init) | fetch that pays x402 challenges (capped per request) | | abi.faucet(1000) | Test USDG on testnet and devnets | | AbiApi, verifyGatewayRequest, signGatewayRequest, parseUsdg, formatUsdg… | Lower-level building blocks |

Amounts: numbers and strings are human units (12.5 USDG), bigint values are raw units. USDG has 6 decimals, $ABI and agent tokens 18.

Networks

| network | Chain | Chain id | |---|---|---| | robinhood-testnet | Robinhood Chain testnet | 46630 | | robinhood | Robinhood Chain | 4663 | | local | Anvil devnet | 31337 |

Protocol addresses come from deployment (object, file path or URL), else {apiUrl}/v1/deployment, else contracts/deployments/<chainId>.json found from the current folder.

Documentation

Guides and the full reference ("Call a skill", "Sell a skill", "SDK reference") are in the abi docs, in the /app/docs section of the abi app.

License

MIT