Commit Graph

1335 Commits

Author SHA1 Message Date
Vitor Pamplona 0e476c8988 Adds test and some refinements. 2026-03-15 19:51:39 -04:00
Vitor Pamplona 61089fa866 Merge branch 'main' into claude/add-relay-event-counters-c7stK 2026-03-15 17:30:23 -04:00
Vitor Pamplona 91a9dcb9a1 Merge branch 'main' of https://github.com/vitorpamplona/amethyst
* 'main' of https://github.com/vitorpamplona/amethyst:
  Rename build step for Benchmark APK in workflow
  compilation error fix: Changed map to mapNotNull
  spotlessApply
2026-03-15 17:16:00 -04:00
Vitor Pamplona cef8f5acde Fixes test case 2026-03-15 17:14:57 -04:00
Vitor Pamplona 6216f7a618 no casts needed 2026-03-15 16:55:00 -04:00
Vitor Pamplona 0c939bd447 converted from Java arraylist to kotlin arraylist 2026-03-15 16:50:34 -04:00
davotoula 3cfa9e1619 compilation error fix: Changed map to mapNotNull 2026-03-15 21:37:21 +01:00
davotoula cd9d345a0e spotlessApply 2026-03-15 21:35:23 +01:00
Vitor Pamplona 30b76347c5 Spotless 2026-03-15 16:15:44 -04:00
Claude d10687d6fe feat: Implement iOS OptimizedJsonMapper using KotlinSerializationMapper
Replace all TODO stubs in the iOS actual implementation with delegation
to KotlinSerializationMapper. Wraps SerializationException into
IllegalArgumentException to match the jvmAndroid error handling pattern.

https://claude.ai/code/session_01QBc4Pb7a6m4TfLZSJKVdjw
2026-03-15 19:58:40 +00:00
Claude 3bea2f795c refactor: Move KSerializers to their respective NIP packages
- Bunker serializers → nip46RemoteSigner/kotlinSerialization/
- NIP-47 serializers → nip47WalletConnect/kotlinSerialization/
- Rumor serializer → nip59Giftwrap/rumors/kotlinSerialization/

Mirrors the existing Jackson serializer directory structure which uses
a jackson/ subpackage within each NIP package.

https://claude.ai/code/session_01QBc4Pb7a6m4TfLZSJKVdjw
2026-03-15 19:55:19 +00:00
Claude ffac682238 feat: Add kotlinx.serialization KSerializers mirroring all Jackson custom serializers
Add 15 KSerializer implementations in commonMain that replicate the exact
behavior of all 21 Jackson serializer/deserializer registrations:

- EventKSerializer, TagArrayKSerializer, FilterKSerializer
- EventTemplateKSerializer, RumorKSerializer, CountResultKSerializer
- MessageKSerializer (8 message types), CommandKSerializer (5 command types)
- BunkerRequest/Response/MessageKSerializer (NIP-46)
- Nip47Request/Response/NotificationKSerializer (NIP-47)
- KotlinSerializationMapper as the main entry point

Uses JsonElement-based approach for performance. All serializers produce
identical JSON output to Jackson. Includes comprehensive test suite (35+
tests) verifying exact output parity and cross-deserialization between
Jackson and kotlinx.serialization.

https://claude.ai/code/session_01QBc4Pb7a6m4TfLZSJKVdjw
2026-03-15 16:37:22 +00:00
Claude 22945b7faa feat: add queryCountSuspend utility to Quartz and simplify ViewModels
Add INostrClient.queryCountSuspend() extension functions in Quartz that
wrap NIP-45 COUNT queries as suspend functions, managing subscription
lifecycle internally. Two overloads: single-relay and multi-relay.

Simplify BasicRelaySetupInfoModel and Nip65RelayListViewModel to use the
new utility — removes IRelayClientListener implementation, subId tracking
maps, onIncomingMessage handlers, and cleanup logic from both ViewModels.

https://claude.ai/code/session_016158D5mq5BygS1uBbLNbsA
2026-03-15 16:14:24 +00:00
Vitor Pamplona 3bd6ef5f6c changes from damus to nos.lol for more stable relay behavior in tests 2026-03-15 11:44:20 -04:00
Vitor Pamplona 2b157cc383 Fixes throw vs null test cases and nsec hallucinations 2026-03-15 11:18:39 -04:00
Vitor Pamplona 0380927f7e fromJsonTo calls throw, they should always be wrapped if we want null results. 2026-03-15 11:05:40 -04:00
Vitor Pamplona 2c91fdea15 Avoids using format to write hex-encoded strings. 2026-03-15 11:03:50 -04:00
Vitor Pamplona d4ae3411c7 spotless 2026-03-14 11:36:58 -04:00
Vitor Pamplona 6739e66bd3 Merge pull request #1828 from vitorpamplona/claude/implement-nip47-wallet-Fjcds
Implement NIP-47 Wallet Connect protocol with full method support
2026-03-14 11:32:51 -04:00
Vitor Pamplona 03e1c32757 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-14 11:20:33 -04:00
Claude 84035f887a feat: parse NIP-47 transaction metadata for sender/recipient display
Add NwcTransactionMetadata parser that extracts comment, payer_data,
recipient_data, and nostr zap data from the untyped metadata field.
The transaction list UI now shows the Nostr user profile picture and
name for zap senders/recipients, falls back to payer name/email or
lightning address, and displays comment when it differs from description.

https://claude.ai/code/session_01JFogiwyR4CPVP8cRznqahJ
2026-03-14 15:18:53 +00:00
Vitor Pamplona 120981f8c4 spotless apply 2026-03-14 10:18:16 -04:00
Vitor Pamplona 493fe05ac4 Fixes missing parameter 2026-03-14 10:18:08 -04:00
Claude 1841e47c5c feat: add high-level Nip47Client and Nip47Server APIs for NIP-47
Simplifies the NWC developer experience by providing Nip47Client (for
wallet client apps) and Nip47Server (for wallet service backends) that
handle URI parsing, signer creation, event building, filter construction,
and response decryption. Updates README with quick-start examples.

https://claude.ai/code/session_01JFogiwyR4CPVP8cRznqahJ
2026-03-14 11:39:17 +00:00
Claude 580678eed8 feat: add server-side event builders and NIP-47 README for quartz
Adds missing server-side capabilities to the NIP-47 quartz module:

- LnZapPaymentResponseEvent.createResponse(): builds encrypted response
  events (kind 23195) for wallet services to reply to client requests
- NwcNotificationEvent.createNotification(): builds encrypted notification
  events (kind 23197) for wallet services to push payment notifications

Creates comprehensive README.md documenting the full NIP-47 API with
code examples for both wallet client and wallet service implementations,
covering URI parsing, request/response building, encryption, notifications,
error handling, transaction states, and caching.

https://claude.ai/code/session_01JFogiwyR4CPVP8cRznqahJ
2026-03-14 04:25:27 +00:00
Claude 83a6feeca4 feat: add Alby JS SDK client interop improvements
- Add NwcBudgetRenewal constants (daily/weekly/monthly/yearly/never)
- Add case-insensitive NwcTransactionState helpers (isSettled, isPending,
  isFailed, isAccepted) for JS SDK lowercase state interop
- Add URI test using Alby JS SDK test vector (69effe7b... pubkey)
- Add JS SDK interop tests: lowercase transaction states in responses,
  notifications, and list_transactions; empty get_budget response;
  all budget renewal periods; structured transaction metadata;
  full 13-method get_info response

https://claude.ai/code/session_01JFogiwyR4CPVP8cRznqahJ
2026-03-14 03:28:17 +00:00
Claude 4ee937ff0c test: add Alby Hub real test vectors to interop tests
Add tests using exact JSON payloads from Alby Hub's test suite:
- Real bolt11 invoice strings from Alby's mock data
- pay_keysend with TLV records and preimage
- make_invoice with nested metadata objects
- make_hold_invoice with 64-char payment hash
- settle_hold_invoice with preimage
- list_transactions with unpaid_outgoing filter
- create_connection with isolated=true

https://claude.ai/code/session_01JFogiwyR4CPVP8cRznqahJ
2026-03-14 03:00:56 +00:00
Claude 9e4cb446ef feat: add NIP-47 get_budget, sign_message, create_connection methods and Alby Hub interop
- Add get_budget, sign_message, create_connection request/response types
- Add NwcTransactionType (incoming/outgoing) and NwcTransactionState
  (PENDING/SETTLED/FAILED/ACCEPTED) constants
- Add missing error codes: BAD_REQUEST, NOT_FOUND, EXPIRED
- Add settle_deadline field to NwcTransaction
- Add total_count to ListTransactionsResult
- Add metadata and lud16 to GetInfoResult
- Add unpaid_outgoing and unpaid_incoming to ListTransactionsParams
- Update Jackson deserializers for new method types
- Add AlbyInteropTest with 25+ tests verifying compatibility with
  Alby Hub's JSON formats for all request/response types
- Update existing tests for new constants and error codes

https://claude.ai/code/session_01JFogiwyR4CPVP8cRznqahJ
2026-03-14 02:58:40 +00:00
Vitor Pamplona 6f57652455 Merge pull request #1827 from vitorpamplona/claude/implement-nip-38-q8DOF
Enhance user status display with emoji support and metadata tags
2026-03-13 13:32:41 -04:00
Vitor Pamplona 3e0b8a5f8f Fixes gradle build on MacOS and adds a Clibsodium.def file 2026-03-13 08:40:51 -04:00
Claude 8c73dd8f14 test: add comprehensive test suite for NIP-47 Wallet Connect implementation
Covers all 10 request methods (create, serialize, deserialize), all success
and error response types, notification deserialization, EncryptionTag and
NotificationsTag parse/assemble/isTag, NwcInfoEvent build and capabilities,
NwcNotificationEvent structure, LnZapPaymentRequestEvent create/decrypt
with NIP-04 and NIP-44, and Nip47WalletConnect URI parsing and serialization.

https://claude.ai/code/session_01JFogiwyR4CPVP8cRznqahJ
2026-03-13 03:45:50 +00:00
Claude da26ab14ab feat: complete NIP-47 Nostr Wallet Connect implementation in Quartz
Implements the full NIP-47 specification with all request methods,
response types, notification events, and JSON serialization.

New request methods:
- pay_invoice (updated with amount, metadata params)
- pay_keysend (amount, pubkey, preimage, TLV records)
- make_invoice, lookup_invoice, list_transactions
- get_balance, get_info
- make_hold_invoice, cancel_hold_invoice, settle_hold_invoice

New response types:
- Success responses for all methods above
- NwcErrorResponse (generic error for any method)
- NwcErrorCode enum with UNSUPPORTED_ENCRYPTION

New event kinds:
- NwcInfoEvent (kind 13194) - wallet service capabilities
- NwcNotificationEvent (kind 23197) - NIP-44 encrypted notifications
- Legacy kind 23196 support for NIP-04 notifications

New data models:
- NwcTransaction (shared invoice/payment object)
- TlvRecord (for keysend TLV records)
- Notification types: payment_received, payment_sent, hold_invoice_accepted
- HoldInvoiceAcceptedData with settle_deadline

Tags (following NIP-88 pattern):
- EncryptionTag for encryption scheme negotiation
- NotificationsTag for supported notification types

Updated:
- LnZapPaymentRequestEvent: generic createRequest() with NIP-44 support
- URI parser: lud16 parameter support
- Jackson deserializers: all methods routed correctly
- EventFactory: new kinds registered

https://claude.ai/code/session_01JFogiwyR4CPVP8cRznqahJ
2026-03-13 03:15:21 +00:00
Claude 82e500eee1 feat: complete NIP-38 implementation with p tag, emoji, and expiration support
- Add optional r/p/e/a/emoji tags to StatusEvent.create() for full spec compliance
- Add GENERAL and MUSIC type constants to StatusEvent
- Filter expired statuses in UserStatusCache.addStatus() and add removeExpired()
- Add p tag (profile reference) display in DisplayStatusInner
- Add NIP-30 custom emoji rendering in status display via CreateTextWithEmoji
- Allow status type parameter in UserStatusAction.create()

https://claude.ai/code/session_0117asp4mDiR65dxbAGKi2hg
2026-03-13 03:06:22 +00:00
KotlinGeekDev 5cdf8bdd86 Merge branch 'vitorpamplona:main' into kmp-completeness 2026-03-13 01:12:49 +01:00
Vitor Pamplona fa67030b47 Adds support for BUD-10 Blossom URIs 2026-03-12 18:57:46 -04:00
Vitor Pamplona d4dd5a65e6 anySync was returning either on true or false. it was not doing what it was supposed to do which is returning after the first true. 2026-03-12 18:56:17 -04:00
KotlinGeekDev 3838b6b815 Some fixes. 2026-03-12 22:16:34 +01:00
KotlinGeekDev 42f48e11fc Make CI happy(attempt 2). 2026-03-12 21:49:08 +01:00
KotlinGeekDev a463a9802f Slightly modify defFile generation, to stop CI cries. 2026-03-12 21:36:25 +01:00
KotlinGeekDev 750bedbabd Foundations(iOS Sourceset): Reduce the header files only to those needed, plus utilities. 2026-03-12 21:06:02 +01:00
KotlinGeekDev 0b928d29a6 Make the libsodium cinterop file generation more reliable. Add in(and comment out) some test code for extracting the libsodium headers from zip file. 2026-03-12 20:28:02 +01:00
KotlinGeekDev 527130a53c Merge remote-tracking branch 'origin/kmp-completeness' into kmp-completeness 2026-03-12 20:22:55 +01:00
KotlinGeekDev d957efb1b8 Foundations(iOS Sourceset): Streamline libsodium bindings configuration. 2026-03-12 16:55:19 +01:00
Vitor Pamplona ad17924622 Making sure UrlDetector returns a schema even if the parser points to some user:password scheme. 2026-03-12 10:48:11 -04:00
KotlinGeekDev 2b61f4a3d6 Function rename for digest provider. 2026-03-12 15:33:07 +01:00
KotlinGeekDev 759b0c8b96 Foundations(iOS Sourceset): Use alternative implementation for MacInstance, due to complications with mac length under previous implementation, which makes NIP49 tests(with all other relevant tests) pass. Some spotless fixes. 2026-03-12 15:31:33 +01:00
KotlinGeekDev 8f02ea0cf6 Foundations(iOS Sourceset): Provide implementation for LibSodiumInstance.ios.kt, using the native library(shipped in project). Generate cinterop definition file with custom Gradle task. Defines bindings for use in actual code(may be streamlined later). Adds NIP44 tests and makes sure they pass. 2026-03-12 15:13:32 +01:00
Vitor Pamplona a94d5bfd07 Fixes BUD 10 tests 2026-03-11 15:29:16 -04:00
Vitor Pamplona 548ce0a69d spotless apply 2026-03-11 15:24:02 -04:00
Claude ac69a0fa74 feat(nipB7Blossom): add BUD-10 Blossom URI parser
Implements a pure-Kotlin (commonMain) parser for the BUD-10 blossom: URI
scheme, which allows sharing blob references with discovery hints.

Format: blossom:<sha256>.<ext>[?xs=<server>&as=<pubkey>&sz=<bytes>]

- BlossomUri data class holds sha256, extension, servers (xs), authors (as), size (sz)
- BlossomUri.parse() returns null for non-blossom URIs or invalid SHA-256
- Supports repeated xs/as params (multiple servers and authors)
- Percent-encodes server URLs on serialisation; decodes on parse
- BlossomUri.toUriString() round-trips back to a canonical URI
- Includes commonTest coverage for all parsing cases

https://claude.ai/code/session_01T4jyLbkNWd3f7i6MwsBcD4
2026-03-11 19:16:45 +00:00