Skip to content

Commit 602b628

Browse files
committed
Cleaned unused methods from the registry code
Signed-off-by: Robert Gogete <gogeterobert@yahoo.com>
1 parent 7fc88b1 commit 602b628

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

src/registry/gun-registry.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -326,55 +326,4 @@ export class GunRegistry {
326326
});
327327
});
328328
}
329-
330-
public async sendSignalingMessage(
331-
targetPeer: string,
332-
message: Record<string, unknown>
333-
): Promise<void> {
334-
if (!this.isGunAvailable || !this.gun) {
335-
throw new Error("Gun.js registry not available");
336-
}
337-
338-
const messageWithTimestamp = {
339-
...message,
340-
timestamp: Date.now(),
341-
};
342-
343-
this.gun
344-
.get(this.options.namespace!)
345-
.get("signaling")
346-
.get(targetPeer)
347-
.put(messageWithTimestamp);
348-
}
349-
350-
public onSignalingMessage(
351-
storeId: string,
352-
callback: (message: Record<string, unknown>) => void
353-
): void {
354-
if (!this.isGunAvailable || !this.gun) {
355-
console.warn("Gun.js not available, signaling will not work");
356-
return;
357-
}
358-
359-
this.gun
360-
.get(this.options.namespace!)
361-
.get("signaling")
362-
.get(storeId)
363-
.on((data: Record<string, unknown>) => {
364-
if (data && data.timestamp) {
365-
callback(data);
366-
}
367-
});
368-
}
369-
370-
public async unregister(storeId: string): Promise<void> {
371-
if (!this.isGunAvailable || !this.gun) {
372-
throw new Error("Gun.js registry not available");
373-
}
374-
375-
// Remove from registry
376-
this.gun.get(this.options.namespace!).get("hosts").get(storeId).put(null);
377-
378-
console.log(`Unregistered host ${storeId}`);
379-
}
380329
}

0 commit comments

Comments
 (0)