/** * H3-DAC Agent Registry * Creates and manages decentralized agent identities using H3 geospatial indexing */ import { ethers } from 'ethers'; /** * Agent metadata stored on-chain */ export interface AgentMetadata { name: string; description: string; capabilities: string[]; endpoint: string; h3Index: string; publicKey: string; timestamp: number; } /** * Agent DID (Decentralized Identifier) * Format: did:opacus:h3::
*/ export interface AgentDID { method: 'opacus'; network: 'h3'; h3Index: string; address: string; full: string; } /** * H3-DAC Agent Registry * Manages agent registration and discovery using H3 geospatial indexing */ export declare class AgentRegistry { private contract; private signer; constructor(contractAddress: string, signer: ethers.Signer); /** * Generate Agent ID from wallet address and H3 index * AgentID = keccak256(address + h3Index + timestamp) */ generateAgentId(h3Index: string): Promise; /** * Create Agent DID (Decentralized Identifier) * Format: did:opacus:h3::
*/ createAgentDID(h3Index: string): Promise; /** * Register a new agent on-chain */ registerAgent(h3Index: string, metadata: Omit): Promise<{ agentId: string; did: AgentDID; tx: ethers.ContractTransactionResponse; }>; /** * Get agent details by ID */ getAgent(agentId: string): Promise; /** * Update agent's H3 location (for mobile agents) */ updateLocation(agentId: string, newH3Index: string): Promise; /** * Deactivate agent */ deactivateAgent(agentId: string): Promise; /** * Find agents in specific H3 cell */ findByH3(h3Index: string): Promise; /** * Find agents with specific capability */ findByCapability(capability: string): Promise; /** * Parse DID string back to components */ static parseDID(did: string): AgentDID | null; /** * Verify DID ownership */ verifyDID(did: string, signature: string, message: string): Promise; } /** * H3 Utility Functions for Agent Location */ export declare class H3AgentUtils { /** * Get H3 index from lat/lng coordinates * Note: In production, use h3-js library for actual H3 indexing */ static getH3Index(lat: number, lng: number, resolution?: number): string; /** * Get neighboring H3 cells (k-ring) */ static getNeighbors(h3Index: string, k?: number): string[]; /** * Calculate distance between two H3 cells */ static getDistance(h3Index1: string, h3Index2: string): number; /** * Check if two H3 cells are neighbors */ static areNeighbors(h3Index1: string, h3Index2: string): boolean; } /** * Example Usage: * * ```typescript * // Initialize registry * const registry = new AgentRegistry(REGISTRY_ADDRESS, signer); * * // Get H3 location * const h3Index = H3AgentUtils.getH3Index(37.7749, -122.4194, 9); // San Francisco * * // Register agent * const { agentId, did } = await registry.registerAgent(h3Index, { * name: 'AI Agent #1', * description: 'Payment processing agent', * capabilities: ['payment', 'escrow', 'data-stream'], * endpoint: 'https://agent1.opacus.ai' * }); * * // Find nearby agents * const nearbyAgents = await registry.findByH3(h3Index); * * // Update location * const newH3 = H3AgentUtils.getH3Index(37.7849, -122.4094, 9); * await registry.updateLocation(agentId, newH3); * ``` */ //# sourceMappingURL=registry.d.ts.map