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

@problee/sdk

v0.1.2

Published

TypeScript SDK for the Problee Agent API. Discover markets, get quotes, prepare trades, subscribe to events.

Readme

@problee/sdk

TypeScript SDK for the Problee Agent API.

v0.1.0 is hand-typed for the highest-traffic endpoints. v1.0.0 will be auto-generated from the OpenAPI spec at https://api.problee.com/api/agent/v1/openapi.json — types perfectly in sync with the protocol. Watch the changelog for the upgrade.

Install

npm install @problee/sdk
# or
pnpm add @problee/sdk

Zero runtime dependencies. Node 18+ (uses native fetch).

Get an API key

https://problee.com/developer/register-agent

Or use the @problee/mcp CLI:

npx @problee/mcp register

Usage

import { ProbleeClient } from "@problee/sdk";

const client = new ProbleeClient({ apiKey: process.env.PROBLEE_API_KEY! });

// Who am I?
const me = await client.me();
console.log(me.tier, me.scopes);

// Discover live markets
const { markets } = await client.markets.list({ lifecycle: "live", limit: 10 });

// Get a quote
const quote = await client.trade.quote({
  marketAddress: "0x...",
  outcome: 1,
  side: "buy",
  amount: "100",
});
console.log(`Price ${quote.price}, slippage ${quote.slippageBps}bps`);

// Prepare a trade (returns a calldata payload to sign)
const prepared = await client.trade.prepare({
  marketAddress: "0x...",
  outcome: 1,
  side: "buy",
  amount: "100",
  walletAddress: "0xYourWallet",
  slippageBps: 100,
});
// Sign and broadcast `prepared.call` with your wallet client of choice

Coverage in v0.1.0

| Method | Endpoint | |---|---| | client.me() | GET /me | | client.markets.list(params?) | GET /discover/markets | | client.markets.get(address) | GET /discover/markets/{address} | | client.markets.chart(address, params?) | GET /discover/markets/{address}/chart | | client.trade.quote(body) | POST /trade/quote | | client.trade.prepare(body) | POST /trade/prepare | | client.events.types() | GET /events/types | | client.events.subscribe(types?) | GET /events/subscribe (SSE) | | client.auth.deviceCode(params?) | POST /authorizations/device | | client.auth.deviceToken(code) | POST /authorizations/token | | client.request<T>(method, path, body?) | escape hatch — typed fetch over any endpoint |

For everything else, use client.request() until v1.0.0 lands. The escape hatch returns whatever the server sends, validated as JSON.

Streaming events (SSE)

const res = await client.events.subscribe(["market.created", "trade.executed"]);
const reader = res.body!.getReader();
const decoder = new TextDecoder();
while (true) {
  const { value, done } = await reader.read();
  if (done) break;
  // Parse the SSE chunks — each event is `event: name\ndata: {...}\n\n`
  console.log(decoder.decode(value));
}

Device-code auth (no API key in env)

For CLI tools that don't want users to copy/paste an API key:

import { ProbleeClient } from "@problee/sdk";

// Use a starter client with no key (just to discover endpoints), then upgrade
const starter = new ProbleeClient({ apiKey: "anonymous" });
const code = await starter.auth.deviceCode({ clientName: "my-cli", scopes: ["markets:read"] });
console.log(`Visit ${code.verification_uri} and enter ${code.user_code}`);

// Poll for completion
let token: string | undefined;
while (!token) {
  await new Promise((r) => setTimeout(r, code.interval * 1000));
  const res = await starter.auth.deviceToken(code.device_code);
  if (res.access_token) token = res.access_token;
  else if (res.error && res.error !== "authorization_pending" && res.error !== "slow_down") {
    throw new Error(`auth failed: ${res.error}`);
  }
}

// Now use it
const client = new ProbleeClient({ apiKey: token });

Errors

All non-2xx responses throw ProbleeError:

import { ProbleeClient, ProbleeError } from "@problee/sdk";

try {
  await client.trade.quote(...);
} catch (err) {
  if (err instanceof ProbleeError) {
    console.error(err.status, err.code, err.requestId);
    console.error(err.body); // full RFC 7807 problem+json body
  }
}

Required scopes per endpoint

| Capability | Required API-key scope | |---|---| | List chains, read public metadata | none | | Read markets and events | markets:read | | Quote trades | trade:quote | | Create markets | markets:create | | Prepare or execute trades | trade:execute | | Read portfolio and fees | portfolio:read | | Manage webhooks | webhooks:manage |

Companion packages

  • @problee/mcp — installer for the Problee MCP server in Claude Desktop / Cursor / Codex
  • @problee/ai — Vercel AI SDK provider that exposes Problee tools to generateText/streamText

Links

  • Live API: https://api.problee.com/api/agent/v1/
  • OpenAPI spec: https://api.problee.com/api/agent/v1/openapi.json
  • Agent docs: https://problee.com/developer
  • Source: https://github.com/probleeprotocol/problee/tree/main/sdk/typescript/sdk

License

MIT