Skip to content

Commit

Permalink
Nip 55 (#1)
Browse files Browse the repository at this point in the history
* delete events from cache

* Add delete to eventcarddropdownmenu

* URL normalization

* Support blocked relays

* format

* Minor debugging changes

* Emit from pool when connecting

* Foramt

* Debugging

* Refactor OutboxTracker to handle tracking users in batches

* Refactor follows function to use fetchEvent instead of fetchEvents

* format

* Fetch relay lists for users from 10002 and 3 in parallel

* Make outbox calculation great again

* move md files

* use r tags because "lets index absolutely everything just in case"

* correct import

* add utxo's notepress reference

* picture before image (#178)

* Move event validation and signature verification in-house (#200)

* Aggregate, cache, deduplicate NIP-05 queries and Zap settings queries -- Massive performance improvement!

* improve markdown rendering

* Cache NIP-05 and zap specs

* format, fix tests, generate docs, version bump

* fix bad release

* NIP46: Fixed wrong parsing of rpc response when requesting decryption from bunker (#202)

- The JSON.parse() call resulted in exception being thrown since 'response.result' is not a valid JSON string

* Remove hexpubkey references everywhere (#199)

* Remove hexpubkey references everywhere

* Add one last one

* Improve hashtag regex (#201)

* Improve hashtag regex

- Match all non space and punctuation characters
- Require a space character before regex to avoid matching URL fragments, see verbiricha/habla.news#163

* fix: match string start or space before hashtag

* remove console.logs

* Add LRU cache for zappers

* unused import (#205)

this unused import appears to be causing a problem in some weird edge case situation

* add created_at to NDKUserProfile (#204)

fix ts errors by type hints

* fix url conversion issue

* threading utility functions

* increase LRU cache size of outbox tracker

* improve LRU caches

* Remove duplicate method calls (#212)

* Remove duplicate method calls

* force a new timestamp for replaceable events

---------

Co-authored-by: Pablo Fernandez <[email protected]>

* Update package manager and add engines (#211)

* Update nostr-tools on ndk-cache-dexie and fix types (#209)

* Squashed commit of the following:

commit cf6d33e6f488d2252ee939af5ca193cc0ffcfc35
Author: Jeff Gardner <[email protected]>
Date:   Tue Apr 9 15:20:53 2024 +0200

    Update nostr-tools on ndk-svelte-components

    - remove unused files

* Squashed commit of the following:

commit 09a56a0a6ab5aadc49fad39a40fd41d7662861bd
Author: Pablo Fernandez <[email protected]>
Date:   Wed Apr 10 10:29:00 2024 +0100

    merge master

commit 8054b64c8909bb1ba75857066ce7e47d57290295
Author: Jeff Gardner <[email protected]>
Date:   Tue Apr 9 16:16:50 2024 +0200

    Update nostr-tools and others for cache-redis

* update pnpm-lock

* avoid verifying signatures of cached events

* allow offloading signature verification to an async web worker

* fix bug where we are REQing events even if they were cached and the filter has completed

* fix unfollow function

* handle more reply cases

* correct timestamp of bad events

* better event content rendering and mentions

* cache events on an LRU too

* fix nip46 login with nip05 (#214)

* fix nip46 login with nip05

* nip46: fix rpc to use nip05 user defined relays

* nip46 fixes on create_account

* fix event fetching from tag when there is no relay hint

* Incease performance of signature verification

* Adds a small LRU cache to prevent re-verifying the same event multiple times
* Skips signature verification of duplicated events
* Strips one unnecessary hashing that was still not being done on the web worker

* fix incorrect tagging when quoting an event

* allow clicking on mentions

* keep event tags in LRU cache too

* fix broken subscription unref

* attempt to load 10002 from cache first

* optimize serialization and avoid grouping subscriptions that will not close with those that do

* allow forcing a tag (for q tagging)

* truncate npub by default

* lay groundwork for ratioed signature validation

* prioritize already-connected relays

* fix race condition when using synchronous cache

* improve outbox tracking

* bump

* fix for when using a pubkey with a secret

* get all profiles that match a filter function from a cache

* support deprecated replies

* bump

* allow passing-in sanitizeHtml options

* Track events per relay when already seen (#218)

* allow scheduling more than one event

* better support for empty d tag

* small thread handling improvements

* allow changing which component is used to render embedded components

* naive changes to how events are interpreted for signature

* fix build

* readd createFeedback

* improve logic to avoid avoid duplicated relays

* format & bump

* if reconnecting to a relay whose reconnection was delayed, don't reattempt immediately

* lower case normalize

* export normalize

* Update nostr-tools on NDK & fix tests (#210)

* Update nostr-tools on NDK & fix tests

* Remove unused jest config

* Make NDKPrivateKeySigner backwards compatible

* Bind function call to relay object

* Update svelte-time to fix warning about svelte export missing

* Add more tests on connectivity

* minor adjustments to make it work

* fix some tests

* add convenience method to update replaceable event id,sig,created_at when publishing

* add optimistic updates

* bump

* render wiki entries as markdown

* wip

* Adds `devcontainer`  (#170)

* draft: added first version of devcontainer

* customize devcontainer with bash

---------

Co-authored-by: JeffG <[email protected]>

* feat: store profile event in NDKUserProfile (#229)

* feat: store profile event in NDKUserProfile

* refactor: make store profile event optional

* correct unfollow method logic and event tagging (#230)

- Fixed user removal logic to set the foundUser flag correctly
- Updated event tagging to use newUserFollowList
- Ensured consistent parameter typing for currentFollowList as Set<NDKUser>

* reduce debugging

* fixes NIP-42

* allow passing in subscription options for root/reply fetchers

* improve how EOSE is handled on NDK-svelte

* control that we don't unnecessarily load more stuff into the LRU beyond it's max size

* remove unused call

* bump

* fix bug that was causing groupable subscriptions not to be cleared properly

* fix issue with failing to send over a closed connection

* fix: only count missing EOSE from connected relays

* add methods to access and manage unpublished events from the cache

* extract code to set active user and make fetching theri data more efficient

* formatting noop

* fix: close subscription on EOSE at the relay level

* be more efficient at fetching uses' relay lists

* remove unused code

* add tests to ndk-cache-dexie

* move docs

* move docs

* change base

* update tests

* typedoc

* typedoc

* wip

* improve typedoc

* lint

* api link

* subscription management

* optimize which relays are set on zap requests

* chore: Add onEvent callback to NDKSvelte subscription options

* chore: Add event ID to unpublished event in NDKCacheAdapterDexie

* fix NIP-42 authentication

* improve url normalization and be more careful on connection management

* fix auth.md to renamed NDKAuthPolicies -> NDKRelayAuthPolicies (#243)

Co-authored-by: jeremyd <jeremyd>

* NDK Nostr Cache Adapter

* refactor outbox and be smarter abotu the relays we publish to (account for p-tags and relay hints)

* add BUILD.md (closes: #244)

* 30818 component powered by svelte-asciidoc. (#247)

* filterForEventsTaggingId

* index event kinds and add byKinds filter

* pnpm-lock

* ignoreDeadLinks

* ignoreDeadLinks

* apply limit filter

* Squashed commit of the following:

commit 3ab09895c5950fcd5f1f6b5245fd36f066663906
Author: Pablo Fernandez <[email protected]>
Date:   Fri Aug 2 13:34:22 2024 +0100

    handle events coming in with the same created_at and different IDs

commit 08b3a2e07f9b5c16e36f9e4883406d0b8350dac7
Author: Pablo Fernandez <[email protected]>
Date:   Fri Aug 2 13:33:24 2024 +0100

    emit insufficient balance

commit b85cbae245852cde72bb532c7dbfa28049213d36
Author: Pablo Fernandez <[email protected]>
Date:   Fri Aug 2 11:57:40 2024 +0100

    handle the same event being incorrectly being published multiple times before it finishes publishing

commit ab187ba7dbe5dd5ba6267e455ded7b4c79683696
Author: Pablo Fernandez <[email protected]>
Date:   Thu Aug 1 16:33:34 2024 +0100

    wrap string in error

commit 9fb7f50ac58abf1fe6f1584778275d0484351fcc
Author: Pablo Fernandez <[email protected]>
Date:   Thu Aug 1 15:57:10 2024 +0100

    fix LN payments

commit b47e829af529addccb37657dcd0feda26a56b9e3
Author: Pablo Fernandez <[email protected]>
Date:   Thu Aug 1 15:56:22 2024 +0100

    Accept from that return undefined

commit 81784d538a5ef50ce0699d8f79382cc5b63864d8
Author: Pablo Fernandez <[email protected]>
Date:   Thu Aug 1 14:07:14 2024 +0100

    improve nutzaps

commit a013d285ebefe4f8a6078697ecf3ce4a08de4a97
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 22:55:28 2024 +0100

    rename meta-data because its bet-ter

commit 942afe9982e8a78603b1de45f9f3afeda2ab20b2
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 22:54:09 2024 +0100

    debug

commit dbf0e79cbda4fd60c376d1c039f301b5a502759b
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 22:50:42 2024 +0100

    be explicit about the timeout

commit c8d9fc8c08ea6db144d48c7e665d432d356c8540
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 22:50:31 2024 +0100

    fix order of getting reference tags so we don't add markers to h tags

commit d3cfdb08d2b1f276aad8bdaf9e8dde47080a8e4f
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 22:47:36 2024 +0100

    refactor NDKCashuWallet a bit to be more explicit on what tags are private or public

commit 5217f01509ec39f0b334006af06cd93cb3b75976
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 22:47:11 2024 +0100

    remove dead code

commit f233ad8753c86ba0922ef7f2019b14f62e6e68d7
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 22:46:55 2024 +0100

    fetch main user's relay lists in order to get a better clue of where the user's wallets are

commit 341a6fda909fa225bccb0dad50f084fb903d61d9
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 22:46:26 2024 +0100

    Read events' onRelays from the subscription manager, this will give a better idea of where events exists

commit 701d5466fef10aed90556005468162d2bb883ebd
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 20:28:00 2024 +0100

    normalize relay urls to connect to explicit relays

commit 68f4a602b564774541ded786fbb8a9db390dbc4d
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 14:09:34 2024 +0100

    delete unused file

commit f1e5624d7a4f51f81787c2cd7fd580bf28e39034
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 11:12:26 2024 +0100

    Add documentation on subscription lifecycle

commit 79d2333cc77567f34e9e208e6b7667ac56a56f92
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 10:12:40 2024 +0100

    lint

commit 1a181a48c0af5a4822e3c2a3201f7dfb37e82c5d
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 10:12:05 2024 +0100

    format

commit 7fe4ca2509073b6480b7f41ed82d2de788c70b78
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 10:05:29 2024 +0100

    changeset

commit 8aae14522c81b8e1df9487977ec87e1375bbb2ac
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 10:03:23 2024 +0100

    Massive refactor of how subscriptions are fingerprinted, grouped, ungrouped and their internal lifecycle

commit 2dd41ecd63363e1b42a1d11545f765456623ea22
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 09:53:42 2024 +0100

    correct NDKSubscriptionTier kind

commit 2286630354c197834a56d1ec1e1e7132220d6f27
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 09:50:06 2024 +0100

    inherit relay auth policy

commit 21a4ac661b6dc79bc1f2a21e35e65bac67cc3244
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 09:45:08 2024 +0100

    add ndk reference to relays

commit 69cc6f9816dbb34e1263ae7df417a41793facc12
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 31 09:44:21 2024 +0100

    k-tag deletions

commit 26e2da921b14dbf082ca3fb3cdbdc553e9d0d463
Author: Pablo Fernandez <[email protected]>
Date:   Thu Jul 25 10:08:18 2024 +0100

    h-tag when getting reference tags

commit 99d413ad5511f0e28e7629975c00a0aca4c7de2b
Author: Pablo Fernandez <[email protected]>
Date:   Mon Jul 22 21:30:34 2024 +0100

    wip

commit 158b65b6adc46a663d1470517ff66030b1ace92f
Author: Pablo Fernandez <[email protected]>
Date:   Mon Jul 22 20:16:00 2024 +0100

    wip

commit 8ad0be00e1d77f4fed1c8e4dd203d1eb47922848
Merge: f7eaec3 8185295
Author: Pablo Fernandez <[email protected]>
Date:   Mon Jul 22 20:15:34 2024 +0100

    merge with all-your-relays-are-mine

commit f7eaec37b0187ee7fa2796b3d7aa94b45c3a37ff
Author: Pablo Fernandez <[email protected]>
Date:   Mon Jul 22 20:11:26 2024 +0100

    abstract relay stuff

commit 818529523b521b0bbb8a430503fec44cadf8672e
Author: Jeff Gardner <[email protected]>
Date:   Mon Jul 22 17:33:57 2024 +0200

    Remove returns from methods in auth-policies

commit 4c47449cd1c84e45a1e1f996c886b9454bdf2663
Author: Jeff Gardner <[email protected]>
Date:   Mon Jul 22 17:25:51 2024 +0200

    Remove dependency on Nostr Tools Relay

commit 741035c7ffb9d4f5b5cbabf737a497faac32866a
Author: Pablo Fernandez <[email protected]>
Date:   Sat Jul 20 08:17:30 2024 +0100

    pnpm

commit 32495e97b743ef665945d5315676cc83aadc7624
Author: Pablo Fernandez <[email protected]>
Date:   Sat Jul 20 08:17:18 2024 +0100

    change the zapping interface

commit 585fa4132e7f4994048b4732b0c8c43f24baa5ca
Author: Pablo Fernandez <[email protected]>
Date:   Sat Jul 20 08:13:51 2024 +0100

    event wrappers

commit 74c5b0893f7772957bf532f387c5fb5a3934e86e
Author: Pablo Fernandez <[email protected]>
Date:   Sat Jul 20 08:12:40 2024 +0100

    prevent writing to closed websockets

commit a64ad45e3796f18c4fc118e24429d313222ca580
Author: Pablo Fernandez <[email protected]>
Date:   Sat Jul 20 08:10:43 2024 +0100

    ensure we only eose once per subscription

commit 337f8418d8035b410c678e60a288ba30920c58e9
Author: Pablo Fernandez <[email protected]>
Date:   Fri Jul 19 00:24:38 2024 +0100

    wip

commit 848abdae26b98dd66fd04e4e80a37b63278d68d7
Author: Pablo Fernandez <[email protected]>
Date:   Fri Jul 19 00:22:50 2024 +0100

    inherir properties from ndkevent when using `from`

commit 709f9d7091deeeb66cee4931f1bdff7c8ba08c46
Author: Pablo Fernandez <[email protected]>
Date:   Thu Jul 18 11:46:25 2024 +0100

    refactor ndk-wallet

commit 415ac6792b651c3b464c8d7589223103d0efb60a
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 17 12:32:18 2024 +0100

    NIP-29 work

commit 191d82a6a3433dd7af9e5fb64db63005379a575a
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 17 12:07:12 2024 +0100

    wip

commit 85cf1da1e872e65e6ae827c109628d14510cfc82
Author: Pablo Fernandez <[email protected]>
Date:   Wed Jul 17 12:07:07 2024 +0100

    wip

commit 0b9bf8e3cfe95693ccb906e0de19075b9be2b6d4
Author: Pablo Fernandez <[email protected]>
Date:   Mon Jul 15 10:47:42 2024 +0100

    wip

* fix docs

* 30818 component powered by svelte-asciidoc. (#257)

* update svelte-asciidoc. (#267)

this fixes an issue with tables.

it also introduces a way to disable the markdown transitional syntax
that makes the asciidoc parser understand some random markdown syntax
directives like "#" (which should be "=" in asciidoc) and just
confuses everybody.

it should have been disabled since day one, but since I missed that
this commit keeps it for all articles in the past and disables it only
for events authored after 2024-09-14 (two weeks expected for this change
to be deployed).

* Update README.md (#261)

Added 'import "websocket-polyfill";'

to demo, could not connect to relay without it

* Add DM receive relay list to NDKKinds (#259)

* fix bad state store

* pnpm-lock

* refactor a bunch ndk-wallet stuff

* remove a bunch of unneeded packages

* cap the number of relay hints we add

* add NIP-78 interface

* track at which timestamp we cached events

* properly handled abandoned subscriptions closing

* use urlFactory to generate URLs on rendering engine

* package dependencies

* nip-44 support

* generate NIP-60 quote events and wip refactor of ndk-wallet's service

* upgrade cashu-ts

* format

* add wallet change events

* bump version

* provide a way to skip receiving an optimistic publish callback

* provide a way to create nuts of specific denomincation(s)

* add lib

* Revert "add lib"

This reverts commit 575a481.

* add lib

* * Change markdown parser for a more modular approach that enables svelte components
* Remove Asciidoc (breaks sveltekit builds!)

* release

* version

* add NDKWallet receiveToken

* better history tagging

* default bunker == user pubkey

* avoid doubling the number of tokens

* add a convenient way to gather network traffic

* improve filter fingerprint -- allow grouping when time constraints have the same value and remove grouping on limit filters (since they change the meaning of the result

* fix incorrect grouping of subscriptions with the same fingerprint

* be more tolerant with incorrect nip04 encryption

* if we run into duplicate proofs throughout the same or different tokens, clean up when we roll them into a new token event

* apply orphan tokens to the default wallet

* fix: authed relays weren't reported as connected on connectedRelays

* concatenate subscriptions that use a limit -- this is better than treating subscriptions with a limit filter as non-groupable

* add netDebug direction

* nip46 fixes

* document netDebug in the introduction

* lol

* fix: authed relays weren't reported as connected on connectedRelays

* skip by default, PRE that have been tagged as "deleted"

* document how to check for unpublished events from the cache

* add kind:7373

* correct types

* fix (NDKRelayConnectivity) reconnection Issues (#280)

* early return when encountering an empty-filter bug

* update closeOnEose example in readme (#264)

* remove old directories

* add Olas as a reference

* commit initial version of ndk-mobile (#281)

* add default export

* remove lockfile

* nasty way of fixing the dependency but turbo is getting in the way

* format

* fixes

* handle both nip04 and nip44 encryption

* add kind 20 and 22

* useNDKSessionEventKind

* change build script so it works on windows (theres still people using that thing lol)

* nip46 fixes

* add useNDKSessionEvents

* add sync profile fetching from cache

* add useUserProfile hook

* add LRU cache for profiles

* add LRU cache for profiles

* add useUserProfile

* simplify client tag check

* fix client tag

* fix bug where user profile information could be returned out of order (mixing user profile data)

this was happening because the call to retrieve user profile could complete after the props had already changed

* include stringified reposted event when reposting, and k-tag non kind-1 events

* allow users to explicitly include muted pubkeys

* Squashed commit of the following:

commit d9317a20921ae657195f92a2e6b569ee81acd094
Author: pablof7z <[email protected]>
Date:   Fri Nov 29 17:26:37 2024 +0000

    modify ndk-mobile to remove NDKWalletService

commit 16c07fbf0977c1e0d2e87bdc3c9c5aeb62b0819a
Author: pablof7z <[email protected]>
Date:   Fri Nov 29 17:11:47 2024 +0000

    wip

commit dd7442a22dc64560b1526818aab2ba782e0b627a
Author: pablof7z <[email protected]>
Date:   Fri Nov 29 17:08:46 2024 +0000

    wip

commit 9799003e4d4d81297f5d635f5438512f5b595118
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 20:50:59 2024 +0000

    try giving all mint proofs to cashu-ts

commit acf0a7b7b60c73ba1b2ac08197c56ee68d6c041d
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 15:43:15 2024 +0000

    wip

commit f239104e9b216e6fc9e1e7e61e7f538b43b2b9ad
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 13:45:13 2024 +0000

    minor corrections

commit 78200ee8f6a9a8f3dc4488fb14d3efaf62cdc82f
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 12:48:16 2024 +0000

    remove dexie from docs?

commit 162ed25a60ed241318fc9cc096d2e89fc0a393a2
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 12:44:14 2024 +0000

    update docs

commit 4971db7363adecb4b0a0df53b2a183bc6713014b
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 12:22:55 2024 +0000

    take ndk-mobile out from the default build

commit 5bfd0b5165cc13d0c1e928743fba632920001153
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 12:21:03 2024 +0000

    hopefully make github actions run

commit eb48a7b480c7b1bcb6c367391a95b73c35ae91e4
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 12:17:33 2024 +0000

    workflow

commit d9da2d5fdbf2913052e5c36babe9410dc198f970
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 12:11:45 2024 +0000

    update test

commit c11da8d393a6e42f509f7295c3f1572af84297ea
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 12:10:58 2024 +0000

    fix bug where both a and e tags were going in zap requests

commit 35cdde8c9b0b70c78ddd10a8152c58ef662edb98
Author: pablof7z <[email protected]>
Date:   Thu Nov 28 12:10:41 2024 +0000

    deprecate user.zap() and ndk.zap() -- use new NDKZapper instead

commit d70feb323e2d7f2d3c0912d8da1462445f192840
Author: pablof7z <[email protected]>
Date:   Wed Nov 27 13:19:53 2024 +0000

    nwc support

commit aee2abd285ea60c57a886849fc8e0820643637ec
Author: pablof7z <[email protected]>
Date:   Fri Nov 22 23:43:52 2024 +0000

    wip

commit ec7bb98b4405880e2a5a12013268f1453ec01464
Author: pablof7z <[email protected]>
Date:   Thu Nov 14 00:09:55 2024 +0000

    wip

commit 74bf589e3aadcd8ab3bb7904d949f32992915255
Author: pablof7z <[email protected]>
Date:   Wed Nov 13 22:07:56 2024 +0000

    upgrade cashu-ts

* change default encryption scheme to nip44

* add validation to check if nip07 extension supports nip44

* fix nip07 bad commit

* be more thorough finding the wallet that can unlock a nutzap

* track wallet stuff on the session

* delete events from cache when we see a deletion

* fix zap missing event tag

* wallet docs

* add pubkey hint to e tags

* remove unused package

* improve how event deletion is handled in the cache

* add support for Svelte 5's runes

* change github workflow

* change github workflow

* Fix github workflow

* skip deleted events by default

* add support in dexie cache to retrieve profile info synchronously

* add NIP-22 support

* Store NWC pairing code

* allow users to automatically store wallet settings

* wip

* fix bad replaceable event write

* refactor some wallet code

* upgrade ndk-mobile packages

* add protections to avoid double-counting proofs

* cache warnings

* add fee on wallet change

* relay indicator component

* Breaking apart NDKCashuWallet

* WIP: begin nip-55 integration in ndk-mobile

---------

Co-authored-by: Pablo Fernandez <[email protected]>
Co-authored-by: gzuuus <[email protected]>
Co-authored-by: JeffG <[email protected]>
Co-authored-by: Five <[email protected]>
Co-authored-by: Alejandro <[email protected]>
Co-authored-by: gsovereignty <[email protected]>
Co-authored-by: arkinox <[email protected]>
Co-authored-by: Sepehr Safari <[email protected]>
Co-authored-by: Caleb Simpson <[email protected]>
Co-authored-by: anon-dev <[email protected]>
Co-authored-by: Vladimir Lazić <[email protected]>
Co-authored-by: Jeremy D <[email protected]>
Co-authored-by: fiatjaf_ <[email protected]>
Co-authored-by: JZ273 <[email protected]>
Co-authored-by: pablof7z <[email protected]>
Co-authored-by: Fer <[email protected]>
Co-authored-by: Adam Soltys <[email protected]>
  • Loading branch information
18 people authored Jan 8, 2025
1 parent d8f4440 commit 600959d
Show file tree
Hide file tree
Showing 388 changed files with 33,948 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
5 changes: 5 additions & 0 deletions .changeset/cold-pianos-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk": minor
---

deprecate user.zap/ndk.zap -- use new NDKZapper instead
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/eighty-toes-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk": patch
---

move NWC to ndk-wallet
5 changes: 5 additions & 0 deletions .changeset/fifty-llamas-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk": patch
---

add pubkey hint to e tags
5 changes: 5 additions & 0 deletions .changeset/flat-garlics-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk-mobile": patch
---

add useUserProfile hook
5 changes: 5 additions & 0 deletions .changeset/fresh-oranges-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk-svelte": minor
---

add support for Svelte 5's runes
5 changes: 5 additions & 0 deletions .changeset/great-keys-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk-mobile": patch
---

add LRU cache for profiles
5 changes: 5 additions & 0 deletions .changeset/khaki-pets-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk": patch
---

fix bug where both a and e tags were going in zap requests
5 changes: 5 additions & 0 deletions .changeset/pretty-berries-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk-wallet": patch
---

NWC support
5 changes: 5 additions & 0 deletions .changeset/purple-fireants-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk-mobile": patch
---

add sync profile fetching from cache
5 changes: 5 additions & 0 deletions .changeset/silly-cows-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk-cache-dexie": patch
---

add support in dexie cache to retrieve profile info synchronously
5 changes: 5 additions & 0 deletions .changeset/strong-files-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nostr-dev-kit/ndk": patch
---

add NIP-22 support
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# FIXME: Hardcoded node version
# FIXME: Use prod and dev stages!
FROM node:20-slim

RUN corepack enable

# FIXME: We need to use a WORKDIR because of
# https://stackoverflow.com/a/65443098 but
# the choice of the actual dir is quite arbitrary.
COPY . /app
WORKDIR /app

RUN pnpm install
29 changes: 29 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "NDK devcontainer",
"build": {
// Path is relative to the devcontainer.json file.
"dockerfile": "Dockerfile",
"context": "../"
},
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
}
}
},
// Add pnpm bin to path, so we have turbo available
"postStartCommand": "echo 'export PATH=$(pnpm bin):$PATH' >> ~/.bashrc && . ~/.bashrc"
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
build
dist
package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@nostr-dev-kit/custom"],
};
66 changes: 66 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy VitePress site to Pages

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches:
- '*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: pnpm install # or pnpm install / yarn install / bun install
- name: Build with VitePress
run: pnpm docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
- name: Build typedoc
run: cd ndk && pnpm typedoc --out ../docs/.vitepress/dist/api
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
docs
coverage
**/.changeset
**/.svelte-kit
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"useTabs": false,
"tabWidth": 4,
"singleQuote": false,
"semi": true,
"trailingComma": "es5",
"printWidth": 100,
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
20 changes: 20 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Build NDK

NDK is structured as a monorepo using `pnpm` as the package manager.

```
git clone https://github.com/nostr-dev-kit/ndk
cd ndk
pnpm install
pnpm build
```

If you only care about building ndk core and not the family of packages you can just

```
git clone https://github.com/nostr-dev-kit/ndk
cd ndk
pnpm install
cd ndk
pnpm build
```
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Pablo Fernandez

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
45 changes: 45 additions & 0 deletions REFERENCES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Open source Nostr apps using NDK

This is a running list of applications using NDK that are open source. Use these codebases to understand
how others handle Nostr things using NDK.

If you are the author of an application that uses NDK, send a pull-request to this repo adding your application
to this list.

- [Highlighter](https://github.com/kind-0/highlighter) - By [@pablof7z](https://njump.me/npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft)
- Svelte, frontend
- [nsecBunker](https://github.com/kind-0/nsecbunkerd) - By [@pablof7z](https://njump.me/npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft)
- Typescript, backend
- [Highlighter Chrome Extension](https://github.com/pablof7z/highlighter-chrome-extension/) - By [@pablof7z](https://njump.me/npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft)
- Typescript, Chrome extension
- [Nostr Data Vending Machine](https://github.com/pablof7z/nostr-data-vending-machine) - By [@pablof7z](https://njump.me/npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft)
- Typescript, backend
- [Nostr Chat Widget](https://github.com/pablof7z/nostr-chat-widget) - By [@pablof7z](https://njump.me/npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft)
- Svelte, Rollup, embeddable widget
- [Zapstr](https://github.com/zapstr/zapstr) - By [@pablof7z](https://njump.me/npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft)
- Svelte, Frontend
- [Ostrich.work](https://github.com/erskingardner/ostrich.work) - By [@jeffg](https://njump.me/npub1zuuajd7u3sx8xu92yav9jwxpr839cs0kc3q6t56vd5u9q033xmhsk6c2uc)
- Svelte, frontend
- [Listr.lol](https://github.com/erskingardner/listr) - By [@jeffg](https://njump.me/npub1zuuajd7u3sx8xu92yav9jwxpr839cs0kc3q6t56vd5u9q033xmhsk6c2uc)
- Svelte, frontend
- [Lume](https://github.com/luminous-devs/lume) - By [@reya](https://njump.me/npub1zfss807aer0j26mwp2la0ume0jqde3823rmu97ra6sgyyg956e0s6xw445)
- Tauri, Desktop app
- [Nostr App Manager](https://github.com/nostrband/nostr-app-manager) - By [@nostrband](https://njump.me/npub1wc4rc9wxl2gfzxl384g0cw3f79nrms0sfdpe02y7aasy7c3we4sqd0qywr)
- React, Frontend
- [Stemstr](https://github.com/stemstr/Client) - By [@stemstr](https://njump.me/npub1stemstrls4f5plqeqkeq43gtjhtycuqd9w25v5r5z5ygaq2n2sjsd6mul5)
- [Audgit.ai](https://github.com/ArcadeLabsInc/audgit.ai) - By [@ArcadeLabsInc](https://njump.me/npub1tlv67m7xvlyplzexuynmfpguvyet0sjffce3y8vu0suuyuwgzauqjk7fdm)
- [Swarmstr](https://github.com/ptrio42/swarmstr.com) - By [@pitiunited](https://njump.me/npub178umpxtdflcm7a08nexvs4mu384kx0ngg9w8ltm5eut6q7lcp0vq05qrg4)
- [zapddit](https://github.com/vivganes/zapddit) - By [@vivganes](https://njump.me/npub1ltx67888tz7lqnxlrg06x234vjnq349tcfyp52r0lstclp548mcqnuz40t)
- [Nuxstr](https://github.com/Sebastix/nuxstr) - By [@Sebastix](https://njump.me/[email protected])
- Nuxt (Vue), frontend
- [Flockstr](https://github.com/zmeyer44/flockstr) - By [@zach](https://njump.me/npub1zach44xjpc4yyhx6pgse2cj2pf98838kja03dv2e8ly8lfr094vqvm5dy5)
- [Flare.pub](https://github.com/zmeyer44/flare) - By [@zach](https://njump.me/npub1zach44xjpc4yyhx6pgse2cj2pf98838kja03dv2e8ly8lfr094vqvm5dy5)
- [Pinstr.app](https://github.com/sepehr-safari/pinstr) - By [@sepehr](https://njump.me/nprofile1qqsru22d9lfnnwck54qr4phrvey50h2q33xc0gqxv5j03ftn4efu4rspr9mhxue69uhhyetvv9ujuumwdae8gtnnda3kjctv9uq3wamnwvaz7tmjwdekccte9ehx7um5wghx6mm99uq36amnwvaz7tmwdaehgu3wd46hg6tw09mkzmrvv46zucm0d5hsv6ffvh)
- React, Nostr Web Client
- [Nostr-Hooks](https://github.com/ostyjs/nostr-hooks) - By [@sepehr](https://njump.me/nprofile1qqsru22d9lfnnwck54qr4phrvey50h2q33xc0gqxv5j03ftn4efu4rspr9mhxue69uhhyetvv9ujuumwdae8gtnnda3kjctv9uq3wamnwvaz7tmjwdekccte9ehx7um5wghx6mm99uq36amnwvaz7tmwdaehgu3wd46hg6tw09mkzmrvv46zucm0d5hsv6ffvh)
- Stateful wrapper library of React hooks around NDK.
- [magicCity h=n](https://github.com/tezosmiami/hicetnunc) - By [@hicetnunc2000](https://github.com/hicetnunc2000/), [@tezosmiami](https://njump.me/npub190rqwj0nud4uhvmaeg7cgn0gypu0s09j87vqjluhfhju0req2khsskh9w7)
- [notepress](https://github.com/utxo-one/notepress) - By [@utxo](httsp://njump.me/[email protected])
- No frameworks! A very simple long-form (NIP-23) reader
- [Olas 🌊](https://github.com/pablof7z/snapstr) - By [@pablof7z](https://njump.me/f7z.io)
- React Native, mobile-only app
Loading

0 comments on commit 600959d

Please sign in to comment.