JavaScript SDK

ComputeNet SDK for Node.js and browsers

Draft Documentation

This documentation is under development and may be incomplete or subject to change.

Overview

The JavaScript SDK provides a type-safe interface for interacting with ComputeNet from Node.js and browser environments.

Installation

# npm
npm install @computenet/sdk

# yarn
yarn add @computenet/sdk

# pnpm
pnpm add @computenet/sdk

Quick Start

import { ComputeNet } from '@computenet/sdk';

// Initialize client
const client = new ComputeNet({
  network: 'testnet',
  apiKey: process.env.COMPUTENET_API_KEY
});

// Submit a compute job
const receipt = await client.compute({
  program: 'sha256',
  input: Buffer.from('hello world')
});

console.log('Job ID:', receipt.jobId);
console.log('Output:', receipt.output.toString('hex'));

// Verify the receipt
const isValid = await client.verify(receipt);
console.log('Valid:', isValid);

TypeScript Support

The SDK is written in TypeScript and includes full type definitions. All methods are fully typed for excellent IDE support.

Draft

The JavaScript SDK is in development. API may change before stable release.