Introduction
Solathon
High performance, easy to use and feature-rich Solana SDK for Python.
pip install solathon
Note: Requires Python 3.9.0 or higher
✨ Easy to use
Using object-oriented approach, Solathon makes everything easy to understand and work with. The documentation includes detailed explanations with examples to get anyone started quickly.
⚡Feature rich
Most of the Solana JSON RPC with the latest methods are supported. Other than that, many utility functions are also provided which come in handy often.
🚀 High performance
Being light weight and optimized for the best performance, Solathon comes with batteries included without being too heavy.
🌀 Async support
Both synchronous and asynchronous clients are available, use the one more suitable for your application.
Example usage
Create new account and airdrop some devnet tokens:
from solathon import Client, Keypair
client = Client("https://api.devnet.solana.com")
new_account = Keypair()print(new_account.public_key, new_account.private_key)amount = 10000 # This is the amount in lamports
res = client.request_airdrop(new_account.public_key, amount)print("Airdrop response: ", res)
Fetch a wallet's balance using it's public key:
from solathon import Client, PublicKey
client = Client("https://api.devnet.solana.com")public_key = PublicKey("B3BhJ1nvPvEhx3hq3nfK8hx4WYcKZdbhavSobZEA44ai")balance = client.get_balance(public_key)
print(balance)
Send a transaction:
from solathon.core.instructions import transferfrom solathon import Client, Transaction, PublicKey, Keypair
client = Client("https://api.devnet.solana.com")
sender = Keypair().from_private_key("your_private_key")receiver = PublicKey("B3BhJ1nvPvEhx3hq3nfK8hx4WYcKZdbhavSobZEA44ai")amount = 10000 # This is the amount in lamports
instruction = transfer( from_public_key=sender.public_key, to_public_key=receiver, lamports=amount)transaction = Transaction(instructions=[instruction], signers=[sender])
result = client.send_transaction(transaction)print(result)