DIDComm.sendDIDCommMessage() method

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Sends the given message to the recipient. If a return transport is provided it will be checked whether the parent thread allows reusing the route. You cannot reuse the transport if the message was forwarded from a DIDComm mediator.

Emits an eventType 'DIDCommV2Message-sent' that contains the message id of packed DIDComm message IPackedDIDCommMessage after the message was sent.

Signature:
sendDIDCommMessage(args: ISendDIDCommMessageArgs, context: IAgentContext<IResolver>): Promise<string>;

Parameters

ParameterTypeDescription
argsISendDIDCommMessageArgsAn object containing the message, recipient information and optional information about the transport that should be used.
contextIAgentContext <IResolver>This method requires an agent that also has IResolver plugins in use. When calling this method, the context is supplied automatically by the framework.
Returns:

Promise<string>

The transport id that was used to send the message. It throws an error in case something went wrong.