@unicitylabs/sphere-sdk 0.6.11 → 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/index.d.cts CHANGED
@@ -4449,8 +4449,8 @@ interface SphereCreateOptions {
4449
4449
  transport: TransportProvider;
4450
4450
  /** Oracle provider instance */
4451
4451
  oracle: OracleProvider;
4452
- /** L1 (ALPHA blockchain) configuration */
4453
- l1?: L1Config;
4452
+ /** L1 (ALPHA blockchain) configuration. Pass null to disable L1 entirely. */
4453
+ l1?: L1Config | null;
4454
4454
  /** Optional price provider for fiat conversion */
4455
4455
  price?: PriceProvider;
4456
4456
  /**
@@ -4487,8 +4487,8 @@ interface SphereLoadOptions {
4487
4487
  transport: TransportProvider;
4488
4488
  /** Oracle provider instance */
4489
4489
  oracle: OracleProvider;
4490
- /** L1 (ALPHA blockchain) configuration */
4491
- l1?: L1Config;
4490
+ /** L1 (ALPHA blockchain) configuration. Pass null to disable L1 entirely. */
4491
+ l1?: L1Config | null;
4492
4492
  /** Optional price provider for fiat conversion */
4493
4493
  price?: PriceProvider;
4494
4494
  /**
@@ -4539,8 +4539,8 @@ interface SphereImportOptions {
4539
4539
  transport: TransportProvider;
4540
4540
  /** Oracle provider instance */
4541
4541
  oracle: OracleProvider;
4542
- /** L1 (ALPHA blockchain) configuration */
4543
- l1?: L1Config;
4542
+ /** L1 (ALPHA blockchain) configuration. Pass null to disable L1 entirely. */
4543
+ l1?: L1Config | null;
4544
4544
  /** Optional price provider for fiat conversion */
4545
4545
  price?: PriceProvider;
4546
4546
  /** Group chat configuration (NIP-29). Omit to disable groupchat. */
@@ -4588,8 +4588,8 @@ interface SphereInitOptions {
4588
4588
  derivationPath?: string;
4589
4589
  /** Optional nametag to register (only on create). Token is auto-minted. */
4590
4590
  nametag?: string;
4591
- /** L1 (ALPHA blockchain) configuration */
4592
- l1?: L1Config;
4591
+ /** L1 (ALPHA blockchain) configuration. Pass null to disable L1 entirely. */
4592
+ l1?: L1Config | null;
4593
4593
  /** Optional price provider for fiat conversion */
4594
4594
  price?: PriceProvider;
4595
4595
  /**
package/dist/index.d.ts CHANGED
@@ -4449,8 +4449,8 @@ interface SphereCreateOptions {
4449
4449
  transport: TransportProvider;
4450
4450
  /** Oracle provider instance */
4451
4451
  oracle: OracleProvider;
4452
- /** L1 (ALPHA blockchain) configuration */
4453
- l1?: L1Config;
4452
+ /** L1 (ALPHA blockchain) configuration. Pass null to disable L1 entirely. */
4453
+ l1?: L1Config | null;
4454
4454
  /** Optional price provider for fiat conversion */
4455
4455
  price?: PriceProvider;
4456
4456
  /**
@@ -4487,8 +4487,8 @@ interface SphereLoadOptions {
4487
4487
  transport: TransportProvider;
4488
4488
  /** Oracle provider instance */
4489
4489
  oracle: OracleProvider;
4490
- /** L1 (ALPHA blockchain) configuration */
4491
- l1?: L1Config;
4490
+ /** L1 (ALPHA blockchain) configuration. Pass null to disable L1 entirely. */
4491
+ l1?: L1Config | null;
4492
4492
  /** Optional price provider for fiat conversion */
4493
4493
  price?: PriceProvider;
4494
4494
  /**
@@ -4539,8 +4539,8 @@ interface SphereImportOptions {
4539
4539
  transport: TransportProvider;
4540
4540
  /** Oracle provider instance */
4541
4541
  oracle: OracleProvider;
4542
- /** L1 (ALPHA blockchain) configuration */
4543
- l1?: L1Config;
4542
+ /** L1 (ALPHA blockchain) configuration. Pass null to disable L1 entirely. */
4543
+ l1?: L1Config | null;
4544
4544
  /** Optional price provider for fiat conversion */
4545
4545
  price?: PriceProvider;
4546
4546
  /** Group chat configuration (NIP-29). Omit to disable groupchat. */
@@ -4588,8 +4588,8 @@ interface SphereInitOptions {
4588
4588
  derivationPath?: string;
4589
4589
  /** Optional nametag to register (only on create). Token is auto-minted. */
4590
4590
  nametag?: string;
4591
- /** L1 (ALPHA blockchain) configuration */
4592
- l1?: L1Config;
4591
+ /** L1 (ALPHA blockchain) configuration. Pass null to disable L1 entirely. */
4592
+ l1?: L1Config | null;
4593
4593
  /** Optional price provider for fiat conversion */
4594
4594
  price?: PriceProvider;
4595
4595
  /**
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 || this.addresses.size === 0) return;
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);