UNPKG

meta-log-db

Version:

Native database package for Meta-Log (ProLog, DataLog, R5RS)

67 lines 1.68 kB
/** * MetaLogNode Manager * * Creates and verifies MetaLogNodes with cryptographic identity */ import { MetaLogNode, CID, BIP32Path, TopoJSON, GeoJSONPatch } from './types.js'; /** * Options for creating a MetaLogNode */ export interface CreateNodeOptions { content: { topo: TopoJSON; geo: GeoJSONPatch; }; parent?: CID; path?: BIP32Path; auth?: string; } /** * MetaLogNode Manager * * Handles creation, signing, and verification of MetaLogNodes */ export declare class MetaLogNodeManager { /** * Create a new MetaLogNode * * @param options - Node creation options * @returns Promise resolving to signed MetaLogNode */ createNode(options: CreateNodeOptions): Promise<MetaLogNode>; /** * Verify node signature * * @param node - MetaLogNode to verify * @param publicKey - Public key for verification (optional, can derive from path) * @returns true if signature is valid */ verifyNode(node: MetaLogNode, publicKey?: string): Promise<boolean>; /** * Compute CID from content * * @param content - Content to hash * @returns Content ID (SHA-256 hash) */ computeCID(content: { topo: TopoJSON; geo: GeoJSONPatch; }): Promise<CID>; /** * Derive BIP32 path from CID * * @param cid - Content ID * @returns BIP32 path */ private derivePath; /** * Sign node with private key * * @param cid - Content ID * @param parent - Parent CID * @param content - Node content * @returns Signature */ private signNode; } //# sourceMappingURL=manager.d.ts.map