Commit Graph

1335 Commits

Author SHA1 Message Date
Vitor Pamplona 81380a32ae Fixes POCO phone's removal of the + sign in NWC 2026-03-23 13:03:18 -04:00
Vitor Pamplona 7af1be7363 v1.06.0 2026-03-23 11:23:44 -04:00
Vitor Pamplona ed3390f64a Fixes weird import 2026-03-23 10:16:59 -04:00
nrobi144 9d8d0e249d fix(chess): encode required fields in Jester content JSON
JesterContent fields version, fen, and history were omitted from
serialized JSON because kotlinx.serialization skips default values.
Jester's isStartGameEvent checks arrayEquals(json.history, []) which
fails when the field is absent (undefined !== []).

Added @EncodeDefault to version, fen, and history so they are always
included in the JSON output regardless of value.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:08:28 +02:00
nrobi144 3eaf3d38a5 fix(chess): normalize SAN for cross-client interop
ChessEngine.makeMove() now normalizes SAN notation before passing to
chesslib, fixing games against jester.nyo.dev and other clients that
use different notation:

- Castling: 0-0 → O-O, 0-0-0 → O-O-O (zeros to letters)
- Annotations: strips !, ?, !!, ??, !?, ?! suffixes

Previously, chesslib rejected 0-0/0-0-0 causing ChessStateReconstructor
to mark games as desynced and skip remaining moves. Games appeared
permanently stuck, even after app restart.

Also fixes discoverUserGames() silently dropping games classified as
spectator — now adds them to spectatingGames instead.

23 new interop tests covering SAN variants, reconstruction, spectator
detection, and missing start event handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 07:21:17 +02:00
Vitor Pamplona 37f6a7b133 Makes sure subscriptions are closed on the NostrClient utility methods 2026-03-22 15:18:48 -04:00
Vitor Pamplona 439b392aa0 Moves EmptyNostrClient to a class to avoid auto-import issues 2026-03-22 15:14:49 -04:00
Vitor Pamplona b6b4856fe4 Fixes a closing bug when the coroutine crashes
Fixes an index bug on matching subscriptions
Requires the relay to send events that match the sub in order to move forward with the paging
2026-03-22 11:18:12 -04:00
Vitor Pamplona adb3a0e0fc Better transitions to a Nostrclient that is autocloseable, destroying all links to everything else when closing 2026-03-22 11:16:54 -04:00
Vitor Pamplona 15ff3040b5 Merge branch 'main' into claude/nip42-relay-auth-P878m 2026-03-21 13:37:21 -04:00
Vitor Pamplona cfead47d71 Improves design of the policy 2026-03-21 13:21:21 -04:00
Vitor Pamplona df6dc17047 Final touches on the Attestation cards 2026-03-20 21:16:59 -04:00
Claude b0a8cae194 refactor: extract AuthPolicy interface from requireAuth boolean
Replace the requireAuth: Boolean parameter in NostrServer with a
pluggable AuthPolicy interface. Each policy has trigger points for
EVENT (acceptEvent), REQ (acceptReq with filter rewriting), COUNT
(acceptCount), and live event delivery (canSendToSession).

Built-in policies: OpenPolicy (allow all) and RequireAuthPolicy
(require auth for all commands, matching the previous behavior).

https://claude.ai/code/session_017vdjbdxdYK1oJMH66koVZE
2026-03-20 22:40:18 +00:00
Claude 8fd08aa56d feat: implement NIP-42 server-side relay authentication
Add server-side AUTH challenge/response handling per NIP-42 spec:
- RelaySession generates a unique challenge per connection and tracks
  authenticated pubkeys (multiple users can auth on one session)
- NostrServer gains relayUrl and requireAuth parameters; when requireAuth
  is true, EVENT/REQ/COUNT are rejected with auth-required: prefix
- AUTH handler validates kind 22242, created_at within 10 min, challenge
  and relay tag matching
- AuthCmd now accepts Event (not just RelayAuthEvent) so the server can
  gracefully reject wrong-kind auth attempts
- 11 new tests covering auth success, wrong challenge/relay/kind/timestamp,
  multi-user auth, and requireAuth gating

https://claude.ai/code/session_017vdjbdxdYK1oJMH66koVZE
2026-03-20 22:05:53 +00:00
Vitor Pamplona 9bfb170ffa simple documentation 2026-03-20 17:15:05 -04:00
Vitor Pamplona fc1e3e6b83 Adds a simple relay to quartz 2026-03-20 16:54:04 -04:00
Vitor Pamplona d431b12f94 Migrates EventStore from Android's SQLLite to KMP
Fixes testing of libsodium between java and android
2026-03-20 16:00:17 -04:00
Vitor Pamplona c5066d89c3 Fixes serialization issues when the code falls back to Kotlin Serialization 2026-03-20 15:58:17 -04:00
Claude afb3221446 feat: add attestations package to quartz experimental
Implement the Attestations NIP with four event types:
- AttestationEvent (31871, addressable) - validity claims about other events
- AttestationRequestEvent (31872, addressable) - request attestation from attestors
- AttestorRecommendationEvent (31873, addressable) - recommend attestors for kinds
- AttestorProficiencyEvent (11871, replaceable) - declare verification proficiency

Each event follows Quartz's tag-per-file pattern with TagArrayExt and
TagArrayBuilderExt for reading/building tags.

https://claude.ai/code/session_01UswHRVTNqn1ToU4P4XDh2V
2026-03-19 20:40:19 +00:00
Vitor Pamplona 3f4e265dc0 Brings the creation of Zap Polls back. 2026-03-19 12:40:14 -04:00
Vitor Pamplona ec29a47dc4 More debugging information 2026-03-19 09:34:52 -04:00
Vitor Pamplona 3e3adaff10 Finalizes the RelaySync utility 2026-03-18 17:35:05 -04:00
Vitor Pamplona e57023cad9 Fix: Filters onCannotConnect to the relays that sent a req 2026-03-18 17:34:50 -04:00
Vitor Pamplona bc5b254d01 merge 2026-03-17 15:57:44 -04:00
Vitor Pamplona 3e19195e4a Renaming and making a test case that considers limits.
Fixes active filter index bug
2026-03-17 15:45:52 -04:00
Claude 5029db2302 refactor: reorganize nip47 wallet connect package into subpackages
Split the flat nip47WalletConnect package into logical subpackages:
- rpc/ - JSON-RPC protocol models (Request, Response, Notification, NwcMethod, NwcErrorCode, NwcTransaction, etc.)
- events/ - Nostr event types (LnZapPaymentRequestEvent, LnZapPaymentResponseEvent, NwcInfoEvent, NwcNotificationEvent)
- cache/ - Decryption caches (NostrWalletConnectRequestCache, NostrWalletConnectResponseCache)

Root level keeps the entry points: Nip47WalletConnect (URI parsing), Nip47Client, Nip47Server.
Existing subpackages (tags/, kotlinSerialization/, jackson/) remain unchanged.

https://claude.ai/code/session_018YcwMeTHPXmeqpbZHcBEUg
2026-03-17 19:04:24 +00:00
Vitor Pamplona aaa3bcfb2a Merge pull request #1870 from vitorpamplona/claude/fix-event-counter-per-filter-Aps6R
Add per-filter event counting for relay pagination
2026-03-17 13:46:10 -04:00
Claude 76c00dea3c fix: track event counts per filter in downloadFromRelay
Change the event counter from a single global counter to per-filter
tracking using Filter.match(). Each filter's limit is now respected
individually - fulfilled filters are excluded from subsequent pages,
and pagination stops when all filters with limits are satisfied.

https://claude.ai/code/session_01Baaira4xoEHEsaSQCX52Sy
2026-03-17 17:41:40 +00:00
Vitor Pamplona dd9e57542f Merge branch 'main' into claude/event-sync-screen-sYGtN 2026-03-17 13:28:36 -04:00
Vitor Pamplona cc98ac72c1 Revert to 20 since Alby only replies if limit is 20. 2026-03-17 12:04:10 -04:00
Claude 034cc0ab6d feat: move downloadFromRelay pagination logic to Quartz library
Extract the paginated relay download into a reusable INostrClient
extension (NostrClientDownloadFromRelayExt.kt) in the Quartz
commonMain accessories package. Uses Channel-based event collection
for KMP compatibility (no JVM-only atomics).

EventSyncViewModel.downloadFromRelay now delegates to the Quartz
extension, keeping the ViewModel thin.

Add NostrClientDownloadFromRelayTest integration test against
wss://nos.lol with Filter(kinds = [MetadataEvent.KIND], limit = 10)
to verify paginated downloads return correctly-typed events.

https://claude.ai/code/session_01U8qF9mK4UBvXsXP1zNMXfX
2026-03-17 15:34:17 +00:00
Claude 883a2f995e style: apply ktlint formatting fixes
https://claude.ai/code/session_01HeWiRdKDTnMGfEBUegk3d1
2026-03-17 03:43:19 +00:00
Vitor Pamplona 56cce46858 Solving all problems with Quartz tests 2026-03-16 19:22:28 -04:00
Vitor Pamplona 962da3280b Moves the N44 test to Jvmtest 2026-03-16 18:57:00 -04:00
Vitor Pamplona 6ffc902598 Unifies UriParser 2026-03-16 18:15:43 -04:00
Vitor Pamplona 790fd45470 Removes warnings 2026-03-16 18:10:55 -04:00
Vitor Pamplona f708f6c265 Specify which .def file is used between simulators and ios Devices 2026-03-16 17:46:20 -04:00
Vitor Pamplona 7f61b4819b new log fuctions mocked 2026-03-16 17:45:05 -04:00
Vitor Pamplona e7760dc7c7 adds bundleId to the binary file 2026-03-16 17:16:18 -04:00
Vitor Pamplona 7e2912ffd8 removes more warnings 2026-03-16 17:15:33 -04:00
Vitor Pamplona b96c1c2c3a Fixes iosGzip 2026-03-16 16:38:31 -04:00
Vitor Pamplona b916817247 Finishes serialization features for NIP-47 2026-03-16 16:35:05 -04:00
Vitor Pamplona abf2151bac Damus' relay is way too restrictive 2026-03-16 16:28:42 -04:00
Vitor Pamplona 7c22c4e6c5 Migrates to collections 1.6, which deprecates iOS Intel targets. 2026-03-16 13:45:01 -04:00
Vitor Pamplona 78ffd5ec6b Moves nip06 tests to the right package. 2026-03-15 21:32:02 -04:00
Vitor Pamplona 8b4a45cb5b Removing deprecated library addresses and deprecated apis 2026-03-15 20:52:01 -04:00
Vitor Pamplona bda7e48a84 removes more warnings 2026-03-15 20:33:31 -04:00
Vitor Pamplona 49f5d9518e Fixes warnings 2026-03-15 20:26:31 -04:00
Vitor Pamplona 19ca7afcb8 fixes warnings 2026-03-15 20:06:20 -04:00
Vitor Pamplona 1cdd061b06 removing warnings 2026-03-15 20:03:39 -04:00