@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.js
CHANGED
|
@@ -1400,6 +1400,9 @@ var NostrTransportProvider = class _NostrTransportProvider {
|
|
|
1400
1400
|
onReconnected: (url) => {
|
|
1401
1401
|
logger.debug("Nostr", "NostrClient reconnected to relay:", url);
|
|
1402
1402
|
this.emitEvent({ type: "transport:connected", timestamp: Date.now() });
|
|
1403
|
+
this.subscribeToEvents().catch((err) => {
|
|
1404
|
+
logger.error("Nostr", "Failed to re-subscribe after reconnect:", err);
|
|
1405
|
+
});
|
|
1403
1406
|
}
|
|
1404
1407
|
});
|
|
1405
1408
|
await Promise.race([
|
|
@@ -2968,6 +2971,9 @@ var MultiAddressTransportMux = class {
|
|
|
2968
2971
|
onReconnected: (url) => {
|
|
2969
2972
|
logger.debug("Mux", "Reconnected to relay:", url);
|
|
2970
2973
|
this.emitEvent({ type: "transport:connected", timestamp: Date.now() });
|
|
2974
|
+
this.updateSubscriptions().catch((err) => {
|
|
2975
|
+
logger.error("Mux", "Failed to re-subscribe after reconnect:", err);
|
|
2976
|
+
});
|
|
2971
2977
|
}
|
|
2972
2978
|
});
|
|
2973
2979
|
await Promise.race([
|
|
@@ -3055,7 +3061,7 @@ var MultiAddressTransportMux = class {
|
|
|
3055
3061
|
* Called whenever addresses are added/removed.
|
|
3056
3062
|
*/
|
|
3057
3063
|
async updateSubscriptions() {
|
|
3058
|
-
if (!this.nostrClient
|
|
3064
|
+
if (!this.nostrClient) return;
|
|
3059
3065
|
if (this.walletSubscriptionId) {
|
|
3060
3066
|
this.nostrClient.unsubscribe(this.walletSubscriptionId);
|
|
3061
3067
|
this.walletSubscriptionId = null;
|
|
@@ -3064,6 +3070,7 @@ var MultiAddressTransportMux = class {
|
|
|
3064
3070
|
this.nostrClient.unsubscribe(this.chatSubscriptionId);
|
|
3065
3071
|
this.chatSubscriptionId = null;
|
|
3066
3072
|
}
|
|
3073
|
+
if (this.addresses.size === 0) return;
|
|
3067
3074
|
const allPubkeys = [];
|
|
3068
3075
|
for (const entry of this.addresses.values()) {
|
|
3069
3076
|
allPubkeys.push(entry.nostrPubkey);
|