import * as Domain from "../domain"; import { Mercury as MercuryInterface } from "../domain/buildingBlocks/Mercury"; import { DIDCommProtocol } from "./DIDCommProtocol"; import { Api } from "../domain"; import { Castor } from "../domain/buildingBlocks/Castor"; /** * Mercury is a powerful and flexible library for working with decentralized identifiers and secure communications * protocols. Whether you are a developer looking to build a secure and private messaging app or a more complex * decentralized system requiring trusted peer-to-peer connections, Mercury provides the tools and features you need to * establish, manage, and secure your communications easily. * * @export * @class Mercury * @typedef {Mercury} */ export default class Mercury implements MercuryInterface { castor: Castor; protocol: DIDCommProtocol; api: Api; /** * Creates an instance of Mercury. * * @constructor * @param {Castor} castor * @param {DIDCommProtocol} protocol * @param {Api} api */ constructor(castor: Castor, protocol: DIDCommProtocol, api: Api); /** * Asynchronously packs a given message object into a string representation. This function may throw an error if the * message object is invalid. * * @param {Domain.Message} message * @returns {Promise} */ packMessage(message: Domain.Message): Promise; /** * Asynchronously unpacks a given string representation of a message into a message object. This * function may throw an error if the string is not a valid message representation. * * @param {string} message * @returns {Promise} */ unpackMessage(message: string): Promise; /** * Asynchronously sends a given message and returns the response data. * * @async * @template T * @param {Domain.Message} message * @returns {Promise} */ sendMessage(message: Domain.Message): Promise; private makeRequest; /** * Asynchronously sends a given message and returns the response message object. * * @async * @param {Domain.Message} message * @returns {Promise} */ sendMessageParseMessage(message: Domain.Message): Promise; private notDid; private prepareForwardMessage; private getDIDCommURL; private getDIDCommDID; private requiresForwarding; }