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

blackswan-sdk

v0.1.3

Published

TypeScript SDK for BlackSwan Protocol - fetch credit dashboards, reputation scores, and loan history from Soulbound Token contracts

Readme

blackswan-sdk

TypeScript SDK for BlackSwan Protocol - works with JavaScript, TypeScript, React, Next.js, Node.js, and more.

Installation

npm install blackswan-sdk

Contract Addresses

import { AMOY_CONTRACTS, SEPOLIA_CONTRACTS } from "blackswan-sdk";

// Amoy (Polygon Testnet)
AMOY_CONTRACTS.P2PLENDING   // 0x7E04C0a283d372537E547086D37642776199C1DC
AMOY_CONTRACTS.BLACKSWANSBT  // 0x6665e5E15Ee295d9de05C6D57c629F33653687D7

// Sepolia Testnet
SEPOLIA_CONTRACTS.P2PLENDING  // 0x20D2E08E283FF4052B2B02A3475dda1B320cD26f
SEPOLIA_CONTRACTS.BLACKSWANSBT // 0xf8D2F43227Ea25a7fD0B34E1b74FF6FF2722879F

Usage

React / Next.js (ESM)

import { BlackSwanClient } from "blackswan-sdk";

const client = new BlackSwanClient({
  network: "amoy",
  rpcUrl: process.env.NEXT_PUBLIC_RPC_URL!
});

const dashboard = await client.getCreditDashboard(wallet);
// {
//   trustRatio: 7700,
//   trustTierScore: 'C',
//   currentApr: 142,
//   totalBorrowedUsd: '...',
//   totalRepaidUsd: '...',
//   interestRepaidUsd: '...',
//   successfulLoans: 1,
//   defaults: 0
// }

Node.js (CommonJS)

const { BlackSwanClient } = require("blackswan-sdk");

const client = new BlackSwanClient({
  network: "amoy",
  rpcUrl: process.env.RPC_URL
});

const dashboard = await client.getCreditDashboard(wallet);

API Methods

  • hasSoulboundToken(wallet) - Check if wallet has SBT (returns true/false)
  • getCreditDashboard(wallet) - Get trustRatio, trustTierScore (A-E), currentApr, amounts, loans
  • getReputation(wallet) - Get repaidVolume, loans, trustRatio
  • getCurrentApr(wallet) - Get current APR
  • getTrustTier(wallet) - Get trust tier score (A, B, C, D, E)
  • getTrustRatio(wallet) - Get trust ratio (raw number)
  • getCreditHistory(wallet) - Get loan history with formatted USD amounts
  • getCurrentRisk(wallet) - Get current risk score

Trust Tier Score

| Score | Tier | |-------|------| | >= 9000 | A | | >= 8000 | B | | >= 7000 | C | | >= 6000 | D | | < 6000 | E |

License

MIT