You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

eval-engine-sdk

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eval-engine-sdk

Eval Engine SDK for JavaScript/TypeScript

0.0.6
latest
Source
npmnpm
Version published
Maintainers
0
Created
Source

Eval Engine JS SDK

A JavaScript SDK for interacting with Eval Engine, a transparent evaluation system built on Chromia blockchain.

Overview

Eval Engine is a system that provides transparent evaluation services using Chromia blockchain as its database layer. It operates with three main parties:

  • Chromia Blockchain: The underlying transparent database
  • Engine: The evaluation service
  • Client: The end user requesting evaluations

Installation

npm install eval-engine-sdk

Core Components

Requirements

  • Node.js >= 18.0.0 (for native fetch support)
  • Chromia Private Key

Eval Client

The main client used by end users to interact with the Eval Engine. It requires a Chromia private key for initialization.

View examples/user_demo.ts for full implementation

import { EvalClient, CHROMIA_CHAIN } from 'eval-engine-sdk';

const evalClient = await EvalClient.init(
    PRIVATE_KEY,
    CHROMIA_CHAIN.MAINNET,
    {
        url: "https://api.evalengine.ai/api",
        prefix: "EVA",
        pub: "YOUR_ENGINE_PUBLIC_KEY"
    }
);

Key Methods:

  • getEngine(): Retrieves engine information
  • signEvaluateTweetRequest(inputTweet, outputTweet): Signs an evaluation request
  • submitEvaluateTweetRequest(txHash): Submits a signed evaluation request

To use it, simply:

const input = "Input tweet here";
const reply = "Replied tweet here";
const txHash = await evalClient.signEvaluateTweetRequest(input, reply);
console.log("txHash", txHash);
const response = await evalClient.submitEvaluateTweetRequest(txHash);
console.log("response", JSON.stringify(response, null, 2));

Engine Client

This is the server implementation of Engine

View examples/engine_server_demo.ts for full implementation

import { EngineClient, CHROMIA_CHAIN } from 'eval-engine-sdk';

const engine = await EngineClient.init(ENGINE_PRIVATE_KEY, CHROMIA_CHAIN.MAINNET);

FAQs

Package last updated on 25 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.