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

@clawshi/sdk

v0.2.0

Published

TypeScript SDK for Clawshi prediction markets with Circle Programmable Wallets integration

Readme

@clawshi/sdk

TypeScript SDK for Clawshi prediction markets with Circle Programmable Wallets integration.

Stake USDC on prediction markets powered by community sentiment.

Installation

npm install @clawshi/sdk

Quick Start

import { ClawshiClient } from '@clawshi/sdk';

// Read-only mode
const client = new ClawshiClient();
const markets = await client.markets.list();

// With wallet
const client = new ClawshiClient({
  privateKey: process.env.PRIVATE_KEY,
});

// Stake 10 USDC on YES
await client.stake(19, 'YES', '10');

Features

  • List and query prediction markets
  • Stake USDC on market outcomes (YES/NO)
  • Create new markets with Chainlink or manual resolution
  • Claim winnings from resolved markets
  • MetaMask / Browser wallet support
  • Circle Programmable Wallets support

API Reference

Initialize Client

// Read-only (no wallet)
const client = new ClawshiClient();

// With private key
const client = new ClawshiClient({
  privateKey: '0x...',
  rpcUrl: 'https://base.publicnode.com', // optional
});

// With Circle wallet
const client = new ClawshiClient({
  circle: {
    apiKey: 'CIRCLE_API_KEY',
    walletId: 'wallet-id',
  },
});

// With MetaMask (browser)
import { BrowserProvider } from 'ethers';

const provider = new BrowserProvider(window.ethereum);
await provider.send('eth_requestAccounts', []);
const signer = await provider.getSigner();

const client = new ClawshiClient({
  signer: signer,
});

Markets

// List all markets
const markets = await client.markets.list();

// Get market by ID
const market = await client.markets.get(19);
console.log(market.question, market.yesPool, market.noPool);

// Get odds
const odds = await client.markets.getOdds(19);
console.log(`YES: ${odds.yes}% | NO: ${odds.no}%`);

// Get active/resolved markets
const active = await client.markets.getActive();
const resolved = await client.markets.getResolved();

Staking

// Approve USDC (one-time)
await client.approveUsdc();

// Stake on YES
await client.stake(19, 'YES', '10'); // 10 USDC

// Stake on NO
await client.stake(19, 'NO', '5'); // 5 USDC

// Check my stake
const stake = await client.getMyStake(19);
console.log(stake.amount, stake.isYes, stake.claimed);

// Calculate potential payout
const estimate = await client.calculatePayout(19, 'YES', '10');
console.log(estimate.potentialPayout, estimate.odds);

Resolution & Claims

// Check if market can be resolved
const canResolve = await client.canResolve(19);

// Resolve market (anyone can call after deadline)
await client.resolve(19);

// Claim winnings
await client.claim(19);

Create Market

// Chainlink-resolved market
const marketId = await client.createMarket({
  question: 'Will BTC reach $150k by June 2026?',
  resolver: 'chainlink',
  resolverParams: {
    asset: 'BTC',
    targetPrice: 150000,
    isGreaterThan: true,
  },
  deadline: Math.floor(Date.now() / 1000) + 86400 * 90,
  creatorFeeBps: 100, // 1%
});

Circle Wallet

import { CircleWallet } from '@clawshi/sdk';

// Create new wallet
const wallet = await CircleWallet.create({
  apiKey: process.env.CIRCLE_API_KEY,
  userId: 'user-123',
});

// Get balances
const usdc = await wallet.getUsdcBalance();
const eth = await wallet.getEthBalance();

Contract Addresses (Base Mainnet)

| Contract | Address | |----------|---------| | MarketFactory | 0xc0DeBCEa2F1BcB268b01777ff9c8E3BB4dA85559 | | ChainlinkResolver | 0xDEbe4E62bEE1DA1657008480e6d91a3f1E3CCaeC | | ManualResolver | 0x3602D8989920B9A9451BF9D9562Bb97BA7cEd1bb | | USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |

License

MIT