@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/core/index.cjs +14 -3
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +14 -3
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.d.cts
CHANGED
|
@@ -3968,6 +3968,8 @@ declare class Sphere {
|
|
|
3968
3968
|
private _market;
|
|
3969
3969
|
private _addressModules;
|
|
3970
3970
|
private _transportMux;
|
|
3971
|
+
/** Fallback DM since timestamp from init options, forwarded to mux on creation. */
|
|
3972
|
+
private _dmSince;
|
|
3971
3973
|
private _l1Config;
|
|
3972
3974
|
private _groupChatConfig;
|
|
3973
3975
|
private _marketConfig;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -3968,6 +3968,8 @@ declare class Sphere {
|
|
|
3968
3968
|
private _market;
|
|
3969
3969
|
private _addressModules;
|
|
3970
3970
|
private _transportMux;
|
|
3971
|
+
/** Fallback DM since timestamp from init options, forwarded to mux on creation. */
|
|
3972
|
+
private _dmSince;
|
|
3971
3973
|
private _l1Config;
|
|
3972
3974
|
private _groupChatConfig;
|
|
3973
3975
|
private _marketConfig;
|
package/dist/core/index.js
CHANGED
|
@@ -16537,6 +16537,8 @@ var Sphere = class _Sphere {
|
|
|
16537
16537
|
// Per-address module instances (Phase 2: independent parallel operation)
|
|
16538
16538
|
_addressModules = /* @__PURE__ */ new Map();
|
|
16539
16539
|
_transportMux = null;
|
|
16540
|
+
/** Fallback DM since timestamp from init options, forwarded to mux on creation. */
|
|
16541
|
+
_dmSince = null;
|
|
16540
16542
|
// Stored configs for creating per-address modules
|
|
16541
16543
|
_l1Config;
|
|
16542
16544
|
_groupChatConfig;
|
|
@@ -16624,9 +16626,6 @@ var Sphere = class _Sphere {
|
|
|
16624
16626
|
const groupChat = _Sphere.resolveGroupChatConfig(options.groupChat, options.network);
|
|
16625
16627
|
const market = _Sphere.resolveMarketConfig(options.market);
|
|
16626
16628
|
const walletExists = await _Sphere.exists(options.storage);
|
|
16627
|
-
if (options.dmSince != null && options.transport.setFallbackDmSince) {
|
|
16628
|
-
options.transport.setFallbackDmSince(options.dmSince);
|
|
16629
|
-
}
|
|
16630
16629
|
if (walletExists) {
|
|
16631
16630
|
const sphere2 = await _Sphere.load({
|
|
16632
16631
|
storage: options.storage,
|
|
@@ -16641,6 +16640,9 @@ var Sphere = class _Sphere {
|
|
|
16641
16640
|
discoverAddresses: options.discoverAddresses,
|
|
16642
16641
|
onProgress: options.onProgress
|
|
16643
16642
|
});
|
|
16643
|
+
if (options.dmSince != null) {
|
|
16644
|
+
sphere2._dmSince = options.dmSince;
|
|
16645
|
+
}
|
|
16644
16646
|
return { sphere: sphere2, created: false };
|
|
16645
16647
|
}
|
|
16646
16648
|
let mnemonic = options.mnemonic;
|
|
@@ -16672,6 +16674,9 @@ var Sphere = class _Sphere {
|
|
|
16672
16674
|
discoverAddresses: options.discoverAddresses,
|
|
16673
16675
|
onProgress: options.onProgress
|
|
16674
16676
|
});
|
|
16677
|
+
if (options.dmSince != null) {
|
|
16678
|
+
sphere._dmSince = options.dmSince;
|
|
16679
|
+
}
|
|
16675
16680
|
return { sphere, created: true, generatedMnemonic };
|
|
16676
16681
|
}
|
|
16677
16682
|
/**
|
|
@@ -17945,6 +17950,9 @@ var Sphere = class _Sphere {
|
|
|
17945
17950
|
const emitEvent = this.emitEvent.bind(this);
|
|
17946
17951
|
const adapter = await this.ensureTransportMux(index, identity);
|
|
17947
17952
|
const addressTransport = adapter ?? this._transport;
|
|
17953
|
+
if (!adapter && this._dmSince != null && addressTransport.setFallbackDmSince) {
|
|
17954
|
+
addressTransport.setFallbackDmSince(this._dmSince);
|
|
17955
|
+
}
|
|
17948
17956
|
const payments = createPaymentsModule({ l1: this._l1Config });
|
|
17949
17957
|
const communications = createCommunicationsModule();
|
|
17950
17958
|
const groupChat = this._groupChatConfig ? createGroupChatModule(this._groupChatConfig) : null;
|
|
@@ -18028,6 +18036,9 @@ var Sphere = class _Sphere {
|
|
|
18028
18036
|
}
|
|
18029
18037
|
logger.debug("Sphere", "Transport mux created and connected");
|
|
18030
18038
|
}
|
|
18039
|
+
if (this._dmSince != null) {
|
|
18040
|
+
this._transportMux.setFallbackDmSince(index, this._dmSince);
|
|
18041
|
+
}
|
|
18031
18042
|
const adapter = await this._transportMux.addAddress(index, identity, this._transport);
|
|
18032
18043
|
return adapter;
|
|
18033
18044
|
}
|