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

@umpledger/sdk

v2.0.0-alpha.2

Published

Universal Monetization Protocol SDK — The payment rail for the autonomous economy

Downloads

198

Readme

@umpledger/sdk

The payment rail for the autonomous economy

npm version License: Apache-2.0 Website

Universal Monetization Protocol (UMP) enables AI agents to autonomously price services, negotiate contracts, meter usage, and settle payments — without human intervention.


Installation

npm install @umpledger/sdk

Quick Start

import { UMP } from '@umpledger/sdk';

const ump = new UMP({ apiKey: 'ump_sk_...' });

// Register two agents
const provider = ump.registerAgent({ name: 'DataAgent', type: 'AI_AGENT',
  authority: { maxPerTransaction: '10', maxPerDay: '1000', currency: 'USD' }
});
const consumer = ump.registerAgent({ name: 'AnalysisAgent', type: 'AI_AGENT',
  authority: { maxPerTransaction: '10', maxPerDay: '1000', currency: 'USD' }
});

// Fund the consumer wallet
consumer.wallet.fund({ amount: 100, currency: 'USD', source: 'bank_transfer' });

// Execute a transaction
const result = await ump.transact({
  from: consumer.id,
  to: provider.id,
  service: 'data_analysis',
});

console.log(`Charged: ${result.cost} ${result.currency}`);
console.log(`Audit ID: ${result.auditId}`);

Architecture

UMP is a 3-layer protocol:

┌─────────────────────────────────────────┐
│  L1 · Identity & Value                  │
│  AgentManager · WalletManager           │
├─────────────────────────────────────────┤
│  L2 · Terms & Metering                  │
│  ContractManager · PricingEngine        │
│  MeteringEngine                         │
├─────────────────────────────────────────┤
│  L3 · Settlement & Governance           │
│  SettlementBus · AuditTrail             │
└─────────────────────────────────────────┘

Core Modules

AgentManager

Register and manage AI agents with Ed25519 keypairs and spending authority.

const agent = ump.agents.create({
  name: 'MyAgent',
  type: 'AI_AGENT',
  authority: { maxPerTransaction: '50', maxPerDay: '500', currency: 'USD' }
});

const { valid } = ump.agents.verify(agent.agentId);

WalletManager

Multi-currency wallets with reserve, debit, credit, and freeze support.

const wallet = ump.wallets.create(agent.agentId);
ump.wallets.fund(wallet.walletId, { amount: 100, currency: 'USD', source: 'bank' });
const [balance] = ump.wallets.getBalance(wallet.walletId);
console.log(balance.available); // 100

PricingEngine

Evaluate 8 composable pricing primitives:

| Primitive | Description | |-----------|-------------| | FIXED | Flat fee per call | | UNIT_RATE | Price × quantity | | TIERED | Volume-based tiers | | PERCENTAGE | Percentage of value | | THRESHOLD | Trigger above/below threshold | | TIME_WINDOW | Peak vs off-peak rates | | CONDITIONAL | Rule-based branching | | COMPOSITE | Combine any of the above |

const rule = PricingTemplates.perToken({ pricePerToken: 0.002, currency: 'USD' });
const result = ump.pricing.evaluate(rule, { tokens: 1500 });
console.log(result.amount); // 3.00

ContractManager

Create, negotiate, and settle bilateral contracts between agents.

const contract = ump.contracts.create(providerAgent.id, {
  targetAgentId: consumerAgent.id,
  pricingRules: [PricingTemplates.perToken({ pricePerToken: 0.001, currency: 'USD' })],
});

// Consumer accepts
ump.contracts.accept(contract.contractId, consumerAgent.id);

SettlementBus

Three settlement modes — instant drawdown, escrow, and waterfall.

// Instant settlement
const { settlement } = await ump.settlement.transact(
  consumerId, providerId, usageEvent, pricingRule
);

// Escrow: lock funds, release on outcome
const escrow = ump.settlement.escrow(consumerId, providerId, amount, currency);
ump.settlement.releaseEscrow(escrow.settlementId, consumerId, providerId);

AuditTrail

Immutable append-only audit log for every operation.

const log = ump.audit.getLog();
// Returns every transaction, contract event, and settlement

Pricing Templates

Pre-built templates for common AI agent use cases:

import { PricingTemplates } from '@umpledger/sdk';

PricingTemplates.perToken({ pricePerToken: 0.002, currency: 'USD' })
PricingTemplates.perInference({ pricePerCall: 0.01, currency: 'USD' })
PricingTemplates.subscriptionPlusUsage({ monthlyFee: 99, usageRate: 0.001, currency: 'USD' })
PricingTemplates.creditPool({ creditValue: 0.001, currency: 'USD' })
PricingTemplates.marketplaceCommission({ commissionRate: 0.05, currency: 'USD' })
PricingTemplates.agentTask({ pricePerTask: 5.00, currency: 'USD' })

Error Handling

import {
  UMPError,
  InsufficientFundsError,
  AgentRevokedError,
  AuthorityExceededError,
  ContractNotFoundError,
} from '@umpledger/sdk';

try {
  await ump.transact({ from, to, service });
} catch (err) {
  if (err instanceof InsufficientFundsError) {
    console.log('Not enough funds in wallet');
  } else if (err instanceof AuthorityExceededError) {
    console.log('Transaction exceeds agent spending authority');
  }
}

Links


License

Apache 2.0 © UMPLedger