@unicitylabs/sphere-sdk 0.6.8-dev.2 → 0.6.8-dev.3

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
@@ -4668,6 +4668,8 @@ declare class Sphere {
4668
4668
  private _market;
4669
4669
  private _addressModules;
4670
4670
  private _transportMux;
4671
+ /** Fallback DM since timestamp from init options, forwarded to mux on creation. */
4672
+ private _dmSince;
4671
4673
  private _l1Config;
4672
4674
  private _groupChatConfig;
4673
4675
  private _marketConfig;
package/dist/index.d.ts CHANGED
@@ -4668,6 +4668,8 @@ declare class Sphere {
4668
4668
  private _market;
4669
4669
  private _addressModules;
4670
4670
  private _transportMux;
4671
+ /** Fallback DM since timestamp from init options, forwarded to mux on creation. */
4672
+ private _dmSince;
4671
4673
  private _l1Config;
4672
4674
  private _groupChatConfig;
4673
4675
  private _marketConfig;
package/dist/index.js CHANGED
@@ -16721,6 +16721,8 @@ var Sphere = class _Sphere {
16721
16721
  // Per-address module instances (Phase 2: independent parallel operation)
16722
16722
  _addressModules = /* @__PURE__ */ new Map();
16723
16723
  _transportMux = null;
16724
+ /** Fallback DM since timestamp from init options, forwarded to mux on creation. */
16725
+ _dmSince = null;
16724
16726
  // Stored configs for creating per-address modules
16725
16727
  _l1Config;
16726
16728
  _groupChatConfig;
@@ -16808,9 +16810,6 @@ var Sphere = class _Sphere {
16808
16810
  const groupChat = _Sphere.resolveGroupChatConfig(options.groupChat, options.network);
16809
16811
  const market = _Sphere.resolveMarketConfig(options.market);
16810
16812
  const walletExists = await _Sphere.exists(options.storage);
16811
- if (options.dmSince != null && options.transport.setFallbackDmSince) {
16812
- options.transport.setFallbackDmSince(options.dmSince);
16813
- }
16814
16813
  if (walletExists) {
16815
16814
  const sphere2 = await _Sphere.load({
16816
16815
  storage: options.storage,
@@ -16825,6 +16824,9 @@ var Sphere = class _Sphere {
16825
16824
  discoverAddresses: options.discoverAddresses,
16826
16825
  onProgress: options.onProgress
16827
16826
  });
16827
+ if (options.dmSince != null) {
16828
+ sphere2._dmSince = options.dmSince;
16829
+ }
16828
16830
  return { sphere: sphere2, created: false };
16829
16831
  }
16830
16832
  let mnemonic = options.mnemonic;
@@ -16856,6 +16858,9 @@ var Sphere = class _Sphere {
16856
16858
  discoverAddresses: options.discoverAddresses,
16857
16859
  onProgress: options.onProgress
16858
16860
  });
16861
+ if (options.dmSince != null) {
16862
+ sphere._dmSince = options.dmSince;
16863
+ }
16859
16864
  return { sphere, created: true, generatedMnemonic };
16860
16865
  }
16861
16866
  /**
@@ -18129,6 +18134,9 @@ var Sphere = class _Sphere {
18129
18134
  const emitEvent = this.emitEvent.bind(this);
18130
18135
  const adapter = await this.ensureTransportMux(index, identity);
18131
18136
  const addressTransport = adapter ?? this._transport;
18137
+ if (!adapter && this._dmSince != null && addressTransport.setFallbackDmSince) {
18138
+ addressTransport.setFallbackDmSince(this._dmSince);
18139
+ }
18132
18140
  const payments = createPaymentsModule({ l1: this._l1Config });
18133
18141
  const communications = createCommunicationsModule();
18134
18142
  const groupChat = this._groupChatConfig ? createGroupChatModule(this._groupChatConfig) : null;
@@ -18212,6 +18220,9 @@ var Sphere = class _Sphere {
18212
18220
  }
18213
18221
  logger.debug("Sphere", "Transport mux created and connected");
18214
18222
  }
18223
+ if (this._dmSince != null) {
18224
+ this._transportMux.setFallbackDmSince(index, this._dmSince);
18225
+ }
18215
18226
  const adapter = await this._transportMux.addAddress(index, identity, this._transport);
18216
18227
  return adapter;
18217
18228
  }