A handle for one additional DID hosted on a Layr8.Client's WebSocket,
returned by Layr8.Client.join_did/3.
It is the per-DID counterpart of Layr8.Client.send/3, request/3 and
request_result/3: those operate on the DID the client connected with,
while these operate on this DID's own channel and stamp from with it.
{:ok, wf} = Layr8.Client.join_did(client, workflow_did, protocols: [proto])
:ok = Layr8.DidHandle.send(wf, %Layr8.Message{type: type, to: [peer], body: %{}})Modelled on the node-sdk's DidHandle (src/client.ts).
Summary
Functions
The DID this handle hosts.
Leaves this DID's channel. The client and every other DID stay connected.
Sends from this DID and waits for a correlated response. Same contract as
Layr8.Client.request/3.
request/3 without the raises. Same contract as Layr8.Client.request_result/3.
Sends a DIDComm message from this DID. Same contract as Layr8.Client.send/3.
Types
Functions
The DID this handle hosts.
@spec leave(t()) :: :ok
Leaves this DID's channel. The client and every other DID stay connected.
@spec request(t(), Layr8.Message.t() | map(), keyword()) :: {:ok, Layr8.Message.t()}
Sends from this DID and waits for a correlated response. Same contract as
Layr8.Client.request/3.
@spec request_result(t(), Layr8.Message.t() | map(), keyword()) :: {:ok, Layr8.Message.t()} | {:error, term()}
request/3 without the raises. Same contract as Layr8.Client.request_result/3.
@spec send(t(), Layr8.Message.t() | map(), keyword()) :: :ok
Sends a DIDComm message from this DID. Same contract as Layr8.Client.send/3.