Mercury
@hyperledger/identus-sdk v7.0.0
@hyperledger/identus-sdk / overview / Mercury
Class: Mercury
Defined in: src/mercury/Mercury.ts:19
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.
Mercury
Implements
Constructors
Constructor
new Mercury(
castor:Castor,protocol:DIDCommProtocol,api:Api):Mercury
Defined in: src/mercury/Mercury.ts:27
Creates an instance of Mercury.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| castor | Castor | |
| protocol | DIDCommProtocol | |
| api | Api | 
Returns
Mercury
Properties
| Property | Modifier | Type | Defined in | 
|---|---|---|---|
| api | public | Api | src/mercury/Mercury.ts:30 | 
| castor | public | Castor | src/mercury/Mercury.ts:28 | 
| protocol | public | DIDCommProtocol | src/mercury/Mercury.ts:29 | 
Methods
packMessage()
packMessage(
message:Message):Promise<string>
Defined in: src/mercury/Mercury.ts:40
Asynchronously packs a given message object into a string representation. This function may throw an error if the message object is invalid.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| message | Message | 
Returns
Promise<string>
Implementation of
sendMessage()
sendMessage<
T>(message:Message):Promise<T>
Defined in: src/mercury/Mercury.ts:68
Asynchronously sends a given message and returns the response data.
Type Parameters
| Type Parameter | Description | 
|---|---|
| T | 
Parameters
| Parameter | Type | Description | 
|---|---|---|
| message | Message | 
Returns
Promise<T>
Implementation of
sendMessageParseMessage()
sendMessageParseMessage(
message:Message):Promise<Message|undefined>
Defined in: src/mercury/Mercury.ts:128
Asynchronously sends a given message and returns the response message object.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| message | Message | 
Returns
Promise<Message | undefined>
Implementation of
Mercury.sendMessageParseMessage
unpackMessage()
unpackMessage(
message:string):Promise<Message>
Defined in: src/mercury/Mercury.ts:56
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.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| message | string | 
Returns
Promise<Message>