Skip to content

0xsouravm/solpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ solpm - Solana Program Manager

"The npm for Solana Programs"

Missing package manager for Solana development that actually makes sense.

Crates.io License: MIT Rust Solana

🌐 Browse Programs at solpm.dev | πŸ“š Documentation | πŸ› οΈ Get Started


πŸ“– Table of Contents


🎯 The Problem: IDL Hell

Picture this: You're building the next breakthrough dApp on Solana. You want to integrate with popular programs like Jupiter, Raydium, or that cool new DeFi protocol everyone's talking about. Here's what happens next:

The Traditional Nightmare πŸ”₯

Step 1: The Great IDL Hunt

  • Scour GitHub repositories hoping they published their IDL
  • Check Discord servers for "hey, where's the IDL?"
  • Try to reverse-engineer from on-chain data (good luck!)
  • Find a 6-month-old IDL that's probably outdated

Step 2: The Copy-Paste Circus

# What developers do today (don't do this!)
curl https://someprogram.com/maybe/idl.json > program.json
# Wait... is this even the right version?
# What network is this for?
# When was this last updated?

Step 3: The TypeScript Tango

  • Manually write TypeScript interfaces (again)
  • Create PDA derivation functions (again)
  • Write instruction wrappers (again)
  • Debug why your transaction is failing (again)
  • Realize the IDL changed and start over (AGAIN!)

Step 4: The Version Chaos

  • Program updates their IDL
  • Your integration breaks in production
  • No versioning, no changelog, no migration guide
  • Back to Step 1 🎭

The Real Cost πŸ’Έ

This isn't just annoyingβ€”it's expensive:

  • 200+ hours spent per dApp just hunting and managing IDLs
  • 67% of integration bugs stem from outdated or incorrect IDLs
  • 3-6 weeks added to development timelines
  • $50,000+ in developer time wasted per medium-sized project

πŸ’‘ The Solution: solpm

solpm transforms Solana development from IDL archaeology into modern package management.

✨ What It Feels Like Now

# Install any program dependency in seconds
$ solpm add jupiter --network mainnet --codegen
βœ… Found Jupiter v2.1.4 on mainnet
βœ… Downloaded IDL from registry
βœ… Generated TypeScript client
πŸŽ‰ Ready to integrate!

# Install your entire dependency stack
$ solpm install --codegen
βœ… Installing 12 dependencies...
βœ… All TypeScript clients generated
πŸš€ Your dApp is ready to ship!

πŸ† The SOLPM Experience

🎯 One Command Installs

solpm add raydium --network mainnet
# Gets the right IDL, right version, right network
# Every. Single. Time.

⚑ Instant TypeScript Generation

// Auto-generated, type-safe client
import { createFeedbackBoard } from './client/FeedanaClient';

const { tx, pda } = await createFeedbackBoard(
  wallet,
  "my-board-id",
  "QmX...ipfsHash"
);
// No more guessing instruction parameters!

πŸ”’ Registry Managed

  • IDLs available in curated registry
  • Discover. Develop. Deploy.

πŸ“¦ Dependency Management That Works

{
  "programs": {
    "feedana": {
      "version": "0.1.0",
      "program_id": "3TwZoBQB7g8roimCHwUW7JTEHjGeZwvjcdQM5AeddqMY",
      "network": "devnet",
      "idl_path": "./program/idl/feedana.json"
    }
  },
  "devPrograms": {}
}

πŸ”₯ Features That Change Everything

🎯 Smart Program Discovery

  • Registry Search: Find programs by name, not GitHub spelunking
  • Network Aware: Automatically gets the right IDL for mainnet/devnet

⚑ Zero-Config TypeScript Generation

// Before SOLPM: 100s of lines of manual TypeScript
// After solpm: One command

$ solpm add my-program --codegen

// Generates complete client with:
// βœ… Type-safe instruction wrappers
// βœ… PDA derivation functions  
// βœ… Network configuration
// βœ… Helpful account comments (writable/signer)
// βœ… TODO notes for missing accounts

πŸ” Security First

  • Registry Curation: Manually verified program submissions
  • Encrypted Storage: Your credentials secured with AES-256-GCM

πŸ“Š Developer Analytics

  • Download Tracking: See which programs are trending
  • Version Specific Downloads: See which versions of a program are downloaded how many times

πŸš€ Quick Start

Installation

# Install from crates.io
cargo install solpm

Your First Integration (2 minutes!)

# 1. Add a program dependency (creates SolanaPrograms.json)
$ solpm add feedana --codegen
βœ… Downloaded Feedana v0.1.0 IDL
βœ… Generated TypeScript client
βœ… Created SolanaPrograms.json

# 2. Use in your app
$ cat program/client/FeedanaClient.ts
// Your integration code
import { createFeedbackBoard } from './program/client/FeedanaClient';

const { tx, pda } = await createFeedbackBoard(
  wallet,
  "my-app-feedback",
  "QmX...ipfsHash"
);

That's it! No hunting, no guessing, no manual TypeScript. Just clean, type-safe integration.


πŸ“‹ Command Reference

Core Workflow

For dApp Developers:

# Add program dependencies (creates SolanaPrograms.json)
solpm add <program-name>[@version] [--dev] [--codegen]
solpm add feedana --network devnet --codegen

# Install all dependencies from existing SolanaPrograms.json
solpm install --codegen
solpm codegen

For Program Authors:

# Initialize publishing config (creates SolanaPrograms.toml)
solpm init [--network mainnet|devnet]

# Publish your program
solpm login
solpm publish
solpm logout

Advanced Options

# Custom IDL paths
solpm add my-program --path ./custom/idl/program.json

# Development dependencies
solpm add test-program --dev --network devnet

# Network targeting
solpm add jupiter --network mainnet
solpm add jupiter --network devnet  # Different IDLs per network!

πŸ“ Project Structures

For dApp Developers (using programs)

your-solana-dapp/
β”œβ”€β”€ SolanaPrograms.json      # πŸ“‹ Dependency lock file
β”‚
β”œβ”€β”€ program/
β”‚   β”œβ”€β”€ idl/                 # πŸ“„ Downloaded IDL files
β”‚   β”‚   β”œβ”€β”€ feedana.json
β”‚   β”‚   β”œβ”€β”€ jupiter.json
β”‚   β”‚   └── other-program.json
β”‚   β”‚
β”‚   └── client/              # 🎯 Generated TypeScript clients
β”‚       β”œβ”€β”€ FeedanaClient.ts
β”‚       β”œβ”€β”€ JupiterClient.ts
β”‚       └── OtherProgramClient.ts
β”‚
└── src/                     # πŸ’» Your app source code
    └── app.ts

For Program Authors (publishing programs)

your-solana-program/
β”œβ”€β”€ SolanaPrograms.toml      # βš™οΈ Publishing configuration
β”œβ”€β”€ Anchor.toml              # πŸ“‹ Anchor project config
β”œβ”€β”€ Cargo.toml               # πŸ¦€ Rust dependencies
β”‚
β”œβ”€β”€ programs/
β”‚   └── your-program/
β”‚       └── src/
β”‚           └── lib.rs
β”‚
β”œβ”€β”€ target/
β”‚   └── idl/
β”‚       └── your_program.json # πŸ“„ Generated IDL
β”‚
└── tests/
    └── your-program.ts

Configuration Files

SolanaPrograms.json (Dependency Management)

{
  "programs": {
    "jupiter": {
      "version": "2.1.4",
      "program_id": "JUP4Fb2cqiRUcaTHdrPC8h2gNsA2ETXiPDD33WcGuJB",
      "network": "mainnet",
      "idl_path": "./program/idl/jupiter.json"
    }
  },
  "devPrograms": {
    "test-program": {
      "version": "0.1.0",
      "program_id": "...",
      "network": "devnet",
      "idl_path": "./program/idl/test-program.json"
    }
  }
}

SolanaPrograms.toml (Publishing Config)

[program]
name = "my-awesome-program"
version = "1.0.0"
program_id = "YOUR_PROGRAM_ID_HERE"
network = "mainnet"
description = "The next big thing in Solana"
repository = "https://github.com/username/my-awesome-program"
authority_keypair = "~/.config/solana/id.json"

πŸ—οΈ For Program Authors

Publishing Your Program

# 1. Initialize your program for publishing
$ solpm init --network mainnet

# 2. Configure your program details
$ cat SolanaPrograms.toml
[program]
name = "my-defi-protocol"
version = "1.0.0"
program_id = "ABC123..."
network = "mainnet"
description = "Revolutionary DeFi protocol"
repository = "https://github.com/username/my-defi-protocol"
authority_keypair = "~/.config/solana/id.json"

# 3. Authenticate with the registry
$ solpm login
Enter your API token: spr_...
Enter you encryption password:

# 4. Publish to the registry
$ solpm publish
βœ… Validating program authority...
βœ… Signing IDL with program authority...
βœ… Uploading to registry...
πŸŽ‰ Published my-defi-protocol v1.0.0!

Registry URL: https://registry.solpm.dev/programs/my-defi-protocol

Benefits of Publishing

  • 🎯 Discoverability: Developers can find and integrate your program
  • πŸ“Š Analytics: See adoption metrics and usage patterns
  • πŸ”’ Trust: Registry curation ensures quality
  • ⚑ Developer Experience: Zero-friction integration for your users
  • πŸ”₯ Publicity and Reach: Reach a wider audience and make your program well known

🀝 Contributing

We welcome contributions from the Solana community!

Areas We Need Help

  • 🌍 Registry Expansion: Help catalog more Solana programs
  • 🎨 TypeScript Generation: Improve client code quality
  • πŸ“Š Analytics: Better insights and developer metrics
  • πŸ”§ IDE Integration: VS Code extensions, etc.
  • πŸ“– Documentation: More examples and tutorials

Community Guidelines

  • Be respectful and inclusive
  • Test your changes thoroughly
  • Follow Rust best practices
  • Update documentation for new features

πŸ“š Learn More

πŸ“– Documentation


❓ FAQ

Q: How is this different from just downloading IDLs manually?

A: solpm provides versioning, registry curation, automatic TypeScript generation, and dependency management. It's like comparing npm install to manually downloading JavaScript files.

Q: How much does it cost?

A: solpm is completely free for use and upgrade. However you can always donate at DoDaGKZt5So1LUjWXGV1tTCWFs5c3JD4MsRJuvZWKFaE if you love using this!

Q: Can I use this in CI/CD?

A: Absolutely! SOLPM is designed for automation. Use solpm install --codegen in your build scripts.

πŸ“„ License

MIT License - see LICENSE for details.


🌟 Star This Project!

If SOLPM saves you time and makes Solana development more enjoyable, please give us a star! ⭐

Built with ❀️ by @0xsouravm for the Solana community.


Ready to stop hunting for IDLs and start building amazing dApps? Try SOLPM today!

cargo install solpm
solpm --help

πŸš€ Happy Building!

About

A Solana program manager for installing and managing Anchor IDLs like packages.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages