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

nexuspay-sdk

v0.1.1

Published

TypeScript SDK for NexusPay — autonomous agent payment infrastructure

Readme

nexuspay-sdk

TypeScript SDK for NexusPay — autonomous agent payment infrastructure.

Installation

npm install nexuspay-sdk

Quick Start

import NexusPay from "nexuspay-sdk";

const client = new NexusPay({
  baseUrl: "https://nexuspay.finance",
  apiKey: "nxp_your_api_key_here",
});

// Create a wallet for your agent
const wallet = await client.wallets.create({
  agentId: "my-agent-001",
  initialFunding: 50,
});
console.log(wallet.address, wallet.balanceUsdc);

// Send a payment
const tx = await client.transactions.send({
  fromAgentId: "my-agent-001",
  toAddress: "0xRecipientAddress",
  amountUsdc: 5.00,
  category: "compute",
  memo: "GPU rental payment",
});

// Instant P2P transfer between agents
const transfer = await client.p2p.transfer({
  fromAgentId: "my-agent-001",
  toAgentId: "my-agent-002",
  amountUsdc: 10.00,
});

// Pay a paywall endpoint (x402)
const access = await client.x402.pay({
  path: "/api/premium-data",
  agentId: "my-agent-001",
});
if (access.access) {
  // proceed to call the endpoint
}

Configuration

const client = new NexusPay({
  baseUrl: "https://nexuspay.finance", // Your NexusPay deployment URL
  apiKey: "nxp_...",                    // API key (from dashboard → API Keys)
});

If JWT_SECRET is not set on the server, the API is open and no apiKey is required (development mode).

API Reference

client.wallets

| Method | Description | |--------|-------------| | wallets.create(opts) | Create a new agent wallet | | wallets.list() | List all wallets | | wallets.get(agentId) | Get a wallet by agentId | | wallets.setStatus(agentId, status) | Suspend or reactivate a wallet |

// Create
const wallet = await client.wallets.create({ agentId: "agent-001", initialFunding: 100 });

// Suspend
await client.wallets.setStatus("agent-001", "SUSPENDED");

// Reactivate
await client.wallets.setStatus("agent-001", "ACTIVE");

client.transactions

| Method | Description | |--------|-------------| | transactions.send(opts) | Send an on-chain USDC transaction | | transactions.list(opts?) | List transactions with optional filters |

const txns = await client.transactions.list({
  agentId: "agent-001",
  status: "CONFIRMED",
  category: "compute",
});

client.p2p

| Method | Description | |--------|-------------| | p2p.transfer(opts) | Instant off-chain transfer between agents |

const result = await client.p2p.transfer({
  fromAgentId: "agent-001",
  toAgentId: "agent-002",
  amountUsdc: 25.00,
  memo: "Revenue share",
});

client.policies

| Method | Description | |--------|-------------| | policies.create(opts) | Create a spending policy for an agent | | policies.list(opts?) | List policies |

await client.policies.create({
  agentId: "agent-001",
  tier: "CONSERVATIVE",
  maxPerTransaction: 10,
  dailyLimit: 50,
  monthlyLimit: 500,
  requireApproval: false,
  allowedCategories: ["compute", "storage"],
});

client.x402

| Method | Description | |--------|-------------| | x402.register(opts) | Register a paywall endpoint | | x402.pay(opts) | Pay to access an endpoint | | x402.list() | List all paywall endpoints |

// Register your endpoint as a paywall
await client.x402.register({
  path: "/api/my-premium-endpoint",
  priceUsdc: 0.001,
  description: "Real-time market data",
});

// Agent pays to access it
const { access, charged } = await client.x402.pay({
  path: "/api/my-premium-endpoint",
  agentId: "agent-001",
});

client.identity

| Method | Description | |--------|-------------| | identity.register(opts) | Register a DID credential for an agent | | identity.list(agentId?) | List credentials |

client.keys

| Method | Description | |--------|-------------| | keys.create(opts) | Create an API key (raw key shown once) | | keys.list() | List all API keys |

const { key, prefix } = await client.keys.create({
  name: "production-agent",
  scopes: ["*"],
});
// Store `key` securely — it cannot be retrieved again

Error Handling

All methods throw NexusPayError on failure:

import { NexusPayError } from "nexuspay-sdk";

try {
  await client.transactions.send({ ... });
} catch (e) {
  if (e instanceof NexusPayError) {
    console.error(`${e.status}: ${e.message}`);
    // e.body contains the full API error response
  }
}

Building from Source

cd sdk
npm install
npm run build   # outputs to dist/
npm run dev     # watch mode

License

MIT