@konemono/nostr-login 1.14.0 → 1.15.0

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.
Files changed (43) hide show
  1. package/README.md +1 -0
  2. package/dist/const/index.d.ts +9 -1
  3. package/dist/index.esm.js +5 -5
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/modules/AuthNostrService.d.ts +2 -1
  6. package/dist/modules/Nip46.d.ts +1 -0
  7. package/dist/modules/Nostr.d.ts +6 -1
  8. package/dist/modules/RelayHealthManager.d.ts +30 -0
  9. package/dist/modules/nip46/IframeNostrRpc.d.ts +15 -0
  10. package/dist/modules/nip46/Nip46Signer.d.ts +35 -0
  11. package/dist/modules/nip46/NostrRpc.d.ts +30 -0
  12. package/dist/modules/nip46/ReadyListener.d.ts +7 -0
  13. package/dist/modules/nip46/RelayPool.d.ts +59 -0
  14. package/dist/modules/nip46/errors.d.ts +6 -0
  15. package/dist/modules/nip46/index.d.ts +8 -0
  16. package/dist/modules/nip46/types.d.ts +25 -18
  17. package/dist/types.d.ts +1 -1
  18. package/dist/unpkg.js +5 -5
  19. package/dist/utils/index.d.ts +1 -1
  20. package/dist/utils/nostrJson.d.ts +1 -0
  21. package/package.json +2 -2
  22. package/src/const/index.ts +27 -1
  23. package/src/iife-module.ts +2 -2
  24. package/src/index.ts +1 -4
  25. package/src/modules/AuthNostrService.ts +17 -100
  26. package/src/modules/BannerManager.ts +10 -10
  27. package/src/modules/ModalManager.ts +6 -5
  28. package/src/modules/Nip46.ts +22 -7
  29. package/src/modules/Nostr.ts +1 -2
  30. package/src/modules/NostrExtensionService.ts +11 -16
  31. package/src/modules/ProcessManager.ts +1 -2
  32. package/src/modules/RelayHealthManager.ts +101 -0
  33. package/src/modules/nip46/IframeNostrRpc.ts +92 -0
  34. package/src/modules/nip46/Nip46Signer.ts +175 -0
  35. package/src/modules/nip46/NostrRpc.ts +295 -0
  36. package/src/modules/nip46/ReadyListener.ts +36 -0
  37. package/src/modules/nip46/RelayPool.ts +219 -0
  38. package/src/modules/nip46/errors.ts +15 -0
  39. package/src/modules/nip46/index.ts +12 -0
  40. package/src/modules/nip46/types.ts +36 -0
  41. package/src/types.ts +3 -1
  42. package/src/utils/index.ts +4 -7
  43. package/src/utils/nostrJson.ts +21 -0
package/README.md CHANGED
@@ -7,6 +7,7 @@ This library is a powerful `window.nostr` provider with NIP-46 (Nostr Connect) s
7
7
 
8
8
  ### Fork Enhancements
9
9
 
10
+ - **rx-nostr based relay management** — Replaced raw WebSocket handling with [rx-nostr](https://github.com/penpenpng/rx-nostr) v3: automatic reconnection with exponential backoff, lazy-keep connection strategy, reactive connection monitoring via `createConnectionStateObservable()`, and `cast()` for best-effort event publishing
10
11
  - **Multiple NIP-46 relay support** — Add/remove/reset relays from the UI
11
12
  - **QR code scanning** — Scan `bunker://` or `nostrconnect://` QR codes with camera
12
13
  - **NIP-46 signing retry** — Auto-retry (up to 3 times) with forced reconnection on relay disconnect/timeout
@@ -2,4 +2,12 @@ export declare const CALL_TIMEOUT = 5000;
2
2
  export declare const AUTH_URL_CALL_TIMEOUT = 120000;
3
3
  export declare const DEFAULT_NIP46_RELAYS: string[];
4
4
  export declare const NIP46_REQUEST_TIMEOUT = 30000;
5
- export declare const NIP46_CONNECT_TIMEOUT = 60000;
5
+ export declare const OUTBOX_RELAYS: string[];
6
+ export declare const DEFAULT_SIGNUP_RELAYS: string[];
7
+ export declare const NOSTRCONNECT_APPS: {
8
+ name: string;
9
+ domain?: string;
10
+ canImport?: boolean;
11
+ img: string;
12
+ link: string;
13
+ }[];