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

@bh2smith/sim-sdk

v0.1.0

Published

[Unofficial] Type-safe TypeScript client for the Sim by Dune API

Readme

Sim SDK

Type-safe TypeScript client for the Sim by Dune API. Built with openapi-fetch and types auto-generated from the official OpenAPI spec.

Install

bun install

Authentication

Set your API key as an environment variable:

export SIM_API_KEY=your_api_key

Or pass it directly:

const sim = new SimClient("your_api_key");

Get your key from the Dune dashboard.

Usage

import { SimClient } from "./src/index.js";

const sim = new SimClient();
const address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";

// Token balances
const balances = await sim.getEvmBalances(address, {
  chain_ids: "1,8453",
  exclude_spam_tokens: true,
});

for (const b of balances.balances) {
  console.log(`${b.symbol}: ${b.amount} ($${b.value_usd?.toFixed(2)})`);
}

// Activity feed
const activity = await sim.getEvmActivity(address, {
  chain_ids: "1",
  limit: 10,
});

// DeFi positions
const defi = await sim.getEvmDefiPositions(address, {
  chain_ids: "1",
});
console.log(`Total DeFi value: $${defi.aggregations?.total_value_usd}`);

// Token price with fallback
const prices = await sim.getPrices([
  { chain_id: 1, address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" }, // USDC
  { chain_id: 8453, address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" }, // USDC on Base
]);

for (const p of prices.prices) {
  console.log(`Chain ${p.chain_id}: $${p.price_usd} (via ${p.source})`);
}

API Reference

EVM

| Method | Description | |---|---| | getEvmActivity(address, query?) | On-chain activity feed (transfers, swaps, calls) | | getEvmBalances(address, query?) | Token balances with USD valuations | | getEvmSingleTokenBalance(address, tokenAddress, query) | Balance for a specific token | | getEvmCollectibles(address, query?) | NFTs (ERC-721, ERC-1155) | | getEvmDefiPositions(address, query?) | DeFi positions across protocols | | getEvmDefiSupportedProtocols(query?) | Supported DeFi protocols | | getEvmStablecoins(address, query?) | Stablecoin balances | | getEvmSupportedChains() | Supported chains and endpoint availability | | getEvmTokenHolders(chainId, address, query?) | Top holders of a token | | searchEvmTokens(query) | Search tokens by name/symbol | | getEvmTokenInfo(address, query) | Token metadata and pricing | | getEvmTransactions(address, query?) | Transaction history |

SVM (Solana)

| Method | Description | |---|---| | getSvmBalances(address, query?) | Token balances | | getSvmTransactions(address, query?) | Transaction history |

Webhooks

| Method | Description | |---|---| | listWebhooks(query?) | List all webhooks | | createWebhook(body) | Create a webhook subscription | | getWebhook(webhookId) | Get webhook details | | updateWebhook(webhookId, body) | Update webhook configuration | | deleteWebhook(webhookId) | Delete a webhook | | getWebhookAddresses(webhookId, query?) | List subscribed addresses | | replaceWebhookAddresses(webhookId, body) | Replace address list | | updateWebhookAddresses(webhookId, body) | Add/remove addresses |

Composite

| Method | Description | |---|---| | getPrices(tokens) | Token prices via tokenInfo, falling back to tokenHolders + defiPositions |

Regenerating Types

To update types from the latest OpenAPI spec:

curl -sL https://docs.sim.dune.com/openapi.json -o openapi.json
bun run generate-types