nostr-tools 2.23.2 → 2.23.4

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 (138) hide show
  1. package/lib/cjs/abstract-pool.js +6 -2
  2. package/lib/cjs/abstract-pool.js.map +2 -2
  3. package/lib/cjs/abstract-relay.js +6 -2
  4. package/lib/cjs/abstract-relay.js.map +2 -2
  5. package/lib/cjs/index.js +181 -17
  6. package/lib/cjs/index.js.map +4 -4
  7. package/lib/cjs/nip17.js +31 -9
  8. package/lib/cjs/nip17.js.map +2 -2
  9. package/lib/cjs/nip22.js +154 -0
  10. package/lib/cjs/nip22.js.map +7 -0
  11. package/lib/cjs/nip44.js +34 -10
  12. package/lib/cjs/nip44.js.map +2 -2
  13. package/lib/cjs/nip46.js +40 -12
  14. package/lib/cjs/nip46.js.map +2 -2
  15. package/lib/cjs/nip47.js +3 -3
  16. package/lib/cjs/nip47.js.map +2 -2
  17. package/lib/cjs/nip59.js +31 -9
  18. package/lib/cjs/nip59.js.map +2 -2
  19. package/lib/cjs/pool.js +6 -2
  20. package/lib/cjs/pool.js.map +2 -2
  21. package/lib/cjs/relay.js +6 -2
  22. package/lib/cjs/relay.js.map +2 -2
  23. package/lib/esm/abstract-pool.js +6 -2
  24. package/lib/esm/abstract-pool.js.map +2 -2
  25. package/lib/esm/abstract-relay.js +6 -2
  26. package/lib/esm/abstract-relay.js.map +2 -2
  27. package/lib/esm/index.js +181 -17
  28. package/lib/esm/index.js.map +4 -4
  29. package/lib/esm/nip17.js +31 -9
  30. package/lib/esm/nip17.js.map +2 -2
  31. package/lib/esm/nip22.js +133 -0
  32. package/lib/esm/nip22.js.map +7 -0
  33. package/lib/esm/nip44.js +34 -10
  34. package/lib/esm/nip44.js.map +2 -2
  35. package/lib/esm/nip46.js +40 -12
  36. package/lib/esm/nip46.js.map +2 -2
  37. package/lib/esm/nip47.js +3 -3
  38. package/lib/esm/nip47.js.map +2 -2
  39. package/lib/esm/nip59.js +31 -9
  40. package/lib/esm/nip59.js.map +2 -2
  41. package/lib/esm/pool.js +6 -2
  42. package/lib/esm/pool.js.map +2 -2
  43. package/lib/esm/relay.js +6 -2
  44. package/lib/esm/relay.js.map +2 -2
  45. package/lib/nostr.bundle.js +189 -25
  46. package/lib/nostr.bundle.js.map +4 -4
  47. package/package.json +8 -2
  48. package/lib/types/abstract-pool.d.ts +0 -60
  49. package/lib/types/abstract-relay.d.ts +0 -110
  50. package/lib/types/benchmarks.d.ts +0 -1
  51. package/lib/types/core.d.ts +0 -32
  52. package/lib/types/core.test.d.ts +0 -1
  53. package/lib/types/fakejson.d.ts +0 -6
  54. package/lib/types/fakejson.test.d.ts +0 -1
  55. package/lib/types/filter.d.ts +0 -19
  56. package/lib/types/filter.test.d.ts +0 -1
  57. package/lib/types/helpers.d.ts +0 -2
  58. package/lib/types/index.d.ts +0 -30
  59. package/lib/types/kinds.d.ts +0 -200
  60. package/lib/types/kinds.test.d.ts +0 -1
  61. package/lib/types/nip04.d.ts +0 -2
  62. package/lib/types/nip04.test.d.ts +0 -1
  63. package/lib/types/nip05.d.ts +0 -17
  64. package/lib/types/nip05.test.d.ts +0 -1
  65. package/lib/types/nip06.d.ts +0 -15
  66. package/lib/types/nip06.test.d.ts +0 -1
  67. package/lib/types/nip07.d.ts +0 -13
  68. package/lib/types/nip10.d.ts +0 -24
  69. package/lib/types/nip10.test.d.ts +0 -1
  70. package/lib/types/nip11.d.ts +0 -266
  71. package/lib/types/nip11.test.d.ts +0 -1
  72. package/lib/types/nip13.d.ts +0 -8
  73. package/lib/types/nip13.test.d.ts +0 -1
  74. package/lib/types/nip17.d.ts +0 -15
  75. package/lib/types/nip17.test.d.ts +0 -1
  76. package/lib/types/nip18.d.ts +0 -22
  77. package/lib/types/nip18.test.d.ts +0 -1
  78. package/lib/types/nip19.d.ts +0 -81
  79. package/lib/types/nip19.test.d.ts +0 -1
  80. package/lib/types/nip21.d.ts +0 -34
  81. package/lib/types/nip21.test.d.ts +0 -1
  82. package/lib/types/nip25.d.ts +0 -15
  83. package/lib/types/nip25.test.d.ts +0 -1
  84. package/lib/types/nip27.d.ts +0 -32
  85. package/lib/types/nip27.test.d.ts +0 -1
  86. package/lib/types/nip28.d.ts +0 -46
  87. package/lib/types/nip28.test.d.ts +0 -1
  88. package/lib/types/nip29.d.ts +0 -265
  89. package/lib/types/nip30.d.ts +0 -22
  90. package/lib/types/nip30.test.d.ts +0 -1
  91. package/lib/types/nip39.d.ts +0 -2
  92. package/lib/types/nip39.test.d.ts +0 -1
  93. package/lib/types/nip40.d.ts +0 -10
  94. package/lib/types/nip40.test.d.ts +0 -1
  95. package/lib/types/nip42.d.ts +0 -5
  96. package/lib/types/nip42.test.d.ts +0 -1
  97. package/lib/types/nip44.d.ts +0 -13
  98. package/lib/types/nip44.test.d.ts +0 -1
  99. package/lib/types/nip46.d.ts +0 -117
  100. package/lib/types/nip47.d.ts +0 -9
  101. package/lib/types/nip47.test.d.ts +0 -1
  102. package/lib/types/nip49.d.ts +0 -3
  103. package/lib/types/nip49.test.d.ts +0 -1
  104. package/lib/types/nip54.d.ts +0 -1
  105. package/lib/types/nip54.test.d.ts +0 -1
  106. package/lib/types/nip55.d.ts +0 -30
  107. package/lib/types/nip55.test.d.ts +0 -1
  108. package/lib/types/nip57.d.ts +0 -25
  109. package/lib/types/nip57.test.d.ts +0 -1
  110. package/lib/types/nip58.d.ts +0 -134
  111. package/lib/types/nip58.test.d.ts +0 -1
  112. package/lib/types/nip59.d.ts +0 -12
  113. package/lib/types/nip59.test.d.ts +0 -1
  114. package/lib/types/nip75.d.ts +0 -61
  115. package/lib/types/nip75.test.d.ts +0 -1
  116. package/lib/types/nip77.d.ts +0 -102
  117. package/lib/types/nip77.test.d.ts +0 -1
  118. package/lib/types/nip94.d.ts +0 -87
  119. package/lib/types/nip94.test.d.ts +0 -1
  120. package/lib/types/nip98.d.ts +0 -74
  121. package/lib/types/nip98.test.d.ts +0 -1
  122. package/lib/types/nip99.d.ts +0 -92
  123. package/lib/types/nip99.test.d.ts +0 -1
  124. package/lib/types/nipb7.d.ts +0 -23
  125. package/lib/types/nipb7.test.d.ts +0 -1
  126. package/lib/types/pool.d.ts +0 -6
  127. package/lib/types/pool.test.d.ts +0 -1
  128. package/lib/types/pure.d.ts +0 -8
  129. package/lib/types/pure.test.d.ts +0 -1
  130. package/lib/types/references.d.ts +0 -10
  131. package/lib/types/references.test.d.ts +0 -1
  132. package/lib/types/relay.d.ts +0 -11
  133. package/lib/types/relay.test.d.ts +0 -1
  134. package/lib/types/signer.d.ts +0 -11
  135. package/lib/types/test-helpers.d.ts +0 -14
  136. package/lib/types/utils.d.ts +0 -9
  137. package/lib/types/utils.test.d.ts +0 -1
  138. package/lib/types/wasm.d.ts +0 -8
@@ -1,11 +0,0 @@
1
- import { EventTemplate, VerifiedEvent } from './core.ts';
2
- export interface Signer {
3
- getPublicKey(): Promise<string>;
4
- signEvent(event: EventTemplate): Promise<VerifiedEvent>;
5
- }
6
- export declare class PlainKeySigner implements Signer {
7
- private secretKey;
8
- constructor(secretKey: Uint8Array);
9
- getPublicKey(): Promise<string>;
10
- signEvent(event: EventTemplate): Promise<VerifiedEvent>;
11
- }
@@ -1,14 +0,0 @@
1
- import { WebSocket } from 'mock-socket';
2
- import { type Event } from './pure.ts';
3
- export declare const MockWebSocketClient: typeof WebSocket;
4
- export declare function buildEvent(params: Partial<Event>): Event;
5
- export declare class MockRelay {
6
- private _server;
7
- url: string;
8
- secretKeys: Uint8Array[];
9
- preloadedEvents: Event[];
10
- unresponsive: boolean;
11
- constructor(url?: string | undefined);
12
- get authors(): string[];
13
- get ids(): string[];
14
- }
@@ -1,9 +0,0 @@
1
- import type { NostrEvent } from './core.ts';
2
- export declare const utf8Decoder: TextDecoder;
3
- export declare const utf8Encoder: TextEncoder;
4
- export { bytesToHex, hexToBytes } from '@noble/hashes/utils.js';
5
- export declare function normalizeURL(url: string): string;
6
- export declare function insertEventIntoDescendingList(sortedArray: NostrEvent[], event: NostrEvent): NostrEvent[];
7
- export declare function insertEventIntoAscendingList(sortedArray: NostrEvent[], event: NostrEvent): NostrEvent[];
8
- export declare function binarySearch<T>(arr: T[], compare: (b: T) => number): [number, boolean];
9
- export declare function mergeReverseSortedLists(list1: NostrEvent[], list2: NostrEvent[]): NostrEvent[];
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import { Nostr as NostrWasm } from 'nostr-wasm';
2
- import { EventTemplate, Event, VerifiedEvent } from './core.ts';
3
- export declare function setNostrWasm(x: NostrWasm): void;
4
- export declare const generateSecretKey: () => Uint8Array;
5
- export declare const getPublicKey: (secretKey: Uint8Array) => string;
6
- export declare const finalizeEvent: (t: EventTemplate, secretKey: Uint8Array) => VerifiedEvent;
7
- export declare const verifyEvent: (event: Event) => event is VerifiedEvent;
8
- export * from './core.ts';