@unicitylabs/sphere-sdk 0.4.5 → 0.4.6
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/dist/connect/index.cjs +17 -0
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +17 -0
- package/dist/connect/index.js.map +1 -1
- package/dist/core/index.cjs +17 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +6 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +17 -0
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +17 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.d.cts
CHANGED
|
@@ -2700,6 +2700,12 @@ declare class CommunicationsModule {
|
|
|
2700
2700
|
* Subscribe to incoming broadcasts
|
|
2701
2701
|
*/
|
|
2702
2702
|
onBroadcast(handler: (message: BroadcastMessage) => void): () => void;
|
|
2703
|
+
/**
|
|
2704
|
+
* Resolve a peer's nametag by their transport pubkey.
|
|
2705
|
+
* Uses transport.resolveTransportPubkeyInfo() for live lookup from relay binding events.
|
|
2706
|
+
* Returns undefined if transport doesn't support resolution or peer has no nametag.
|
|
2707
|
+
*/
|
|
2708
|
+
resolvePeerNametag(peerPubkey: string): Promise<string | undefined>;
|
|
2703
2709
|
private handleIncomingMessage;
|
|
2704
2710
|
private handleComposingIndicator;
|
|
2705
2711
|
private handleIncomingBroadcast;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -2700,6 +2700,12 @@ declare class CommunicationsModule {
|
|
|
2700
2700
|
* Subscribe to incoming broadcasts
|
|
2701
2701
|
*/
|
|
2702
2702
|
onBroadcast(handler: (message: BroadcastMessage) => void): () => void;
|
|
2703
|
+
/**
|
|
2704
|
+
* Resolve a peer's nametag by their transport pubkey.
|
|
2705
|
+
* Uses transport.resolveTransportPubkeyInfo() for live lookup from relay binding events.
|
|
2706
|
+
* Returns undefined if transport doesn't support resolution or peer has no nametag.
|
|
2707
|
+
*/
|
|
2708
|
+
resolvePeerNametag(peerPubkey: string): Promise<string | undefined>;
|
|
2703
2709
|
private handleIncomingMessage;
|
|
2704
2710
|
private handleComposingIndicator;
|
|
2705
2711
|
private handleIncomingBroadcast;
|
package/dist/core/index.js
CHANGED
|
@@ -7659,6 +7659,23 @@ var CommunicationsModule = class {
|
|
|
7659
7659
|
return () => this.broadcastHandlers.delete(handler);
|
|
7660
7660
|
}
|
|
7661
7661
|
// ===========================================================================
|
|
7662
|
+
// Public API - Peer Resolution
|
|
7663
|
+
// ===========================================================================
|
|
7664
|
+
/**
|
|
7665
|
+
* Resolve a peer's nametag by their transport pubkey.
|
|
7666
|
+
* Uses transport.resolveTransportPubkeyInfo() for live lookup from relay binding events.
|
|
7667
|
+
* Returns undefined if transport doesn't support resolution or peer has no nametag.
|
|
7668
|
+
*/
|
|
7669
|
+
async resolvePeerNametag(peerPubkey) {
|
|
7670
|
+
if (!this.deps?.transport.resolveTransportPubkeyInfo) return void 0;
|
|
7671
|
+
try {
|
|
7672
|
+
const info = await this.deps.transport.resolveTransportPubkeyInfo(peerPubkey);
|
|
7673
|
+
return info?.nametag;
|
|
7674
|
+
} catch {
|
|
7675
|
+
return void 0;
|
|
7676
|
+
}
|
|
7677
|
+
}
|
|
7678
|
+
// ===========================================================================
|
|
7662
7679
|
// Private: Message Handling
|
|
7663
7680
|
// ===========================================================================
|
|
7664
7681
|
handleIncomingMessage(msg) {
|