@meforcetechnology/oiia-core
v1.0.1
Published
The official Javascript/Typescript SDK for the decentralized OIIA DAG mesh network.
Readme
@oiia/core
The official SDK for building decentralized applications on the OIIA mesh network.
Installation
npm install @oiia/coreQuick Start
import { NetworkEngine } from '@oiia/core';
// 1. Initialize the engine
const engine = new NetworkEngine();
await engine.connect();
// 2. Generate or load keys
const { privateKey, publicKey } = engine.generateKeyPair();
// 3. Create a state payload (dApp interaction, contract update)
const payload = JSON.stringify({ action: "join_pool", amount: 100 });
const tags = [['t', 'oiiaswap']];
const signedEvent = await engine.createSignedEvent(104, payload, tags, privateKey);
// 4. Publish to the DAG
await engine.publishEvent(signedEvent);
// 5. Query live state from peers
engine.queryEvents({ kinds: [104], limit: 10 }, (event) => {
console.log("New mesh event:", event);
});Architecture
OIIA doesn't use traditional smart contracts. Instead, it relies on client-side validation of cryptographically signed JSON state transitions over a P2P WebSocket mesh (NIP-01 based).
Building a dApp means deploying a frontend that reads the local indexedDB and filters standard OIIA DAG events streams.
