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

@caypo/canton-sdk

v0.2.0

Published

Core SDK for AI agent banking on Canton Network — USDCx transfers, encrypted wallets, safeguards, and MPP auto-pay

Readme

@caypo/canton-sdk

Core SDK for AI agent banking on Canton Network

USDCx transfers, encrypted wallets, safeguards, traffic management, and MPP auto-pay — everything an AI agent needs to operate a bank account on Canton.

License Tests

Install

npm install @caypo/canton-sdk

Quick Start

import { CantonAgent } from "@caypo/canton-sdk";

const agent = await CantonAgent.create({
  ledgerUrl: "http://localhost:7575",
  token: "your-jwt",
  partyId: "Agent::1220...",
  network: "testnet",
});

// Balance
const { available, holdingCount } = await agent.checking.balance();
console.log(`${available} USDCx across ${holdingCount} holdings`);

// Send USDCx (safeguards checked automatically)
const tx = await agent.checking.send("Bob::1220...", "10.00");
console.log(`Sent! Update ID: ${tx.updateId}`);

// Pay for API call (handles 402 automatically)
const result = await agent.mpp.pay("https://mpp.caypo.xyz/openai/v1/chat/completions", {
  method: "POST",
  body: JSON.stringify({ model: "gpt-4o", messages: [{ role: "user", content: "Hello" }] }),
  maxPrice: "0.05",
});

Features

CantonClient — JSON Ledger API v2

import { CantonClient } from "@caypo/canton-sdk";

const client = new CantonClient({ ledgerUrl, token, userId });
await client.submitAndWait({ commands, commandId, actAs });
await client.queryActiveContracts({ filtersByParty, activeAtOffset });
await client.getLedgerEnd();
await client.allocateParty("Alice");
await client.isHealthy();

USDCxService — Token Operations

import { USDCxService } from "@caypo/canton-sdk";

const usdcx = new USDCxService(client, partyId);
const holdings = await usdcx.getHoldings();     // USDCx UTXO holdings
const balance = await usdcx.getBalance();        // Sum as string
await usdcx.transfer({ recipient, amount });     // TransferFactory_Transfer
await usdcx.mergeHoldings(holdingCids);          // Consolidate UTXOs

SafeguardManager — Spending Controls

import { SafeguardManager } from "@caypo/canton-sdk";

const safeguards = await SafeguardManager.load();
safeguards.setTxLimit("100");                    // Per-transaction limit
safeguards.setDailyLimit("1000");                // Daily spending limit
safeguards.lock("1234");                         // Lock wallet
const { allowed, reason } = safeguards.check("50"); // Pre-tx check

Keystore — Encrypted Wallet

import { Keystore } from "@caypo/canton-sdk";

const ks = await Keystore.create("1234", { partyId, jwt, userId });
const loaded = await Keystore.load("1234");
const { partyId, jwt } = loaded.getCredentials();
await loaded.changePin("1234", "5678");

Amount Utilities — No Floating Point

import { addAmounts, compareAmounts, subtractAmounts } from "@caypo/canton-sdk";

addAmounts("1.5", "2.5");           // "4"
compareAmounts("10", "9.99");        // 1
subtractAmounts("100", "0.01");      // "99.99"
// All amounts are strings — Canton uses Numeric 10 (10 decimal places)

API Reference

| Class | Purpose | |-------|---------| | CantonAgent | High-level entry point — wires all services together | | CheckingAccount | Balance, send, receive, history | | CantonClient | Low-level JSON Ledger API v2 client | | USDCxService | Holdings, balance, transfer, merge | | SafeguardManager | Tx/daily limits, lock/unlock | | TrafficManager | Validator traffic balance | | MppPayClient | HTTP 402 auto-pay flow | | Keystore | AES-256-GCM encrypted wallet |

License

Apache-2.0 OR MIT