> ## Documentation Index
> Fetch the complete documentation index at: https://docs.steward.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# @stwd/eliza-plugin

> API reference for the Steward ElizaOS plugin — wallet management for AI agents.

# @stwd/eliza-plugin

The `@stwd/eliza-plugin` package provides drop-in Steward wallet management for [ElizaOS](https://elizaos.ai) agents.

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @stwd/eliza-plugin
  ```

  ```bash pnpm theme={null}
  pnpm add @stwd/eliza-plugin
  ```

  ```bash bun theme={null}
  bun add @stwd/eliza-plugin
  ```
</CodeGroup>

## Plugin Structure

```typescript theme={null}
import { stewardPlugin } from "@stwd/eliza-plugin";

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

## Exports

```typescript theme={null}
// 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.

```typescript theme={null}
class StewardService extends Service {
  getClient(): StewardClient;
}
```

**Configuration via environment variables:**

| Variable              | Required | Description           |
| --------------------- | -------- | --------------------- |
| `STEWARD_API_URL`     | Yes      | Steward API base URL  |
| `STEWARD_API_KEY`     | No\*     | Tenant API key        |
| `STEWARD_AGENT_TOKEN` | No\*     | Agent JWT (preferred) |
| `STEWARD_AGENT_ID`    | Yes      | Agent ID in Steward   |

\*At least one of `STEWARD_API_KEY` or `STEWARD_AGENT_TOKEN` is required.

**Accessing from runtime:**

```typescript theme={null}
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

```typescript theme={null}
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",
  },
};
```

## Related

* [ElizaOS Integration Guide](/guides/eliza-plugin) — Step-by-step setup
* [StewardClient Reference](/sdk/client) — Underlying SDK client
* [Agent Setup Guide](/guides/agent-setup) — Creating agents with policies
