Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ohara-ai/sdk

Repository files navigation

OharaAI SDK - pre-release, alpha version

A comprehensive SDK and smart contract library for modular features. This repository provides Solidity smart contracts and a code-first SDK that exposes functional primitives (Match, Scores, App) for building on-chain applications.

You can test the features of contracts and SDK using tests and the e2e-test app.

QUICK START

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Doppler
  • Foundry - for Solidity development and local e2e-test app
curl -L https://foundry.paradigm.xyz | bash
foundryup

Setup

./bin/setup

Start the test app

./bin/start

To run the test app with Doppler (useful for api integration tests), use the optional --doppler flag:

./bin/start --doppler

Run tests

./bin/test

Cleanup

npx eslint --config eslint.config.mjs . # --fix
npx prettier . # --write

Publish a new version of the SDK (patch|minor|major) with automated version bump, build, test, and git commit + push

# Generate an access token with 2fa bypass enabled at https://npmjs.com/settings/
# Use it with NPM_TOKEN environment variable

NPM_TOKEN=your_token_here ./bin/publish patch "Some commit message"

Key Features

Functional Primitives - Simple async functions instead of raw contract calls
Type-Safe - Full TypeScript support with hierarchical context
Automatic Address Management - Fetches contract addresses from backend
No UI Lock-in - Build your own interface on top of primitives
Server-Side Operations - Separate entry point for controller operations
Secure by Default - API mode for production, optional encryption for dev/backend

Security Notes

⚠️ Controller Key Storage: The SDK stores controller keys locally in ohara-ai-data/ for development. For production:

  • Use Ohara API mode (recommended) - keys managed securely by Ohara infrastructure
  • Or enable key encryption with OHARA_KEY_ENCRYPTION_SECRET for backend deployments
  • Never use local key storage in browser/frontend environments
  • Never commit ohara-ai-data/ to version control

See sdk/README.md for detailed security guidance.

Repository Structure

/
├── bin/                # Utility scripts
├── contracts/          # Solidity smart contracts
├── sdk/                # TypeScript SDK for on-chain features
├── scripts/            # Contracts -> SDK ABIs update script
└── e2e-test/           # End-to-end testing application (Next.js)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •