Add the plugin to your ElizaOS character configuration:
import { stewardPlugin } from "@stwd/eliza-plugin";const character = { name: "TradingAgent", plugins: [stewardPlugin], settings: { // ... other settings },};
Set the required environment variables:
STEWARD_API_URL=https://api.steward.fi # Steward API base URLSTEWARD_API_KEY=stwd_your_tenant_key # Tenant API keySTEWARD_AGENT_ID=my-trading-agent # Agent ID in StewardSTEWARD_AGENT_TOKEN=stwd_jwt_... # Agent JWT (optional, preferred over API key)
The StewardService initializes and manages the Steward SDK connection:
import { StewardService } from "@stwd/eliza-plugin";// The service is registered automatically when the plugin loads.// Access it from the runtime:const stewardService = runtime.getService<StewardService>("steward");const client = stewardService.getClient();
Signs and broadcasts an EVM transaction through Steward’s policy engine.
transfer
Transfer native tokens (ETH/SOL) to a specified address.
sign-transaction — Triggered when the agent needs to sign a blockchain transaction:
User: "Swap 0.01 ETH for USDC on Uniswap"Agent: [evaluates swap parameters] → calls sign-transaction action → Steward evaluates policies → Transaction signed and broadcastAgent: "Done! TX: 0x8d7592b..."
transfer — Triggered for simple token transfers:
User: "Send 0.05 ETH to 0x742d..."Agent: → calls transfer action → Steward evaluates policies → Transfer signed and broadcastAgent: "Sent 0.05 ETH. TX: 0xa1b2c3..."
Provides wallet address and status context to the agent’s prompts.
balance
Provides current balance information for the agent’s wallet.
These providers inject wallet context into the agent’s LLM prompts, so the agent knows its wallet address and current balance without explicit queries.
When a transaction exceeds the auto-approve threshold, it enters the approval queue:
// The plugin handles this automatically. The agent receives:// "Transaction requires manual approval. TX ID: 550e8400-..."// A tenant admin can approve via API:// POST /vault/my-agent/approve/550e8400-...
The approval-required evaluator periodically checks for pending transactions and can notify users in the chat.