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

@agentic-trust/8004-sdk

v1.0.42

Published

ERC-8004 Trustless Agents SDK - A TypeScript SDK for interacting with ERC-8004 compliant implementations

Readme

ERC-8004 Trustless Agents SDK

A TypeScript SDK for interacting with ERC-8004 compliant implementations. This SDK makes zero assumptions beyond what the ERC-8004 specification says, treating all "MAY" fields as optional rather than mandatory.

Features

  • ERC-8004 Compliant: Implements the full ERC-8004 specification for trustless agents
  • Multi-Adapter Support: Works with different blockchain libraries (Ethers.js, Viem)
  • TypeScript First: Full TypeScript support with comprehensive type definitions
  • Modular Design: Use only the components you need
  • Zero Assumptions: Follows the spec exactly, no opinionated defaults

Installation

npm install @agentic-trust/8004-sdk
# or
yarn add @agentic-trust/8004-sdk
# or
pnpm add @agentic-trust/8004-sdk

Quick Start

import { ERC8004Client, EthersAdapter } from '@agentic-trust/8004-sdk';
import { ethers } from 'ethers';

// Create an adapter for your preferred blockchain library
const provider = new ethers.JsonRpcProvider('https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY');
const adapter = new EthersAdapter(provider);

// Initialize the SDK
const client = new ERC8004Client({
  adapter,
  addresses: {
    identityRegistry: '0x...',
    reputationRegistry: '0x...',
    // ... other contract addresses
  }
});

// Use the client
const identity = await client.identity.getTokenURI(tokenId);
const reputation = await client.reputation.getReputationScore(agentAddress);

Core Components

ERC8004Client

The main client that provides access to all ERC-8004 functionality:

import { ERC8004Client } from '@agentic-trust/8004-sdk';

const client = new ERC8004Client({
  adapter: yourAdapter,
  addresses: {
    identityRegistry: '0x...',
    reputationRegistry: '0x...',
  }
});

// Access different modules
const identity = client.identity;
const reputation = client.reputation;
const validation = client.validation;

IdentityClient

Handles identity-related operations:

import { IdentityClient } from '@agentic-trust/8004-sdk';

const identityClient = new IdentityClient(adapter, identityRegistryAddress);

// Get token URI for an identity
const tokenURI = await identityClient.getTokenURI(tokenId);

// Get owner of an identity
const owner = await identityClient.getOwner(tokenId);

// Check if an identity exists
const exists = await identityClient.exists(tokenId);

ReputationClient

Manages reputation scoring and feedback:

import { ReputationClient } from '@agentic-trust/8004-sdk';

const reputationClient = new ReputationClient(adapter, reputationRegistryAddress);

// Get reputation score
const score = await reputationClient.getReputationScore(agentAddress);

// Give feedback
await reputationClient.giveFeedback({
  agent: agentAddress,
  score: 5,
  feedback: "Excellent service!",
  metadata: { category: "quality" }
});

// Get feedback history
const feedback = await reputationClient.getFeedbackHistory(agentAddress);

ValidationClient

Provides validation utilities:

import { ValidationClient } from '@agentic-trust/8004-sdk';

const validationClient = new ValidationClient(adapter);

// Validate agent metadata
const isValid = await validationClient.validateAgentMetadata(metadata);

// Validate reputation score
const isValidScore = validationClient.validateReputationScore(score);

Adapters

The SDK uses an adapter pattern to support different blockchain libraries:

EthersAdapter

import { EthersAdapter } from '@agentic-trust/8004-sdk';
import { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider('https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY');
const adapter = new EthersAdapter(provider);

Custom Adapter

You can create your own adapter by implementing the BlockchainAdapter interface:

import { BlockchainAdapter } from '@agentic-trust/8004-sdk';

class MyCustomAdapter implements BlockchainAdapter {
  async call(contractAddress: string, abi: any, functionName: string, args: any[]): Promise<any> {
    // Your implementation
  }
  
  async send(contractAddress: string, abi: any, functionName: string, args: any[], options?: any): Promise<string> {
    // Your implementation
  }
  
  // ... implement other required methods
}

Types

The SDK exports comprehensive TypeScript types:

import type {
  AgentMetadata,
  ReputationScore,
  FeedbackData,
  IdentityData,
  BlockchainAdapter,
  ContractAddresses
} from '@agentic-trust/8004-sdk';

Contract Addresses

You'll need to provide contract addresses for your target network:

const addresses: ContractAddresses = {
  identityRegistry: '0x...',    // ERC-8004 Identity Registry
  reputationRegistry: '0x...',  // ERC-8004 Reputation Registry
  // Add other contract addresses as needed
};

Supported Networks

  • Ethereum Mainnet
  • Ethereum Sepolia (testnet)
  • Base Sepolia (testnet)
  • Optimism Sepolia (testnet)
  • Any EVM-compatible network with ERC-8004 contracts deployed

Development

Building

npm run build

Development Mode

npm run dev

Cleaning

npm run clean

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Changelog

v1.0.0

  • Initial release
  • Full ERC-8004 specification support
  • Ethers.js adapter
  • TypeScript definitions
  • Comprehensive documentation