Skip to main content

Solana AI Agent Payment Processing SDK - Non-custodial SOL/USDC payments for AI agents

Project description

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!

  1. Visit https://coinrailz.com/api-keys
  2. Send $1 to the platform wallet
  3. 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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coinrailz_solana-1.0.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coinrailz_solana-1.0.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file coinrailz_solana-1.0.2.tar.gz.

File metadata

  • Download URL: coinrailz_solana-1.0.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for coinrailz_solana-1.0.2.tar.gz
Algorithm Hash digest
SHA256 07fa9abfad3fd78284d80ac3279b63cd8178c596e03aa64024785262de9bcc35
MD5 3d3105c61836df3de9b9e6f6969e1ccf
BLAKE2b-256 0dd4e7b0820bf5e4b8e068147869fd297f3fe186d32501846f66a2f9930e0f26

See more details on using hashes here.

File details

Details for the file coinrailz_solana-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for coinrailz_solana-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c2478758ddc4647b242e55ef4c17596adb6a53ee6a0281e742eb93218390f11f
MD5 f057d905f11fea7b5fad19dca16e30a7
BLAKE2b-256 c64eccd171b2da6101a9baccf98effd8916863a62d26e85e865230d4a1ee8542

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page