import { InitParams } from './configs'; /** * Universal resolver URL for DID resolution fallback * @constant {string} */ export declare const universalResolverUrl = "https://uniresolver.truvera.io"; import { CachedDIDResolver } from './cached-did-resolver'; /** * Main blockchain service class for managing blockchain connections and DID resolution * @class * @description Provides methods for connecting to Cheqd blockchain, resolving DIDs, * and managing blockchain-related operations */ export declare class BlockchainService { dock: any; modules: any; cheqdApi: any; cheqdApiUrl: any; isBlockchainReady: boolean; private _resolver; get resolver(): any; /** * Event names emitted by the blockchain service * @static * @readonly * @property {string} BLOCKCHAIN_READY - Emitted when blockchain connection is established */ static Events: { BLOCKCHAIN_READY: string; }; rpcMethods: ((did: any) => any)[]; /** * Creates a new BlockchainService instance * @constructor */ constructor(); /** * Gets the types and modules needed for DID or accumulator operations * @param {string} didOrRegistryId - DID or registry identifier * @returns {Object} Object containing accumulator-related types and modules * @returns {typeof AccumulatorPublicKey} returns.PublicKey - Accumulator public key type * @returns {typeof AccumulatorId} returns.AccumulatorId - Accumulator ID type * @returns {typeof AccumulatorCommon} returns.AccumulatorCommon - Common accumulator type * @returns {Object} returns.AccumulatorModule - Accumulator module instance */ getTypesForDIDOrAccumulator(didOrRegistryId: any): { PublicKey: any; AccumulatorId: any; AccumulatorCommon: any; AccumulatorModule: any; }; /** * Ensures the blockchain connection is ready before proceeding * @returns {Promise} Resolves when blockchain is ready * @example * await blockchainService.ensureBlockchainReady(); * // Blockchain is now connected and ready */ ensureBlockchainReady(): Promise; /** * Gets the cached DIDs * @returns {Promise} Cached DIDs */ getCachedDIDs(): any; /** * Gets the cached DID resolution data * @param {string} did - The DID to get the cache entry for * @returns {Promise} Cached DID resolution data */ getCacheEntry(did: any): any; /** * Clears cached data for a specific DID * @param {string} did - The DID to clear from cache * @returns {void} */ clearCache(did: any): any; /** * Creates a DID resolver with caching support * @private * @returns {CachedDIDResolver} Cached DID resolver instance */ createDIDResolver(isBlockchainReady: boolean): CachedDIDResolver; /** * Initializes the blockchain service with connection parameters * @param {InitParams} params - Initialization parameters * @param {string} params.cheqdApiUrl - URL of the Cheqd API endpoint * @param {string} [params.networkId] - Cheqd network identifier * @param {string} [params.cheqdMnemonic] - Mnemonic for Cheqd wallet (auto-generated if not provided) * @returns {Promise} True if initialization successful * @throws {Error} If cheqdApiUrl is not provided * @example * await blockchainService.init({ * cheqdApiUrl: 'https://api.cheqd.network', * networkId: 'mainnet' * }); */ init(params: InitParams): Promise; /** * Disconnects from the blockchain * @returns {Promise} Resolves when disconnection is complete * @example * await blockchainService.disconnect(); */ disconnect(): Promise; /** * Waits for the blockchain to be ready * @returns {Promise} Resolves when blockchain is ready * @private */ waitBlockchainReady(): Promise; /** * Resolves a DID to its document * @param {string} did - The DID to resolve * @returns {Promise} The resolved DID document * @example * const didDoc = await blockchainService.resolveDID('did:key:z6Mk...'); */ resolveDID(did: string): Promise; /** * Checks if the blockchain API is connected * @returns {Promise} True if connected, false otherwise * @example * const isConnected = await blockchainService.isApiConnected(); */ isApiConnected(): Promise; /** * Gets the current Cheqd API URL * @returns {Promise} The Cheqd API URL * @example * const apiUrl = await blockchainService.getAddress(); */ getAddress(): Promise; /** * Sets the blockchain ready state and emits events * @private * @param {boolean} isBlockchainReady - Whether blockchain is ready */ _setBlockchainReady(isBlockchainReady: any): void; } /** * Singleton instance of the blockchain service * @type {BlockchainService} * @example * import { blockchainService } from '@docknetwork/wallet-sdk-wasm/services/blockchain'; * * // Initialize the service * await blockchainService.init({ * cheqdApiUrl: 'https://api.cheqd.network' * }); * * // Resolve a DID * const didDoc = await blockchainService.resolveDID('did:key:z6Mk...'); */ export declare const blockchainService: BlockchainService; //# sourceMappingURL=service.d.ts.map