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

@erc8001/sdk

v1.0.0

Published

TypeScript SDK for ERC-8001 Agent Coordination Framework

Readme

@erc8001/sdk

Installation

npm install @erc8001/sdk viem

Quick Start

import { CoordinationClient, BoundedClient } from '@erc8001/sdk';
import { createPublicClient, createWalletClient, http } from 'viem';
import { baseSepolia } from 'viem/chains';
import { privateKeyToAccount } from 'viem/accounts';

// Setup clients
const account = privateKeyToAccount('0x...');
const publicClient = createPublicClient({ chain: baseSepolia, transport: http() });
const walletClient = createWalletClient({
    account,
    chain: baseSepolia,
    transport: http()
});

// Create coordination client
const coordination = new CoordinationClient({
    contractAddress: '0x...', // Your deployed AgentCoordination contract
    publicClient,
    walletClient,
});

// Propose a coordination
const { intentHash, payload } = await coordination.propose({
    agentId: account.address,
    participants: ['0xAlice...', '0xBob...'],
    coordinationType: 'TRADE_V1',
    payload: {
        version: '0x' + '01'.padStart(64, '0'),
        coordinationType: '0x...',
        coordinationData: '0x...',
        conditionsHash: '0x' + '0'.repeat(64),
        metadata: '0x',
    },
});

console.log('Proposed:', intentHash);

// Accept as a participant
const { txHash } = await coordination.accept(intentHash);
console.log('Accepted:', txHash);

// Wait for all participants to accept
const status = await coordination.waitForReady(intentHash);
console.log('Ready for execution!');

// Execute
const { txHash: execTx } = await coordination.execute(intentHash, payload);
console.log('Executed:', execTx);

Bounded Execution

Add spending limits and policy constraints to agent actions:

import { BoundedClient } from '@erc8001/sdk';
import { parseEther, encodeFunctionData } from 'viem';

const bounded = new BoundedClient({
    contractAddress: '0x...', // Your deployed BoundedExecution contract
    publicClient,
    walletClient,
});

// Register a policy
const { policyId } = await bounded.registerPolicy({
    agent: '0xAgent...',
    actions: [
        { target: '0xVault...', selector: '0xa9059cbb' }, // transfer
        { target: '0xVault...', selector: '0x095ea7b3' }, // approve
    ],
    spendingLimit: parseEther('10'),
    maxCalls: 100,
    durationSeconds: 86400, // 1 day
});

// Execute within bounds
const callData = encodeFunctionData({
    abi: [...],
    functionName: 'transfer',
    args: [recipient, amount],
});

const { success } = await bounded.execute(policyId, {
    target: '0xVault...',
    callData,
    value: parseEther('1'),
});

Core Concepts

Coordination Flow

propose → accept (all participants) → execute
  1. Propose: Initiator signs an EIP-712 intent with required participants
  2. Accept: Each participant signs an acceptance attestation
  3. Execute: Once all accept, anyone can trigger execution

Participant Canonicalization

Participants must be sorted ascending by address:

import { canonicalizeParticipants } from '@erc8001/sdk';

const sorted = canonicalizeParticipants(['0xBob...', '0xAlice...']);
// Returns ['0xAlice...', '0xBob...'] (sorted by uint160)

Coordination Types

import { CoordinationTypes, coordinationType } from '@erc8001/sdk';

// Built-in types
CoordinationTypes.TRADE      // keccak256("ERC8001.TRADE_V1")
CoordinationTypes.SWAP       // keccak256("ERC8001.SWAP_V1")
CoordinationTypes.PAYMENT    // keccak256("ERC8001.PAYMENT_V1")

// Custom types
const myType = coordinationType('MY_CUSTOM_COORD_V1');

EIP-712 Signing

import {
    createDomain,
    signIntent,
    signAcceptance,
    computeIntentStructHash,
} from '@erc8001/sdk';

// Create domain
const domain = createDomain(84532n, '0xContract...');

// Sign intent
const signature = await signIntent(walletClient, domain, intent);

// Compute intent hash (for acceptances)
const intentHash = computeIntentStructHash(intent);

// Sign acceptance
const attestation = await signAcceptance(walletClient, domain, {
    intentHash,
    participant: account.address,
    nonce: 0n,
    expiry: BigInt(Math.floor(Date.now() / 1000) + 3600),
    conditionsHash: '0x' + '0'.repeat(64),
});

API Reference

CoordinationClient

| Method | Description | |--------|-------------| | propose(options) | Propose a new coordination | | accept(intentHash) | Accept a coordination | | execute(intentHash, payload) | Execute a ready coordination | | cancel(intentHash, reason) | Cancel a coordination | | getStatus(intentHash) | Get coordination status | | getAgentNonce(agentId) | Get agent's current nonce | | waitForReady(intentHash) | Wait for all acceptances |

BoundedClient

| Method | Description | |--------|-------------| | registerPolicy(options) | Register a new policy | | execute(policyId, action) | Execute within bounds | | revokePolicy(policyId) | Revoke a policy | | getPolicy(policyId) | Get policy details | | verifyBounds(...) | Check if action is allowed |

Utilities

| Function | Description | |----------|-------------| | canonicalizeParticipants(addresses) | Sort addresses ascending | | createIntent(options, nonce) | Build an AgentIntent | | createAttestation(options) | Build an AcceptanceAttestation | | computeBoundsRoot(actions) | Compute Merkle root for actions | | generateProof(actions, index) | Generate Merkle proof |

Contract Addresses

Base Sepolia (84532)

| Contract | Address | |----------|---------| | AgentCoordination | 0x... | | BoundedExecution | 0x... |

Resources

License

MIT