@majikah/majik-message 0.2.19 → 0.2.20

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.
@@ -28,6 +28,10 @@ export declare class MajikContactDirectory {
28
28
  blockContact(id: string): MajikContact;
29
29
  unblockContact(id: string): MajikContact;
30
30
  hasContact(id: string): boolean;
31
+ /**
32
+ * Checks if a contact exists by their public key (base64)
33
+ */
34
+ hasContactByPublicKeyBase64(publicKeyBase64: string): Promise<boolean>;
31
35
  clear(): this;
32
36
  setMajikahStatus(id: string, status: boolean): MajikContact;
33
37
  isMajikahIdentityChecked(id: string): boolean;
@@ -131,6 +131,16 @@ export class MajikContactDirectory {
131
131
  hasContact(id) {
132
132
  return this.contacts.has(id);
133
133
  }
134
+ /**
135
+ * Checks if a contact exists by their public key (base64)
136
+ */
137
+ async hasContactByPublicKeyBase64(publicKeyBase64) {
138
+ if (!publicKeyBase64 || typeof publicKeyBase64 !== "string") {
139
+ throw new MajikContactDirectoryError("Public key must be a non-empty base64 string");
140
+ }
141
+ const contact = await this.getContactByPublicKeyBase64(publicKeyBase64);
142
+ return contact !== undefined;
143
+ }
134
144
  clear() {
135
145
  this.contacts.clear();
136
146
  this.fingerprintMap.clear();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@majikah/majik-message",
3
3
  "type": "module",
4
4
  "description": "Post-quantum end-to-end encryption with ML-KEM-768. Seed phrase–based accounts. Auto-expiring messages. Offline-ready. Exportable encrypted messages. Tamper-proof threads with blockchain-like integrity. Quantum-resistant messaging.",
5
- "version": "0.2.19",
5
+ "version": "0.2.20",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",