Commit Graph
266 Commits
Author SHA1 Message Date
fiatjaf e17366cd2e add AUTH recommendations to README.
fixes https://github.com/nbd-wtf/nostr-tools/issues/537
2026-06-10 22:09:28 -03:00
fiatjaf ed47ef8ef7 bump version. 2026-05-18 20:52:28 -03:00
fiatjaf a9e89e16e3 nip22: like nip10, but for kind:1111 and adjacent kinds. 2026-05-18 20:52:05 -03:00
d3vv3andfiatjaf 1b955bdbcb fix: window.printer is undefined in AbstractRelay._onmessage 2026-02-28 01:01:07 -03:00
fiatjaf 1c1e2cc51a verify event should catch exceptions from basic validation. 2026-02-26 18:10:39 -03:00
fiatjaf e45a9987e2 pool: prevent edge case with undefined subcloser. 2026-02-12 15:08:13 -03:00
fiatjaf ab802c8dbe automatic prune broken relay objects and keep track of relay idleness so they can be pruned. 2026-02-02 18:44:52 -03:00
fiatjaf 05b1fba511 export source files so they can be imported by other ts apps and libraries better. 2026-02-02 00:38:15 -03:00
fiatjaf ccb9641fb9 pool: maxWaitForConnection parameter.
this was so obvious.
2026-01-31 00:27:55 -03:00
fiatjaf b624ad4059 pool: hooks to notify when a relay fails to connect, then ask whether a connection should be attempted. 2026-01-30 17:35:46 -03:00
fiatjaf b3d314643a make everything dependent on npm again. 2026-01-30 07:16:04 -03:00
fiatjaf 42c9c7554d migrate to jsr dependencies for @noble and @scure. 2026-01-27 23:54:50 -03:00
fiatjaf 3588d30044 do the same for @noble/ciphers and @scure packages. 2026-01-27 22:43:54 -03:00
b40f59af74 Upgrade to @noble/curves ^2.0.1 and @noble/hashes ^2.0.1
This commit upgrades the noble cryptography dependencies to v2.0.1, which includes:

Breaking changes addressed:
- Updated all @noble imports to include .js extensions (required by v2 ESM-only API)
- Changed @noble/hashes/sha256 to @noble/hashes/sha2.js across 8 files
- Fixed secp256k1 API changes: methods now require Uint8Array instead of hex strings
- Updated schnorr.utils.randomPrivateKey() to schnorr.utils.randomSecretKey()

Files modified (27 total):
- package.json: Bump dependency versions
- Source files (12): pure.ts, nip04.ts, nip06.ts, nip13.ts, nip19.ts, nip44.ts,
  nip49.ts, nip77.ts, nip98.ts, nipb7.ts, utils.ts, wasm.ts
- Test files (14): All corresponding test files updated

Benefits:
- Latest security updates from audited noble libraries
- Smaller bundle sizes from v2 optimizations
- Future-proof ESM-only compatibility
- All tests passing

Co-authored-by: OpenCode <opencode@anomalyco.com>
2026-01-24 09:41:15 -03:00
fiatjaf bfa40da316 nip46: improve fromURI() and implement "switch_relays". 2026-01-22 21:50:30 -03:00
fiatjaf 0235b490fa nip27: fix trailing / in urls. 2025-12-11 21:23:32 -03:00
fiatjaf 7a50d9328d add some more kinds. 2025-12-09 10:56:43 -03:00
fiatjaf 0b6543e1a8 use setInterval() instead of nested setTimeout()s for pingpong.
prevent call stacks from building up
2025-12-05 21:46:16 -03:00
fiatjaf 85c964be3d enableReconnect() always update the filters to the time of the last received event on each subscription. 2025-12-05 13:24:49 -03:00
fiatjaf de7d459f6f only transform filters with enableReconnect() when we're actually reconnecting. 2025-12-05 09:22:33 -03:00
fiatjaf e959409c14 fix classifyKind() test. 2025-11-25 22:21:46 -03:00
fiatjaf 34a1d8db47 kinds: more reliable regular/replaceable kind figuring. 2025-11-24 20:08:15 -03:00
fiatjaf 01880b6fb5 nip27: parse emoji shortcodes and hashtags too. 2025-11-21 00:37:40 -03:00
fiatjaf c45e861493 fire subscriptions.
this was broken during the negentropy stuff.

fixes https://github.com/nbd-wtf/nostr-tools/issues/517
2025-11-19 14:53:24 -03:00
fiatjaf 66cc55c7f0 nip77: negentropy implementation and nip77 interface.
supersedes https://github.com/nbd-wtf/nostr-tools/pull/516
2025-11-18 09:33:11 -03:00
Chris McCormickandfiatjaf 1e0f393268 Fix subscribeMap EOSE grouping. Fixes #514 2025-10-29 08:18:49 -03:00
Chris McCormickandfiatjaf 1bec9fa365 Ping pong memory leak fix for #511 (#512)
* New test for pingpong memory leak (failing).

* Shim once in relay ping mem test.

* Fix pong memory leak with .once.

Fixes #511.

* Fix missing global WebSocket on Node.

* Lint fix.

* Remove overkill WebSocket impl check.
2025-10-26 23:33:38 -03:00
tajava2006andfiatjaf_ 0e6e7af934 chore: Bump version and document NIP-46 usage 2025-08-25 11:00:06 -03:00
fiatjaf 86235314c4 deduplicate relay URLs in pool.subscribe() and pool.subscribeMany() 2025-08-06 10:37:36 -03:00
fiatjaf b575e47844 nip57: include "k" tag. 2025-08-01 19:38:03 -03:00
fiatjaf b076c34a2f tag new minor because of the pingpong stuff. 2025-08-01 14:12:53 -03:00
fiatjaf 4b6cc19b9c cleanup. 2025-07-23 16:22:25 -03:00
fiatjaf f0357805c3 catch errors on function passed to auth() and log them. 2025-06-10 10:20:20 -03:00
fiatjaf d773012658 proper auth support on pool.publish(). 2025-06-06 22:36:07 -03:00
fiatjaf b8f91c37fa and there was an error in jsr.json 2025-06-05 14:37:56 -03:00
fiatjaf 2da3528362 forgot to expose blossom, as usual. 2025-06-05 01:29:54 -03:00
fiatjaf 315e9a472c expose signer module. 2025-06-04 21:47:17 -03:00
fiatjaf 5b78a829c7 ignore error when sending on a CLOSE to a closed connection. 2025-05-31 12:29:24 -03:00
fiatjaf de26ee98c5 failed to connect to a websocket should reject the promise. 2025-05-31 11:16:22 -03:00
fiatjaf eff9ea9579 remove deprecated subscribeManyMap() 2025-05-17 18:52:01 -03:00
fiatjaf 4ba9c8886b forgot to remove nip96 from export lists. 2025-05-12 05:24:57 -03:00
fiatjaf 3e839db6f2 tag v2.13.0 (breaking because stuff is removed). 2025-05-12 05:20:45 -03:00
fiatjaf ba26b92973 get rid of nip96 and unnecessary dependencies. 2025-04-02 11:51:02 -03:00
fiatjaf e498c9144d nip46: auto-reconnect. 2025-04-02 10:58:26 -03:00
fiatjaf 4a738c93d0 nip46: stop supporting nip04-encrypted messages. 2025-04-02 10:25:19 -03:00
fiatjaf 2a11c9ec91 nip04: functions shouldn't be async. 2025-04-02 10:19:27 -03:00
fiatjaf cbe3a9d683 pool subscribe methods accept an onauth param. 2025-04-01 19:16:42 -03:00
fiatjaf 9a612e59a2 update nip11 test. 2025-03-14 09:30:35 -03:00
Baris Aydekandfiatjaf_ 3c4019a154 nip54 normalizeIdentifier function 2025-02-25 13:52:40 -03:00
fiatjaf 43ce7f9377 fix reference to nostr-wasm dependency so it can be installed on deno.
fixes https://github.com/nbd-wtf/nostr-tools/issues/459
2024-11-25 21:33:25 -03:00