Skip to main content

@stwd/eliza-plugin

The @stwd/eliza-plugin package provides drop-in Steward wallet management for ElizaOS agents.

Installation

npm install @stwd/eliza-plugin

Plugin Structure

import { stewardPlugin } from "@stwd/eliza-plugin";

// stewardPlugin: Plugin
// {
//   name: "@stwd/eliza-plugin",
//   services: [StewardService],
//   actions: [signTransactionAction, transferAction],
//   providers: [walletStatusProvider, balanceProvider],
//   evaluators: [approvalRequiredEvaluator],
// }

Exports

// Default export
export default stewardPlugin;

// Named exports
export { stewardPlugin } from "@stwd/eliza-plugin";
export { StewardService } from "@stwd/eliza-plugin";
export type { StewardPluginConfig } from "@stwd/eliza-plugin";
export { signTransactionAction } from "@stwd/eliza-plugin";
export { transferAction } from "@stwd/eliza-plugin";
export { walletStatusProvider } from "@stwd/eliza-plugin";
export { balanceProvider } from "@stwd/eliza-plugin";
export { approvalRequiredEvaluator } from "@stwd/eliza-plugin";

StewardService

The core service that initializes the Steward SDK connection.
class StewardService extends Service {
  getClient(): StewardClient;
}
Configuration via environment variables:
VariableRequiredDescription
STEWARD_API_URLYesSteward API base URL
STEWARD_API_KEYNo*Tenant API key
STEWARD_AGENT_TOKENNo*Agent JWT (preferred)
STEWARD_AGENT_IDYesAgent ID in Steward
*At least one of STEWARD_API_KEY or STEWARD_AGENT_TOKEN is required. Accessing from runtime:
const service = runtime.getService<StewardService>("steward");
const client = service.getClient();

// Use the client directly
const balance = await client.getBalance(agentId, 8453);

Actions

signTransactionAction

Signs and broadcasts an EVM transaction through Steward. Trigger: Agent determines a blockchain transaction is needed (via LLM reasoning). Parameters extracted from conversation:
  • to — Destination address
  • value — Amount in wei
  • data — Optional calldata
  • chainId — Target chain
Example conversation:
User: "Approve 100 USDC on Uniswap"
Agent: I'll sign an approval transaction for USDC on Uniswap.
       [Calls signTransactionAction]
       ✅ Transaction signed! Hash: 0x8d7592b...

transferAction

Transfers native tokens (ETH/SOL) to an address. Parameters:
  • to — Recipient address
  • amount — Amount (human-readable, e.g., “0.1 ETH”)
Example:
User: "Send 0.05 ETH to 0x742d35Cc..."
Agent: Sending 0.05 ETH to 0x742d35Cc...
       [Calls transferAction]
       ✅ Sent! TX: 0xa1b2c3...

Providers

walletStatusProvider

Injects wallet context into the agent’s prompt:
Steward Wallet Status:
- Agent ID: my-trading-agent
- EVM Address: 0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18
- Solana Address: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
- Status: Connected

balanceProvider

Injects current balance into the agent’s prompt:
Current Balance:
- ETH (Base): 1.05 ETH

Evaluators

approvalRequiredEvaluator

Checks for pending transactions in the Steward approval queue. When a transaction requires manual approval, it injects context for the agent to inform the user.

Usage in Character Config

import { stewardPlugin } from "@stwd/eliza-plugin";

export default {
  name: "TradingBot",
  plugins: [stewardPlugin],
  system: `You are a trading agent with a Steward-managed wallet.
You can check balances, sign transactions, and transfer tokens.
Always confirm transaction details before signing.`,
  settings: {
    model: "gpt-4o",
  },
};