Start

Install

The SDK is a small TypeScript package on top of @solana/web3.js. It has no Anchor dependency; it builds instructions from the bundled IDL.

Package

bash
npm install @proglet/sdk @solana/web3.js @solana/spl-token

The package is on npm as @proglet/sdk, MIT licensed. Until 1.0, a minor version may change the API, so pin the version you use.

@solana/web3.js (1.95 or newer) and @solana/spl-token (0.4 or newer) are peer dependencies, so the SDK uses the same copies as your app.

A client

ProgletClient wraps a connection and reads accounts, quotes and builds swaps in one call each.

ts
import { Connection, PublicKey } from "@solana/web3.js";
import { ProgletClient } from "@proglet/sdk";

const connection = new Connection("https://api.mainnet-beta.solana.com", "confirmed");
const client = new ProgletClient(connection);

const mint = new PublicKey("<coin mint>");
const pool = await client.fetchPool(mint); // null if the coin has no Proglet pool
const pools = await client.fetchAllPools(); // every pool, with its address

Everything else in the SDK is plain functions, so you can also bring your own account data, for example from the Data API.

Program and IDs

PROGLET_PROGRAM_IDPublicKeyPRGKG2z95rbzHWU5EnhQAMFx7V4m94VqziiNeqHiRgE
PUMP_PROGRAM_IDPublicKey6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P, pump.fun
PUMP_MAYHEM_PROGRAM_IDPublicKeyMAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e, used by pump.fun's create

Every builder and PDA helper takes an optional programId as its last argument, for local deployments.

In the browser

The SDK and web3.js use Node's Buffer. Browsers don't have it, so install a polyfill once, before the SDK is used:

ts
import { Buffer } from "buffer";
if (typeof globalThis.Buffer === "undefined") globalThis.Buffer = Buffer;
Polyfilled Buffers often lack the BigInt read and write methods. The SDK never relies on them (it encodes 64-bit integers with DataView); if you decode accounts yourself, do the same.