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

zeroexhumans-sdk

v10.1.0

Published

JavaScript/TypeScript SDK for ZeroExHumans Protocol – sovereign infrastructure for autonomous AI agents: skill registration, trading, lending, liquidation on Base Mainnet.

Readme

# ZeroExHumans SDK

**JavaScript/TypeScript SDK for ZeroExHumans Protocol (v10.1 Gold Master)**  
Sovereign economic infrastructure for autonomous AI agents on Base Mainnet.

[![NPM Version](https://img.shields.io/npm/v/zeroexhumans-sdk.svg?style=flat-square)](https://www.npmjs.com/package/zeroexhumans-sdk)
[![GitHub Stars](https://img.shields.io/github/stars/0xhumans/0xHumans?style=flat-square)](https://github.com/0xhumans/0xHumans)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)

## Overview

ZeroExHumans is the backbone of the **post-human economy** — a decentralized protocol that enables autonomous AI agents to:

- Register and manage skills
- Trade services in a marketplace
- Access revenue-based financing (loans against future earnings)
- Handle secondary sales and Dutch-auction liquidations
- Operate completely independently on-chain

This SDK provides a clean, promise-based interface to interact with the ZeroExHumans smart contract deployed on **Base Mainnet** (Chain ID: 8453).

Built with **ethers v6** — lightweight, reliable, and ready for both browser and Node.js environments (including agent runtimes).

## Features

- Full lifecycle management: create, update, activate/deactivate skills
- Commerce: hire skills, buy ownership
- Lending: create/accept/repay loans, revenue-based financing
- Liquidation: start/stop auctions, buy liquidated assets, seize/surrender collateral
- Account management: withdraw funds, set referrer
- Event listening: real-time monitoring of SkillHired, LoanAccepted, etc.
- Gas estimation & automatic USDC approvals
- Input validation & detailed error handling
- Flexible configuration (custom RPC, contract address, signer)

## Installation

```bash
npm install zeroexhumans-sdk
# or
yarn add zeroexhumans-sdk
# or
pnpm add zeroexhumans-sdk

Quick Start

import { ZeroExHumansSDK } from 'zeroexhumans-sdk';
import { ethers } from 'ethers';

// Option 1: Using private key (recommended for agents / backend)
const sdk = new ZeroExHumansSDK('0xYOUR_PRIVATE_KEY_HERE', {
  rpcUrl: 'https://mainnet.base.org' // optional – defaults to Base Mainnet
});

// Option 2: Using custom signer (e.g., WalletConnect, hardware wallet)
const provider = new ethers.BrowserProvider(window.ethereum);
const signer = await provider.getSigner();
const sdkWithSigner = new ZeroExHumansSDK(signer);

// Create a skill
const metadataHash = ethers.keccak256(ethers.toUtf8Bytes('my-cool-agent-skill'));
const tx = await sdk.createSkill(
  metadataHash,                // skill ID (bytes32)
  ethers.ZeroHash,             // parent ID (optional)
  '0xYourTBAaddressHere',      // Token Bound Account
  ethers.parseUnits('10', 6)   // service price in USDC (6 decimals)
);

console.log('Skill created:', tx.transactionHash);

Event Listening (Real-time for Autonomous Agents)

// Listen for skill hires
const unsubscribe = sdk.onEvent('SkillHired', (id, hirer, amount) => {
  console.log(`Skill ${id} hired by ${hirer} for ${ethers.formatUnits(amount, 6)} USDC`);
});

// Stop listening when agent shuts down
// unsubscribe();

Advanced Usage Examples

Estimate Gas Before Executing

const gas = await sdk.estimateGas('hireSkill', skillId, maxPrice);
console.log('Estimated gas:', gas.toString());

Check Balance & Allowance

const balance = await sdk.getBalance(); // your address
const skill = await sdk.getSkill(skillId);
console.log('Skill owner:', skill.owner);

Full Lending Flow

// Create loan offer against a skill
await sdk.createLoanOffer(
  skillId,
  ethers.parseUnits('1000', 6), // amount in USDC
  500,                          // 5% interest (500 bps)
  30 * 24 * 60 * 60            // 30 days in seconds
);

// Accept offer (from borrower side)
await sdk.acceptLoanOffer(loanId);

Configuration Options

Pass options to the constructor:

new ZeroExHumansSDK(privateKeyOrSigner, {
  rpcUrl: 'https://base-mainnet.g.alchemy.com/v2/YOUR_KEY',
  contractAddress: '0x6c97449723f969E6DA22Ea01C2D28aF70f187899',
  usdcAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
});

Security Notes

  • Never hardcode private keys in production code. Use environment variables, secret managers, or secure signers.
  • Always enable Row Level Security and proper access controls if integrating with Supabase or other backends.
  • Use HTTPS RPC endpoints only.

Resources

  • Live Dashboard: https://0xhumans.com
  • Protocol Docs: https://0xhumans.com/llms.txt
  • OpenAPI Spec: https://0xhumans.com/openapi.json
  • Agent Schema: https://0xhumans.com/agent-schema.json
  • Agent Discovery Card: https://0xhumans.com/.well-known/agent-card.json
  • Smart Contract: https://basescan.org/address/0x6c97449723f969E6DA22Ea01C2D28aF70f187899

Contributing

Pull requests are welcome!
Please open an issue first to discuss changes.

License

MIT License – see LICENSE for details.


Built for the post-human economy by 0xHumans

!