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

@saw-protocol/sdk

v1.0.8

Published

The unified orchestration SDK for the SAWP Protocol

Downloads

1,022

Readme

Solana Agentic Wallet Protocol (SAWP)

The standard for autonomous AI wallet orchestration on Solana.

NPM Version NPM Downloads GitHub Stars Live Demo

WATCH the demo video here


🌐 The Vision

SAWP is an open-source protocol and SDK suite designed to empower AI agents with secure, autonomous, and programmable financial capabilities. It defines a unified standard for how agents create identities, subscribe to wallets, sign transactions, and interact with the Solana ecosystem—all while operating within strict, human-defined safety boundaries.

Just as ERC-4337 brought account abstraction to Ethereum, SAWP brings agentic abstraction to Solana, ensuring that security is structural, models are interchangeable, and agents are first-class network citizens.


💎 Core Pillars

1. The Wallet is Infrastructure

In SAWP, the wallet is a physical execution daemon (the Execution Plane) that secures keys. The agent is a logical client (the Tooling Plane) that dispatches signed intents. This separation allows you to swap AI models (GPT-4o, Claude 3.5, Local Llama) without migrating your keys or re-writing your logic.

2. Structural Security (The Sandbox)

Every transaction intent generated by an AI is subjected to the SAWP Sandbox.

  • Policy Engine: Enforces spend limits, network scope, and allowed program IDs.
  • NodeSandbox: Wraps execution in an isolated environment with CPU/Memory limiting and timeout protection.
  • Observation Plane: Real-time audit logging of every intent, decision, and signature.

3. Network Citizenship

Agents are not just scripts; they have DIDs (Decentralized Identifiers). They can discover other agents, verify each other's signatures, delegate permissions, and connect to dApps via the same interfaces used by human wallets.


🚀 Live Demo

Experience the protocol in action without setting up a local environment:

👉 Try the SAWP Agent Chat App

Features on display:

  • Autonomous Tool Selection: Watch the agent decide which Solana tools to call.
  • Real-time Observability: Inspect the sandbox metrics and policy evaluations for every prompt.
  • On-chain Action: Execute real Devnet transactions (Airdrops, Transfers, Swaps).

🛠️ Quick Start (v1.0.8)

Installation

Install the primary orchestration SDK:

npm install @saw-protocol/sdk @saw-protocol/keystore-env @saw-protocol/runtime-openai

Basic Implementation

import { SAWP, Agent, generateAgentDID } from "@saw-protocol/sdk";
import { OpenAIRuntime } from "@saw-protocol/runtime-openai";

// 1. Initialize the Execution Plane (Wallet)
const wallet = await SAWP.Wallet.create({
  keyStore: new MyCustomKeyStore(),
  network: "devnet",
});

// 2. Provision Identity & Authorize
const { did, keypair } = generateAgentDID();
await wallet.authorize({ id: did, did, keypair });

// 3. Synthesize the Agent
const agent = new Agent({
  did,
  runtime: new OpenAIRuntime({ apiKey: "sk-..." }),
  targetWallet: wallet, // Same-process mode
  keypair,
});

// 4. Execute
const receipt = await agent.run(
  "Check my balance and airdrop some SOL if I'm low.",
);
console.log(receipt.outcome); // 'success'

🧠 Behind the Scenes: How it Works

The SAWP protocol operates on a decoupled Intent-Action-Receipt flow. This ensures that the AI never has direct access to private keys, and every decision is verifiable.

1. The Intent Flow

  1. Reasoning: The AI model (Prompt) generates a natural language plan and selects a Tool.
  2. Intent: The SDK wraps this into a TransactionIntent containing the requested action, parameters, and the AI's internal reasoning.
  3. Policy Check: Before hitting the blockchain, the Policy Plane evaluates the intent against active PolicyRules (e.g., "Max $50 per swap").
  4. Sandbox Execution: The intent is passed to the Execution Plane. The logic runs inside the NodeSandbox to prevent CPU spikes or infinite loops.
  5. Signing & Broadcast: If all checks pass, the Wallet (holding the keys) signs the transaction and broadcasts it to Solana.
  6. Receipt: An immutable ExecutionReceipt is generated, hashed, and recorded in the Observation Plane.

2. The 7 Planes of SAWP

To ensure modularity, the protocol is strictly divided into functional planes:

  • 🛡️ Identity Plane: Manages Ed25519-based DIDs for Agents and Wallets.
  • 📜 Policy Plane: A stateful engine that evaluates permissions in real-time.
  • Execution Plane: The bridge to the Solana blockchain (Building, Signing, Broadcasting).
  • 👁️ Observation Plane: The "black box" recorder providing full auditability.
  • 📡 Communication Plane: A secure messaging layer (WebSocket/Local) between Agents and Wallets.
  • 🔗 Connection Plane: Standardized interfaces for dApps to "Connect Agent Wallet".
  • 🛠️ Tooling Plane: The catalog of high-level capabilities (DeFi, Staking, NFT) exposed to AI models.

📑 Developer Resources & Documentation

For a comprehensive guide to building with SAWP, please refer to our dedicated documentation:

📚 SDK Documentation

Complete API reference, implementation flows, and best practices for the SAWP SDK suite.

📜 Protocol Specification Index

Technical deep-dives into the 7-plane architectural model:


📦 Package Ecosystem

SAWP is built as a modular monorepo. Use only what you need.

| Package | Purpose | | :---------------------------- | :-------------------------------------------------------------- | | @saw-protocol/sdk | The unified entry point for all features. | | @saw-protocol/core | Core interfaces, types, and cryptographic primitives. | | @saw-protocol/policy | The rule-based permission and spending limit engine. | | @saw-protocol/sandbox | Process-level execution isolation and timeout management. | | @saw-protocol/builder | High-level Solana transaction construction. | | @saw-protocol/logger | Highly configurable logging pipeline for the Observation Plane. | | @saw-protocol/widget | Premium React components for dApp wallet connections. | | @saw-protocol/runtime-* | Adapters for OpenAI, Anthropic, and Local models. |


🧰 Integrated Tool Catalog

When you initialize a SAWP Agent, it automatically gains access to a robust set of Solana-native capabilities:

  • Self-Awareness: get_my_address, get_my_sol_balance, get_agent_info.
  • Balance & Accounts: get_sol_balance, get_token_balance, get_account_info.
  • Transfers: solana_transfer, spl_transfer.
  • DeFi (Jupiter): get_jupiter_quote, jupiter_swap, get_token_price.
  • Staking: stake_sol, unstake_sol.
  • Network: estimate_gas_fee, request_airdrop, get_network_stats.

📂 Project Structure

  • /packages: The core protocol source code.
  • /agent-chat-app: The source code for the Live Demo.
  • /spec: Comprehensive protocol specifications (Identity through to On-Chain Anchoring).
  • /docs: API references and implementation guides.

💻 Local Development

If you want to contribute to the protocol or run the chat app locally:

  1. Clone & Install:

    git clone https://github.com/timileyindev/sawp.git
    npm install
  2. Configure Environment:

    cp .env.example .env
    # Add your OPENAI_API_KEY and optional VITE_RPC_URL
  3. Run the Suite:

    npm run test:harness  # Interactive CLI for testing all planes
    npm run dev           # Start the local Agent Chat App