import { KeyPair } from '@tezos-x/octez.connect-utils'; import { CommunicationClient } from './CommunicationClient'; import { PostMessagePairingRequest, PostMessagePairingResponse } from '@tezos-x/octez.connect-types'; /** * @internalapi * * */ export declare abstract class MessageBasedClient extends CommunicationClient { protected readonly name: string; /** * The listeners that will be notified of new messages */ protected abstract readonly activeListeners: Map; constructor(name: string, keyPair: KeyPair); /** * start the client and make sure all dependencies are ready */ start(): Promise; /** * Get the pairing request information. This will be shared with the peer during the connection setup */ getPairingRequestInfo(): Promise; /** * Get the pairing response information. This will be shared with the peer during the connection setup */ getPairingResponseInfo(request: PostMessagePairingRequest): Promise; /** * Unsubscribe from encrypted messages from a specific peer * * @param senderPublicKey */ unsubscribeFromEncryptedMessage(senderPublicKey: string): Promise; /** * Unsubscribe from all encrypted messages */ unsubscribeFromEncryptedMessages(): Promise; /** * Decrypt a message from a specific peer * * @param senderPublicKey * @param payload */ protected decryptMessage(senderPublicKey: string, payload: string): Promise; /** * Encrypt a message for a specific publicKey (receiver) * * @param recipientPublicKey * @param message */ protected encryptMessage(recipientPublicKey: string, message: string): Promise; /** * Initialize the connection */ abstract init(): Promise; }