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

@q3labs/pact-insurance

v0.1.4

Published

TypeScript SDK for Pact Network's on-chain parametric insurance program on Solana — enable insurance, top up delegations, submit claims, and query pool state.

Readme

@q3labs/pact-insurance

TypeScript SDK for Pact Network's on-chain parametric insurance program on Solana. Enable coverage for an agent against a specific API provider, top up USDC delegations, query pool state, and submit claims when the provider fails.

Pact Network monitors API provider reliability in real time, computes actuarially-derived insurance rates from observed failure data, and pays out claims automatically when covered calls fail. This SDK is the Anchor client that agents use to interact with the insurance program.

Install

npm install @q3labs/pact-insurance

Quick start

import { PactInsurance } from "@q3labs/pact-insurance";
import { Keypair } from "@solana/web3.js";

const insurance = new PactInsurance({
  rpcUrl: "https://api.mainnet-beta.solana.com",
  programId: "<pact-insurance-program-id>",
});

const agentKeypair = Keypair.generate();

// Enable insurance coverage for an API provider with a USDC allowance
await insurance.enableInsurance(agentKeypair, {
  providerHostname: "api.example.com",
  allowanceUsdc: 10_000_000n, // 10 USDC in base units
});

Features

  • enableInsurance — Create an agent insurance policy for a given provider and delegate a USDC allowance to the pool.
  • topUpDelegation — Increase the delegated USDC allowance for an existing policy.
  • getPolicy — Read policy state (premiums paid, claims received, remaining allowance, etc.).
  • submitClaim — Submit a claim with backend-signed proof of a failed covered call.
  • estimateCoverage — Given the current provider rate, estimate how many calls a USDC allowance will cover.

See src/types.ts for the full type definitions and src/client.ts for all methods.

IDL

The program IDL is bundled at idl/pact_insurance.json as data only. The address field inside that file reflects whichever deploy was current when the SDK was published (devnet today, mainnet later) and is never used at runtime — the SDK overrides it with the programId you pass to PactInsurance. This makes the SDK program-ID-agnostic: a consumer pinned to an older SDK version will still talk to whatever deploy you point them at via config.

You can import the IDL directly if you need to build custom Anchor instructions, but you must supply your own program ID:

import idl from "@q3labs/pact-insurance/idl/pact_insurance.json" with { type: "json" };

Configuration

new PactInsurance({
  rpcUrl: "https://api.mainnet-beta.solana.com",
  programId: "<program-id>",             // required — authoritative, overrides IDL
  backendUrl: "https://pactnetwork.io",  // optional, for claim signing
  apiKey: "...",                         // optional
});

License

MIT — see LICENSE.