import type { AgentContext, Key } from '@aries-framework/core'; import type { GetNymResponse, LedgerReadReplyResponse, LedgerRequest, LedgerWriteReplyResponse } from 'indy-sdk'; import { Logger, FileSystem } from '@aries-framework/core'; import { Subject } from 'rxjs'; import { IndySdkModuleConfig } from '../IndySdkModuleConfig'; import { IndySdkPool } from './IndySdkPool'; export interface CachedDidResponse { nymResponse: GetNymResponse; indyNamespace: string; } export declare class IndySdkPoolService { pools: IndySdkPool[]; private logger; private indySdk; private stop$; private fileSystem; private indySdkModuleConfig; constructor(logger: Logger, stop$: Subject, fileSystem: FileSystem, indySdkModuleConfig: IndySdkModuleConfig); /** * Get the most appropriate pool for the given did. * If the did is a qualified indy did, the pool will be determined based on the namespace. * If it is a legacy unqualified indy did, the pool will be determined based on the algorithm as described in this document: * https://docs.google.com/document/d/109C_eMsuZnTnYe2OAd02jAts1vC4axwEKIq7_4dnNVA/edit * * This method will optionally return a nym response when the did has been resolved to determine the ledger * either now or in the past. The nymResponse can be used to prevent multiple ledger queries fetching the same * did */ getPoolForDid(agentContext: AgentContext, did: string): Promise<{ pool: IndySdkPool; nymResponse?: GetNymResponse; }>; private getPoolForLegacyDid; private getSettledDidResponsesFromPools; /** * Get the most appropriate pool for the given indyNamespace */ getPoolForNamespace(indyNamespace?: string): IndySdkPool; submitWriteRequest(agentContext: AgentContext, pool: IndySdkPool, request: LedgerRequest, signingKey: Key): Promise; submitReadRequest(pool: IndySdkPool, request: LedgerRequest): Promise; private signRequest; private appendTaa; private getTransactionAuthorAgreement; private getDidFromPool; } export interface PublicDidRequest { did: GetNymResponse; pool: IndySdkPool; response: LedgerReadReplyResponse; }