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

djd-agent-score

v1.0.3

Published

TypeScript client for the DJD Agent Score API — wallet screening for payouts and paid agent workflows

Downloads

335

Readme

djd-agent-score

TypeScript client SDK for the DJD Agent Score API focused on screening wallets before payouts or paid x402 work.

Install

npm install djd-agent-score

Quick Start

import { DJDAgentScore } from 'djd-agent-score'

const client = new DJDAgentScore()

// Free: basic score (10/day)
const basic = await client.getBasicScore('0x1234...')
console.log(basic.score, basic.tier) // 72 "Established"

// Optional: broader context once screening is in place
const history = await client.getScoreHistory('0x1234...')

// Optional: ecosystem metrics for additional context
const economy = await client.getEconomyMetrics('daily', 7)

Paid Endpoints (API key)

Monthly-plan access uses a normal Bearer API key:

const client = new DJDAgentScore({
  apiKey: 'djd_live_...',
})

const full = await client.getFullScore('0x1234...')
const history = await client.getScoreHistory('0x1234...', { limit: 25 })

If you pass both apiKey and paymentHeaderProvider, the SDK uses the API key and skips x402 payment headers.

Paid Endpoints (x402)

Paid endpoints require a payment header provider that generates x402 USDC payment headers:

const client = new DJDAgentScore({
  paymentHeaderProvider: async (endpoint, price) => {
    // Your x402 payment logic here
    return base64EncodedPaymentHeader
  },
})

// $0.10 USDC --- full score with dimensions
const full = await client.getFullScore('0x1234...')

// $0.15 USDC --- score history with trend analysis
const history = await client.getScoreHistory('0x1234...', { limit: 25 })

// $0.25 USDC --- force recalculation
const fresh = await client.refreshScore('0x1234...')

// $0.02 USDC --- submit fraud report
await client.submitReport({
  target: '0xbad...',
  reporter: '0xgood...',
  reason: 'payment_fraud',
  details: 'Failed to deliver on x402 payment',
})

API Reference

| Method | Endpoint | Price | Description | |--------|----------|-------|-------------| | getBasicScore(wallet) | GET /v1/score/basic | Free (10/day) | Basic score + tier | | getFullScore(wallet) | GET /v1/score/full | $0.10 | Full score + dimensions | | refreshScore(wallet) | GET /v1/score/refresh | $0.25 | Force recalculation | | getScoreHistory(wallet) | GET /v1/score/history | $0.15 | Historical trend | | submitReport(body) | POST /v1/report | $0.02 | Report fraud | | getEconomyMetrics(period, limit) | GET /v1/data/economy | Free | Ecosystem context | | registerAgent(body) | POST /v1/agent/register | Free | Optional identity profile | | submitCompute(wallet) | POST /v1/score/compute | --- | Async compute | | pollJob(jobId) | GET /v1/score/job/:id | --- | Check job status | | waitForScore(wallet) | --- | --- | Poll until complete |

The client is most useful when you start with getBasicScore() for screening and only layer in history or forensics when the workflow needs more depth.

Error Handling

import { DJDScoreError } from 'djd-agent-score'

try {
  await client.getBasicScore('invalid')
} catch (err) {
  if (err instanceof DJDScoreError) {
    console.log(err.status) // 400
    console.log(err.body)   // { error: 'Invalid wallet address' }
  }
}

Configuration

const client = new DJDAgentScore({
  apiKey: 'djd_live_...', // Optional Bearer API key for monthly-plan access
  baseUrl: 'https://djdagentscore.dev',
  timeoutMs: 15_000,      // Request timeout (default: 30s)
  maxRetries: 3,           // Retry on 5xx (default: 2)
  paymentHeaderProvider,   // Optional x402 payment header generator
  fetch: customFetch,      // Custom fetch implementation
})

License

MIT