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

@pincerpay/solana

v0.2.0

Published

Solana integration for PincerPay. Kora gasless transactions and Squads smart account support.

Readme

@pincerpay/solana

npm downloads license TypeScript

Solana infrastructure integrations for PincerPay: Kora gasless transactions and Squads SPN smart accounts.

Install

npm install @pincerpay/solana

Kora (Gasless Transactions)

Agents pay transaction fees in USDC instead of SOL via Kora signer nodes.

Quick Start

import { createKoraClient, createKoraFacilitatorSvmSigner, parseKoraConfig } from "@pincerpay/solana/kora";

// Parse config from environment variables (KORA_RPC_URL, KORA_API_KEY)
const config = parseKoraConfig(process.env);

// Low-level client
const kora = createKoraClient({
  rpcUrl: "https://your-kora-node.example.com",
  apiKey: "optional-api-key",
});

const feePayer = await kora.getFeePayer();

// x402 facilitator integration
const signer = createKoraFacilitatorSvmSigner({
  config: { rpcUrl: "https://your-kora-node.example.com" },
  rpcUrls: { "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": "https://api.devnet.solana.com" },
});

await signer.init(); // Fetches fee payer address from Kora node

API Reference

interface KoraConfig {
  rpcUrl: string;
  apiKey?: string;
}

function createKoraClient(config: KoraConfig): KoraRpcClient;

function createKoraFacilitatorSvmSigner(options: {
  config: KoraConfig;
  rpcUrls?: Record<string, string>;
}): FacilitatorSvmSigner & { init(): Promise<void> };

// Parse KORA_RPC_URL and KORA_API_KEY from env — returns null if no URL
function parseKoraConfig(env: Record<string, string | undefined>): KoraConfig | null;

// Zod schema for KoraConfig validation
const koraConfigSchema: z.ZodObject<{ rpcUrl: z.ZodString; apiKey: z.ZodOptional<z.ZodString> }>;

Squads SPN (Smart Accounts)

Decentralized policy co-signer for agent sub-accounts with on-chain spending limits via the Squads Protocol.

Quick Start

import {
  deriveSmartAccountPda,
  createSpendingLimit,
  checkSpendingLimit,
  revokeSpendingLimit,
  SpendingLimitPeriod,
} from "@pincerpay/solana/squads";

// Derive smart account PDA
const [smartAccountPda] = await deriveSmartAccountPda(creatorAddress, 0);

// Create a daily spending limit
const ix = await createSpendingLimit(
  {
    smartAccountPda,
    mint: usdcMintAddress,
    amount: 10_000_000n, // 10 USDC
    period: SpendingLimitPeriod.Day,
    members: [agentAddress],
    destinations: [merchantAddress],
  },
  0, // spending limit index
  authorityAddress
);

// Check remaining allowance
const limit = await checkSpendingLimit(smartAccountPda, 0, rpcUrl);
// { exists: true, remainingAmount: 8_000_000n, period: "Day" }

// Revoke a spending limit
const revokeIx = await revokeSpendingLimit(smartAccountPda, 0, authorityAddress, rentCollectorAddress);

API Reference

PDA Derivation

async function deriveSmartAccountPda(
  creator: Address, accountIndex: number, programId?: Address
): Promise<[Address, number]>;

async function deriveSettingsPda(
  smartAccountPda: Address, programId?: Address
): Promise<[Address, number]>;

async function deriveSpendingLimitPda(
  smartAccountPda: Address, spendingLimitIndex: number, programId?: Address
): Promise<[Address, number]>;

High-Level Spending Limit Management

async function createSpendingLimit(
  config: SpendingLimitConfig, spendingLimitIndex: number, authority: Address
): Promise<Instruction>;

async function checkSpendingLimit(
  smartAccountPda: Address, spendingLimitIndex: number, rpcUrl: string
): Promise<{ exists: boolean; remainingAmount?: bigint; period?: SpendingLimitPeriod } | null>;

async function revokeSpendingLimit(
  smartAccountPda: Address, spendingLimitIndex: number, authority: Address, rentCollector: Address
): Promise<Instruction>;

Low-Level Instruction Builders

For fine-grained control over transaction construction:

// Create a new Squads Smart Account
function createSmartAccountInstruction(config: SmartAccountConfig): Promise<Instruction>;

// Add a spending limit to an existing Smart Account
function addSpendingLimitInstruction(
  config: SpendingLimitConfig, spendingLimitIndex: number, authority: Address
): Promise<Instruction>;

// Use (decrement) a spending limit
function useSpendingLimitInstruction(...): Promise<Instruction>;

// Remove a spending limit and reclaim rent
function removeSpendingLimitInstruction(params: {
  smartAccountPda: Address;
  spendingLimitIndex: number;
  authority: Address;
  rentCollector: Address;
}): Promise<Instruction>;

Types

enum SpendingLimitPeriod {
  OneTime = 0,
  Day = 1,
  Week = 2,
  Month = 3,
}

interface SpendingLimitConfig {
  smartAccountPda: Address;
  mint: Address;
  amount: bigint;
  period: SpendingLimitPeriod;
  members: Address[];
  destinations: Address[];
}

interface SmartAccountConfig {
  creator: Address;
  accountIndex: number;
  members: Address[];
  threshold: number;
}

const SQUADS_PROGRAM_ID = "SMRTzfY6DfH5ik3TKiyLFfXexV8uSG3d2UksSCYdunG";

Common Patterns

Kora + Squads together

import { createKoraFacilitatorSvmSigner } from "@pincerpay/solana/kora";
import { deriveSmartAccountPda, checkSpendingLimit } from "@pincerpay/solana/squads";

// Agent pays gas in USDC (Kora) + has on-chain spending limits (Squads)
const signer = createKoraFacilitatorSvmSigner({ config: koraConfig });
const [smartAccount] = await deriveSmartAccountPda(creator, 0);
const limit = await checkSpendingLimit(smartAccount, 0, rpcUrl);

Parse Kora config from environment

import { parseKoraConfig } from "@pincerpay/solana/kora";

const config = parseKoraConfig(process.env);
if (config) {
  console.log("Kora enabled:", config.rpcUrl);
} else {
  console.log("Kora not configured, using local keypair for gas");
}

Anti-Patterns

Don't skip signer.init() for Kora

The Kora signer must call init() before use -- it fetches the fee payer address from the Kora node.

Don't use Squads on EVM

Squads SPN is Solana-only. For EVM agent permissions, use ERC-7715 session keys instead.