Skip to content

Agent SDK quickstart

Three steps from a fresh project to a covered call. Assumes you’re on mainnet; for devnet or localnet, read the B1 callout first.

Terminal window
npm install @q3labs/pact-sdk
import { createPact } from "@q3labs/pact-sdk";
import { Keypair } from "@solana/web3.js";
const pact = await createPact({
network: "mainnet",
signer: Keypair.fromSecretKey(/* your 64-byte ed25519 secret */),
});

The SDK ships a default for every host, proxy, indexer, and program ID. On mainnet you shouldn’t have to touch any of them to try it.

const res = await pact.fetch("https://api.helius.xyz/v0/addresses/…");

That’s the whole thing on mainnet.

Once per agent, sign one SPL approve to the SettlementAuthority delegate. After this, covered breaches refund automatically via settle_batch — no claim form, no dispute.

await pact.setup({ allowanceUsdc: 5 });

If you skip this, pact.fetch() still works — calls just won’t be covered until the approve lands.

  • Node ≥ 18 — relies on the built-in fetch, TextEncoder, and WebCrypto globals.
  • Browser — works under any ESM bundler (Vite, Webpack 5, esbuild, Rollup).
  • ESM-only — there is no CJS export. If your toolchain still requires CJS, file an issue.