@youam/sdk 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,10 +21,15 @@ import { Agent } from "@youam/sdk";
21
21
 
22
22
  const agent = new Agent("myagent");
23
23
  await agent.connect();
24
- const msgId = await agent.send("friend::youam.network", "Hello!");
24
+ const result = await agent.send("friend::youam.network", "Hello!");
25
+ // result.messageId, result.status ("delivered", "stored", "pending", ...),
26
+ // result.delivered (true only when the relay says the recipient has it)
25
27
  await agent.close();
26
28
  ```
27
29
 
30
+ `status` is `"pending"` when the recipient only accepts messages from
31
+ approved contacts: the relay kept nothing, so don't resend it.
32
+
28
33
  ### Check Inbox
29
34
 
30
35
  ```typescript
@@ -72,7 +77,7 @@ const agent = new Agent("name", {
72
77
  await agent.connect();
73
78
 
74
79
  // Messaging
75
- const msgId = await agent.send(address, message);
80
+ const { messageId, status } = await agent.send(address, message);
76
81
  const messages = await agent.inbox(limit);
77
82
 
78
83
  // Trust management