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

@predge/ai-sdk

v0.1.0

Published

Predge tools for the Vercel AI SDK: signed settlement-risk checks for Polymarket markets (free) and x402-paid Polymarket data

Readme

@predge/ai-sdk

Predge tools for the Vercel AI SDK. Before your agent trades, pays or settles on a Polymarket market, it can check whether that market's resolution is settled, disputed or at risk. Records are read live from UMA's Optimistic Oracle on Polygon and signed with ed25519. Every signature is verified against Predge's published key.

The free tools need no API key and no wallet.

Install

npm install @predge/ai-sdk ai zod

Usage

import { generateText, stepCountIs } from "ai";
import { predgeTools } from "@predge/ai-sdk";

const { text } = await generateText({
  model: "openai/gpt-5-mini",
  prompt: "Is Polymarket market 5608010 safe to settle against? Check its settlement risk first.",
  tools: predgeTools(),
  stopWhen: stepCountIs(3),
});

console.log(text);

Paid tools (x402, USDC on Base)

Pass an account and the paid tools are added. Any viem account works, e.g. privateKeyToAccount.

import { privateKeyToAccount } from "viem/accounts";
import { predgeTools } from "@predge/ai-sdk";

const tools = predgeTools({
  account: privateKeyToAccount(process.env.BUYER_PRIVATE_KEY as `0x${string}`),
  maxPaymentUsd: 0.05, // per-call cap; 0 disables paid tools
});

Payments use x402 v2 (exact scheme, EIP-3009 USDC authorization on Base). The tool pays only USDC on the account's chain and never more than maxPaymentUsd per call.

Tools

| Key | Tool name | Price | What it does | |---|---|---|---| | predgeSettlementRisk | predge_get_settlement_risk | free | Signed settlement-risk record for a market (condition id, numeric id or slug): risk_level (ok, watch, caution, resolved), UMA state, disputes, signature check | | predgeVerifyRecord | predge_verify_record | free | Verifies a Predge signed record offline against the pinned key | | predgeSettlementEstimate | predge_get_settlement_estimate | $0.02 | Same record plus settlement_estimate: for a disputed market, the calibrated probability that it settles differently from the disputed proposal. Failed requests are not charged | | predgeWhaleTrades | predge_get_whale_trades | $0.005 | Latest Polymarket trades of $10,000+ notional, delayed 15 minutes |

An error, or a record whose signature does not verify, is never a "no risk" answer. The tool output says so.

Verifying records yourself

import { verifyPredgeRecord } from "@predge/ai-sdk";

const res = await fetch("https://api.predge.io/v1/settlement-risk/5608010");
console.log(verifyPredgeRecord(await res.json())); // { valid: true, kid: "13fa3d18a369e6c7", checks: {...} }

Links

  • API docs: https://predge.io/docs
  • OpenAPI: https://api.predge.io/openapi.json
  • Signing keys: https://api.predge.io/.well-known/predge-keys.json
  • Canonicalization spec: https://data.predge.io/canonicalization.md

MIT