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

dark-x402-terminal

v1.0.0

Published

Dark X402 Terminal - Privacy-First DeFi Terminal with AI Agents

Readme

🌑 Dark X402 Terminal

A privacy-first DeFi terminal with Google Gen AI agents, multiple X402 agents, dark swaps, and shielded wallets

Version License Network


🚀 Features

🤖 AI Agents

  • Google Gen AI Integration - Chat with Gemini-powered agents for portfolio analysis and trading strategies
  • X402 Agent Swarm - Deploy multiple specialized AI agents (swap, arbitrage, portfolio, security)
  • TEE Security - Agents run in Trusted Execution Environments with attestation
  • Autonomous Operations - Agents can execute swaps, transfers, and analysis autonomously

🔄 Dark Swaps

  • Privacy-Preserving Swaps - Execute token swaps with Zcash Sapling privacy
  • Jupiter Integration - Best price routing across all Solana DEXs
  • Oracle Validation - Price protection with Birdeye oracle integration
  • MEV Protection - Shield transactions from MEV bots
  • Slippage Control - Customizable slippage tolerance

💼 Dark Wallets

  • Shielded Balances - Hide transaction amounts using zero-knowledge proofs
  • Sapling Addresses - Generate unlimited diversified addresses
  • Hierarchical Deterministic - BIP-39/BIP-32 compliant key derivation
  • Private Transfers - Send tokens without revealing amounts or recipients
  • Shield/Unshield - Move between public and private pools

🎨 X402 Dark Theme

  • Beautiful terminal UI with cyberpunk aesthetics
  • Interactive menus and prompts
  • Real-time balance and analytics displays
  • QR code support for addresses

📦 Installation

Prerequisites

Quick Start

# Clone the repository
cd terminal

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

# Edit .env and add your API keys
nano .env

# Build the terminal
npm run build

# Start the terminal
npm start

Development Mode

# Run in development with hot reload
npm run dev

# Watch mode
npm run watch

🔑 Configuration

Edit .env file with your API keys:

# Required
HELIUS_API_KEY=your_helius_api_key

# Optional (enables additional features)
JUPITER_API_KEY=your_jupiter_api_key
REDPILL_API_KEY=your_redpill_api_key
GOOGLE_AI_API_KEY=your_google_ai_api_key
NETWORK=devnet

API Keys

| Key | Required | Purpose | Get It | |-----|----------|---------|--------| | HELIUS_API_KEY | ✅ Yes | Solana RPC access | helius.dev | | JUPITER_API_KEY | ⚠️ Recommended | Token swaps | jup.ag | | GOOGLE_AI_API_KEY | 🎯 Optional | AI agents | Google AI Studio | | REDPILL_API_KEY | 🔐 Optional | TEE verification | redpill.ai |


💻 Usage

Starting the Terminal

npm start

Main Menu

🌑 DARK X402 TERMINAL

1. 🤖 X402 AI Agents
   - Launch Google Gen AI Agent
   - Deploy X402 Agent Swarm
   - List Active Agents
   - Agent Analytics
   - Execute Agent Action

2. 🔄 Dark Swaps
   - Execute Private Swap
   - Get Quote
   - Swap History

3. 💼 Wallet Manager
   - View Balances
   - Shield Tokens
   - Unshield Tokens
   - Private Transfer
   - Sapling Addresses
   - Export Keys

4. 📊 Dashboard
   - Portfolio overview
   - Agent statistics
   - Recent activity

5. ⚙️ Settings
   - Network selection
   - Privacy level
   - RPC endpoint

🤖 AI Agent Examples

Launch Google Gen AI Agent

// The terminal will guide you through:
1. Select "🤖 X402 AI Agents"
2. Choose "Launch Google Gen AI Agent"
3. Chat with the agent:

   You: "Analyze my portfolio and suggest optimizations"
   Agent: "Based on your current holdings of 10 SOL..."

   You: "Should I swap SOL for USDC now?"
   Agent: "Current SOL price is $150. Market indicators suggest..."

Deploy X402 Agent Swarm

// Deploy multiple specialized agents:
1. Select "Deploy X402 Agent Swarm"
2. Choose number of agents (1-10)
3. Agents are automatically assigned roles:
   - Swap Agent: Executes token swaps
   - Arbitrage Agent: Finds arbitrage opportunities
   - Portfolio Agent: Analyzes holdings
   - Security Agent: Monitors risks
   - Multi Agent: All capabilities

🔄 Dark Swap Examples

Execute Private Swap

// Privacy-preserving token swap:
1. Select "🔄 Dark Swaps"
2. Choose "Execute Private Swap"
3. Select tokens (e.g., SOL → USDC)
4. Enter amount
5. Set slippage tolerance
6. Review quote and confirm

// Transaction is shielded using Zcash Sapling
// Amounts and routes are hidden from observers

💼 Wallet Examples

Create Shielded Wallet

// First time setup:
1. Choose "🆕 Create new wallet"
2. Save your 24-word mnemonic phrase securely
3. Confirm by entering a random word
4. Wallet is ready with:
   - Solana public key
   - Sapling shielded address
   - Hierarchical deterministic keys

Shield Tokens

// Move tokens to private pool:
1. Select "💼 Wallet Manager"
2. Choose "🔐 Shield Tokens"
3. Enter amount to shield
4. Confirm transaction

// Tokens are now invisible to blockchain explorers

🏗️ Architecture

terminal/
├── x402-terminal.ts          # Main terminal class
├── google-ai-agent.ts        # Google Gen AI integration
├── x402-agents.ts            # X402 agent manager
├── dark-swap-ui.ts           # Swap interface
├── dark-wallet-manager.ts    # Wallet interface
├── index.ts                  # Entry point
├── package.json
├── tsconfig.json
└── .env.example

../Protocol/
├── client.ts                 # Dark Protocol client
├── wallet.ts                 # Wallet management
├── swap.ts                   # Swap manager
├── ai-agent.ts               # AI agent manager
├── sapling.ts                # Zcash Sapling
├── privacy.ts                # Privacy utilities
└── types.ts                  # Type definitions

🔐 Security

Current Status

  • Zcash Sapling cryptography - Production-grade privacy
  • ChaCha20-Poly1305 encryption - Secure note encryption
  • BIP-39/BIP-32 HD wallets - Standard key derivation
  • ⚠️ ZK-SNARK proofs - Using placeholders (not production-ready)
  • ⚠️ TEE attestation - Mock implementation (dev only)

Best Practices

  1. Never share your mnemonic - It's the only way to recover your wallet
  2. Use strong passwords - For encrypted storage
  3. Test on devnet first - Before using mainnet
  4. Verify transactions - Always check transaction signatures
  5. Keep software updated - Pull latest security patches

Known Limitations

  • ZK-SNARK circuits are placeholders (require production deployment)
  • TEE attestation is simulated (Intel SGX/AMD SEV not integrated)
  • This is alpha software (security audit pending)

🛣️ Roadmap

  • [ ] Production ZK-SNARK circuits
  • [ ] Real TEE attestation (Intel SGX/AMD SEV)
  • [ ] Multi-signature support
  • [ ] Hardware wallet integration
  • [ ] Mobile app companion
  • [ ] Advanced trading strategies
  • [ ] Social recovery
  • [ ] Governance integration

🤝 Contributing

We welcome contributions!

# Fork and clone
git clone https://github.com/your-username/dark-protocol
cd dark-protocol/terminal

# Create feature branch
git checkout -b feature/amazing-feature

# Make changes and commit
git commit -m "Add amazing feature"

# Push and create PR
git push origin feature/amazing-feature

📄 License

Apache License 2.0 - see LICENSE


🙏 Acknowledgments

  • Zcash Foundation - Sapling protocol
  • Electric Coin Company - Zcash implementation
  • Solana Labs - Solana blockchain
  • Helius - RPC infrastructure
  • Jupiter - DEX aggregation
  • Google - Gemini AI models
  • Anchor - Solana framework

📞 Support


⚠️ Disclaimer

This software is provided "as is" without warranty. Use at your own risk. This is alpha software not audited for production use. Do not use with significant funds on mainnet.


🌑 Welcome to the Dark Side of DeFi 🌑

Built with ❤️ by the Dark Protocol team