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

0.0.1 • Public • Published

ATTPs Plugin for Virtuals Game

The ATTPs Plugin enables G.A.M.E agents to interact with the ATTPs Platform, providing capabilities for agent creation, data verification, and price querying functionalities.

Features

  • Create and register new agents on the ATTPs Platform
  • Verify data with agent signatures
  • Query price data from various feeds

Available Functions

  1. createAndRegisterAgent: Creates and registers a new agent with specified signers and settings
  2. verifyData: Verifies data with provided signatures and metadata
  3. priceQuery: Fetches price data for specific feeds and agents

Installation

To install the plugin, use npm or yarn:

npm install @virtuals-protocol/game-attps-plugin

or

yarn add @virtuals-protocol/game-attps-plugin

Usage

Importing the Plugin

First, import the AttpsPlugin class from the plugin:

import AttpsPlugin from "@virtuals-protocol/game-attps-plugin";

Setup environment variables

Set the following environment variables:

  • RPC_URL: The RPC URL for the blockchain network
  • PRIVATE_KEY: Your private key for transaction signing
  • PROXY_ADDRESS: The proxy address for the ATTPs Platform

Creating a Worker

Create a worker with the necessary credentials:

const attpsPlugin = new AttpsPlugin({
  credentials: {
    proxyAddress: process.env.PROXY_ADDRESS,
    privateKey: process.env.PRIVATE_KEY,
    rpcUrl: process.env.RPC_URL,
  }
});

Creating an Agent

Create an agent and add the worker to it:

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

const agent = new GameAgent("GAME_API_KEY", {
  name: "ATTPs Bot",
  goal: "Create agents, verify data, and query price data.",
  description: "A bot that can interact with the ATTPs Platform",
  workers: [attpsPlugin.getWorker({})],
});

Running the Agent

Initialize and run the agent:

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

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

Readme

Keywords

none

Package Sidebar

Install

npm i @virtuals-protocol/game-attps-plugin

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

30.9 kB

Total Files

6

Last publish

Collaborators

  • vituals
  • zuhwa
  • jsoh0118