import type { ConnectionRecord } from '../modules/connections'; import type { InboundTransport } from '../transport'; import type { TransportSession } from './TransportService'; import { ConnectionsModule } from '../modules/connections'; import { AgentConfig } from './AgentConfig'; import { Dispatcher } from './Dispatcher'; import { EnvelopeService } from './EnvelopeService'; import { MessageSender } from './MessageSender'; import { TransportService } from './TransportService'; export declare class MessageReceiver { private config; private envelopeService; private transportService; private messageSender; private dispatcher; private logger; private connectionsModule; readonly inboundTransports: InboundTransport[]; constructor(config: AgentConfig, envelopeService: EnvelopeService, transportService: TransportService, messageSender: MessageSender, connectionsModule: ConnectionsModule, dispatcher: Dispatcher); registerInboundTransport(inboundTransport: InboundTransport): void; /** * Receive and handle an inbound DIDComm message. It will decrypt the message, transform it * to it's corresponding message class and finally dispatch it to the dispatcher. * * @param inboundMessage the message to receive and handle */ receiveMessage(inboundMessage: unknown, { session, connection }: { session?: TransportSession; connection?: ConnectionRecord; }): Promise; private receivePlaintextMessage; private receiveEncryptedMessage; /** * Decrypt a message using the envelope service. * * @param message the received inbound message to decrypt */ private decryptMessage; private isPlaintextMessage; private isEncryptedMessage; private transformAndValidate; private findConnectionByMessageKeys; /** * Transform an plaintext DIDComm message into it's corresponding message class. Will look at all message types in the registered handlers. * * @param message the plaintext message for which to transform the message in to a class instance */ private transformMessage; /** * Send the problem report message (https://didcomm.org/notification/1.0/problem-report) to the recipient. * @param message error message to send * @param connection connection to send the message to * @param plaintextMessage received inbound message */ private sendProblemReportMessage; }