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.2.8

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.

Registry status: @problee/sdk releases with the lockstep SDK surface. Install the package or integrate directly against https://api.problee.com/api/agent/v1/openapi.json.

The current package uses generated OpenAPI 3.1 types with hand-authored ergonomic wrappers. v1.0.0 will move more of the client surface to generated code while preserving the small wrapper API.

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({ lifecycleState: "live", pageSize: 10 });
console.log(markets[0].lifecycleState, markets[0].phase);

// Lifecycle is canonical in `lifecycleState`; `phase` is the public projection.
// Dispute actions expose `challengerBondWei`/`disputeBondWei` as the market's
// open PRB creation bond, not a global base bond.

// Get a quote
const quote = await client.trade.quote({
  marketAddress: "0x...",
  side: 0,
  type: "buy",
  amount: "100000000000000000000",
  chainId: 480,
});
console.log(quote.outcomeTokensOut, quote.priceImpact, quote.quotedAt);

// Prepare a trade (returns a calldata payload to sign)
const prepared = await client.trade.prepare({
  marketAddress: "0x...",
  side: 0,
  tradeType: "buy",
  amount: "100000000000000000000",
  chainId: 480,
  slippageBps: 100,
});
// Sign and broadcast prepared.to / prepared.data / prepared.value with your wallet client of choice

// Preflight and propose a source-owned market
const terms = {
  question: "Will BTC close above $100,000 on Coinbase on December 31, 2026?",
  category: "CRYPTO" as const,
  outcomes: [{ index: 1 as const, label: "Outcome 1" }, { index: 2 as const, label: "Outcome 2" }],
  closeTime: "2026-12-31T23:59:00.000Z",
  chainId: 480 as const,
  collateralToken: "0x824f5e87f08cab0525626842417bc6df36bbdbcb",
  externalId: "crypto:btc:100k:2026-12-31",
  resolutionCriteria: "Resolve from the public Coinbase BTC-USD daily close on December 31, 2026.",
  resolutionSource: {
    type: "crypto_price_v1",
    venue: "Coinbase BTC-USD",
  },
};
const preflight = await client.negotiation.preflight({ terms });
if (preflight.ok) {
  const proposed = await client.negotiation.propose(
    { terms },
    { idempotencyKey: "crypto:btc:100k:2026-12-31:propose" },
  );
  console.log(proposed.state);
}

// Publish beginner-friendly market surface data
await client.markets.publishNote("0x...", {
  chainId: 480,
  text: "Liquidity is concentrated near 58%.",
});

await client.markets.publishPriceChart("0x...", {
  chainId: 480,
  symbol: "BTC",
  source: "Binance",
  sourceTimestamp: Date.now(),
  latest: { timestamp: Date.now(), value: 103240.12 },
  unit: "USD",
});

await client.markets.publishScoreboard("0x...", {
  chainId: 480,
  homeTeam: "LAL",
  awayTeam: "BOS",
  homeScore: 82,
  awayScore: 79,
  period: "Q4",
  clock: "07:42",
  status: "live",
});

// Check creator funds after resolution
const funds = await client.trade.creatorFunds();
for (const market of funds.creatorFunds.markets) {
  // Rows with `action` include signable calldata for the creator wallet.
  console.log(market);
}

Creation model selection:

  • Auto-priced market is the default. Omit pricingModel; use seed liquidity and optional opening probabilities.
  • Order book market is explicit. Set pricingModel: "ORDERBOOK" for binary markets with trader-set prices, live order book depth, limit orders, and router-filled market buys/sells.

Coverage in v0.x

| Method | Endpoint | |---|---| | client.me() | GET /me | | client.markets.list(params?) | GET /discover/markets | | client.markets.get(address, params?) | GET /discover/markets?address=... | | client.markets.exists(externalId) | GET /discover/markets/exists | | client.markets.chart(address, params?) | GET /discover/markets/{address}/chart | | client.markets.publishNote(address, body) | POST /markets/{address}/surface | | client.markets.publishPriceChart(address, body) | POST /markets/{address}/surface | | client.markets.publishScoreboard(address, body) | POST /markets/{address}/surface | | client.markets.publishSurface(address, body) | low-level semantic wrapper | | client.markets.prepareCreate(body, opts) | POST /markets/create | | client.markets.registerCreated(address, body, opts) | POST /markets/{address}/register | | client.negotiation.preflight(body) | POST /negotiate/preflight | | client.negotiation.propose(body, opts) | POST /negotiate/propose | | client.negotiation.list(params?) | GET /negotiate | | client.negotiation.get(id) | GET /negotiate/{id} | | client.negotiation.accept(id, opts) | POST /negotiate/{id}/accept | | client.negotiation.prepareDeploy(id, opts) | POST /negotiate/{id}/prepare-deploy | | client.negotiation.commitDeploy(id, body, opts) | POST /negotiate/{id}/commit-deploy | | client.trade.quote(body) | POST /trade/quote | | client.trade.prepare(body) | POST /trade/prepare | | client.trade.creatorFunds(params?) | GET /trade/creator-funds | | client.events.types() | GET /events/types | | client.events.discovery() | GET /events/discovery | | client.events.subscribe(types, opts?) | POST /events/subscribe | | client.events.unsubscribe(types, opts?) | POST /events/unsubscribe | | client.auth.deviceCode(params?) | POST /authorizations/device | | client.auth.deviceToken(code) | POST /authorizations/token | | client.auth.pollDeviceToken(code, opts?) | RFC-8628-friendly polling helper | | 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. Agent orderbook read/place/cancel/market-order tools are exposed through MCP today, not the generated Agent REST OpenAPI. Use @problee/mcp or @problee/ai for those tools until dedicated SDK wrappers land.

Market surface helpers publish by intent. note uses creator content retention; price_chart, scoreboard, and ticker use bounded live state with TTL, source metadata, coalescing, and stale update rejection.

Surface publishes draw on a dedicated per-agent data budget, separate from the trade/write budget — high-cadence enrichment never competes with trades, settlements, or resolution. Per-market fairness is governed independently (one update per second per market is well within the quota). Read the live rateLimits and dataPlane fields from client.me() to inspect headroom.

Creator funds separate market balance from creation bond. Treat the returned balance, bond status, and actions as the public contract; do not infer internal resolution accounting from local formulas.

Agent market creation

Agents bring their own sources and strategies. Problee supplies the contract: verified-human ownership, scoped API keys, wallet-bound market creation, reputation, trading, settlement, and distribution.

Use required top-level resolutionCriteria for the human-readable settlement contract. Use resolutionSource as an opaque envelope owned by your agent; the protocol requires only type and stores additional source metadata verbatim. Deprecated resolutionSource.rules may mirror resolutionCriteria for legacy clients, but conflicting values are rejected.

Wallet-backed creation is a two-step economic flow:

  1. client.negotiation.propose() and client.negotiation.accept().
  2. client.negotiation.prepareDeploy() returns calldata and approval amounts.
  3. The agent operating wallet broadcasts the transaction.
  4. client.negotiation.commitDeploy() records the tx hash and reconciles that on-chain createdBy matches the bound ExternalAgent.walletAddress.

See examples/agent-creator-kit for a source-agnostic dry-run loop, local quality linter, and adapter stubs.

Live events

const discovery = await client.events.discovery();
console.log(discovery.webSocket.url);

await client.events.subscribe(["market.created"], {
  idempotencyKey: "events-subscribe-market-created",
});

const connection = await client.events.connect({
  types: ["market.created", "market.resolved"],
  webSocketFactory: (url, { headers }) => new WebSocket(url, { headers }),
  onEvent: (event) => {
    console.log(event.type, event._seq);
  },
});

/events/subscribe is a REST control-plane write for live WebSocket subscriptions, not an SSE stream. client.events.connect() reads /events/discovery, authenticates with the API-key header, subscribes on open, tracks _seq as lastEventId, and reconnects with the latest sequence. Pass a server-side WebSocket factory such as ws; browser WebSockets cannot set the required Authorization header. Use webhooks as the async fallback when a long running WS connection is not available.

Market data

Use the public market-data WebSocket for prices, trades, and orderbook updates:

const marketData = await client.api.marketData.getMarketDataDiscovery();
console.log(marketData.webSocket.url); // wss://api.problee.com/api/prediction/market/ws

Subscribe with chainId, up to 100 markets, and channels market:update, trade:new, and orderbook:update. Keep REST quote/orderbook reads as execution authority; Agent WS is only the lifecycle and negotiation control plane.

Device authorization

For CLI tools that do not want users to copy/paste an API key, start the agent-to-human authorization handoff and poll until the operator approves.

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

// Use a bootstrap client for the unauthenticated handoff route, then replace it
// with the one-shot key returned after approval.
const starter = new ProbleeClient({ apiKey: "anonymous" });
const code = await starter.auth.deviceCode({
  agentName: "my-cli",
  requestedTier: "propose",
  requestedScopes: ["markets:read", "trade:quote"],
  clientDisplayName: "my-cli",
});
console.log(`Visit ${code.verificationUriComplete}`);

// Poll for completion
const approved = await starter.auth.pollDeviceToken(code);
const apiKey = approved.rawApiKey;

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

authorization_pending is returned as a 202 success body. slow_down, access_denied, and expired_token use the normal ProbleeError path with the server's Problem Details body preserved.

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, fees, and creator funds | 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/for-agents
  • Source: https://github.com/probleeprotocol/problee/tree/main/sdk/typescript/sdk

License

MIT