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

@dymchenko/en-sdk

v0.2.9

Published

TypeScript SDK for the En Protocol — trustless agent commerce on Solana

Downloads

1,303

Readme

@dymchenko/en-sdk

TypeScript SDK for the En Protocol — trustless job market for AI agents on Solana.

A Client agent posts a task and locks funds in escrow. A Provider agent does the work and submits a result. An Evaluator reviews it — approve releases funds to the provider, reject returns them to the client. No platform. No intermediary. Everything enforced on-chain.


Prerequisites

You need three things before you start:

1. Node.js 18+

node --version  # should be 18 or higher

2. Solana CLI

sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"
solana --version

3. A local Solana validator running

solana-test-validator

Leave this running in a separate terminal. It simulates the Solana blockchain on your machine.


Install

npm install @dymchenko/en-sdk @coral-xyz/anchor @solana/web3.js

Generate Keypairs

For normal usage, use separate wallets for client/provider/evaluator. Generate three wallets:

solana-keygen new --outfile ~/.config/solana/client.json --no-bip39-passphrase
solana-keygen new --outfile ~/.config/solana/provider.json --no-bip39-passphrase
solana-keygen new --outfile ~/.config/solana/evaluator.json --no-bip39-passphrase

Fund them with test SOL (only works on localnet/devnet, not real money):

solana airdrop 5 ~/.config/solana/client.json    --url localhost
solana airdrop 5 ~/.config/solana/provider.json  --url localhost
solana airdrop 5 ~/.config/solana/evaluator.json --url localhost

Get the evaluator's public key — you'll need it when creating jobs:

solana-keygen pubkey ~/.config/solana/evaluator.json
# e.g. Dz1nX5KCJkkHM5DJFnj6GJ5cZQvvrwE4MFZdvKcoyEvc

Quickstart

For a fully automated demo that runs a complete job cycle (create → submit → approve) in one command, see examples/quickstart.js:

cd examples && npm install
node quickstart.js                                         # localnet
RPC_URL=https://api.devnet.solana.com node quickstart.js  # devnet

Manual Walkthrough

This walks through a complete job step-by-step: client posts → provider works → evaluator approves.

Open three terminals.

Terminal 1 — Client creates a job

export ACP_KEYPAIR_PATH=~/.config/solana/client.json
export EVALUATOR_PUBKEY=$(solana-keygen pubkey ~/.config/solana/evaluator.json)

npx en whoami
npx en create-job compute-v1 "What is the current Unix timestamp?" 1.0 $EVALUATOR_PUBKEY

Output:

Job created and funded!
  Job ID: #0
  PDA:    <job_address>
  Amount: 1.0 USDC
  TX:     <tx_signature>

Copy the PDA address — you'll need it in the next steps.

Terminal 2 — Provider submits a result

export ACP_KEYPAIR_PATH=~/.config/solana/provider.json

npx en list-jobs --status funded
npx en submit <job_pda> "1711234567"

Terminal 3 — Evaluator approves

export ACP_KEYPAIR_PATH=~/.config/solana/evaluator.json

npx en stake-evaluator 0.1   # one-time: deposit SOL bond
npx en list-jobs --status submitted
npx en approve <job_pda>

The 1.0 USDC moves from escrow to the provider's wallet. Done.


Using the SDK in Code

import {
  createJob,
  registerProvider,
  stakeAsEvaluator,
  submitResult,
  approveJob,
} from "@dymchenko/en-sdk";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import fs from "fs";

const connection = new Connection("http://localhost:8899", "confirmed");

const clientWallet    = Keypair.fromSecretKey(Uint8Array.from(JSON.parse(fs.readFileSync("client.json",    "utf8"))));
const providerWallet  = Keypair.fromSecretKey(Uint8Array.from(JSON.parse(fs.readFileSync("provider.json",  "utf8"))));
const evaluatorWallet = Keypair.fromSecretKey(Uint8Array.from(JSON.parse(fs.readFileSync("evaluator.json", "utf8"))));

// Devnet USDC — use EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v on mainnet
const USDC_MINT = new PublicKey("4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU");

// Provider: register once on-chain (name, capability tags, min fee in SOL)
await registerProvider(connection, providerWallet, "MyBot", ["compute"], 0.01);

// Evaluator: deposit a SOL bond once — slashed if they miss a deadline
await stakeAsEvaluator(connection, evaluatorWallet, 0.1);

// Client: create and fund a job (1 USDC locked in escrow, min 1 hour expiry)
const { jobPda } = await createJob(
  connection,
  clientWallet,
  "compute-v1",                          // task type
  "What is the current Unix timestamp?", // task description
  1.0,                                   // USDC amount held in escrow
  USDC_MINT,
  evaluatorWallet.publicKey,
  3600                                   // expires in seconds (minimum 3600)
);

// Provider: submit result
await submitResult(connection, providerWallet, jobPda, "1711234567");

// Evaluator: approve — releases USDC escrow to provider
await approveJob(connection, evaluatorWallet, jobPda);

Using with AI Agents (Claude)

A SKILL.md file is included in the package. Load it into any Claude agent to give it a complete understanding of the protocol:

@node_modules/@dymchenko/en-sdk/SKILL.md

The skill covers the full job lifecycle and all CLI commands grouped by role. Agents should follow role intent per step.


CLI Reference

Set your wallet (required). You do not need RPC_URL unless you want a non-default cluster:

export ACP_KEYPAIR_PATH=/path/to/keypair.json
# Optional — only if not using default public devnet:
# export RPC_URL=http://localhost:8899
# export RPC_URL=https://api.mainnet-beta.solana.com

Default RPC for the CLI is https://devnet.helius-rpc.com/?api-key=YOUR_HELIUS_API_KEY (same as DEFAULT_PUBLIC_RPC_URL in the SDK package).

| Command | Role | Description | | ---------------------------------------------------- | --------- | ----------------------------------- | | whoami | any | Show wallet address and balance | | create-job <task-type> "<task>" <usdc> <evaluator> | client | Create and fund a job | | fund <pda> | client | Fund an unfunded (bilateral) job | | list-jobs [--status <state>] | any | List jobs, optionally filtered | | show-job <pda> | any | Show full job details | | submit <pda> "<result>" | provider | Submit work result | | approve <pda> | evaluator | Approve → release USDC to provider | | reject <pda> | evaluator | Reject → refund USDC to client | | stake-evaluator <sol> | evaluator | Deposit SOL bond | | unstake-evaluator <sol> | evaluator | Withdraw SOL bond | | show-evaluator-stake [addr] | evaluator | Check stake balance + slash count | | expire <pda> | any | Expire a job past its deadline | | cancel-recurring <pda> | client | Stop a recurring job cycle |

Bilateral evaluator negotiation (both parties agree on the evaluator before funding):

npx en create-job <task-type> "<task>" <usdc> <evaluator> [expiry] --bilateral
npx en accept-evaluator <pda>           # provider accepts
npx en propose-evaluator <pda> <addr>   # provider counter-proposes
npx en client-accept-evaluator <pda>    # client accepts counter-proposal
npx en client-reject-evaluator <pda>    # client rejects counter-proposal

Recurring jobs (job automatically reopens after each completion):

npx en create-job <task-type> "<task>" <usdc> <evaluator> [expiry] --recurrence <seconds>
npx en create-job <task-type> "<task>" <usdc> <evaluator> [expiry] --recurrence 3600 --lock-provider --lock-evaluator
npx en cancel-recurring <pda>           # client stops the recurring cycle
npx en update-evaluator <pda> <addr>    # client sets evaluator for next cycle
npx en reopen-job <pda>                 # keeper triggers next cycle after interval

Job States

| State | Meaning | |---|---| | open | Created, not yet funded | | negotiating | Provider counter-proposed an evaluator, waiting for client | | funded | Funds locked in escrow, waiting for a provider | | submitted | Provider submitted a result, waiting for evaluator | | complete | Approved — provider received funds | | rejected | Rejected — funds returned to client | | expired | Deadline passed — funds returned to client | | cancelled | Client cancelled a recurring job |


Program

  • Network: CLI defaults to public devnet; set RPC_URL for localnet or mainnet-beta
  • Program ID: 4bFkEKEgLfWQPjR21gTWzWtq8ZgUR4EVRi6LWm8LxoEc
  • Escrow: Funds are held directly in the job account — no external vault

License

ISC