SolanaAgentKit
Purpose
Usage
Initialization Example
from agentipy.agent import SolanaAgentKit
# !! IMPORTANT SECURITY WARNING !!
# NEVER hardcode your private key directly into your code, ESPECIALLY for Mainnet.
# This is for demonstration purposes ONLY.
# In a real application, use environment variables, secure key vaults, or other
# secure key management practices. Compromising your private key can lead to
# loss of funds.
PRIVATE_KEY = "YOUR_PRIVATE_KEY_HERE" # ⚠️ REPLACE THIS SECURELY! ⚠️
RPC_URL = "https://api.mainnet-beta.solana.com" # Mainnet RPC endpoint, change to devnet or testnet as needed
# Initialize the SolanaAgentKit
agent = SolanaAgentKit(
private_key=PRIVATE_KEY,
rpc_url=RPC_URL
)
print(f"SolanaAgentKit initialized. Using RPC: {agent.rpc_url}")
# You can now pass this 'agent' object to other AgentiPy tools.