@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.
@@ -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;
@@ -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;
@@ -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) {