@unicitylabs/sphere-sdk 0.14.0-dev.5 → 0.14.0-dev.6

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.
@@ -367,6 +367,7 @@ declare class WalletApiSession {
367
367
  private reseedChain;
368
368
  private reseedsPending;
369
369
  private readonly handlers;
370
+ private readonly statusHandlers;
370
371
  private socket;
371
372
  private started;
372
373
  private stopped;
@@ -395,6 +396,8 @@ declare class WalletApiSession {
395
396
  private nudgeAllStreams;
396
397
  private startPullTimers;
397
398
  status(): ConnectionStatus;
399
+ /** Transition feed off the existing emitStatus point (FacadeSession.subscribeStatus). */
400
+ subscribeStatus(handler: (status: ConnectionStatus) => void): () => void;
398
401
  private emitStatus;
399
402
  private connect;
400
403
  private openSocket;
@@ -367,6 +367,7 @@ declare class WalletApiSession {
367
367
  private reseedChain;
368
368
  private reseedsPending;
369
369
  private readonly handlers;
370
+ private readonly statusHandlers;
370
371
  private socket;
371
372
  private started;
372
373
  private stopped;
@@ -395,6 +396,8 @@ declare class WalletApiSession {
395
396
  private nudgeAllStreams;
396
397
  private startPullTimers;
397
398
  status(): ConnectionStatus;
399
+ /** Transition feed off the existing emitStatus point (FacadeSession.subscribeStatus). */
400
+ subscribeStatus(handler: (status: ConnectionStatus) => void): () => void;
398
401
  private emitStatus;
399
402
  private connect;
400
403
  private openSocket;
@@ -2719,6 +2719,7 @@ var WalletApiSession = class {
2719
2719
  reseedChain = Promise.resolve();
2720
2720
  reseedsPending = 0;
2721
2721
  handlers = /* @__PURE__ */ new Map();
2722
+ statusHandlers = /* @__PURE__ */ new Set();
2722
2723
  socket = null;
2723
2724
  started = false;
2724
2725
  stopped = false;
@@ -2869,10 +2870,16 @@ var WalletApiSession = class {
2869
2870
  status() {
2870
2871
  return this.lastStatus ?? "offline";
2871
2872
  }
2873
+ /** Transition feed off the existing emitStatus point (FacadeSession.subscribeStatus). */
2874
+ subscribeStatus(handler) {
2875
+ this.statusHandlers.add(handler);
2876
+ return () => this.statusHandlers.delete(handler);
2877
+ }
2872
2878
  emitStatus(status) {
2873
2879
  if (this.stopped || this.lastStatus === status) return;
2874
2880
  this.lastStatus = status;
2875
2881
  this.deps.emitStatus(status);
2882
+ for (const handler of this.statusHandlers) handler(status);
2876
2883
  }
2877
2884
  async connect() {
2878
2885
  if (this.stopped) return;