This release is a pre-release and may not be stable for production use.
elizaOS Plugin Solana (Python)
Python implementation of the Solana blockchain plugin for elizaOS agents.
Installation
pip install elizaos-plugin-solana
Quick Start
import asyncio
from elizaos_plugin_solana import SolanaClient, WalletConfig
async def main():
# Read-only mode (just need a public key)
config = WalletConfig.read_only(
"https://api.mainnet-beta.solana.com",
"YourPublicKeyHere"
)
async with SolanaClient(config) as client:
# Get SOL balance
balance = await client.get_sol_balance()
print(f"Balance: {balance} SOL")
# Get token accounts
tokens = await client.get_token_accounts()
for token in tokens:
print(f"{token.mint}: {token.ui_amount}")
asyncio.run(main())
With Signing Capability
from elizaos_plugin_solana import SolanaClient, WalletConfig
from decimal import Decimal
# Full access mode (with private key)
config = WalletConfig.with_keypair(
"https://api.mainnet-beta.solana.com",
"YourPrivateKeyHere"
)
async with SolanaClient(config) as client:
# Transfer SOL
recipient = "RecipientPublicKey"
result = await client.transfer_sol(recipient, Decimal("0.1"))
print(f"Transfer signature: {result.signature}")
Environment Variables
Load configuration from environment:
config = WalletConfig.from_env()
Required environment variables:
SOLANA_RPC_URL- Solana RPC endpoint (defaults to mainnet)SOLANA_PRIVATE_KEYorWALLET_PRIVATE_KEY- Private key for signingSOLANA_PUBLIC_KEYorWALLET_PUBLIC_KEY- Public key (if no private key)
Optional:
SLIPPAGE- Slippage tolerance in basis points (default: 50)HELIUS_API_KEY- For enhanced RPCBIRDEYE_API_KEY- For token price data
Token Swaps via Jupiter
from elizaos_plugin_solana import SwapQuoteParams
params = SwapQuoteParams(
input_mint="So11111111111111111111111111111111111111112", # SOL
output_mint="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", # USDC
amount="1000000000", # 1 SOL in lamports
slippage_bps=50,
)
quote = await client.get_swap_quote(params)
print(f"Expected output: {quote.out_amount}")
# Execute the swap
result = await client.execute_swap(quote)
print(f"Swap signature: {result.signature}")
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Run linting
ruff check .
ruff format .
# Run type checking
mypy elizaos_plugin_solana
License
MIT
Metadata
Release files for elizaos-plugin-solana 2.0.0a5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| elizaos_plugin_solana-2.0.0a5.tar.gz | 16.0 kB | Without provenance | Details for elizaos_plugin_solana-2.0.0a5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| elizaos_plugin_solana-2.0.0a5-py3-none-any.whl | Python 3 | none | any | Details for elizaos_plugin_solana-2.0.0a5-py3-none-any.whl |
Total release size: 35.8 kB
Release files / elizaos_plugin_solana-2.0.0a5.tar.gz
| Download URL | elizaos_plugin_solana-2.0.0a5.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73a7aeec28e7c3c7345e1ec76573b2901d787aeed252977ceadbe582dd165a16
|
|
BLAKE2b-256 checksum How to use checksums |
d8028b2c5d5e6eb2b242c63e0381bb31ecfca074bcf4109ba247d45800023138
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / elizaos_plugin_solana-2.0.0a5-py3-none-any.whl
| Download URL | elizaos_plugin_solana-2.0.0a5-py3-none-any.whl |
|---|---|
| Size | 19.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59cc474d76713b0729cdf44026c60372d4c76fbabdc346357b2e174db48fd0da
|
|
BLAKE2b-256 checksum How to use checksums |
77b9754ccd28579256195b6b97a3bd23c913c34627115f463e9ad9a970c259f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for elizaos-plugin-solana 2.0.0a5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.