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

@zerodev/solana-sponsorship-sdk

v0.0.1

Published

TypeScript SDK for sponsoring Solana transactions via ZeroDev

Readme

Solana Sponsorship SDK

A TypeScript SDK for handling Solana transaction sponsorship, built with Bun.

Installation

bun add @solana/kit @solana-program/system @zerodev/solana-sponsorship-sdk

Quick Start

import {
  createTransactionMessage,
  pipe,
  setTransactionMessageLifetimeUsingBlockhash,
  address,
  blockhash,
  lamports,
  createSolanaRpc,
  devnet,
  generateKeyPairSigner,
  partiallySignTransactionMessageWithSigners,
  appendTransactionMessageInstructions,
  setTransactionMessageFeePayerSigner,
  createNoopSigner,
} from "@solana/kit";
import { getTransferSolInstruction } from "@solana-program/system";
import { sponsorTransaction, createSponsorshipRpc } from "@zerodev/solana-sponsorship-sdk";

async function main() {
  // Create RPC clients
  const sponsorshipRpc = createSponsorshipRpc({
    endpoint: `https://rpc.zerodev.app/api/v3/svm/${PROJECT_ID}/chain/9034109931`,
  });
  const solanaRpc = createSolanaRpc(devnet("https://api.devnet.solana.com"));

  // Get a recent blockhash
  const { value: { blockhash: recentBlockhash, lastValidBlockHeight } } = 
    await solanaRpc.getLatestBlockhash({ commitment: "finalized" }).send();

  // Generate test keypairs
  const fromKeypair = await generateKeyPairSigner();
  const toKeypair = await generateKeyPairSigner();

  // Create transfer instruction
  const transferInstruction = getTransferSolInstruction({
    source: fromKeypair,
    destination: toKeypair.address,
    amount: lamports(0n),
  });

  // Get fee payer from sponsorship server
  const feePayer = await sponsorshipRpc.getFeePayer().send();

  // Create and sponsor the transaction
  const sponsoredMessage = await pipe(
    createTransactionMessage({ version: "legacy" }),
    (message) => setTransactionMessageFeePayerSigner(
      createNoopSigner(address(feePayer)),
      message
    ),
    (message) => appendTransactionMessageInstructions(
      [transferInstruction],
      message
    ),
    (message) => setTransactionMessageLifetimeUsingBlockhash(
      {
        blockhash: blockhash(recentBlockhash),
        lastValidBlockHeight,
      },
      message
    )
  );

  // Sign and sponsor the transaction
  const signedMessage = await partiallySignTransactionMessageWithSigners(sponsoredMessage);
  const response = await sponsorTransaction(sponsorshipRpc, signedMessage);
  console.log(
    `Sponsored and broadcast by server: https://explorer.solana.com/tx/${response.signature}?cluster=devnet`
  );
}

Documentation

Core Concepts

  • Sponsorship RPC: Create and manage transaction sponsorship
  • Fee Payer: Get and set the sponsor's fee payer
  • Transaction Signing: Handle transaction signing with sponsored fee payer
  • Utils: Helper functions for common operations

API Reference

createSponsorshipRpc(config: SponsorshipConfig)

Creates a sponsorship RPC client for interacting with the sponsorship server.

sponsorTransaction(rpc, message)

Sponsors a transaction and returns a SponsorshipResponse. response.signature is the broadcast transaction signature, and response.message is the sponsored base64 wire transaction returned by the server.

getFeePayer()

Gets the sponsor's fee payer address from the sponsorship server.

License

MIT License