Mercury
@hyperledger/identus-sdk v8.0.0
@hyperledger/identus-sdk / overview / Mercury
Class: Mercury
Defined in: packages/lib/sdk/src/mercury/index.ts:23
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: packages/lib/sdk/src/mercury/index.ts:31
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 | packages/lib/sdk/src/mercury/index.ts:34 |
castor | public | Castor | packages/lib/sdk/src/mercury/index.ts:32 |
protocol | public | DIDCommProtocol | packages/lib/sdk/src/mercury/index.ts:33 |
Methods
packMessage()
packMessage(
message:Message):Promise<string>
Defined in: packages/lib/sdk/src/mercury/index.ts:44
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: packages/lib/sdk/src/mercury/index.ts:72
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: packages/lib/sdk/src/mercury/index.ts:132
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: packages/lib/sdk/src/mercury/index.ts:60
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>