@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 +7 -2
- package/dist/cli/index.cjs +448 -176
- package/dist/index.cjs +1053 -131
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +184 -7
- package/dist/index.d.ts +184 -7
- package/dist/index.js +1047 -129
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
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
|
|
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
|
|
80
|
+
const { messageId, status } = await agent.send(address, message);
|
|
76
81
|
const messages = await agent.inbox(limit);
|
|
77
82
|
|
|
78
83
|
// Trust management
|