58 Commits

Author SHA1 Message Date
fiatjaf
3e1c0ddc7e fix pinging relays: use the main relay context, not the relay connection temporary context. 2025-01-17 14:08:54 -03:00
fiatjaf
06a15fdaab follow list fetching test and related changes and fixes.
- make BatchedSubManyEose() use a single duplicate id index and use it for replaceable loaders;
- fixes parsing follow entry from kind:3 events (and others);
- adds a "cause" to most cancelation errors in relay/pool;
- remove the inherent cache from dataloader (we have our own hopefully);
- increase max frame size we can read from any websocket to 2**18 (262k), which gives over 2000 item lists.
2025-01-17 13:44:51 -03:00
fiatjaf
7be028ff7c sdk: test and fix encode/decode relay lists. 2025-01-16 17:53:44 -03:00
fiatjaf
956868e956 sdk: clarify event tracker functions. 2025-01-16 17:47:31 -03:00
fiatjaf
febf022124 add some basic sdk tests, fix saving hints (normalize urls), checkduplicates arg order, kvdb stuff and other things. 2025-01-16 17:39:16 -03:00
fiatjaf
46569b6ef4 sdk: actually no, let's store all relay urls together in the same kvdb key. 2025-01-16 11:30:14 -03:00
fiatjaf
4cf9631c28 sdk: use a prefix iterator on kvdb for storing relay urls associated with ids. 2025-01-16 10:25:00 -03:00
fiatjaf
e1971d12c0 WithCheckDuplicate(), let's see if this works. 2025-01-15 14:29:38 -03:00
fiatjaf
ba38c28b99 sdk: track event relays on kvstore. 2025-01-15 14:29:38 -03:00
fiatjaf
faa4fabffe sdk: setup KVStore. 2025-01-15 14:29:35 -03:00
fiatjaf
e89b817f7d sdk: remove skipFetch from fetchGenericList() 2025-01-15 14:26:53 -03:00
fiatjaf
de19a457e3 sdk: rename and adjust BatchSizePerNumberOfQueries() -> PerQueryLimitInBatch(). 2025-01-12 21:29:39 -03:00
fiatjaf
7be4b02236 sdk: BatchSizePerNumberOfQueries() 2025-01-12 21:29:39 -03:00
fiatjaf
36ddf1eb36 sdk: FetchSpecific from input string or from a pointer. 2025-01-12 21:29:39 -03:00
fiatjaf
b33cfb19fa rename option pool.WithQueryMiddleware() to pool.WithAuthorKindQueryMiddleware(). 2025-01-03 00:12:34 -03:00
fiatjaf
668720f4bc sdk: forgot to create replaceable/addressable loader slices. 2025-01-03 00:12:14 -03:00
fiatjaf
5875b644a2 sdk: fetching sets. 2025-01-02 12:19:06 -03:00
reis
63919cf685
support wasm (#163) 2025-01-02 09:42:04 -03:00
fiatjaf
a7a66add61 sdk: fix references test. 2025-01-01 20:55:12 -03:00
fiatjaf
c2c08ab6bc more list fetchers. 2025-01-01 18:16:36 -03:00
fiatjaf
acf63fa7cd fetchspecificevent also accepts a hex id and saves hints. 2025-01-01 17:59:02 -03:00
fiatjaf
08d6943dd1 references returns an iterator because why not? 2025-01-01 17:59:02 -03:00
dtonon
dcd5030fcd Add NIP-22 support 2025-01-01 17:58:51 -03:00
fiatjaf
95ddacb9f3 sdk: track query attempts automatically and other small tweaks to replaceable fetching and stuff. 2024-12-24 00:15:10 -03:00
fiatjaf
3b3d5cce7b sdk/hints: adapt sqlite to also support postgres. 2024-12-23 18:48:29 -03:00
fiatjaf
9aac901c03 sdk/hints/sqlite: unceremoniously rename table to nostr_sdk_pubkey_relays. 2024-12-23 10:02:06 -03:00
fiatjaf
72d9aac9b1 replace all ocurrences of encoding/json with json-iterator so we get rid of HTML escaping and hopefully get faster too. 2024-12-03 00:49:27 -03:00
fiatjaf
9df2fc8d7b hints: prevent malicious timestamp hints to bork calculations. 2024-11-28 21:29:47 -03:00
fiatjaf
2519cab5ae sdk: validate nip05. 2024-11-27 10:23:28 -03:00
fiatjaf
1ac5516440 sdk: mutelist cache. 2024-11-27 00:59:34 -03:00
fiatjaf
ab52b3efb2 sdk: ristretto is generic now, no need for the fiatjaf fork. 2024-10-22 08:02:52 -03:00
fiatjaf
986944059f sdk: remove an unnecessary type annotation because this linter thing is annoying. 2024-10-18 07:09:05 -03:00
fiatjaf
7ede46661c fix FetchSpecificEvent() behavior for the faster no-relays case. 2024-10-14 14:47:15 -03:00
fiatjaf
f0f4eb5276 sdk: default eventstore to NullStore instead of SliceStore. 2024-10-06 15:54:00 -03:00
fiatjaf
36c197af42 sdk: FetchSpecificEvent() 2024-10-06 15:54:00 -03:00
fiatjaf
69b97107a9 sdk: deduplicate relay selection for replaceable loader. 2024-09-26 21:09:18 -03:00
fiatjaf
ade77ad6c9 sdk: label some default queries. 2024-09-26 21:08:40 -03:00
fiatjaf
2c19358c3a sdk: I am crazy and had removed the actual cache.Set() calls. 2024-09-26 21:08:16 -03:00
fiatjaf
2edc0fb713 sdk: optimize caching lists (so we don't fetch twice in a row). 2024-09-25 23:45:49 -03:00
fiatjaf
8327310d52 improve SimplePool authHandler, rename IncomingEvent to RelayEvent so we can use it there. 2024-09-19 12:28:42 -03:00
kehiy
47243fdcc4 feat(event): adding more helpers. 2024-09-19 11:34:31 -03:00
fiatjaf
2b04ea9bc1 sdk: do not track hints from ephemeral events. 2024-09-17 08:06:04 -03:00
fiatjaf
2c09338ecb sdk/hints: sqlite backend and tests. 2024-09-16 22:23:55 -03:00
fiatjaf
072da132f4 move nostr-sdk repository into here because why not? 2024-09-11 10:14:13 -03:00
fiatjaf
1789d43d51
move sdk out to its own module. 2023-10-31 17:49:27 -03:00
fiatjaf
5847335506
sdk: return store event along with ProfileMetadata. 2023-10-31 15:22:55 -03:00
fiatjaf
711b0844b1
expose System properties. 2023-10-31 12:16:08 -03:00
fiatjaf
374dbbe1a0
sdk: fetch and cache profiles. 2023-10-31 11:00:46 -03:00
fiatjaf
c506cc0f8b
sdk taking shape. 2023-10-30 19:23:58 -03:00
fiatjaf
a0f6dec451
fix sdk. 2023-10-02 09:13:36 -03:00