9 Commits
Author SHA1 Message Date
Kaiandfiatjaf 1f2c967b04 feat(nip47): support multiple relays in parseConnectionString
NIP-47 connection strings can specify multiple relay params, but
parseConnectionString only returned the first one.

Adds a 'relays' field (string[]) to NWCConnection while keeping the
existing 'relay' field (deprecated) for backward compatibility.

Fixes #494
2026-04-25 13:41:06 -03:00
Kaiandfiatjaf_ 8be6d08a43 fix(nip47): support multiple relays in parseConnectionString
Addresses #494. The NIP-47 spec allows multiple relay parameters in
connection strings, but parseConnectionString only returned the first one.

Changes:
- Add 'relays' field to NWCConnection interface (string array)
- Use searchParams.getAll('relay') to capture all relays
- Keep 'relay' field for backwards compatibility (returns first relay)

This is backwards compatible - existing code using connection.relay
will continue to work, while new code can use connection.relays to
access all specified relays.
2026-03-27 07:02:47 -03:00
SondreBandfiatjaf_ 2f529b3f8a enhance parseConnectionString to support double slash URL format 2025-07-13 11:59:04 -03:00
fiatjaf 57354b9fb4 expose hexToBytes and bytesToHex helpers. 2025-05-28 14:50:25 -03:00
Alex Gleasonandfiatjaf_ 9c0ade1329 Fix (most) slow types by adding explicit return types 2024-03-07 07:22:44 -03:00
fiatjaf fe87529646 change tests and nips to use the new api. 2023-12-19 13:58:37 -03:00
fiatjaf 6a07e7c1cc remove the kind type parameter from events and filters. 2023-12-16 10:10:37 -03:00
fiatjaf 6874f58c0a apply prettier. 2023-09-26 12:19:01 -03:00
Sam Samskiesandfiatjaf_ de72172583 add helper functions for nip-47 2023-09-19 14:43:01 -03:00