Solana Plugin
The Solana Plugin provides blockchain functionality including wallet management and transaction trust evaluation.
Installation
-
Install the package:
Terminal window npm i github:elizaos-plugins/plugin-solanaTerminal window pnpm add github:elizaos-plugins/plugin-solanaTerminal window yarn add github:elizaos-plugins/plugin-solana -
Configure environment:
Terminal window SOLANA_PRIVATE_KEY=your-wallet-private-keySOLANA_RPC_URL=your-rpc-endpoint
Usage
import { createSolanaPlugin } from "@eliza/plugin-solana";
const solanaPlugin = createSolanaPlugin({ privateKey: process.env.SOLANA_PRIVATE_KEY, rpcUrl: process.env.SOLANA_RPC_URL});
const agent = new AgentBuilder() .withPlugin(solanaPlugin) .build();
Features
Evaluators
Evaluator | Description |
---|---|
trustEvaluator | Assess transaction trust scores |
Providers
Provider | Description |
---|---|
walletProvider | Wallet management and operations |
trustScoreProvider | Transaction trust metrics |
Configuration
interface SolanaPluginConfig { privateKey: string; rpcUrl: string; network?: "mainnet" | "testnet" | "devnet"; trustScoreThreshold?: number;}
Best Practices
- โ๏ธ Implement proper error handling for transactions
- โ๏ธ Validate addresses before operations
- โ๏ธ Monitor trust scores for suspicious activity
- โ๏ธ Use appropriate network for testing
Secure your private keys and never expose them in your code or version control.