applesauce-relay 0.0.0-next-20251231055351 → 0.0.0-next-20251231062646

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/relay.d.ts CHANGED
@@ -33,10 +33,11 @@ export type RelayOptions = {
33
33
  publishRetry?: RetryConfig;
34
34
  };
35
35
  export declare class Relay implements IRelay {
36
- #private;
37
36
  url: string;
38
37
  protected log: typeof logger;
39
38
  protected socket: WebSocketSubject<any>;
39
+ /** Internal subject that tracks the ready state of the relay */
40
+ protected _ready$: BehaviorSubject<boolean>;
40
41
  /** Whether the relay is ready for subscriptions or event publishing. setting this to false will cause all .req and .event observables to hang until the relay is ready */
41
42
  ready$: Observable<boolean>;
42
43
  /** A method that returns an Observable that emits when the relay should reconnect */
package/dist/relay.js CHANGED
@@ -29,9 +29,9 @@ export class Relay {
29
29
  log = logger.extend("Relay");
30
30
  socket;
31
31
  /** Internal subject that tracks the ready state of the relay */
32
- #ready$ = new BehaviorSubject(true);
32
+ _ready$ = new BehaviorSubject(true);
33
33
  /** Whether the relay is ready for subscriptions or event publishing. setting this to false will cause all .req and .event observables to hang until the relay is ready */
34
- ready$ = this.#ready$.asObservable();
34
+ ready$ = this._ready$.asObservable();
35
35
  /** A method that returns an Observable that emits when the relay should reconnect */
36
36
  reconnectTimer;
37
37
  /** How many times the relay has tried to reconnect */
@@ -75,7 +75,7 @@ export class Relay {
75
75
  closing$ = new Subject();
76
76
  // sync state
77
77
  get ready() {
78
- return this.#ready$.value;
78
+ return this._ready$.value;
79
79
  }
80
80
  get connected() {
81
81
  return this.connected$.value;
@@ -260,10 +260,12 @@ export class Relay {
260
260
  if (!this.ready)
261
261
  return;
262
262
  this.error$.next(error instanceof Error ? error : new Error("Connection error"));
263
- this.#ready$.next(false);
263
+ this._ready$.next(false);
264
264
  this.reconnectTimer(error, this.attempts$.value)
265
265
  .pipe(take(1))
266
- .subscribe(() => this.#ready$.next(true));
266
+ .subscribe(() => {
267
+ this._ready$.next(true);
268
+ });
267
269
  }
268
270
  /** Wait for authentication state, make connection and then wait for authentication if required */
269
271
  waitForAuth(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-relay",
3
- "version": "0.0.0-next-20251231055351",
3
+ "version": "0.0.0-next-20251231062646",
4
4
  "description": "nostr relay communication framework built on rxjs",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -57,14 +57,14 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@noble/hashes": "^1.7.1",
60
- "applesauce-core": "0.0.0-next-20251231055351",
60
+ "applesauce-core": "0.0.0-next-20251231062646",
61
61
  "nanoid": "^5.0.9",
62
- "nostr-tools": "~2.18",
62
+ "nostr-tools": "~2.19",
63
63
  "rxjs": "^7.8.1"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@hirez_io/observer-spy": "^2.2.0",
67
- "applesauce-signers": "0.0.0-next-20251231055351",
67
+ "applesauce-signers": "0.0.0-next-20251231062646",
68
68
  "rimraf": "^6.0.1",
69
69
  "typescript": "^5.7.3",
70
70
  "vitest": "^4.0.15",