A Python client library for interacting with the FURY API service - a comprehensive toolkit for Solana token operations.
- Complete API Coverage - Access to all FURY API endpoints
- Type Hints - Full Python type annotations for better IDE support
- Helper Models - Data classes for simpler request construction
- Error Handling - Custom exceptions with detailed error information
- Validation - Built-in parameter validation
- Python 3.7+
requests
library for HTTP requestssolana-py
andbase58
for transaction signing (optional, only needed if signing transactions)
pip install requests
pip install solana base58 # Only needed for transaction signing
# From PyPI (when published)
pip install fury-sdk
# From source
git clone https://github.com/furydotbot/python-sdk.git
cd fury-sdk
pip install -e .
from fury import FurySDK
# Initialize the SDK
fury = FurySDK("https://solana.fury.bot")
# Check API health
health = fury.health_check()
print(health)
# Generate a new mint key
mint_key = fury.utilities.generate_mint()
print(f"Generated mint key: {mint_key['pubkey']}")
from fury import FurySDK, Protocol
fury = FurySDK("https://solana.fury.bot")
# Buy tokens
result = fury.tokens.buy(
wallet_addresses=["FuRytmqsoo4mKQAhNXoB64JD4SsiVqxYkUKC6i1VaBot"],
token_address="Bq5nFQ82jBYcFKRzUSximpCmCg5t8L8tVMqsn612pump",
sol_amount=1.5,
protocol=Protocol.PUMPFUN,
slippage_bps=9990
)
print(f"Transaction data: {result['transactions']}")
from fury import FurySDK, Protocol
from solana.keypair import Keypair
from solana.transaction import Transaction
import base58
import json
# Initialize SDK
fury = FurySDK("https://solana.fury.bot")
# Load wallet
with open('wallet_keypair.json', 'r') as f:
keypair_data = json.load(f)
keypair = Keypair.from_secret_key(bytes(keypair_data))
# Generate buy transaction
result = fury.tokens.buy(
wallet_addresses=[base58.b58encode(keypair.public_key.to_bytes()).decode('ascii')],
token_address="Bq5nFQ82jBYcFKRzUSximpCmCg5t8L8tVMqsn612pump",
sol_amount=0.5,
protocol=Protocol.PUMPFUN
)
# Sign transactions
signed_transactions = []
for tx_base64 in result['transactions']:
tx_bytes = base58.b58decode(tx_base64)
transaction = Transaction.deserialize(tx_bytes)
transaction.sign([keypair])
signed_tx_data = transaction.serialize()
signed_transactions.append({
"transaction": base58.b58encode(signed_tx_data).decode('ascii'),
"options": {"skipPreflight": False, "preflightCommitment": "confirmed"}
})
# Send signed transactions
send_result = fury.transactions.send(
transactions=signed_transactions,
use_rpc=False
)
print(f"Transaction signatures: {send_result['results']}")
from fury import FurySDK, TokenMetadata, create_token_config
fury = FurySDK("https://solana.fury.bot")
# Generate a mint key
mint_key = fury.utilities.generate_mint()
mint_pubkey = mint_key["pubkey"]
# Create token metadata
metadata = TokenMetadata(
name="Test Token",
symbol="TEST",
description="A test token created with FURY SDK",
file="https://example.com/logo.png",
website="https://example.com"
)
# Create token
token_config = create_token_config(metadata)
result = fury.tokens.create(
wallet_addresses=["5tqe3S1zsfAmT7L2Ru5gVJDaq4wUB7AbCpTLPaxaM6eG"],
mint_pubkey=mint_pubkey,
config=token_config,
amounts=[0.1]
)
print(f"Token created: {result}")
from fury import FurySDK, Recipient
fury = FurySDK("https://solana.fury.bot")
# Define recipients
recipients = [
Recipient("8fwjXcyQrCCkG5k3vHUioVLNbPr72otA59mmR1w6CwpS", "0.01"),
Recipient("68qzyqvqX3eEGEfwa2ajsDKmEjhmU9XRj1VjcUPJNwpq", "0.01")
]
# Distribute tokens
result = fury.wallets.distribute(
sender="2chjSgQNmEkHWH6zmj1BgT8q1fSCzS6FcJiatYq4Atcs",
recipients=[r.to_dict() for r in recipients]
)
print(f"Distribution transactions: {result['transactions']}")
FurySDK(base_url, api_key=None)
- Initialize the SDKhealth_check()
- Check API health
tokens.buy(wallet_addresses, token_address, sol_amount, protocol="auto", ...)
- Buy tokenstokens.sell(wallet_addresses, token_address, percentage=100, protocol="auto", ...)
- Sell tokenstokens.transfer(sender_public_key, receiver, token_address, amount)
- Transfer tokenstokens.create(wallet_addresses, mint_pubkey, config, amounts)
- Create a new tokentokens.burn(wallet_public_key, token_address, amount)
- Burn tokenstokens.cleaner(seller_address, buyer_address, token_address, sell_percentage, buy_percentage)
- Execute buy/sell operations
transactions.send(transactions, use_rpc=False)
- Submit transactions
analytics.calculate_pnl(addresses, token_address=None, include_timestamp=False)
- Calculate profit and loss
utilities.generate_mint()
- Generate a new mint public key
wallets.distribute(sender, recipients)
- Distribute tokens to multiple walletswallets.consolidate(source_addresses, receiver_address, percentage=100, token_address=None)
- Consolidate tokens from multiple wallets
from fury import FurySDK, FuryAPIError
fury = FurySDK("https://solana.fury.bot")
try:
result = fury.tokens.buy(...)
print(f"Success: {result}")
except FuryAPIError as e:
print(f"API Error ({e.status_code}): {e}")
if e.error_data:
print(f"Error details: {e.error_data}")
except Exception as e:
print(f"Unexpected error: {e}")
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.