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

@collinsville22/sanctum-gateway-sdk

v1.0.0

Published

TypeScript SDK for Sanctum Gateway - Solana transaction optimization and multi-path delivery

Readme

Sanctum Gateway SDK

TypeScript SDK for Sanctum Gateway - Solana transaction optimization and multi-path delivery.

What is Sanctum Gateway?

Sanctum Gateway is a high-performance API for optimizing and delivering Solana transactions through multiple paths simultaneously (RPC, Jito, Triton, Paladin). It provides:

  • Transaction Optimization - Auto-calculate compute units and priority fees
  • Multi-Path Delivery - Send transactions through multiple channels at once
  • Jito Tip Refunds - Get refunded if regular RPC succeeds first
  • Real-time Metrics - Track which delivery method succeeded

Installation

npm install @sanctum-gateway/sdk

Quick Start

import { GatewayClient } from '@sanctum-gateway/sdk';

// Initialize the client
const gateway = new GatewayClient({
  rpcUrl: 'https://tpg.sanctum.so/v1/mainnet?apiKey=YOUR_API_KEY',
  apiKey: 'YOUR_API_KEY',
  network: 'mainnet-beta'
});

// Send a transaction
const result = await gateway.sendTransaction({
  transaction: signedTransactionBase64,
  jitoTip: 10000 // Optional: 0.00001 SOL tip
});

console.log('Transaction signature:', result.signature);
console.log('Delivered via:', result.deliveryPath);
console.log('Landing time:', result.landingTime, 'ms');
console.log('Jito refunded:', result.jitoRefunded);

API Reference

Constructor

const gateway = new GatewayClient(config);

Parameters:

  • config.rpcUrl (string) - Gateway RPC endpoint URL
  • config.apiKey (string, optional) - Your Gateway API key
  • config.network ('mainnet-beta' | 'devnet' | 'testnet') - Solana network
  • config.timeout (number, optional) - Request timeout in ms (default: 30000)

Methods

optimizeTransaction(params)

Optimize a transaction with auto-calculated compute units and priority fees.

const optimized = await gateway.optimizeTransaction({
  transaction: base64Transaction,
  cuPrice: 1000, // Optional: priority fee in microlamports
  enabledDeliveryMethods: ['rpc', 'jito'], // Optional
  expireInSlot: 100 // Optional: slots until expiry
});

console.log('Optimized transaction:', optimized.optimizedTransaction);
console.log('Estimated cost:', optimized.estimatedCost);

Returns:

  • optimizedTransaction (string) - Base64 encoded optimized transaction
  • computeUnits (number) - Calculated compute units
  • priorityFee (number) - Optimal priority fee
  • estimatedCost (number) - Estimated transaction cost

sendTransaction(params)

Send a transaction through Gateway's multi-path delivery.

const result = await gateway.sendTransaction({
  transaction: signedBase64Transaction,
  enabledDeliveryMethods: ['rpc', 'jito', 'triton', 'paladin'], // Optional
  jitoTip: 10000, // Optional: tip in lamports
  deliveryDelay: 50 // Optional: delay between methods in ms
});

Returns:

  • signature (string) - Transaction signature
  • deliveryPath ('rpc' | 'jito' | 'triton' | 'paladin') - Which method succeeded
  • landingTime (number) - Time to land in milliseconds
  • actualCost (number) - Actual cost paid in lamports
  • jitoRefunded (boolean) - Whether Jito tip was refunded

getTransactionStatus(signature)

Get the status of a transaction.

const status = await gateway.getTransactionStatus(signature);

Configuration

Getting an API Key

  1. Visit gateway.sanctum.so
  2. Create an account
  3. Generate an API key
  4. Use it in your configuration

Network Endpoints

Mainnet:

https://tpg.sanctum.so/v1/mainnet?apiKey=YOUR_API_KEY

Devnet:

https://tpg.sanctum.so/v1/devnet?apiKey=YOUR_API_KEY

Complete Example

import { Connection, Keypair, Transaction, SystemProgram, LAMPORTS_PER_SOL } from '@solana/web3.js';
import { GatewayClient } from '@sanctum-gateway/sdk';

async function sendWithGateway() {
  // 1. Create a transaction
  const connection = new Connection('https://api.mainnet-beta.solana.com');
  const wallet = Keypair.generate();

  const transaction = new Transaction().add(
    SystemProgram.transfer({
      fromPubkey: wallet.publicKey,
      toPubkey: wallet.publicKey,
      lamports: 0.001 * LAMPORTS_PER_SOL
    })
  );

  // 2. Get recent blockhash
  const { blockhash } = await connection.getLatestBlockhash();
  transaction.recentBlockhash = blockhash;
  transaction.feePayer = wallet.publicKey;

  // 3. Sign transaction
  transaction.sign(wallet);

  // 4. Serialize to base64
  const serialized = transaction.serialize().toString('base64');

  // 5. Send via Gateway
  const gateway = new GatewayClient({
    rpcUrl: 'https://tpg.sanctum.so/v1/mainnet?apiKey=YOUR_API_KEY',
    apiKey: 'YOUR_API_KEY',
    network: 'mainnet-beta'
  });

  const result = await gateway.sendTransaction({
    transaction: serialized,
    jitoTip: 10000 // 0.00001 SOL
  });

  console.log('Success!');
  console.log('Signature:', result.signature);
  console.log('Delivered via:', result.deliveryPath);
  console.log('Landing time:', result.landingTime, 'ms');

  if (result.jitoRefunded) {
    console.log('Jito tip was refunded!');
  }
}

sendWithGateway();

Delivery Methods

The SDK supports these delivery methods:

  • RPC - Standard Solana RPC nodes
  • Jito - Jito MEV bundle delivery
  • Triton - Triton Cascade delivery
  • Paladin - Paladin delivery network

Transactions are sent through all enabled methods simultaneously. The first to succeed wins, and Jito tips are refunded if RPC succeeds first.

Error Handling

try {
  const result = await gateway.sendTransaction({
    transaction: signedTx
  });
  console.log('Success:', result.signature);
} catch (error) {
  console.error('Gateway error:', error.message);
  // Handle error
}

TypeScript Support

The SDK is written in TypeScript and includes full type definitions.

import {
  GatewayClient,
  GatewayConfig,
  SendTransactionParams,
  SendTransactionResponse,
  DeliveryMethod
} from '@sanctum-gateway/sdk';

License

MIT

Resources

Contributing

Contributions welcome! Please open an issue or PR on GitHub.