UNPKG

@hashgraphonline/standards-sdk

Version:

The Hashgraph Online Standards SDK provides a complete implementation of the Hashgraph Consensus Standards (HCS), giving developers all the tools needed to build applications on Hedera.

102 lines 3.92 kB
import { PrivateKey, TransactionReceipt, AccountId } from '@hashgraph/sdk'; import { HCS2BaseClient } from './base-client'; import { HCS2ClientConfig, HCS2Message, TopicRegistrationResponse, RegistryOperationResponse, TopicRegistry, CreateRegistryOptions, RegisterEntryOptions, UpdateEntryOptions, DeleteEntryOptions, MigrateTopicOptions, QueryRegistryOptions } from './types'; /** * SDK client configuration for HCS-2 */ export interface SDKHCS2ClientConfig extends HCS2ClientConfig { operatorId: string | AccountId; operatorKey: string | PrivateKey; keyType?: 'ed25519' | 'ecdsa'; } /** * SDK client for HCS-2 operations */ export declare class HCS2Client extends HCS2BaseClient { private client; private operatorId; private operatorKey; private initialized; private keyType; /** * Create a new HCS-2 client * @param config Client configuration */ constructor(config: SDKHCS2ClientConfig); /** * Initialize the Hedera client with operator information */ private initializeClient; /** * Create a Hedera client for the specified network * @param network The network to connect to * @returns The Hedera client */ private createClient; /** * Create a new registry topic * @param options Registry creation options * @returns Promise resolving to the transaction result */ createRegistry(options?: CreateRegistryOptions): Promise<TopicRegistrationResponse>; /** * Register a new entry in the registry * @param registryTopicId The topic ID of the registry * @param options Registration options * @returns Promise resolving to the operation result */ registerEntry(registryTopicId: string, options: RegisterEntryOptions): Promise<RegistryOperationResponse>; /** * Update an existing entry in the registry (indexed registries only) * @param registryTopicId The topic ID of the registry * @param options Update options * @returns Promise resolving to the operation result */ updateEntry(registryTopicId: string, options: UpdateEntryOptions): Promise<RegistryOperationResponse>; /** * Delete an entry from the registry (indexed registries only) * @param registryTopicId The topic ID of the registry * @param options Delete options * @returns Promise resolving to the operation result */ deleteEntry(registryTopicId: string, options: DeleteEntryOptions): Promise<RegistryOperationResponse>; /** * Migrate a registry to a new topic * @param registryTopicId The topic ID of the registry * @param options Migration options * @returns Promise resolving to the operation result */ migrateRegistry(registryTopicId: string, options: MigrateTopicOptions): Promise<RegistryOperationResponse>; /** * Get all entries from a registry * @param topicId The topic ID of the registry * @param options Query options * @returns Promise resolving to the registry information */ getRegistry(topicId: string, options?: QueryRegistryOptions): Promise<TopicRegistry>; /** * Submit a message to a topic * @param topicId The topic ID to submit to * @param payload The message payload * @returns Promise resolving to the transaction receipt */ submitMessage(topicId: string, payload: HCS2Message): Promise<TransactionReceipt>; /** * @param topicId The topic ID to query * @returns Promise resolving to the topic information */ getTopicInfo(topicId: string): Promise<any>; /** * Close the client and release resources */ close(): void; /** * Get the configured key type (ed25519 or ecdsa) */ getKeyType(): 'ed25519' | 'ecdsa'; /** * Get the configured operator private key */ getOperatorKey(): PrivateKey; } //# sourceMappingURL=client.d.ts.map