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

@capsign/sdk

v0.1.0

Published

Official TypeScript SDK for CapSign API

Readme

CapSign TypeScript SDK

Official TypeScript SDK for the CapSign API - programmatic access to tokenized securities, digital equity management, and compliant investment workflows.

Installation

npm install @capsign/sdk

Quick Start

import { CapSign } from '@capsign/sdk';

const capsign = new CapSign({
  apiKey: process.env.CAPSIGN_API_KEY!,
  environment: 'sandbox', // or 'production'
});

// Create a wallet
const wallet = await capsign.wallets.create({
  ownerAddress: '0x123...',
  threshold: 1,
});

// Issue tokens
const token = await capsign.tokens.create({
  walletAddress: wallet.address,
  name: 'Example Corp Class A',
  symbol: 'EXMP-A',
  totalSupply: '1000000',
  securityType: 'COMMON_STOCK',
});

// Launch an offering
const offering = await capsign.offerings.create({
  tokenAddress: token.address,
  offeringType: 'REG_D',
  totalAmount: '5000000',
  pricePerToken: '10',
});

console.log(`Offering created: ${offering.id}`);

Features

  • Type-Safe - Full TypeScript types for all API operations
  • Auto-Pagination - Automatic handling of paginated responses
  • Retry Logic - Built-in exponential backoff for failed requests
  • Webhooks - Helper methods for webhook signature verification
  • Error Handling - Structured error types for better debugging
  • Modern Fetch - Uses native fetch API (Node.js 18+ / browser)

Authentication

Get your API key from the CapSign Dashboard.

const capsign = new CapSign({
  apiKey: 'csk_test_...',  // Sandbox key
  // or
  apiKey: 'csk_live_...',  // Production key
});

Environments

| Environment | Base URL | Network | |-------------|----------|---------| | Sandbox | https://demo.capsign.com/api/v1 | Base Sepolia (testnet) | | Production | https://capsign.com/api/v1 | Base Mainnet |

Resources

Wallets

// Create wallet
const wallet = await capsign.wallets.create({
  ownerAddress: '0x123...',
  threshold: 1,
});

// Get wallet
const wallet = await capsign.wallets.get('0xabc...');

// List wallets with auto-pagination
for await (const wallet of capsign.wallets.list()) {
  console.log(wallet.address);
}

Tokens

// Create token
const token = await capsign.tokens.create({
  walletAddress: '0xabc...',
  name: 'Example Corp',
  symbol: 'EXMP',
  totalSupply: '1000000',
  securityType: 'COMMON_STOCK',
});

// List tokens
const tokens = await capsign.tokens.list({ limit: 50 });

// Get token details
const token = await capsign.tokens.get('0xdef...');

Offerings

// Create offering
const offering = await capsign.offerings.create({
  tokenAddress: '0xdef...',
  offeringType: 'REG_D',
  totalAmount: '5000000',
  pricePerToken: '10',
  minimumInvestment: '1000',
});

// List offerings
for await (const offering of capsign.offerings.list()) {
  console.log(`${offering.token.symbol}: $${offering.totalRaised}`);
}

Documents

// Create document
const document = await capsign.documents.create({
  walletAddress: '0xabc...',
  title: 'Investment Agreement',
  content: 'Document content...',
  signers: [
    { email: '[email protected]', role: 'INVESTOR' },
    { email: '[email protected]', role: 'ISSUER' },
  ],
});

// Get document
const document = await capsign.documents.get(document.id);

Webhooks

// List webhooks
const webhooks = await capsign.webhooks.list();

// Create webhook
const webhook = await capsign.webhooks.create({
  url: 'https://your-app.com/webhooks/capsign',
  events: ['wallet.created', 'token.created', 'offering.investment'],
});

// Verify webhook signature (Express example)
app.post('/webhooks/capsign', (req, res) => {
  const signature = req.headers['x-capsign-signature'] as string;
  const payload = JSON.stringify(req.body);
  
  if (!capsign.webhooks.verifySignature(payload, signature, webhookSecret)) {
    return res.status(401).json({ error: 'Invalid signature' });
  }
  
  // Process webhook
  const event = req.body;
  console.log(`Received: ${event.type}`);
  
  res.json({ received: true });
});

Error Handling

import { CapSignError } from '@capsign/sdk';

try {
  const wallet = await capsign.wallets.create({
    ownerAddress: '0x123...',
    threshold: 1,
  });
} catch (error) {
  if (error instanceof CapSignError) {
    console.error('API Error:', {
      message: error.message,
      code: error.code,
      status: error.status,
      details: error.details,
    });
  } else {
    console.error('Unexpected error:', error);
  }
}

Advanced Usage

Custom Configuration

const capsign = new CapSign({
  apiKey: process.env.CAPSIGN_API_KEY!,
  environment: 'production',
  
  // Custom base URL
  baseUrl: 'https://custom.capsign.com/api/v1',
  
  // Retry configuration
  maxRetries: 3,
  retryDelay: 1000,
  
  // Timeout (ms)
  timeout: 30000,
  
  // Custom headers
  headers: {
    'X-Custom-Header': 'value',
  },
});

Pagination Helpers

// Auto-pagination with async iterator
for await (const token of capsign.tokens.list()) {
  console.log(token.symbol);
}

// Manual pagination
let cursor: string | undefined;
do {
  const response = await capsign.tokens.list({ cursor, limit: 100 });
  
  for (const token of response.tokens) {
    console.log(token.symbol);
  }
  
  cursor = response.pagination.nextCursor;
} while (cursor);

// Collect all pages into array (use with caution)
const allTokens = await capsign.tokens.listAll();

TypeScript Support

The SDK is written in TypeScript and provides full type safety:

import type { 
  Wallet, 
  Token, 
  Offering, 
  Document 
} from '@capsign/sdk';

// All responses are fully typed
const wallet: Wallet = await capsign.wallets.create({...});
const token: Token = await capsign.tokens.get('0x...');

Documentation

Support

License

MIT © CapSign Inc.