Commit Graph

1143 Commits

Author SHA1 Message Date
Vitor Pamplona 46dcd105c8 Organizes Chess class and common tags 2026-03-04 09:19:39 -05:00
Vitor Pamplona 4060bef2be Lint 2026-03-04 09:19:21 -05:00
Vitor Pamplona ad578b394d Merge pull request #1759 from vitorpamplona/claude/refactor-nip64chess-structure-3iFIB
refactor: restructure nip64Chess to match nip88Polls pattern
2026-03-04 08:30:35 -05:00
Vitor Pamplona e065cbc63b Merge branch 'main' into feature/namecoin-nip05-resolution 2026-03-04 08:29:48 -05:00
Claude 2df8a106d4 refactor: restructure nip64Chess to match nip88Polls pattern
Reorganize nip64Chess event classes into individual packages with
dedicated tag classes, TagArrayBuilderExt, and TagArrayExt files,
following the same structure used by nip88Polls.

New package structure:
- challenge/ - LiveChessGameChallengeEvent with PlayerColorTag, TimeControlTag
- accept/ - LiveChessGameAcceptEvent with ChallengeEventTag
- move/ - LiveChessMoveEvent with GameIdTag, MoveNumberTag, SanTag, FenTag
- end/ - LiveChessGameEndEvent with ResultTag, TerminationTag, WinnerTag
- draw/ - LiveChessDrawOfferEvent
- game/ - ChessGameEvent (Kind 64)
- jester/ - JesterEvent, JesterProtocol, JesterContent, JesterGameEvents

Each tag class follows the companion object pattern with isTag(),
parse(), and assemble() methods. Each event package includes
TagArrayBuilderExt for building and TagArrayExt for parsing.

https://claude.ai/code/session_01Qtzhka3p5N3Hbns4xrRbsv
2026-03-04 00:51:43 +00:00
M cb1031705b Remove dead ElectrumX servers ulrichard.ch and nmc2.lelux.fi
ulrichard.ch:50006 — connects but never responds (timeout)
nmc2.lelux.fi:50006 — DNS resolution fails (ENOTFOUND)
2026-03-04 06:34:39 +11:00
M c649f2163b Add nmc2.bitcoins.sk and 46.229.238.187 as backup ElectrumX servers
Both verified to resolve Namecoin names via scripthash lookups.
Port 57002, TLS with self-signed certs.
2026-03-04 06:30:50 +11:00
Vitor Pamplona edb73b3556 Updates AGP 2026-03-03 11:52:03 -05:00
Vitor Pamplona 2b80ab52b7 Merge pull request #1747 from vitorpamplona/claude/nip39-kind-10011-support-EACQk
Implement NIP-39 External Identities (kind 10011) event support
2026-03-03 10:01:52 -05:00
Claude 79b06d35b9 feat: add NIP-39 kind 10011 (ExternalIdentitiesEvent) support
- Add ExternalIdentitiesEvent (kind 10011) to quartz/nip39ExtIdentities
  with createNew/updateFromPast factory methods and identityClaims()
- Generalize TagArrayBuilderExt to work with any Event type (not just
  MetadataEvent) so claims/twitterClaim etc. work with both kinds
- Extract replaceClaims logic to List<IdentityClaimTag>.replaceClaims()
  shared extension used by both MetadataEvent and ExternalIdentitiesEvent
- Register ExternalIdentitiesEvent in EventFactory (kind 10011)
- Add consume(ExternalIdentitiesEvent) to LocalCache and dispatch in
  justConsumeInnerInner
- Add ExternalIdentitiesEvent.KIND to UserMetadataForKeyKinds relay filter
  so kind 10011 is fetched alongside kind 0 when loading user profiles
- Add UserExternalIdentitiesViewModel that observes the kind 10011
  AddressableNote for a user and exposes List<IdentityClaimTag> as a Flow
- Thread UserExternalIdentitiesViewModel through ProfileScreen →
  RenderScreen → ProfileHeader → DrawAdditionalInfo
- DrawAdditionalInfo now shows kind 10011 identities, falling back to
  kind 0 for backwards compatibility
- UserMetadataState: add sendNewUserIdentities() for kind 10011 and
  remove identity claim params from sendNewUserMetadata() (kind 0)
- NewUserMetadataViewModel: load identities from kind 10011 first
  (fallback to kind 0), save identities to kind 10011 separately

https://claude.ai/code/session_017iU6ZdRu5qRXPCeDztVeeV
2026-03-03 13:47:27 +00:00
Vitor Pamplona 0370e51e57 Merge branch 'main' of https://github.com/vitorpamplona/amethyst
* 'main' of https://github.com/vitorpamplona/amethyst:
  feat: add NIP-C0 code snippet support (kind:1337)
2026-03-02 19:27:27 -05:00
Claude 8c12d4d692 feat: add NIP-C0 code snippet support (kind:1337)
Adds full protocol support for NIP-C0 code snippet events following the
same structure used for NIP-88 polls.

Quartz (quartz/nipC0CodeSnippets/):
- CodeSnippetEvent (kind:1337) with accessors for all optional metadata
- TagArrayExt: parse language, extension, name, description, runtime,
  license, deps (repeatable), and repo from tag arrays
- TagArrayBuilderExt: typed builder functions for CodeSnippetEvent
- Tag classes: LanguageTag (l), ExtensionTag, SnippetNameTag (name),
  SnippetDescriptionTag (description), RuntimeTag, LicenseTag, DepTag,
  RepoTag

EventFactory: register kind 1337 → CodeSnippetEvent
LocalCache: add consume(CodeSnippetEvent) and dispatch in when block

https://claude.ai/code/session_013ykLNfJNdwWpXh8ZhZaSXY
2026-03-02 23:48:43 +00:00
Vitor Pamplona 254ef7081b Merge branch 'main' of https://github.com/vitorpamplona/amethyst
* 'main' of https://github.com/vitorpamplona/amethyst:
  feat: add NIP-66 relay monitor and discovery support to quartz
2026-03-02 17:32:37 -05:00
Vitor Pamplona 85330f932c Merge pull request #1742 from vitorpamplona/claude/add-nip66-support-GmCWu
feat: add NIP-66 relay monitor and discovery support to quartz
2026-03-02 17:17:33 -05:00
Vitor Pamplona 7ed0909169 Blocks the size of RelayAuthStatus arrays from growing forever with auth messages 2026-03-02 17:09:52 -05:00
Claude 49e2f2c7c9 feat: add NIP-66 relay monitor and discovery support to quartz
Implements both event kinds from NIP-66 (Relay Monitor Protocol):

- Kind 10166 (RelayMonitorEvent) - replaceable event published by
  monitoring services, declaring check frequency, timeout values, and
  supported check types (open, read, write, auth, nip11, dns, geo)

- Kind 30166 (RelayDiscoveryEvent) - addressable event (keyed by relay
  URL in d-tag) published per monitored relay, carrying RTT metrics,
  network type, relay type, supported NIPs, accepted kinds, access
  requirements, topics, and geohash

Package: nip66RelayMonitor/{monitor,discovery} following existing NIP-88
patterns with tag classes, TagArrayBuilderExt, and TagArrayExt. Both
events registered in EventFactory.

https://claude.ai/code/session_01Wtg56Vudthgfyz8ASTb4p7
2026-03-02 21:20:43 +00:00
Vitor Pamplona 7fabb6b554 Makes addresses serializable 2026-03-02 15:39:58 -05:00
M 69e95159e9 fix: check Namecoin name expiry before resolving
Query current block height via blockchain.headers.subscribe and reject
names that have expired (>= 36000 blocks since last update). Populate
expiresIn field in NameShowResult for downstream use.

Unconfirmed transactions (height <= 0) are treated as active.
2026-03-03 06:56:59 +11:00
M 3f39f96e81 fix: route ElectrumX through Tor proxy, add onion server
- ElectrumxClient accepts injected SocketFactory (lambda) so connections
  respect the user's Tor/proxy settings instead of leaking their IP
  through raw sockets
- Add ProxiedSocketFactory for SOCKS5 proxy routing
- Add .onion ElectrumX server as primary when Tor is enabled, with
  electrumx.testls.space as clearnet fallback
- NamecoinNameResolver accepts serverListProvider lambda for dynamic
  server selection based on current Tor settings
- RoleBasedHttpClientBuilder.socketFactoryForNip05() bridges Amethyst's
  Tor settings to the socket factory
- NamecoinNameService now requires explicit init with proxy-aware client
- Remove dead code: Nip05NamecoinAdapter (never referenced),
  NamecoinVerificationDisplay (never called)
- Update design documentation
2026-03-03 06:28:01 +11:00
davotoula 51ba076f26 remove unused imports 2026-03-02 15:52:03 +00:00
M d82ace2f63 feat: Namecoin NIP-05 identity verification via ElectrumX
Add censorship-resistant NIP-05 verification using the Namecoin blockchain.
Users can set their nip05 field to a .bit domain (e.g. alice@example.bit)
or direct Namecoin name (d/example, id/alice) and Amethyst will resolve
the pubkey mapping via ElectrumX instead of HTTP.

Resolution uses the standard Electrum protocol (scripthash-based lookups):
- Build canonical name index script matching ElectrumX-NMC indexing
- Query blockchain.scripthash.get_history for the name's tx history
- Parse NAME_UPDATE script from the latest transaction output
- Extract Nostr pubkey from the name's JSON value

Supports both d/ (domain) and id/ (identity) Namecoin namespaces,
simple and extended NIP-05-like value formats with relay hints,
LRU caching with 1h TTL, and self-signed TLS certificates.

New files:
- quartz: ElectrumxClient, NamecoinNameResolver, NamecoinLookupCache
- amethyst: NamecoinNameService, Nip05NamecoinAdapter, NamecoinVerificationDisplay
- docs: namecoin-nip05-design.md
- tests: NamecoinNameResolverTest

Modified:
- Nip05Client: optional namecoinResolver routes .bit to blockchain
- AppModules: wire up resolver

See docs/namecoin-nip05-design.md for full architecture and protocol details.
2026-03-02 13:07:46 +11:00
Vitor Pamplona 050ef73530 adds support for NIP-51 favorite relay lists. 2026-03-01 19:50:07 -05:00
Vitor Pamplona f8a0f17384 Making filter stable 2026-03-01 14:22:54 -05:00
Vitor Pamplona 1bff239183 Fixes need for suspending function on uploading 2026-02-28 11:43:31 -05:00
Vitor Pamplona 9675f59040 Fixes lack of import and new kotlin rules 2026-02-27 08:53:49 -05:00
Claude b8cda402cb test(quartz/utils): add GZipTest to commonTest
Covers the full expect/actual contract across all platforms (Android,
JVM, iOS):

- round-trip for empty, single-char, simple, unicode, and JSON strings
- repetitive input compresses to a smaller size
- gzip magic number (0x1F 0x8B) present in compressed output
- compressed bytes differ from raw input bytes
- decompress of invalid data throws an exception
- special/control characters survive a round-trip

https://claude.ai/code/session_0125CGfu6aMAnSv6ZzAxFHvV
2026-02-27 01:57:10 +00:00
Claude 5cd05ab008 feat(quartz/ios): implement GZip compress/decompress for iOS
Uses platform.zlib (built-in on all Apple targets) via Kotlin/Native
cinterop to provide the actual GZip implementation:

- compress: deflateInit2 with windowBits=31 (MAX_WBITS+16) for gzip
  format; deflateBound gives a tight upper-bound so a single Z_FINISH
  call is always enough – no output loop required.
- decompress: inflateInit2 with windowBits=47 (MAX_WBITS+32) for
  automatic gzip/zlib format detection; output is collected in
  fixed-size chunks to handle arbitrary decompressed sizes.

https://claude.ai/code/session_0125CGfu6aMAnSv6ZzAxFHvV
2026-02-27 01:18:47 +00:00
Vitor Pamplona 18270f8020 Adds a reqUntilEoseAsFlow extension to the Nostr Client 2026-02-26 19:56:39 -05:00
Vitor Pamplona 591c32ceb3 Solving some more stability issues 2026-02-25 16:53:50 -05:00
Vitor Pamplona b1fd450c91 Merge branch 'main' into feat/desktop-private-dms 2026-02-24 17:50:48 -05:00
nrobi144 78aa7962e9 feat(desktop): add DM broadcast status banner and audit fixes
- Show relay confirmation URLs in broadcast banner
- Add relayUrls field to DmBroadcastStatus.Sent
- Wire send progress tracking with per-relay confirmations
- Fix empty chatroom Loading state transition
- Improve NewDmDialog npub metadata resolution
- Harden sendAndWaitForResponse timeout handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 06:53:53 +02:00
Vitor Pamplona 086e2046db Fixes test file loader for iOS 2026-02-18 12:34:55 -05:00
Vitor Pamplona ee7d20e939 Minor adjustment in class names 2026-02-18 12:25:48 -05:00
Vitor Pamplona 64c8c0edfd Improves the name of the NIP01 Crypto object 2026-02-18 11:29:56 -05:00
Vitor Pamplona 907ff6e844 Moves deterministic signer to the test package since it's only used there. 2026-02-18 11:24:33 -05:00
Vitor Pamplona cf7b4ed4e3 Fixes warning in chess test cases 2026-02-18 10:49:59 -05:00
Vitor Pamplona ab6560d47d Fixes Chess's need for clone functions that are not available on iOS 2026-02-18 10:46:06 -05:00
Vitor Pamplona 2c3ca7f906 - Finishes the transition to EventHint objects for building events.
- Removes the "a-tag" dependency on Addressable interface because the `a` can have different names in different objects.
2026-02-18 10:45:50 -05:00
Vitor Pamplona c755908db5 Removes string-concat compiler argument since it is not supported anymore 2026-02-17 19:02:53 -05:00
Vitor Pamplona cf7bdef028 Adds missing actual implementations on iOS 2026-02-17 19:00:24 -05:00
Vitor Pamplona c4e3d99392 moves chess lib to version catalog 2026-02-17 18:45:35 -05:00
Vitor Pamplona bb3937edb4 Makes 24h the default end time for polls 2026-02-17 18:41:25 -05:00
Vitor Pamplona 713e91185b Merge pull request #1702 from nrobi144/feat/chess-pgn-display-878
chess: live chess game implementation with Jester protocol
2026-02-17 16:12:26 -05:00
Vitor Pamplona f665bec63d adds basic support for NIP85 Polls 2026-02-17 16:00:54 -05:00
nrobi144 5f15f0c3b1 fix: address Copilot review comments
- ChessPosition: include all fields in equals/hashCode
- AcceptedGamesRegistry: add thread safety with synchronized
- ChessEventBroadcaster: use valid filter for connection trigger
- ChessEventBroadcaster: fix misleading relayResults
- Remove println debug logging from ChessSubscription/Broadcaster
- UserProfileScreen: use proper JSON parsing via MetadataEvent

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 16:39:24 +02:00
nrobi144 8d098cf86d feat(chess): focused polling, promotion fix, and game end celebration
- Add focused game mode to ChessPollingDelegate: when viewing a game,
  only that game is polled instead of all active games
- Fix pawn promotion by parsing promotion suffix in publishMove
  (e.g., "e8q" -> "e8" + QUEEN)
- Add game end overlay with victory/defeat/draw celebration
- Remove all debug println statements for production readiness

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 12:14:34 +02:00
nrobi144 42b33ca04c feat(chess): add platform adapters and enhance lobby state (steps 5-6)
- Add ChessLobbyState with completedGames, replaceGameState(), moveToCompleted()
- Add challengerAvatarUrl to ChessChallenge
- Add CompletedGame data class for game history

Platform Adapters:
- AndroidChessAdapter: AndroidChessPublisher, AndroidRelayFetcher, AndroidMetadataProvider
- DesktopChessAdapter: DesktopChessPublisher, DesktopRelayFetcher, DesktopMetadataProvider

Shared Infrastructure:
- ChessRelayFetchHelper for one-shot relay queries
- IUserMetadataProvider interface for platform-specific metadata
- ChessFilterBuilder with simple filter methods for fetchers
- ChessSubscriptionController interface for subscription management

Fix ChessSubscription.kt to remove broken dataSources().chess reference
(subscriptions now managed by ChessLobbyLogic)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 12:14:34 +02:00
nrobi144 e0d0e33408 refactor impl 2026-02-10 12:14:05 +02:00
nrobi144 06accf5831 full chess implementation 2026-02-10 11:58:00 +02:00
nrobi144 18c8156ab2 integrate chess events 2026-02-10 11:56:43 +02:00