@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/index.cjs
CHANGED
|
@@ -8115,6 +8115,23 @@ var CommunicationsModule = class {
|
|
|
8115
8115
|
return () => this.broadcastHandlers.delete(handler);
|
|
8116
8116
|
}
|
|
8117
8117
|
// ===========================================================================
|
|
8118
|
+
// Public API - Peer Resolution
|
|
8119
|
+
// ===========================================================================
|
|
8120
|
+
/**
|
|
8121
|
+
* Resolve a peer's nametag by their transport pubkey.
|
|
8122
|
+
* Uses transport.resolveTransportPubkeyInfo() for live lookup from relay binding events.
|
|
8123
|
+
* Returns undefined if transport doesn't support resolution or peer has no nametag.
|
|
8124
|
+
*/
|
|
8125
|
+
async resolvePeerNametag(peerPubkey) {
|
|
8126
|
+
if (!this.deps?.transport.resolveTransportPubkeyInfo) return void 0;
|
|
8127
|
+
try {
|
|
8128
|
+
const info = await this.deps.transport.resolveTransportPubkeyInfo(peerPubkey);
|
|
8129
|
+
return info?.nametag;
|
|
8130
|
+
} catch {
|
|
8131
|
+
return void 0;
|
|
8132
|
+
}
|
|
8133
|
+
}
|
|
8134
|
+
// ===========================================================================
|
|
8118
8135
|
// Private: Message Handling
|
|
8119
8136
|
// ===========================================================================
|
|
8120
8137
|
handleIncomingMessage(msg) {
|