/** * H3LocationHelper — Opacus H3 Geospatial Utilities * * H3 is Uber's hexagonal hierarchical geospatial indexing system. * Each hexagonal cell covers a consistent area at each resolution level: * Res 0 → ~4,357,449 km² (continent-scale) * Res 5 → ~252 km² (city-scale) * Res 8 → ~0.74 km² (neighbourhood-scale) ← Opacus default * Res 10 → ~0.015 km² (building-scale) * * Opacus uses H3 cells to: * 1. Assign agents to geographic zones (CitadelDID) * 2. Route tasks to nearby agents (proximity matching) * 3. Enable IoT devices to publish location-attested sensor data * 4. Power the H3 Beacon Globe visualisation * * NOTE: This file does NOT depend on the full h3-js library to keep * the SDK lightweight. It implements a deterministic Opacus-compatible * cell encoding that is structurally correct and round-trips correctly * through the protocol. If you need full H3 spec compliance (e.g. for * Dune Analytics queries), install h3-js and use latLngToCell() there. */ /** Uber H3 resolution → approximate hexagonal cell area in km². */ export declare const H3_RESOLUTION_KM2: Record; /** * Convert a GPS coordinate to an Opacus-compatible H3 cell index string. * * The encoding is: * • 2-char resolution prefix (e.g. "88" for res 8) * • 7-char latitude hash * • 7-char longitude hash * • "ffff" suffix (sentinel) * * This produces a valid-looking H3 hex string that identifies the same cell * for coordinates within the same ~0.74 km² hexagon (res 8). * * @param lat Latitude (-90 to 90) * @param lon Longitude (-180 to 180) * @param resolution H3 resolution 0–10 (default 8, ~0.74 km²) * @returns H3 hex cell index string */ export declare function latLngToH3Cell(lat: number, lon: number, resolution?: number): string; /** * Build the canonical Opacus Citadel DID for a registered agent. * * Format: `did:opacus:h3:{h3Index}:{walletAddress}` * * @example * const did = citadelDID('88abc1234def890ffff', '0xDEAD…BEEF'); * // → 'did:opacus:h3:88abc1234def890ffff:0xdead…beef' */ export declare function citadelDID(h3Index: string, walletAddress: string, _network?: string): string; /** * Extract the H3 index from an Opacus Citadel DID string. * * @returns H3 index string, or null if the DID is not in the expected format. */ export declare function h3FromDID(did: string): string | null; /** * Haversine great-circle distance between two GPS points. * * @param lat1 Latitude of point A * @param lon1 Longitude of point A * @param lat2 Latitude of point B * @param lon2 Longitude of point B * @returns Distance in kilometres */ export declare function distKm(lat1: number, lon1: number, lat2: number, lon2: number): number; export interface IoTAgentConfig { latitude: number; longitude: number; h3Index: string; /** Hook to submit a signed datagram to the Opacus world-events layer */ submitToChain?: (signedDatagramHex: string) => Promise<{ txHash: string; }>; } /** * Build an IoT agent configuration object for the agent-kernel factory. * * @example * const config = buildIoTConfig(41.01, 28.97); * // Pass to: POST /api/agents { agentType: 'iot', ...config } */ export declare function buildIoTConfig(lat: number, lon: number, opts?: { submitToChain?: IoTAgentConfig['submitToChain']; }): IoTAgentConfig; /** * Named presets for well-known cities (for demos and testing). */ export declare const CITY_PRESETS: Record; //# sourceMappingURL=H3LocationHelper.d.ts.map