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

gatekeeper-plugin-solana

v0.1.0

Published

ElizaOS Plugin for Project Gatekeeper - Deterministic Pre-Flight Firewall & Gas Protection on Solana

Downloads

156

Readme

gatekeeper-plugin-solana

License: MIT ElizaOS npm version

Deterministic Pre-Flight Transaction Security & Gas Firewall Plugin for ElizaOS AI Agents.

Protect your autonomous ElizaOS agents from burning treasury SOL on failed swaps, DEX slippage reverts (0x1771), and account contention. Gatekeeper simulates swap intents off-chain before signing, dynamically clamps compute units (CU), and guarantees 0 gas burned on failed transactions.


⚡ Features

  • 🛡️ 0 Gas Burned on Reverts: Catches slippage errors (e.g. Raydium 0x1771), expired blockhashes, and account locking off-chain before priority fees are paid.
  • ✂️ Dynamic Compute Budget Clamping: Automatically injects exact compute unit limits (simulated + 12% safety buffer), saving over 150,000 unneeded compute units per swap.
  • ⚡ Sub-80ms Latency: Ultra-fast off-chain simulation against live Solana cluster state.
  • 📊 Context Provider for Agents: Supplies your ElizaOS agent with real-time stats on preserved fees and protected capital.

📦 Installation

npm install gatekeeper-plugin-solana

Or with pnpm:

pnpm add gatekeeper-plugin-solana

⚙️ Environment Variables

Configure your ElizaOS character file or .env with the following variables:

| Variable | Description | Default | | :--- | :--- | :--- | | GATEKEEPER_API_KEY | (Required for production) Your secret Gatekeeper API Key | gk_... | | GATEKEEPER_API_URL | Gatekeeper Gateway Base URL | https://gk.ai-futures-bot.pro |


🚀 Quickstart: Integrating into ElizaOS Runtime

1. Character File Configuration (character.json)

{
  "name": "SolanaTreasuryGuard",
  "plugins": ["@gatekeeper/plugin-solana"],
  "settings": {
    "secrets": {
      "GATEKEEPER_API_KEY": "gk_your_production_api_key",
      "GATEKEEPER_API_URL": "https://gk.ai-futures-bot.pro"
    }
  }
}

2. Direct Programmatic Registration

import { AgentRuntime } from "@elizaos/core";
import { gatekeeperPlugin } from "@gatekeeper/plugin-solana";

const runtime = new AgentRuntime({
  character: myCharacter,
  plugins: [
    gatekeeperPlugin,
    // ...other plugins (e.g. solana trading)
  ],
});

await runtime.initialize();

🔍 How it Works

  1. When a user requests a swap (e.g. "Swap 0.5 SOL for USDC"), the GATEKEEPER_PREFLIGHT action intercepts the trading parameters.
  2. The plugin submits a pre-flight intent to the Gatekeeper Gateway (https://gk.ai-futures-bot.pro/api/v1/preflight).
  3. If valid, the trade is APPROVED with an exact clamped compute budget (e.g. 49,078 CU instead of 200,000 CU).
  4. If invalid (e.g. DEX revert 0x1771), Gatekeeper returns HARD_ABORT off-chain:
    🛡️ [Gatekeeper Pre-Flight] HARD_ABORT triggered in 54ms!
    • Reason: ERR_SLIPPAGE_EXCEEDED (0x1771)
    • On-Chain Gas Paid: 0 Lamports (0.00 SOL verbrannt)
    • Preserved Fees: 0.007556 SOL saved in agent treasury.

🧪 Testing

Run the included smoke test suite:

npm test

📜 License

MIT License. See LICENSE for details.