@koralabs/handle-chat-sdk 1.0.1 → 1.1.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.
Files changed (38) hide show
  1. package/assets/libsignal_bg.wasm +0 -0
  2. package/lib/libsignal-wasm/pkg/handle_libsignal_wasm.d.ts +20 -0
  3. package/lib/libsignal-wasm/pkg/handle_libsignal_wasm.js +85 -0
  4. package/lib/src/chat/ChatService.d.ts +13 -9
  5. package/lib/src/chat/ChatService.js +384 -105
  6. package/lib/src/chat/anchor.d.ts +2 -2
  7. package/lib/src/chat/anchor.js +2 -2
  8. package/lib/src/chat/blob.d.ts +14 -0
  9. package/lib/src/chat/blob.js +107 -6
  10. package/lib/src/chat/chainDirectory.d.ts +14 -19
  11. package/lib/src/chat/chainDirectory.js +73 -31
  12. package/lib/src/chat/demeter.d.ts +3 -0
  13. package/lib/src/chat/demeter.js +8 -0
  14. package/lib/src/chat/directory.d.ts +12 -2
  15. package/lib/src/chat/directory.js +23 -0
  16. package/lib/src/chat/guardian.d.ts +6 -4
  17. package/lib/src/chat/guardian.js +17 -5
  18. package/lib/src/chat/guardianHistory.d.ts +3 -0
  19. package/lib/src/chat/guardianHistory.js +36 -0
  20. package/lib/src/chat/httpRateLimit.d.ts +5 -0
  21. package/lib/src/chat/httpRateLimit.js +54 -0
  22. package/lib/src/chat/identity.d.ts +1 -1
  23. package/lib/src/chat/identity.js +8 -2
  24. package/lib/src/chat/invite.d.ts +7 -0
  25. package/lib/src/chat/invite.js +18 -0
  26. package/lib/src/chat/mesh/client.d.ts +6 -3
  27. package/lib/src/chat/mesh/client.js +89 -13
  28. package/lib/src/chat/mesh/protocol.d.ts +35 -0
  29. package/lib/src/chat/mesh/protocol.js +11 -0
  30. package/lib/src/chat/publish.d.ts +1 -1
  31. package/lib/src/chat/publish.js +13 -2
  32. package/lib/src/chat/sessionStore.d.ts +10 -1
  33. package/lib/src/chat/sessionStore.js +52 -7
  34. package/lib/src/chat/transport.d.ts +2 -2
  35. package/lib/src/chat/transport.js +66 -6
  36. package/lib/src/signal/SignalEngine.d.ts +5 -0
  37. package/lib/src/signal/SignalEngine.js +10 -0
  38. package/package.json +3 -2
@@ -44,6 +44,16 @@ export class SignalEngine {
44
44
  sealedSend(remote, plaintext) {
45
45
  return this.account.sealedSend(remote, plaintext, Date.now());
46
46
  }
47
+ /** Read an untrusted sender hint without changing the session; authenticate it after decryption. */
48
+ sealedSenderHint(ciphertext) {
49
+ const hint = this.account.sealedSenderHint(ciphertext, Date.now());
50
+ try {
51
+ return { sender: hint.sender, identityKey: hint.identityKey };
52
+ }
53
+ finally {
54
+ hint.free();
55
+ }
56
+ }
47
57
  /**
48
58
  * Sealed-sender decrypt: recovers the sender handle + its certificate identity key (for the caller's
49
59
  * on-chain anchor cross-check) and the plaintext bytes, opening the seal with our own identity key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koralabs/handle-chat-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Programmatic client for handle-to-handle E2E chat (chat.handle.me): wallet-rooted identities (sign-to-derive), libsignal WASM sessions, transports, invite links, and the SSR guardian payloads.",
5
5
  "type": "module",
6
6
  "main": "lib/src/index.js",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "scripts": {
22
22
  "build": "node scripts/build.mjs",
23
- "test": "npm run build && node --test \"test/**/*.test.mjs\"",
23
+ "test": "npm run build && node --test --test-concurrency=2 \"test/**/*.test.mjs\"",
24
24
  "examples": "node examples/quickstart.mjs && node examples/guardian-flow.mjs",
25
25
  "prepack": "npm run build"
26
26
  },
@@ -39,6 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@types/node": "^22.10.0",
41
41
  "@types/qrcode-generator": "^0.0.16",
42
+ "node-datachannel": "^0.32.3",
42
43
  "typescript": "^5.7.2"
43
44
  },
44
45
  "keywords": [