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

@divij_web3dev/sentinel-sdk

v0.1.6

Published

TypeScript SDK for building autonomous, verifiable agents on Solana with x402 payments, TAP (Visa) verification, and XMCP tools.

Downloads

17

Readme

@divij_web3dev/sentinel-sdk

TypeScript SDK for building autonomous, verifiable agents on Solana with x402 payments, TAP (Visa) verification, and XMCP tools.

Features

  • PayAI Facilitator Client (Solana devnet)
    • FacilitatorClient for /verify and /settle with PayAI
    • createAcceptSpec to generate x402 AcceptSpec (price, network, asset, payTo)
    • Solana SPL token support via tokenMint and decimals (SOL, USDC, CASH)
  • TAP (Visa, RFC 9421) signing and verification
    • signTap, verifyTap standalone utilities
    • Express router via registerTapRoutes for /tap/keys/:keyId and /tap/sign
    • Ed25519 and RSA-PSS-SHA256 support
  • Solana SPL utilities
    • getAssociatedTokenAddress, getMintDecimals
    • CASH_MINT constant for CASH token
  • XMCP scaffolding with paid tools
    • scaffoldXmcpProject generates XMCP app with sentinel.create_job, sentinel.checkpoint, sentinel.settle
    • Optional on-chain tools: sentinel.register_agent, sentinel.query_reputation
  • Coral adapter + helpers
    • createCoralClient, buildCoralAgentToml, env helpers
  • Crossmint provider (peer dep)
    • Balances, transfers, wallet creation for SOL, USDC, and generic SPL
  • MCP wrappers
    • Commitment injection helpers for x402 flows

Install

npm i @divij_web3dev/sentinel-sdk
# Optional for Crossmint wallet integration in your app:
npm i @crossmint/wallets-sdk

Requires Node 20+.

Quickstart: Scaffold a full stack

The fastest way to get started is with the CLI scaffolder:

npx create-sentinelx@latest my-app

This generates:

  • gateway-express: x402 payment gateway with TAP (Visa) verification (Solana devnet → PayAI)
  • research-python-service: FastAPI service with Parallel Beta Search + Task API fallback
  • client-solana: Minimal client using x402-fetch to pay and call the gateway
  • client-fetch: Multi-network client (EVM/SVM) with TAP signing
  • tap-python-server: TAP signer exposing /tap/keys/:keyId and /tap/sign
  • xmcp: XMCP app with paid tools (optional)

Then configure .env files and run:

cd my-app/gateway-express && npm i && npm run dev  # :4021
cd ../research-python-service && pip install -r requirements.txt && uvicorn main:app --reload --port 4022
cd ../client-solana && npm i && npm run dev "your question"

Quick start (PayAI facilitator + AcceptSpec)

import { FacilitatorClient, createAcceptSpec } from '@divij_web3dev/sentinel-sdk';

// Build a 402 AcceptSpec for a paid endpoint (Solana devnet)
const accept = createAcceptSpec({
  network: 'solana-devnet',
  asset: 'SOL',
  payTo: '<YOUR_SOL_ADDRESS_BASE58>',
  maxAmountRequired: '$0.002', // string price OK; server-side will resolve to lamports
  resource: 'POST /research',
  // Optional for SPL tokens:
  // tokenMint: '<SPL_MINT>',
  // decimals: 6,
});

const facilitator = new FacilitatorClient('https://facilitator.payai.network');

// Verify a payment request prior to serving a resource
const verifyRes = await facilitator.verify(accept, { network: 'solana-devnet', asset: accept.asset, payTo: accept.payTo });
if (!verifyRes.isValid) throw new Error('Payment verification failed: ' + (verifyRes.error || ''));

// Later, settle a payment (server-to-facilitator)
const settleRes = await facilitator.settle(accept, { network: 'solana-devnet', asset: accept.asset, payTo: accept.payTo });
if (settleRes.status !== 'settled') throw new Error('Settlement failed: ' + (settleRes.error || ''));
console.log('Tx:', settleRes.transactionSignature);

Notes:

  • The AcceptSpec may include tokenMint and decimals to charge in SPL tokens.
  • createAcceptSpec normalizes the network tag (e.g., solana-devnet).

Quick start (scaffold an XMCP project programmatically)

import { scaffoldXmcpProject } from '@divij_web3dev/sentinel-sdk';

await scaffoldXmcpProject({
  outDir: './xmcp',
  projectName: 'x402-xmcp',
  includeOnchain: false,
});
// Then: cd xmcp && npm i && npm run dev

The generated XMCP app exposes the paid tools over HTTP when running in dev mode. Point your x402 server's MCP_URL at the printed tools endpoint.

TAP Agent (Express)

import express from 'express';
import { registerTapRoutes } from '@divij_web3dev/sentinel-sdk';

const app = express();
registerTapRoutes(app, {
  basePath: '/tap',
  keyId: 'agent-ed25519',
  alg: 'ed25519',
  ed25519PublicKeyB64: process.env.ED25519_PUBLIC_KEY,
  ed25519PrivateSeedB64: process.env.ED25519_PRIVATE_KEY,
});
  • GET /tap/keys/:keyId returns the public key
  • POST /tap/sign returns signature headers for requests

TAP sign/verify (standalone)

import { signTap, verifyTap } from '@divij_web3dev/sentinel-sdk';

const signingString = '"@authority": example.com\n"@path": /research\n"@signature-params": ("@authority" "@path"); created=..., expires=..., keyId="agent-ed25519"; alg="ed25519"';
const signatureB64 = await signTap({ alg: 'ed25519', ed25519PrivateSeedB64: process.env.ED25519_PRIVATE_KEY! }, signingString);

const ok = await verifyTap({ alg: 'ed25519', ed25519PublicKeyB64: process.env.ED25519_PUBLIC_KEY! }, signingString, signatureB64);
console.log('verified?', ok);

Coral adapter

import { createCoralClient, buildCoralAgentToml } from '@divij_web3dev/sentinel-sdk';
const coral = createCoralClient({ connectionUrl: process.env.CORAL_CONNECTION_URL! });

Generate a TOML for Coral option system:

const toml = buildCoralAgentToml(
  { name: 'x402-paid-agent', version: '0.1.0', description: 'Paid tools via x402' },
  { OPENROUTER_API_KEY: { type: 'string', description: 'LLM API key' } }
);

Crossmint provider

This SDK includes a provider that maps a Crossmint wallet to balances and transfers. Install the peer dep in your app:

npm i @crossmint/wallets-sdk

Currently supported:

  • Create/fetch wallet (email or phone signers)
  • Balances: native + USDC
  • Send: SOL, USDC, and generic SPL by mint/decimals (e.g., CASH)
  • Sign: signMessage, signTransaction

Example (CASH on Solana, 6 decimals):

import { createCrossmintProvider, CASH_MINT } from '@divij_web3dev/sentinel-sdk';

const crossmint = createCrossmintProvider({
  apiKey: process.env.CROSSMINT_API_KEY!,
  network: 'solana-devnet',
  identifier: { email: '[email protected]' },
});

// Send 1 CASH (6 decimals)
await crossmint.sendSPL('<recipient>', CASH_MINT, '1000000', 6);

Notes:

  • Generic SPL relies on wallet support (Crossmint methods like sendSpl/sendSPL or compatible fallbacks).
  • If unsupported on a given chain/wallet, an explicit error is thrown.

Roadmap:

  • Expand wallet coverage and normalization across chains

MCP wrappers (commitments)

import { ensureCommitments } from '@divij_web3dev/sentinel-sdk';

const enriched = ensureCommitments(body, {
  paymentCommitment: '<hex>',
  tapCommitment: '<hex>',
});

License

MIT