@unicitylabs/sphere-sdk 0.6.12 → 0.6.13-dev.2

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/index.cjs CHANGED
@@ -1578,6 +1578,9 @@ var NostrTransportProvider = class _NostrTransportProvider {
1578
1578
  onReconnected: (url) => {
1579
1579
  logger.debug("Nostr", "NostrClient reconnected to relay:", url);
1580
1580
  this.emitEvent({ type: "transport:connected", timestamp: Date.now() });
1581
+ this.subscribeToEvents().catch((err) => {
1582
+ logger.error("Nostr", "Failed to re-subscribe after reconnect:", err);
1583
+ });
1581
1584
  }
1582
1585
  });
1583
1586
  await Promise.race([
@@ -3146,6 +3149,9 @@ var MultiAddressTransportMux = class {
3146
3149
  onReconnected: (url) => {
3147
3150
  logger.debug("Mux", "Reconnected to relay:", url);
3148
3151
  this.emitEvent({ type: "transport:connected", timestamp: Date.now() });
3152
+ this.updateSubscriptions().catch((err) => {
3153
+ logger.error("Mux", "Failed to re-subscribe after reconnect:", err);
3154
+ });
3149
3155
  }
3150
3156
  });
3151
3157
  await Promise.race([
@@ -3233,7 +3239,7 @@ var MultiAddressTransportMux = class {
3233
3239
  * Called whenever addresses are added/removed.
3234
3240
  */
3235
3241
  async updateSubscriptions() {
3236
- if (!this.nostrClient || this.addresses.size === 0) return;
3242
+ if (!this.nostrClient) return;
3237
3243
  if (this.walletSubscriptionId) {
3238
3244
  this.nostrClient.unsubscribe(this.walletSubscriptionId);
3239
3245
  this.walletSubscriptionId = null;
@@ -3242,6 +3248,7 @@ var MultiAddressTransportMux = class {
3242
3248
  this.nostrClient.unsubscribe(this.chatSubscriptionId);
3243
3249
  this.chatSubscriptionId = null;
3244
3250
  }
3251
+ if (this.addresses.size === 0) return;
3245
3252
  const allPubkeys = [];
3246
3253
  for (const entry of this.addresses.values()) {
3247
3254
  allPubkeys.push(entry.nostrPubkey);