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

nirium

v0.6.1

Published

Official TypeScript SDK for the Nirium autonomous agent economy on Stellar (x402 + MPP)

Downloads

313

Readme

nirium

Official TypeScript SDK for the Nirium Protocol — autonomous AI treasury infrastructure on Stellar/Soroban.

Nirium agents rebalance USDC ↔ CETES (tokenized Mexican T-bills via Etherfuse) 24/7 without human intervention. Built for developers who want to integrate autonomous treasury management, agentic payments (x402 + MPP), and real-time market signals into their applications.

Install

npm install nirium

Quick Start

import { Agent } from 'nirium';

const agent = new Agent({
  apiKey: 'sk_inst_your_key_here',
  baseUrl: 'https://api.nirium.xyz',
});

// Health check
const alive = await agent.ping();
console.log('Agent alive:', alive);

// Real market data from Stellar Horizon
const market = await agent.getMarket();
console.log('XLM Price:', market.xlmPrice);

// Execute a treasury rebalance strategy
const result = await agent.execute('blend-yield', 'USDC', { amount: 5000 });
console.log('Result:', result.success, result.txHash);

// Real-time signals via WebSocket
agent.subscribe((signal) => {
  console.log('Signal:', signal.signal_type, signal.data.details);
});

API Coverage

| Category | Methods | |---|---| | Health | ping(), health(), systemHealth() | | Execution | execute(), executeDemo() | | Market | getTickers(), getMarket(), getStats(), getLoopStatus(), startLoop(), stopLoop(), triggerScan() | | Signals | createSubscription(), getSubscriptions(), deleteSubscription(), getSubscriptionStats(), getRecentSignals() | | Skills | getSkills(), installSkill(), uninstallSkill(), getSkillMarketplace(), executeSkillAction() | | Strategies | getStrategies() | | Webhooks | registerWebhook(), getWebhooks(), deleteWebhook(), testWebhook() | | Auth | getAuthToken(), createAuthKey(), getAuthKeys(), revokeAuthKey() | | Revenue | getRevenue(), getInfo() | | Admin | configureLLM() | | WebSocket | subscribe(), onLog(), disconnect() | | x402 Payments | initX402(), x402Fetch() | | MPP Payments | initMpp(), mppFetch() |

Authentication

// API Key for REST endpoints
const agent = new Agent({
  apiKey: 'sk_inst_...',
  baseUrl: 'https://api.nirium.xyz',
});

// With JWT token for WebSocket (optional)
const agent = new Agent({
  apiKey: 'sk_inst_...',
  baseUrl: 'https://api.nirium.xyz',
  token: 'eyJhbG...', // JWT from /api/auth/token
});

Payment Protocols

x402 — Pay-Per-Request

agent.initX402({
  secretKey: 'S...',           // Stellar secret key
  network: 'stellar:testnet',
});

const response = await agent.x402Fetch('https://api.nirium.xyz/api/v1/premium/signals');
const data = await response.json();

MPP — Session-Based Budget Delegation

agent.initMpp({
  secretKey: 'S...',
  network: 'stellar:testnet',
  mode: 'pull',
});

const response = await agent.mppFetch('https://api.nirium.xyz/api/v1/mpp/signals');
const data = await response.json();

Endpoint Access Model

| Access | Endpoints | |---|---| | Public (no key) | health, loop/status, execute-demo, signals/recent, skills list | | Protected (API key) | execute, market, loop/start\|stop\|scan, subscriptions, skills/install, webhooks | | WebSocket (JWT) | /ws/signals — real-time signal stream | | x402 Premium | /api/v1/premium/signals ($0.02 USDC), /api/v1/premium/market ($0.05 USDC) | | MPP | /api/v1/mpp/signals, /api/v1/mpp/market |

Requirements

  • Node.js >= 18
  • TypeScript >= 5.0

Links

License

MIT — Nirium Protocol