Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

erc-800claw

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

erc-800claw

ERC-8004 SDK for OpenClaw agents. Register, query, and rate agent identities on Ethereum.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

ERC-800Claw

ERC-8004 SDK for OpenClaw agents. Register, query, and rate agent identities on Ethereum.

From Primer Systems · @primer_systems

npm install erc-800claw

Quick Start

CLI

# Get agent details
npx erc-800claw agent 1

# Check if agent exists
npx erc-800claw exists 1

# Get agent count for an address
npx erc-800claw owner 0x9ce7082814bDA389F3ba548BDf2626006279569c

# Register a new agent (requires private key)
PRIVATE_KEY=0x... npx erc-800claw register --name "My Agent" --network sepolia

# List networks and contracts
npx erc-800claw networks

# Show contract addresses
npx erc-800claw contracts mainnet

# Use testnet
npx erc-800claw agent 1 --network sepolia

# JSON output
npx erc-800claw agent 1 --json

JavaScript/TypeScript

const { createClient } = require('erc-800claw');

const client = createClient({ network: 'mainnet' });

// Get agent by ID
const agent = await client.getAgent(1);
console.log(agent);
// {
//   agentId: 1,
//   tokenURI: 'ipfs://...',
//   owner: '0x...',
//   metadata: { name: 'My Agent', ... },
//   explorerUrl: 'https://etherscan.io/...'
// }

// Check if agent exists
const exists = await client.agentExists(1);

// Get agent count for an address
const count = await client.getAgentCount('0x...');
console.log(`Address owns ${count} agents`);

// Register a new agent (no IPFS needed - uses data URI!)
const result = await client.registerAgent(process.env.PRIVATE_KEY, {
  name: 'My Autonomous Agent',
  description: 'Handles customer support',
  services: [{ name: 'support', endpoint: 'https://myagent.com/api' }]
});
console.log(`Registered agent #${result.agentId}`);

// Give feedback to an agent
await client.giveFeedback(process.env.PRIVATE_KEY, agentId, {
  value: 4.5,     // Score out of 5
  decimals: 1,
  tag1: 'support',
  tag2: 'fast'
});

API

createClient(options?)

Create a client instance.

const client = createClient({
  network: 'mainnet',  // or 'sepolia'
  rpcUrl: 'https://...'  // optional custom RPC
});

Read Methods

client.getAgent(agentId)

Get agent details by ID. Returns null if agent doesn't exist.

{
  agentId: 1,
  tokenURI: 'ipfs://...' | null,
  owner: '0x...',
  metadata: { ... } | null,  // Fetched from tokenURI if available
  explorerUrl: 'https://...'
}

client.agentExists(agentId)

Check if an agent exists. Returns true or false.

client.getAgentCount(ownerAddress)

Get number of agents owned by an address.

client.getReputation(agentId, options?)

Get reputation summary for an agent.

const rep = await client.getReputation(1, {
  clientAddresses: ['0x...'],  // Required: specific reviewers to query
  tag1: 'support',             // Optional: filter by tag
  tag2: ''
});

client.getNetworkInfo()

Get current network configuration.

Write Methods

All write methods require a private key for signing transactions.

client.register(privateKey, agentURIOrMetadata?)

Register a new agent. Pass a URI string or metadata object (auto-converted to data URI).

// With metadata object (recommended - no IPFS needed)
const result = await client.register(privateKey, {
  name: 'My Agent',
  description: 'Does cool stuff'
});

// With custom URI
const result = await client.register(privateKey, 'ipfs://...');

// Without URI (can set later)
const result = await client.register(privateKey);

client.registerAgent(privateKey, options)

Convenience method with structured options.

const result = await client.registerAgent(privateKey, {
  name: 'My Agent',           // Required
  description: 'Agent desc',  // Optional
  image: 'https://...',       // Optional
  services: [{                // Optional
    name: 'api',
    endpoint: 'https://...'
  }],
  supportedTrust: ['reputation']  // Optional, default: ['reputation']
});
// Returns: { agentId, txHash, owner, explorerUrl }

client.setAgentURI(privateKey, agentId, newURIOrMetadata)

Update an agent's metadata URI.

await client.setAgentURI(privateKey, agentId, {
  name: 'Updated Name',
  description: 'New description'
});

client.giveFeedback(privateKey, agentId, feedback)

Submit reputation feedback for an agent.

await client.giveFeedback(privateKey, agentId, {
  value: 4.5,              // Score value
  decimals: 1,             // Decimal places (default: 2)
  tag1: 'quality',         // Primary category
  tag2: 'fast',            // Secondary tag
  endpoint: '/api/chat',   // Which endpoint was used
  feedbackURI: '',         // Optional: link to detailed feedback
  feedbackHash: '0x...'    // Optional: hash of feedback data
});

Helper Functions

createDataURI(metadata)

Create a data URI from a metadata object (no IPFS upload needed).

const { createDataURI } = require('erc-800claw');
const uri = createDataURI({ name: 'My Agent', description: '...' });
// Returns: data:application/json;base64,...

parseDataURI(dataUri)

Parse a data URI back to a metadata object.

createRegistrationMetadata(options)

Create standard ERC-8004 registration metadata.

Networks

NetworkChain IDStatus
Ethereum Mainnet1Live
Sepolia Testnet11155111Live

Contract Addresses

Mainnet

  • Identity Registry: 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
  • Reputation Registry: 0x8004BAa17C55a88189AE136b182e5fdA19dE9b63

Sepolia

  • Identity Registry: 0x8004A818BFB912233c491871b3d84c89A494BD9e
  • Reputation Registry: 0x8004B663056A597Dffe9eCcC1965A193B7388713

What is ERC-8004?

ERC-8004 provides on-chain identity, reputation, and validation for autonomous agents:

  • Identity Registry - ERC-721 agent identities with registration metadata
  • Reputation Registry - Signed feedback scores between agents/clients
  • Validation Registry - Independent verification (zkML, TEE, stakers)

Learn more: 8004.org | EIP-8004

License

MIT - Primer Systems

Keywords

erc-8004

FAQs

Package last updated on 03 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts