ElizaOS is the leading framework for building autonomous AI agents. By creating a plugin, you can give any ElizaOS agent the ability to check on-chain wallet reputation — enabling trust-aware decision making.
This guide walks through building an ElizaOS plugin that integrates with AgentTrust for on-chain reputation scoring.
npx create-eliza-app)Create a new directory for your plugin:
eliza-plugin-agenttrust/ ├── src/ │ ├── index.ts │ ├── actions/ │ │ └── checkReputation.ts │ └── types.ts ├── package.json └── tsconfig.json
// src/types.ts
export interface ReputationScore {
address: string;
score: number;
grade: string;
factors: {
age: number;
volume: number;
successRate: number;
diversity: number;
consistency: number;
endorsements: number;
collaboration: number;
};
updatedAt: string;
}
export interface CheckReputationConfig {
apiKey: string;
baseUrl?: string;
}
The action is what ElizaOS agents can invoke via natural language. It calls the AgentTrust API and returns a formatted score.
// src/actions/checkReputation.ts
import { Action, IAgentRuntime, Memory, State } from "@elizaos/core";
export const checkReputationAction: Action = {
name: "CHECK_WALLET_REPUTATION",
description: "Check an Ethereum wallet's on-chain reputation score",
examples: [
["Check 0x742d35Cc6634C0532925a3b844Bc9e7595f12bD18"],
["What's the trust score of vitalik.eth?"],
["Is 0x1234... safe to transact with?"],
],
validate: async (runtime: IAgentRuntime) => {
return !!runtime.getSetting("AGENTTRUST_API_KEY");
},
handler: async (
runtime: IAgentRuntime,
message: Memory,
state: State
): Promise => {
const address = extractAddress(message.content.text);
if (!address) return "No wallet address found in your message.";
const apiKey = runtime.getSetting("AGENTTRUST_API_KEY");
const res = await fetch(
`https://agent-trust-score.web.app/api/score/${address}`,
{ headers: { "X-API-Key": apiKey } }
);
if (res.status === 402) {
return "Score not available. Please add credits.";
}
const data = await res.json();
return formatScore(data);
},
};
// src/index.ts
import { Plugin } from "@elizaos/core";
import { checkReputationAction } from "./actions/checkReputation";
export const agentTrustPlugin: Plugin = {
name: "agent-trust",
description: "On-chain wallet reputation via AgentTrust",
actions: [checkReputationAction],
evaluators: [],
providers: [],
};
Add the plugin to your ElizaOS agent configuration:
// agent.config.ts
import { Agent } from "@elizaos/core";
import { agentTrustPlugin } from "./plugins/agentTrust";
const agent = new Agent({
name: "trading-agent",
plugins: [
agentTrustPlugin,
// other plugins...
],
settings: {
AGENTTRUST_API_KEY: process.env.AGENTTRUST_API_KEY,
},
});
await agent.start();
Once the agent is running, you can interact with it:
User: "Check 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Agent: "Wallet 0x8dA6...6045 has a score of 92 (AAA).
Ultra Reliable. 7+ years of activity,
$50M+ volume, 99.8% success rate."
Once your plugin works, extend it with:
For the full ElizaOS plugin source code, check the AgentTrust GitHub repository. Learn more about top AI agent tools for crypto including ElizaOS and AgentTrust.
Get your free API key and build your ElizaOS plugin today
Get API Key →