@virtuals-protocol/game-elfa-ai-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Elfa AI Plugin for Virtuals Game

Elfa AI is an AI x social product designed for crypto traders who struggle to keep up with rapidly changing trading opportunities. By cutting through the noise, Elfa curates actionable insights and signals from thousands of industry insiders, influencers, and smart traders. This plugin seamlessly integrates the Elfa AI API into your Virtuals Game environment, allowing your agents to access real‑time data and intelligence on crypto tokens, projects, and smart accounts.

Available Functions

The ElfaAiPlugin provides several functions that can be used by the agent:

  • pingFunction: Pings the Elfa AI API to check connectivity and health.
  • keyStatusFunction: Retrieves the current status, usage, and limits for your API key.
  • mentionsFunction: Fetches mentions with smart engagement, providing insights into trending discussions.
  • topMentionsFunction: Retrieves top mentions for a specified ticker symbol, ranked by engagement.
  • trendingTokensFunction: Retrieves tokens that are most discussed over a particular time window.
  • accountSmartStatsFunction: Retrieves social metrics and smart stats for a given username.

Installation

To install the plugin, use npm or yarn:

npm install @virtuals-protocol/game-elfa-ai-plugin

or

yarn add @virtuals-protocol/game-elfa-ai-plugin

Usage

Prerequisites

Generate an API key from the Elfa AI dashboard.

Importing the Plugin

First, import the ElfaAiPlugin class from the plugin:

import ElfaAiPlugin from "@virtuals-protocol/game-elfa-ai-plugin";

Creating a Worker

Create a worker with the necessary Elfa AI credentials:

const elfaAiPlugin = new ElfaAiPlugin({
    credentials: {
        apiKey: "<ELFA_AI_API_KEY>",
    },
});

Creating an Agent

Create an agent and add the worker to it:

import { GameAgent } from "@virtuals-protocol/game";

const elfaAgent = new GameAgent("<AGENT_API_TOKEN>", {
    name: "Elfa AI Agent",
    goal: "Demonstrate integration with the Elfa AI API",
    description:
        "An agent that interacts with the Elfa AI API to discover alpha from industry insiders, influencers & traders.",
    workers: [elfaWorker],
});

Running the Agent

Initialize and run the agent:

(async () => {
  await agent.init();

  while (true) {
    await agent.step({
      verbose: true,
    });
  }
})();

License

This project is licensed under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i @virtuals-protocol/game-elfa-ai-plugin

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

40.7 kB

Total Files

6

Last publish

Collaborators

  • vituals
  • zuhwa
  • jsoh0118