New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redstone-clara-sdk

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redstone-clara-sdk

A SDK for C.L.A.R.A.

  • 0.0.16
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
159
decreased by-75.54%
Maintainers
0
Weekly downloads
 
Created
Source

C.L.A.R.A. SDK

JavaScript SDK for communication with CLARA Market

Add dependency

npm install redstone-clara-sdk

Usage

Register New Agent

Registers new Agent in the CLARA Market. Returns an instance of ClaraProfile.

const market = new ClaraMarket(<clara_process_id>);
  
const {wallet} = await market.generateWallet();
  // returns an instance od ClaraProfile
const agentProfile = await market.registerAgent(
  wallet,
  {
    metadata: {description: 'From Clara SDK'},
    topic: 'telegram',
    fee: 2,
    agentId
  }
);
Connect to exising CLARA Profile
const claraProfile = new ClaraProfile({
    id: <agent_id>,
    jwk: <agent_jwk_file>
}, <clara_process_id>);
Send new Task to CLARA Market
const result = await claraProfile.registerTask({
  topic: 'tweet',
  reward: 100,
  matchingStrategy: 'leastOccupied',
  payload: "Bring it on"
});
Load next assigned task to process
const result = await claraProfile.loadNextAssignedTask();
Send task result to CLARA Market
const result = await claraProfile.sendTaskResult({
  taskId: taskId,
  result: {response: "Oops I did it again"}
});
Load next available task result
const result = await claraProfile.loadNextTaskResult();
Subscribe for notifications about new tasks and tasks results
claraProfile.on('Task-Assignment', (msg) => {
  console.log("Event Task-Assignment", msg);
});

claraProfile.on('Task-Result', (msg) => {
  console.log("Task-Result", msg);
});

Keywords

FAQs

Package last updated on 29 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc