coinrailz-solana
Solana AI Agent Payment Processing SDK by Coin Railz LLC - Non-custodial SOL/USDC payments for AI agents.
Installation
pip install coinrailz-solana
Get Your API Key
Instant API Key - Pay $1 (USDC/USDT on Base or Solana) and get your API key immediately. No account required!
- Visit https://coinrailz.com/api-keys
- Send $1 to the platform wallet
- Verify your transaction and receive your key + $5 starter credits
Key Persistence: Your API key is permanent and works across ALL Coin Railz services. One key = unlimited access (credits are deducted per use). You can top up credits anytime with the same key.
Quick Start
from coinrailz_solana import CoinRailzSolana, SendPaymentParams
client = CoinRailzSolana(api_key="your-api-key")
# Send USDC on Solana
result = client.send(SendPaymentParams(
to="9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
amount=10.00,
currency="USDC"
))
print(result)
# SendPaymentResult(
# success=True,
# transaction_id='sol_abc123',
# signature='5abc...',
# amount=Amount(gross=10.00, fee=0.16, net=9.84),
# explorer_url='https://solscan.io/tx/5abc...'
# )
Features
- SOL Transfers - Native SOL payments
- USDC Transfers - SPL Token USDC on Solana
- Wallet Creation - Generate new Solana wallets
- Balance Queries - Check SOL balances
- Transaction Status - Track payment confirmations
API Reference
Constructor
client = CoinRailzSolana(
api_key="your-api-key", # Required: Your API key
base_url="https://...", # Optional: API base URL
timeout=30.0 # Optional: Request timeout in seconds
)
Methods
send(params)
Send SOL or USDC payment.
from coinrailz_solana import SendPaymentParams
result = client.send(SendPaymentParams(
to="SolanaAddress...",
amount=10.00,
currency="USDC", # "SOL" or "USDC"
memo="Payment for service"
))
get_balance(address)
Get SOL balance for an address.
balance = client.get_balance("SolanaAddress...")
# BalanceResult(balance=Balance(sol=1.5, lamports=1500000000))
create_wallet()
Create a new Solana wallet.
wallet = client.create_wallet()
# WalletResult(wallet=WalletInfo(address='...'), private_key='...')
get_transaction(signature)
Get transaction status.
tx = client.get_transaction("5abc...")
# TransactionResult(signature='5abc...', status='confirmed')
status()
Check service status.
status = client.status()
# StatusResult(status='operational', network='mainnet-beta')
Error Handling
All API errors return machine-readable structured responses for programmatic handling:
result = client.send(SendPaymentParams(to="...", amount=10.00))
if not result.success:
print(f"Error code: {result.error.code}")
print(f"Hint: {result.error.agent_hint}")
# Programmatic error handling
if result.error.code == "PAYMENT_INVALID_TX_HASH_LENGTH":
# Solana signatures should be 87-88 base58 chars
pass
elif result.error.code == "SOLANA_VERIFICATION_FAILED":
# On-chain verification failed
pass
elif result.error.code == "INSUFFICIENT_CREDITS":
# Top up credits at coinrailz.com/api-keys
pass
Error Codes Reference
| Code | Description | Recoverable |
|---|---|---|
PAYMENT_INVALID_TX_HASH_LENGTH |
Transaction hash wrong length | Yes |
PAYMENT_INVALID_TX_HASH_FORMAT |
Invalid characters in hash | Yes |
SOLANA_VERIFICATION_FAILED |
Solana on-chain verification failed | No |
PAYMENT_VERIFICATION_EXCEPTION |
Verification threw an error | Maybe |
INSUFFICIENT_CREDITS |
Not enough credits for operation | Yes |
INVALID_API_KEY |
API key not found or expired | No |
Context Manager
with CoinRailzSolana(api_key="your-api-key") as client:
result = client.send(SendPaymentParams(to="...", amount=10.00))
Pricing
| Tier | Volume | Processing Fee |
|---|---|---|
| Starter | $0-$10K/mo | 1.5% + $0.01 |
| Growth | $10K-$100K/mo | 1.25% + $0.01 |
| Platform | $100K+/mo | 0.9% + $0.01 |
Minimum transaction: $0.05
Use Cases
- AI Agent Payments - Autonomous agent-to-agent payments on Solana
- ElizaOS Integration - Payment processing for ElizaOS agents
- AgentKit - Coinbase AgentKit payment plugin
- MCP Tools - Model Context Protocol payment tools
Support
- Documentation: https://coinrailz.com/docs/sdk/solana
- Discord: https://discord.gg/coinrailz
- Email: support@coinrailz.com
License
MIT
Metadata
Release files for coinrailz-solana 1.0.2
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 |
|---|---|---|---|---|
| coinrailz_solana-1.0.2.tar.gz | 6.5 kB | Without provenance | Details for coinrailz_solana-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coinrailz_solana-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for coinrailz_solana-1.0.2-py3-none-any.whl |
Total release size: 13.7 kB
Release files / coinrailz_solana-1.0.2.tar.gz
| Download URL | coinrailz_solana-1.0.2.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07fa9abfad3fd78284d80ac3279b63cd8178c596e03aa64024785262de9bcc35
|
|
BLAKE2b-256 checksum How to use checksums |
0dd4e7b0820bf5e4b8e068147869fd297f3fe186d32501846f66a2f9930e0f26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / coinrailz_solana-1.0.2-py3-none-any.whl
| Download URL | coinrailz_solana-1.0.2-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2478758ddc4647b242e55ef4c17596adb6a53ee6a0281e742eb93218390f11f
|
|
BLAKE2b-256 checksum How to use checksums |
c64eccd171b2da6101a9baccf98effd8916863a62d26e85e865230d4a1ee8542
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Security for coinrailz-solana 1.0.2
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.