Commit graph

22 commits

Author SHA1 Message Date
dni ⚡
a53d2d7767
refactor: get rid of secp lib (#40) 2025-11-04 10:30:43 +02:00
dni ⚡
35584a230f
chore: add uv, linting, fixes (#39)
Some checks failed
CI / lint (push) Has been cancelled
/ release (push) Has been cancelled
CI / tests (push) Has been cancelled
/ pullrequest (push) Has been cancelled
* chore: add uv, linting, fixes
2025-10-30 10:43:27 +01:00
PatMulligan
22df5868de
FEAT: Implement NIP-01 Addressable Events Support (#33)
* Implement NIP-16 parameterized replaceable events

Add support for parameterized replaceable events (kinds 30000-39999) to
properly
handle Nostr marketplace product and stall updates according to NIP-16
specification.

Changes:
- Add is_parameterized_replaceable_event property to NostrEvent
- Implement automatic deletion of previous versions when new
parameterized replaceable event is received
- Add 'd' tag filtering support to NostrFilter for parameterized
replacement logic
- Update SQL query generation to handle 'd' tag joins

Fixes issue where product updates would create duplicate entries instead
of
replacing previous versions, ensuring only the latest version remains
visible.

* Refactor event handling for addressable events

Renamed the property is_parameterized_replaceable_event to is_addressable_event in NostrEvent to align with NIP-01 specifications (previously NIP-16). Updated the client_connection.py to utilize the new property for extracting 'd' tag values for addressable replacement, ensuring proper event handling in the relay system.

* Refactor tag filtering logic in NostrFilter

Updated the tag filtering mechanism to ensure that the filter only fails if the specified tags ('e' and 'p') are not found. This change improves clarity and maintains functionality by allowing for more precise control over event filtering.

* update readme

* Fix addressable event deletion and SQL schema issues

- Fix Pydantic field alias usage for d tag filtering (use #d instead of
d)
- Remove nostrrelay schema prefixes from SQL table references
- Implement subquery approach for DELETE operations with JOINs
- Resolve SQLite DELETE syntax incompatibility with JOIN statements
- Ensure NIP-33 compliance: only delete events with matching d tag
values
2025-09-10 16:40:40 +03:00
PatMulligan
687d7b89c1
Fix REQ message handling to support multiple filter subscriptions (#34)
This fix addresses an issue where REQ messages with multiple filters
were being rejected by the relay. Notably: The nostrmarket extension's
"Refresh from Nostr" functionality sends a single REQ message containing
4 different filter subscriptions:
- Direct Messages (kinds: [4])
- Stalls (kinds: [30017])
- Products (kinds: [30018])
- Profile (kinds: [0])

Changes:
- Changed validation from `len(data) != 3` to `len(data) < 3` to allow
multiple filters
- Added loop to process all filters in a single REQ message (data[2:])
- Accumulate responses from all filters before returning

This ensures compatibility with clients that batch multiple subscription
filters in a single REQ message, which is a valid pattern according to
NIP-01.
2025-09-10 16:35:25 +03:00
Vlad Stan
3dc066fbd4
[fix] Ws api tests (#31) 2024-11-11 15:25:25 +02:00
dni ⚡
73054fd5ce
feat: update to v1.0.0 (#30) 2024-11-08 15:32:04 +02:00
Bitkarrot
2bdbbb274d
Update client_connection.py (#29)
omit return none, in ref to https://github.com/lnbits/nostrrelay/issues/27
2024-10-14 09:39:48 +03:00
dni ⚡
cc6752003a
feat: improve codequality and CI (#25)
* feat: improve codequality and CI
2024-08-30 13:20:23 +02:00
Vlad Stan
ccf620d476 feat: check account for REQ 2023-04-06 18:14:35 +03:00
Vlad Stan
dc50d3493d fix: is free to join if cost_to_join == 0 2023-04-06 18:14:12 +03:00
Vlad Stan
8ed361230b refactor: prepare for pay check 2023-04-06 17:33:09 +03:00
Vlad Stan
fddc8a1d22 refactor: field name 2023-04-06 17:31:49 +03:00
Vlad Stan
16b9d93dca fix: use Spec for PaymentSpec 2023-02-22 11:39:35 +02:00
Vlad Stan
8c860f851a feat: update supported NIPs 2023-02-21 16:20:19 +02:00
Vlad Stan
7ec3045130 feat: add extension clean-up endpoint 2023-02-17 14:57:31 +02:00
Vlad Stan
230729483c chore: code format 2023-02-17 14:44:39 +02:00
Vlad Stan
855812cb8f refactor: extract NostrRelay 2023-02-17 14:44:39 +02:00
Vlad Stan
2ebc83a286 refactor: extract NostrFilter 2023-02-17 14:44:39 +02:00
Vlad Stan
6be0169ea9 refactor: extract NostrEvent 2023-02-17 14:44:39 +02:00
Vlad Stan
c42d81f696 refactor: extract client_connection 2023-02-17 14:44:39 +02:00
Vlad Stan
aa68d2a79a refactor: extract EventValidator 2023-02-17 14:44:39 +02:00
Vlad Stan
c46c903703 refactor: move client-manager 2023-02-17 14:44:39 +02:00