@unicitylabs/sphere-sdk 0.6.12 → 0.6.13-dev.1
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/core/index.cjs +8 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +8 -1
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/index.cjs +3 -0
- package/dist/impl/browser/index.cjs.map +1 -1
- package/dist/impl/browser/index.js +3 -0
- package/dist/impl/browser/index.js.map +1 -1
- package/dist/impl/nodejs/index.cjs +3 -0
- package/dist/impl/nodejs/index.cjs.map +1 -1
- package/dist/impl/nodejs/index.js +3 -0
- package/dist/impl/nodejs/index.js.map +1 -1
- package/dist/index.cjs +8 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.cjs
CHANGED
|
@@ -1480,6 +1480,9 @@ var NostrTransportProvider = class _NostrTransportProvider {
|
|
|
1480
1480
|
onReconnected: (url) => {
|
|
1481
1481
|
logger.debug("Nostr", "NostrClient reconnected to relay:", url);
|
|
1482
1482
|
this.emitEvent({ type: "transport:connected", timestamp: Date.now() });
|
|
1483
|
+
this.subscribeToEvents().catch((err) => {
|
|
1484
|
+
logger.error("Nostr", "Failed to re-subscribe after reconnect:", err);
|
|
1485
|
+
});
|
|
1483
1486
|
}
|
|
1484
1487
|
});
|
|
1485
1488
|
await Promise.race([
|
|
@@ -3048,6 +3051,9 @@ var MultiAddressTransportMux = class {
|
|
|
3048
3051
|
onReconnected: (url) => {
|
|
3049
3052
|
logger.debug("Mux", "Reconnected to relay:", url);
|
|
3050
3053
|
this.emitEvent({ type: "transport:connected", timestamp: Date.now() });
|
|
3054
|
+
this.updateSubscriptions().catch((err) => {
|
|
3055
|
+
logger.error("Mux", "Failed to re-subscribe after reconnect:", err);
|
|
3056
|
+
});
|
|
3051
3057
|
}
|
|
3052
3058
|
});
|
|
3053
3059
|
await Promise.race([
|
|
@@ -3135,7 +3141,7 @@ var MultiAddressTransportMux = class {
|
|
|
3135
3141
|
* Called whenever addresses are added/removed.
|
|
3136
3142
|
*/
|
|
3137
3143
|
async updateSubscriptions() {
|
|
3138
|
-
if (!this.nostrClient
|
|
3144
|
+
if (!this.nostrClient) return;
|
|
3139
3145
|
if (this.walletSubscriptionId) {
|
|
3140
3146
|
this.nostrClient.unsubscribe(this.walletSubscriptionId);
|
|
3141
3147
|
this.walletSubscriptionId = null;
|
|
@@ -3144,6 +3150,7 @@ var MultiAddressTransportMux = class {
|
|
|
3144
3150
|
this.nostrClient.unsubscribe(this.chatSubscriptionId);
|
|
3145
3151
|
this.chatSubscriptionId = null;
|
|
3146
3152
|
}
|
|
3153
|
+
if (this.addresses.size === 0) return;
|
|
3147
3154
|
const allPubkeys = [];
|
|
3148
3155
|
for (const entry of this.addresses.values()) {
|
|
3149
3156
|
allPubkeys.push(entry.nostrPubkey);
|