@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/index.js
CHANGED
|
@@ -1427,6 +1427,9 @@ var NostrTransportProvider = class _NostrTransportProvider {
|
|
|
1427
1427
|
onReconnected: (url) => {
|
|
1428
1428
|
logger.debug("Nostr", "NostrClient reconnected to relay:", url);
|
|
1429
1429
|
this.emitEvent({ type: "transport:connected", timestamp: Date.now() });
|
|
1430
|
+
this.subscribeToEvents().catch((err) => {
|
|
1431
|
+
logger.error("Nostr", "Failed to re-subscribe after reconnect:", err);
|
|
1432
|
+
});
|
|
1430
1433
|
}
|
|
1431
1434
|
});
|
|
1432
1435
|
await Promise.race([
|
|
@@ -2995,6 +2998,9 @@ var MultiAddressTransportMux = class {
|
|
|
2995
2998
|
onReconnected: (url) => {
|
|
2996
2999
|
logger.debug("Mux", "Reconnected to relay:", url);
|
|
2997
3000
|
this.emitEvent({ type: "transport:connected", timestamp: Date.now() });
|
|
3001
|
+
this.updateSubscriptions().catch((err) => {
|
|
3002
|
+
logger.error("Mux", "Failed to re-subscribe after reconnect:", err);
|
|
3003
|
+
});
|
|
2998
3004
|
}
|
|
2999
3005
|
});
|
|
3000
3006
|
await Promise.race([
|
|
@@ -3082,7 +3088,7 @@ var MultiAddressTransportMux = class {
|
|
|
3082
3088
|
* Called whenever addresses are added/removed.
|
|
3083
3089
|
*/
|
|
3084
3090
|
async updateSubscriptions() {
|
|
3085
|
-
if (!this.nostrClient
|
|
3091
|
+
if (!this.nostrClient) return;
|
|
3086
3092
|
if (this.walletSubscriptionId) {
|
|
3087
3093
|
this.nostrClient.unsubscribe(this.walletSubscriptionId);
|
|
3088
3094
|
this.walletSubscriptionId = null;
|
|
@@ -3091,6 +3097,7 @@ var MultiAddressTransportMux = class {
|
|
|
3091
3097
|
this.nostrClient.unsubscribe(this.chatSubscriptionId);
|
|
3092
3098
|
this.chatSubscriptionId = null;
|
|
3093
3099
|
}
|
|
3100
|
+
if (this.addresses.size === 0) return;
|
|
3094
3101
|
const allPubkeys = [];
|
|
3095
3102
|
for (const entry of this.addresses.values()) {
|
|
3096
3103
|
allPubkeys.push(entry.nostrPubkey);
|