Commit Graph

100 Commits

Author SHA1 Message Date
Vitor Pamplona
df54f7bb67 Moves all Dispatchers.Default to IO because of the amount of Synchronized code that blocks the thread underneath each coroutine and since Default only has the exact number of threads the processor offers, once they block, we lose computing power 2025-10-21 18:30:08 -04:00
Vitor Pamplona
7a280a3cde - Migrates Quartz from Android to CommonMain
- Fully converts OpenTimestamp Java codebase to Kotlin, migrating the sync and async HTTP call interfaces to OkHttp and coroutines
- Redesigns parsing of relay commands, messages and filters for performance in Jackson.
- Starts the use of KotlinX Serialization when speed is not a requirement
- Migrates all Jackson field annotations to Kotlin Serialization
- Migrates Regex use in Quarts to Kotlin's Regex class
- Migrates Base64 from Android to Kotlin
- Migrates UUID from Android/Java to Kotlin
- Migrates LRUCache usage from Android/Java to Kotlin collections
- Migrates all String to bytearray conversions to Kotlin methods
- Migrates all System.arraycopy calls to kotlin native ones.
- Separates parsing code from the data classes Companion objects
- Exposes Rfc3986 normalizations to each platform.
- Exposes URI parsing classes to each platform.
- Exposes URL Encoders to each platform.
- Exposes BigDecimal to each platform.
- Exposes the Url Detector to each platform.
- Exposes MacInstances to each platform
- Exposes Diggest instances to each platform.
- Exposes a BitSet to each platform.
- Exposes GZip to each platform.
- Exposes Secp256k1 to each platform.
- Exposes SecureRandom to each platform.
- Exposes Time in seconds to each platform.
- Exposes the LargeCache to each platform.
- Exposes AES CBC and AES GCM encryption/decryption to each platform
- Migrate test assertions to Kotlin Tests
- Exposes Address class to each platform because of the Parceleable
- Creates our own ByteArrayOutputStream.
- Removes Lock features inside the Bloomfilters because we don't need data consistency/
- Migrates UserMetadata parser from Jackson to Kotlin serialization
- Removes the need for Static methods in each tag.
- Adds an event template serializer
- Adds KotlinX Datetime to migrate some of the date-based logs
- Adds support for LibSodium in the JVM platform
- Creates a shared test build for iOS targets
- Fixes several usages of Reflection when serializing classes
- Fixes a bug on loading RelayDB for the HintBloom filter test
- Increases the Bloom filter space to better use hints in the app.
- Removes support for iOS in x86
- Creates a Jackson mapper just for NIP-55, which stays in the Android build only.
- Keeps the event store in the android build as well.
- Removes @Syncronized tags in favor of Mutexes.
- Improved sendAndWaitForResponse NostrClient method to properly account for returns from each relay.
- Removes the need for GlobalScope and async calls in the downloadFirstEvent method.
- Restructures the parser and serialization of the relay messages and commands for performance with Jackson
- Removes the dependency on Jackson's error classes across the codebase.
- Moves the hint to quote tag extension methods to their own packages.
- Speeds up the generation of Bech32 addresses
- Migrates NIP-6 and Blossom uploads to use Kotlin Serialization
2025-09-22 19:44:51 -04:00
Vitor Pamplona
442f75fc41 - Migrates Quartz to a KMP project
- Converts OpenTimestamps from java to Kotlin
- Moves OTS OkHttp setup to Quartz
2025-08-27 17:32:39 -04:00
Vitor Pamplona
d605eb3b0a Fixes lack of update on chats and channels due to the new indexer being decoupled form LocalCache. 2025-08-12 16:37:32 -04:00
Vitor Pamplona
726f9e2f4f Moves target compatibility to java 21 2025-08-06 14:07:51 -04:00
Vitor Pamplona
a747f25906 Adds exception handlers for managed coroutine scopes 2025-08-05 11:47:03 -04:00
Vitor Pamplona
25e92666e0 Adjusts the gradle DSL language to the latest deprecations 2025-07-24 09:53:00 -04:00
Vitor Pamplona
2ecfeb6e7f Moves subscription management from Ammolite to Quatrz 2025-07-11 08:51:02 -04:00
Vitor Pamplona
17e33c61e7 Refactoring base EOSE managers to provide better logging 2025-07-09 09:03:45 -04:00
Vitor Pamplona
cf48516602 Makes sure Filters are not updated if the since is the only change 2025-07-07 13:37:57 -04:00
Vitor Pamplona
546d238db3 Reformats due to new lint 2025-07-02 10:51:13 -04:00
Vitor Pamplona
0cfcfaf899 3rd large migration to outbox. 2025-07-01 20:38:18 -04:00
Vitor Pamplona
6367e9ddc9 Moving logs from SubscriptionController to the Manager to be able to distinguish between the multiple managers 2025-05-14 19:19:58 -04:00
Vitor Pamplona
b045d0e122 Migrates lint to the newer default version and copyright to 2025 2025-05-14 11:59:15 -04:00
Vitor Pamplona
2c06df7e50 Simple refactoring for the name of the subscription cache 2025-05-14 10:43:42 -04:00
Vitor Pamplona
52d31502e6 Migrates the Subscription controller to use filters from the NostrClient instead of the past version in the controller to avoid out of sync comparisons 2025-05-14 10:08:56 -04:00
Vitor Pamplona
6ecb25b8e1 - Refactors the entire EOSE caching structure.
- Refactors all Datasource classes into a 3 layer design with composeSubscriptions being registered, passed to a group of EOSE managers that can change eose caching capabilities based on needs, and migrates the old subscription Orchestrator into a simpler controller
- Breaks down all Datasource into multiple filter functions
- Improves EOSE support for many of the base filters like on NIP-04 DMs, notifications, etc
- Moves EOSE cache for public, non-user-dependent items like channels, hashtags, etc to their own caching system.
- Improves the Relay speed logger to better track how many events are being received, and check for duplications
2025-05-13 14:52:26 -04:00
Vitor Pamplona
466f52245b Adds an isDifferent function to avoid resending NormalFilters 2025-05-13 14:46:09 -04:00
Vitor Pamplona
4279ad004c Only updates EOSE log if the time is bigger 2025-05-13 14:43:44 -04:00
Vitor Pamplona
50cde1bc3e - Bugfix to mark relay connections as AfterEOSE when the relay client or server closes the subscription
- Adds an arrival time to log the time EOSEs were received in case the listener is running async processes later.
2025-05-13 14:43:28 -04:00
Vitor Pamplona
e6b0b41e80 Adds a Normal Nostr filter as a PerRelay filter 2025-05-07 13:46:39 -04:00
Vitor Pamplona
be0a559b7d Prints better logs for relay subscriptions 2025-05-06 19:38:13 -04:00
Vitor Pamplona
63a009f36d - Adds support for Ephemeral Chats from coolr.chat
- Adds support for following ephemeral chats
- Adds support for live events at the top of the feed.
- Adds support for NIP-51, kind:10005 public chat lists
- Adds support for Channel feeds
- Moves following of NIP-28 chats from the Contact List to kind: 10005
- Disables following of events at the Contact list
- Improves gallery display to slightly override profile pictures when in list
- Starts the Account refactoring by moving custom Emoji, EphemeralList and PublicChat lists to their own packages
- Refactors NIP-51 lists to use common classes of private tags instead of general list classes.
- Starts to separate all Public chats into their own database.
- Removes old account upgrades from the local storage
- Refactors url NIP-11 loading and unifies icon
- Reduces the dependency of Relay classes in the LocalCache, Notes and User classes
2025-05-02 21:18:10 -04:00
Vitor Pamplona
9c79ef08c7 Moves logging out of quartz Relay class 2025-04-30 14:00:08 -04:00
Vitor Pamplona
187d77c138 Marks GlobalScope as optin 2025-04-24 18:07:22 -04:00
Vitor Pamplona
ecebc68e11 avoiding deprecated .put api 2025-04-24 17:36:27 -04:00
Vitor Pamplona
fdc95a656f Ignore permissions to use our services. 2025-04-24 16:42:43 -04:00
Vitor Pamplona
a84371a0b3 - Restructures the old static datasource model into dynamic filter assemblers.
- Moves filter assemblers, viewModels and DAL classes to their own packages.
- Creates Composable observers for Users and Notes
- Deletes most of the secondary LiveData objects in the move to Flow
- Manipulates nostr filters depending on the account of the current screen, not a global account.
- Unifies all FilterAssembly lifecycle watchers to a few classes.
- Prepares to separate The Nostr Client as an Engine of Amethyst.
- Moves the pre-caching processor of new events from the datasource to the accountViewModel
- Reorganizes search to be per-screen basis
- Moves authentication to a fixed Coordinator class for all accounts in all relays.
- Moves NOTIFY command to its own coordinator class for all accounts
- Moves the connection between filters and cache to its own class.
- Significantly reduces the dependency on a single ServiceManager class.
2025-04-23 16:24:41 -04:00
Vitor Pamplona
3833f5f822 - Refactoring services to be part of the App Lifecycle,
- Migrated services to Flows that are active while their flows remain subscribed
- Improved OTS Decoupling
- Moved OTS verification procedures from the local cache to the data source
- Migrated the forceProxy options to lambdas that return an OkHttpClient
- Isolated Connectivity services, from Compose to Flow
- Isolated Tor services, from Compose to Tor (only starts if the Tor option is marked as internal)
- Isolated Memory trimming services, from Compose to Flow
- Isolated Image Caching services, from Compose to Flow
- Isolated Video Caching services
- Isolated Logging services
- Isolated NIP-95 Caching services
- Isolated Pokey receiver services
- Improved support for Tor in push notifications
- Isolated OkHttpClient services as flows
- Reduced the coupling of Context objects with singleton objects.
- Migrated UserFeedStates, StringFeedStates and ZapFeedStates to MutableStateFlow, avoiding feed updates on Main
- Forces a reconnect into relays that lost connection if any tor, connectivity or account changes
- Speeds up Base64 parser
2025-04-09 18:51:17 -04:00
Vitor Pamplona
ed0435061c Moves to cover all classes in the proguard. 2025-04-03 20:45:25 -04:00
Vitor Pamplona
3d5d7b4987 adds nostr elites as a default global relay 2025-02-27 19:15:55 -05:00
Vitor Pamplona
9689acb5f3 Deletes experimental serializer on NIP-01
Moves classes to the appropriate packages on NIP-01
Adds a PoW miner to quartz.
Adds a PoW commit evaluator as a bytearray of the ID
2025-02-18 17:47:34 -05:00
Vitor Pamplona
9c21a8a7da Massive refactoring of Quartz to:
- Define each tag in their own class.
- Allow extension functions to additional responsibilities to other classes
- Migrate from hardcoded tag filters in events to the Tag's parser and assemble functions.
- Migrate hardcoded event.create to builders that use extension functions
- Restructures threading infrastructure for NIP-10
- Decouple the event signing from the Event building functions via event templates
- Create classes to represent Tags and TagArrays and use extension functions to add domain-related methods to the tag array of each nip.
- Uses external functions on event template builders to better point to which functions and which tags can be used in which event kinds.
- Separates Event kinds in packages inside each nip.
- Improves support for NIP-89
- Correctly establishes which imeta params can be used in each nip (video, picture, files)
- Decouples the iMeta builder from any nip.
- Fixes mute list word and user removal when inserted from a different client.
- Migrates the Account class to avoiding having to build each Event inside of it
2025-02-13 17:39:13 -05:00
Vitor Pamplona
86a9fb2af5 Moves the relay structure to quartz 2025-01-14 12:09:25 -05:00
Vitor Pamplona
e36e49cc88 Breakes the Command and Message parsers out of the Relay class 2025-01-14 11:47:52 -05:00
Vitor Pamplona
3ac303c724 Starts the work to filter events that return from the relay to make sure they match the subscription submitted 2025-01-13 19:42:43 -05:00
Vitor Pamplona
e3e90229ce Separates Typed Relay class from a SimpleRelay class to prepare to move to Quartz 2025-01-13 19:15:20 -05:00
Vitor Pamplona
7f6b0ef7c2 Fixes package names for filters that moved to quartz 2025-01-13 13:03:22 -05:00
Vitor Pamplona
57fe3740fc Moves limits and Filters to quartz 2025-01-13 12:46:15 -05:00
Vitor Pamplona
d2b731e372 Massive refactoring of quartz to prepare for nip-based packages. 2025-01-13 10:38:45 -05:00
greenart7c3
eb93664968 Add getRelay 2025-01-05 14:43:44 -03:00
greenart7c3
10459b0a7a Add getAll 2025-01-05 13:58:48 -03:00
Vitor Pamplona
6522d74253 Fixes the Tor leaks for relays and some image content. 2025-01-04 17:35:34 -05:00
Vitor Pamplona
09539ac22a adds new rules for proguard 2024-12-30 19:57:31 -05:00
Vitor Pamplona
626daa9967 Refactoring 2024-12-30 15:43:09 -05:00
Vitor Pamplona
94c74a1e0c Adds support for encrypted media uploads on NIP-17 DMs 2024-12-23 20:30:22 -05:00
Vitor Pamplona
f839565152 Refactors Ammolite to remove the dependency on OkHttp to prepare for KTor and multiplatform settings.
- This also reduces the Singleton coupling between Client and RelayPool.

To migrate, create a NostrClient instance on your Application class and update your code to access that `client` instance.
2024-12-20 15:36:50 -05:00
Vitor Pamplona
bcb9ba26ab Improves search by npubs to use all relays. 2024-12-05 17:14:16 -05:00
Vitor Pamplona
26ba75c7c9 Fixes array too big because strfry blocks more than 20 filters 2024-10-17 17:18:35 -04:00
Vitor Pamplona
a028c2c3fc Fixes missing zaps on the first connection to a NWC wallet with a split payment. 2024-09-27 15:19:59 -04:00