3 Commits
Author SHA1 Message Date
Kaiandfiatjaf e1f3ffdece fix: format pool.test.ts and relay.test.ts (pre-existing) 2026-04-25 13:41:06 -03:00
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