From a9d5b05bfdc5deb1e9b83a8f54130ce7e3f2471b Mon Sep 17 00:00:00 2001 From: J the Code Monkey Date: Wed, 8 Jan 2025 13:07:18 -0500 Subject: [PATCH] Revert "Nip 55 (#1)" This reverts commit 600959d5f6929f6cb9ad077c6dead8db3f19b9c5. --- .changeset/README.md | 8 - .changeset/cold-pianos-tickle.md | 5 - .changeset/config.json | 11 - .changeset/eighty-toes-refuse.md | 5 - .changeset/fifty-llamas-boil.md | 5 - .changeset/flat-garlics-taste.md | 5 - .changeset/fresh-oranges-guess.md | 5 - .changeset/great-keys-knock.md | 5 - .changeset/khaki-pets-smell.md | 5 - .changeset/pretty-berries-talk.md | 5 - .changeset/purple-fireants-invite.md | 5 - .changeset/silly-cows-boil.md | 5 - .changeset/strong-files-fly.md | 5 - .devcontainer/Dockerfile | 13 - .devcontainer/devcontainer.json | 29 - .eslintignore | 13 - .eslintrc.js | 3 - .github/workflows/deploy.yml | 66 -- .prettierignore | 5 - .prettierrc | 16 - BUILD.md | 20 - LICENSE | 21 - REFERENCES.md | 45 - docs/.vitepress/config.mts | 78 -- docs/.vitepress/theme/index.ts | 17 - docs/.vitepress/theme/style.css | 139 --- docs/api-examples.md | 49 - docs/cache/dexie.md | 153 --- docs/cache/nostr.md | 34 - docs/getting-started/introduction.md | 35 - docs/getting-started/signers.md | 38 - docs/getting-started/usage.md | 57 -- docs/index.md | 18 - docs/internals/subscriptions.md | 205 ---- docs/markdown-examples.md | 85 -- docs/mobile/index.md | 53 -- docs/mobile/profile-hook.md | 20 - docs/mobile/session.md | 36 - docs/mobile/subscriptions.md | 0 docs/mobile/wallet.md | 47 - docs/tutorial/auth.md | 29 - docs/tutorial/index.md | 1 - docs/tutorial/local-first.md | 63 -- docs/tutorial/publishing.md | 38 - docs/tutorial/speed.md | 48 - docs/tutorial/subscription-management.md | 67 -- docs/tutorial/zaps/index.md | 16 - docs/wallet/discover.md | 44 - docs/wallet/index.md | 23 - docs/wallet/nutsack.md | 95 -- docs/wallet/nutzaps.md | 16 - docs/wrappers/svelte.md | 107 --- ndk-cache-dexie/.gitignore | 5 - ndk-cache-dexie/.prettierignore | 1 - ndk-cache-dexie/CHANGELOG.md | 389 -------- ndk-cache-dexie/README.md | 28 - ndk-cache-dexie/jest.config.ts | 16 - ndk-cache-dexie/package.json | 64 -- ndk-cache-dexie/src/caches/event-tags.ts | 37 - ndk-cache-dexie/src/caches/events.ts | 35 - ndk-cache-dexie/src/caches/nip05.ts | 43 - ndk-cache-dexie/src/caches/profiles.ts | 42 - ndk-cache-dexie/src/caches/relay-info.ts | 49 - .../src/caches/unpublished-events.ts | 104 -- ndk-cache-dexie/src/caches/zapper.ts | 47 - ndk-cache-dexie/src/db.ts | 81 -- ndk-cache-dexie/src/index.test.ts | 79 -- ndk-cache-dexie/src/index.ts | 607 ------------ ndk-cache-dexie/src/lru-cache.ts | 164 ---- ndk-cache-dexie/tsconfig.json | 5 - ndk-cache-dexie/typedoc.json | 16 - ndk-cache-nostr/.gitignore | 3 - ndk-cache-nostr/.prettierignore | 1 - ndk-cache-nostr/CHANGELOG.md | 56 -- ndk-cache-nostr/README.md | 34 - ndk-cache-nostr/jest.config.ts | 11 - ndk-cache-nostr/package.json | 56 -- ndk-cache-nostr/src/index.ts | 272 ------ ndk-cache-nostr/src/queue.ts | 90 -- ndk-cache-nostr/tsconfig.json | 5 - ndk-cache-redis/.gitignore | 3 - ndk-cache-redis/.prettierignore | 1 - ndk-cache-redis/CHANGELOG.md | 362 ------- ndk-cache-redis/README.md | 27 - ndk-cache-redis/jest.config.ts | 11 - ndk-cache-redis/package.json | 58 -- ndk-cache-redis/src/index.test.ts | 83 -- ndk-cache-redis/src/index.ts | 160 ---- ndk-cache-redis/tsconfig.json | 5 - ndk-mobile/CHANGELOG.md | 21 - ndk-mobile/LICENSE | 21 - ndk-mobile/README.md | 35 - ndk-mobile/index.ts | 10 - ndk-mobile/package.json | 83 -- ndk-mobile/src/cache-adapter/migrations.ts | 61 -- ndk-mobile/src/cache-adapter/sqlite.ts | 314 ------- ndk-mobile/src/components/index.ts | 7 - ndk-mobile/src/components/relays/index.tsx | 3 - .../src/components/relays/indicator.tsx | 45 - ndk-mobile/src/context/index.ts | 2 - ndk-mobile/src/context/ndk.ts | 30 - ndk-mobile/src/context/session.ts | 27 - ndk-mobile/src/hooks/index.ts | 4 - ndk-mobile/src/hooks/ndk.ts | 12 - ndk-mobile/src/hooks/session.ts | 57 -- ndk-mobile/src/hooks/subscribe.ts | 252 ----- ndk-mobile/src/hooks/user-profile.ts | 85 -- ndk-mobile/src/index.ts | 13 - ndk-mobile/src/providers/index.ts | 2 - ndk-mobile/src/providers/ndk/index.tsx | 118 --- ndk-mobile/src/providers/ndk/signers/index.ts | 4 - ndk-mobile/src/providers/ndk/signers/nip07.ts | 14 - ndk-mobile/src/providers/ndk/signers/nip46.ts | 16 - ndk-mobile/src/providers/ndk/signers/nip55.ts | 324 ------- ndk-mobile/src/providers/ndk/signers/pk.ts | 12 - ndk-mobile/src/providers/session/index.tsx | 273 ------ ndk-mobile/src/stores/session.ts | 75 -- ndk-mobile/src/stores/wallet.ts | 27 - ndk-mobile/tsconfig.json | 17 - ndk-svelte-components/.eslintrc.cjs | 32 - ndk-svelte-components/.gitignore | 14 - ndk-svelte-components/.npmrc | 5 - ndk-svelte-components/.prettierignore | 3 - ndk-svelte-components/.storybook/main.ts | 26 - ndk-svelte-components/.storybook/preview.ts | 16 - ndk-svelte-components/CHANGELOG.md | 380 -------- ndk-svelte-components/LICENSE | 21 - ndk-svelte-components/README.md | 69 -- ndk-svelte-components/images/relay-list.png | Bin 200622 -> 0 bytes ndk-svelte-components/package.json | 97 -- ndk-svelte-components/postcss.config.cjs | 7 - ndk-svelte-components/src/app.html | 28 - .../src/lib/event/ElementConnector.svelte | 65 -- .../src/lib/event/EventCard.svelte | 109 --- .../lib/event/EventCardDropdownMenu.svelte | 87 -- .../src/lib/event/EventThread.svelte | 217 ----- .../src/lib/event/content/EventContent.svelte | 94 -- .../src/lib/event/content/Kind1.svelte | 82 -- .../src/lib/event/content/Kind1063.svelte | 81 -- .../src/lib/event/content/Kind30000.svelte | 29 - .../src/lib/event/content/Kind30001.svelte | 27 - .../src/lib/event/content/Kind30023.svelte | 59 -- .../src/lib/event/content/Kind9802.svelte | 26 - .../lib/event/content/NoteContentLink.svelte | 30 - .../event/content/NoteContentNewline.svelte | 8 - .../event/content/NoteContentPerson.svelte | 25 - .../lib/event/content/NoteContentTopic.svelte | 8 - .../src/lib/event/content/RenderHtml.svelte | 69 -- .../lib/event/content/renderer/hashtag.svelte | 5 - .../src/lib/event/content/renderer/index.ts | 12 - .../lib/event/content/renderer/link.svelte | 29 - .../lib/event/content/renderer/mention.svelte | 15 - .../event/content/renderer/nostr-event.svelte | 19 - ndk-svelte-components/src/lib/index.ts | 32 - .../src/lib/relay/RelayList.svelte | 34 - .../src/lib/relay/RelayListItem.svelte | 208 ---- .../src/lib/relay/RelayName.svelte | 8 - ndk-svelte-components/src/lib/stores/ndk.ts | 13 - .../src/lib/user/Avatar.svelte | 97 -- .../src/lib/user/Name.svelte | 82 -- .../src/lib/user/Nip05.svelte | 99 -- .../src/lib/user/Npub.svelte | 86 -- .../src/lib/user/UserCard.svelte | 110 --- .../src/lib/utils/event/index.ts | 30 - .../src/lib/utils/extensions/event.svelte | 19 - .../src/lib/utils/extensions/hashtag.svelte | 5 - .../src/lib/utils/extensions/image.svelte | 10 - .../src/lib/utils/extensions/mention.svelte | 17 - ndk-svelte-components/src/lib/utils/index.ts | 14 - .../src/lib/utils/markdown.ts | 111 --- ndk-svelte-components/src/lib/utils/notes.ts | 312 ------ .../src/lib/utils/relay/index.ts | 20 - .../src/lib/utils/user/index.ts | 8 - ndk-svelte-components/src/routes/+page.svelte | 6 - .../src/stories/Introduction.mdx | 21 - .../src/stories/events/EventCard.stories.ts | 63 -- .../events/EventCardDropdownMenu.stories.ts | 46 - .../stories/events/EventContent.stories.ts | 60 -- .../src/stories/events/EventThread.stories.ts | 67 -- .../src/stories/events/kinds/1.stories.ts | 49 - .../src/stories/events/kinds/1063.stories.ts | 43 - .../src/stories/events/kinds/30023.stories.ts | 53 -- .../src/stories/events/kinds/9802.stories.ts | 45 - .../events/kinds/lists/30000.stories.ts | 46 - .../events/kinds/lists/30001.stories.ts | 46 - .../src/stories/relay/RelayList.stories.ts | 57 -- .../src/stories/user/Avatar.stories.ts | 87 -- .../src/stories/user/Name.stories.ts | 89 -- .../src/stories/user/Nip05.stories.ts | 96 -- .../src/stories/user/Npub.stories.ts | 59 -- .../src/stories/user/UserCard.stories.ts | 75 -- ndk-svelte-components/src/styles/global.css | 21 - ndk-svelte-components/static/favicon.png | Bin 1571 -> 0 bytes ndk-svelte-components/svelte.config.js | 15 - ndk-svelte-components/tailwind.config.js | 4 - ndk-svelte-components/tsconfig.json | 13 - ndk-svelte-components/vite.config.ts | 6 - ndk-svelte/.gitignore | 13 - ndk-svelte/.prettierignore | 1 - ndk-svelte/CHANGELOG.md | 362 ------- ndk-svelte/LICENSE | 21 - ndk-svelte/README.md | 102 -- ndk-svelte/package.json | 60 -- ndk-svelte/src/index.svelte.ts | 119 --- ndk-svelte/src/index.ts | 359 ------- ndk-svelte/tsconfig.json | 5 - ndk-wallet/CHANGELOG.md | 428 --------- ndk-wallet/README.md | 24 - ndk-wallet/jest.config.ts | 11 - ndk-wallet/package.json | 67 -- ndk-wallet/src/index.ts | 15 - ndk-wallet/src/light-bolt11-decoder.d.ts | 4 - ndk-wallet/src/nutzap-monitor/index.ts | 245 ----- ndk-wallet/src/utils/ln.ts | 26 - ndk-wallet/src/wallets/cashu/decrypt.ts | 18 - .../src/wallets/cashu/deposit-monitor.ts | 40 - ndk-wallet/src/wallets/cashu/deposit.ts | 193 ---- .../wallets/cashu/event-handlers/deletion.ts | 14 - .../src/wallets/cashu/event-handlers/index.ts | 22 - .../src/wallets/cashu/event-handlers/quote.ts | 14 - .../src/wallets/cashu/event-handlers/token.ts | 14 - ndk-wallet/src/wallets/cashu/history.ts | 182 ---- ndk-wallet/src/wallets/cashu/mint.ts | 60 -- ndk-wallet/src/wallets/cashu/mint/utils.ts | 64 -- ndk-wallet/src/wallets/cashu/pay.ts | 14 - ndk-wallet/src/wallets/cashu/pay/ln.ts | 111 --- ndk-wallet/src/wallets/cashu/pay/nut.test.ts | 42 - ndk-wallet/src/wallets/cashu/pay/nut.ts | 255 ----- ndk-wallet/src/wallets/cashu/proofs.ts | 96 -- ndk-wallet/src/wallets/cashu/quote.ts | 78 -- ndk-wallet/src/wallets/cashu/token.ts | 126 --- ndk-wallet/src/wallets/cashu/validate.ts | 116 --- ndk-wallet/src/wallets/cashu/wallet/index.ts | 740 --------------- .../src/wallets/cashu/wallet/payment.ts | 86 -- ndk-wallet/src/wallets/cashu/wallet/state.ts | 305 ------ ndk-wallet/src/wallets/cashu/wallet/txs.ts | 95 -- ndk-wallet/src/wallets/index.ts | 89 -- ndk-wallet/src/wallets/nwc/index.ts | 173 ---- ndk-wallet/src/wallets/nwc/req.ts | 100 -- ndk-wallet/src/wallets/nwc/res.ts | 47 - ndk-wallet/src/wallets/nwc/types.ts | 122 --- ndk-wallet/src/wallets/webln/index.ts | 76 -- ndk-wallet/src/wallets/webln/pay.ts | 78 -- ndk-wallet/tsconfig.json | 5 - ndk/.prettierignore | 7 - ndk/CHANGELOG | 23 - ndk/CHANGELOG.md | 336 ------- ndk/LICENSE | 21 - ndk/OUTBOX.md | 7 - ndk/docs-styles.css | 37 - ndk/jest.config.ts | 15 - ndk/package.json | 87 -- ndk/src/app-settings/index.ts | 75 -- ndk/src/blossom/index.ts | 0 ndk/src/cache/index.ts | 118 --- ndk/src/dvm/schedule.ts | 135 --- ndk/src/events/content-tagger.test.ts | 232 ----- ndk/src/events/content-tagger.ts | 186 ---- ndk/src/events/dedup.ts | 14 - ndk/src/events/encode.test.ts | 17 - ndk/src/events/fetch-tagged-event.ts | 44 - ndk/src/events/index.test.ts | 567 ----------- ndk/src/events/index.ts | 886 ------------------ ndk/src/events/kind.ts | 20 - ndk/src/events/kinds/NDKRelayList.ts | 115 --- ndk/src/events/kinds/article.ts | 152 --- ndk/src/events/kinds/classified.ts | 181 ---- ndk/src/events/kinds/drafts.ts | 116 --- .../events/kinds/dvm/NDKTranscriptionDVM.ts | 69 -- ndk/src/events/kinds/dvm/feedback.ts | 48 - ndk/src/events/kinds/dvm/index.ts | 6 - ndk/src/events/kinds/dvm/request.ts | 121 --- ndk/src/events/kinds/dvm/result.ts | 83 -- ndk/src/events/kinds/highlight.ts | 115 --- ndk/src/events/kinds/index.ts | 185 ---- ndk/src/events/kinds/lists/index.test.ts | 51 - ndk/src/events/kinds/lists/index.ts | 391 -------- ndk/src/events/kinds/nip89/NDKAppHandler.ts | 57 -- ndk/src/events/kinds/nutzap/index.ts | 182 ---- ndk/src/events/kinds/nutzap/mint-list.ts | 76 -- ndk/src/events/kinds/nutzap/proof.ts | 18 - ndk/src/events/kinds/repost.ts | 74 -- ndk/src/events/kinds/simple-group/index.ts | 240 ----- .../events/kinds/simple-group/member-list.ts | 43 - ndk/src/events/kinds/simple-group/metadata.ts | 62 -- ndk/src/events/kinds/subscriptions/amount.ts | 61 -- ndk/src/events/kinds/subscriptions/receipt.ts | 146 --- .../kinds/subscriptions/subscription-start.ts | 147 --- .../events/kinds/subscriptions/tier.test.ts | 76 -- ndk/src/events/kinds/subscriptions/tier.ts | 122 --- ndk/src/events/kinds/video.ts | 144 --- ndk/src/events/kinds/wiki.ts | 7 - ndk/src/events/nip04.ts | 52 - ndk/src/events/nip19.test.ts | 58 -- ndk/src/events/nip19.ts | 34 - ndk/src/events/nip73.ts | 13 - ndk/src/events/repost.ts | 47 - ndk/src/events/serializer.ts | 41 - ndk/src/events/signature.ts | 52 - ndk/src/events/validation.ts | 90 -- ndk/src/index.ts | 61 -- ndk/src/light-bolt11-decoder.d.ts | 4 - ndk/src/media/index.test.ts | 77 -- ndk/src/media/index.ts | 199 ---- ndk/src/ndk/active-user.ts | 112 --- ndk/src/ndk/fetch-event-from-tag.test.ts | 22 - ndk/src/ndk/fetch-event-from-tag.ts | 162 ---- ndk/src/ndk/index.ts | 737 --------------- ndk/src/ndk/queue/index.ts | 90 -- ndk/src/outbox/index.ts | 118 --- ndk/src/outbox/read/with-authors.ts | 24 - ndk/src/outbox/relay-ranking.ts | 27 - ndk/src/outbox/tracker.test.ts | 20 - ndk/src/outbox/tracker.ts | 177 ---- ndk/src/outbox/write.ts | 38 - ndk/src/relay/auth-policies.test.ts | 19 - ndk/src/relay/auth-policies.ts | 93 -- ndk/src/relay/connectivity.test.ts | 122 --- ndk/src/relay/connectivity.ts | 619 ------------ ndk/src/relay/index.test.ts | 168 ---- ndk/src/relay/index.ts | 289 ------ ndk/src/relay/pool/index.test.ts | 26 - ndk/src/relay/pool/index.ts | 437 --------- ndk/src/relay/publisher.ts | 112 --- ndk/src/relay/score.ts | 2 - ndk/src/relay/sets/calculate.test.ts | 205 ---- ndk/src/relay/sets/calculate.ts | 179 ---- ndk/src/relay/sets/index.ts | 196 ---- ndk/src/relay/sets/utils.ts | 29 - ndk/src/relay/sub-manager.ts | 84 -- ndk/src/relay/subscription.test.ts | 165 ---- ndk/src/relay/subscription.ts | 439 --------- ndk/src/signers/index.ts | 73 -- ndk/src/signers/nip07/index.ts | 261 ------ ndk/src/signers/nip46/backend/connect.ts | 42 - .../signers/nip46/backend/get-public-key.ts | 12 - ndk/src/signers/nip46/backend/index.ts | 214 ----- .../signers/nip46/backend/nip04-decrypt.ts | 39 - .../signers/nip46/backend/nip04-encrypt.ts | 39 - .../signers/nip46/backend/nip44-decrypt.ts | 39 - .../signers/nip46/backend/nip44-encrypt.ts | 39 - ndk/src/signers/nip46/backend/ping.ts | 26 - ndk/src/signers/nip46/backend/sign-event.ts | 48 - ndk/src/signers/nip46/index.test.ts | 71 -- ndk/src/signers/nip46/index.ts | 351 ------- ndk/src/signers/nip46/rpc.ts | 209 ----- ndk/src/signers/private-key/index.test.ts | 63 -- ndk/src/signers/private-key/index.ts | 139 --- ndk/src/subscription/grouping.test.ts | 71 -- ndk/src/subscription/grouping.ts | 80 -- ndk/src/subscription/index.test.ts | 84 -- ndk/src/subscription/index.ts | 587 ------------ ndk/src/subscription/manager.ts | 34 - ndk/src/subscription/utils.test.ts | 92 -- ndk/src/subscription/utils.ts | 278 ------ ndk/src/thread/index.test.ts | 267 ------ ndk/src/thread/index.ts | 233 ----- ndk/src/user/follows.test.ts | 52 - ndk/src/user/follows.ts | 42 - ndk/src/user/index.test.ts | 292 ------ ndk/src/user/index.ts | 547 ----------- ndk/src/user/nip05.test.ts | 40 - ndk/src/user/nip05.ts | 111 --- ndk/src/user/pin.ts | 45 - ndk/src/user/profile.ts | 109 --- ndk/src/utils/get-users-relay-list.ts | 119 --- ndk/src/utils/normalize-url.ts | 356 ------- ndk/src/utils/timeout.ts | 19 - ndk/src/workers/sig-verification.ts | 40 - ndk/src/zap/invoice.ts | 111 --- ndk/src/zapper/index.test.ts | 124 --- ndk/src/zapper/index.ts | 488 ---------- ndk/src/zapper/ln.ts | 84 -- ndk/src/zapper/nip57.ts | 58 -- ndk/src/zapper/nip61.ts | 43 - ndk/tsconfig.json | 8 - ndk/typedoc.json | 23 - packages/eslint-config-custom/index.json | 25 - packages/eslint-config-custom/package.json | 17 - packages/tailwind-config/package.json | 11 - packages/tailwind-config/tailwind.config.js | 21 - packages/tsconfig/base.json | 24 - packages/tsconfig/ndk-cache-dexie.json | 5 - packages/tsconfig/ndk-cache-redis.json | 5 - packages/tsconfig/ndk-svelte.json | 5 - packages/tsconfig/ndk.json | 16 - packages/tsconfig/package.json | 16 - tsconfig.json | 4 - 388 files changed, 33948 deletions(-) delete mode 100644 .changeset/README.md delete mode 100644 .changeset/cold-pianos-tickle.md delete mode 100644 .changeset/config.json delete mode 100644 .changeset/eighty-toes-refuse.md delete mode 100644 .changeset/fifty-llamas-boil.md delete mode 100644 .changeset/flat-garlics-taste.md delete mode 100644 .changeset/fresh-oranges-guess.md delete mode 100644 .changeset/great-keys-knock.md delete mode 100644 .changeset/khaki-pets-smell.md delete mode 100644 .changeset/pretty-berries-talk.md delete mode 100644 .changeset/purple-fireants-invite.md delete mode 100644 .changeset/silly-cows-boil.md delete mode 100644 .changeset/strong-files-fly.md delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .prettierignore delete mode 100644 .prettierrc delete mode 100644 BUILD.md delete mode 100644 LICENSE delete mode 100644 REFERENCES.md delete mode 100644 docs/.vitepress/config.mts delete mode 100644 docs/.vitepress/theme/index.ts delete mode 100644 docs/.vitepress/theme/style.css delete mode 100644 docs/api-examples.md delete mode 100644 docs/cache/dexie.md delete mode 100644 docs/cache/nostr.md delete mode 100644 docs/getting-started/introduction.md delete mode 100644 docs/getting-started/signers.md delete mode 100644 docs/getting-started/usage.md delete mode 100644 docs/index.md delete mode 100644 docs/internals/subscriptions.md delete mode 100644 docs/markdown-examples.md delete mode 100644 docs/mobile/index.md delete mode 100644 docs/mobile/profile-hook.md delete mode 100644 docs/mobile/session.md delete mode 100644 docs/mobile/subscriptions.md delete mode 100644 docs/mobile/wallet.md delete mode 100644 docs/tutorial/auth.md delete mode 100644 docs/tutorial/index.md delete mode 100644 docs/tutorial/local-first.md delete mode 100644 docs/tutorial/publishing.md delete mode 100644 docs/tutorial/speed.md delete mode 100644 docs/tutorial/subscription-management.md delete mode 100644 docs/tutorial/zaps/index.md delete mode 100644 docs/wallet/discover.md delete mode 100644 docs/wallet/index.md delete mode 100644 docs/wallet/nutsack.md delete mode 100644 docs/wallet/nutzaps.md delete mode 100644 docs/wrappers/svelte.md delete mode 100644 ndk-cache-dexie/.gitignore delete mode 100644 ndk-cache-dexie/.prettierignore delete mode 100644 ndk-cache-dexie/CHANGELOG.md delete mode 100644 ndk-cache-dexie/README.md delete mode 100644 ndk-cache-dexie/jest.config.ts delete mode 100644 ndk-cache-dexie/package.json delete mode 100644 ndk-cache-dexie/src/caches/event-tags.ts delete mode 100644 ndk-cache-dexie/src/caches/events.ts delete mode 100644 ndk-cache-dexie/src/caches/nip05.ts delete mode 100644 ndk-cache-dexie/src/caches/profiles.ts delete mode 100644 ndk-cache-dexie/src/caches/relay-info.ts delete mode 100644 ndk-cache-dexie/src/caches/unpublished-events.ts delete mode 100644 ndk-cache-dexie/src/caches/zapper.ts delete mode 100644 ndk-cache-dexie/src/db.ts delete mode 100644 ndk-cache-dexie/src/index.test.ts delete mode 100644 ndk-cache-dexie/src/index.ts delete mode 100644 ndk-cache-dexie/src/lru-cache.ts delete mode 100644 ndk-cache-dexie/tsconfig.json delete mode 100644 ndk-cache-dexie/typedoc.json delete mode 100644 ndk-cache-nostr/.gitignore delete mode 100644 ndk-cache-nostr/.prettierignore delete mode 100644 ndk-cache-nostr/CHANGELOG.md delete mode 100644 ndk-cache-nostr/README.md delete mode 100644 ndk-cache-nostr/jest.config.ts delete mode 100644 ndk-cache-nostr/package.json delete mode 100644 ndk-cache-nostr/src/index.ts delete mode 100644 ndk-cache-nostr/src/queue.ts delete mode 100644 ndk-cache-nostr/tsconfig.json delete mode 100644 ndk-cache-redis/.gitignore delete mode 100644 ndk-cache-redis/.prettierignore delete mode 100644 ndk-cache-redis/CHANGELOG.md delete mode 100644 ndk-cache-redis/README.md delete mode 100644 ndk-cache-redis/jest.config.ts delete mode 100644 ndk-cache-redis/package.json delete mode 100644 ndk-cache-redis/src/index.test.ts delete mode 100644 ndk-cache-redis/src/index.ts delete mode 100644 ndk-cache-redis/tsconfig.json delete mode 100644 ndk-mobile/CHANGELOG.md delete mode 100644 ndk-mobile/LICENSE delete mode 100644 ndk-mobile/README.md delete mode 100644 ndk-mobile/index.ts delete mode 100644 ndk-mobile/package.json delete mode 100644 ndk-mobile/src/cache-adapter/migrations.ts delete mode 100644 ndk-mobile/src/cache-adapter/sqlite.ts delete mode 100644 ndk-mobile/src/components/index.ts delete mode 100644 ndk-mobile/src/components/relays/index.tsx delete mode 100644 ndk-mobile/src/components/relays/indicator.tsx delete mode 100644 ndk-mobile/src/context/index.ts delete mode 100644 ndk-mobile/src/context/ndk.ts delete mode 100644 ndk-mobile/src/context/session.ts delete mode 100644 ndk-mobile/src/hooks/index.ts delete mode 100644 ndk-mobile/src/hooks/ndk.ts delete mode 100644 ndk-mobile/src/hooks/session.ts delete mode 100644 ndk-mobile/src/hooks/subscribe.ts delete mode 100644 ndk-mobile/src/hooks/user-profile.ts delete mode 100644 ndk-mobile/src/index.ts delete mode 100644 ndk-mobile/src/providers/index.ts delete mode 100644 ndk-mobile/src/providers/ndk/index.tsx delete mode 100644 ndk-mobile/src/providers/ndk/signers/index.ts delete mode 100644 ndk-mobile/src/providers/ndk/signers/nip07.ts delete mode 100644 ndk-mobile/src/providers/ndk/signers/nip46.ts delete mode 100644 ndk-mobile/src/providers/ndk/signers/nip55.ts delete mode 100644 ndk-mobile/src/providers/ndk/signers/pk.ts delete mode 100644 ndk-mobile/src/providers/session/index.tsx delete mode 100644 ndk-mobile/src/stores/session.ts delete mode 100644 ndk-mobile/src/stores/wallet.ts delete mode 100644 ndk-mobile/tsconfig.json delete mode 100644 ndk-svelte-components/.eslintrc.cjs delete mode 100644 ndk-svelte-components/.gitignore delete mode 100644 ndk-svelte-components/.npmrc delete mode 100644 ndk-svelte-components/.prettierignore delete mode 100644 ndk-svelte-components/.storybook/main.ts delete mode 100644 ndk-svelte-components/.storybook/preview.ts delete mode 100644 ndk-svelte-components/CHANGELOG.md delete mode 100644 ndk-svelte-components/LICENSE delete mode 100644 ndk-svelte-components/README.md delete mode 100644 ndk-svelte-components/images/relay-list.png delete mode 100644 ndk-svelte-components/package.json delete mode 100644 ndk-svelte-components/postcss.config.cjs delete mode 100644 ndk-svelte-components/src/app.html delete mode 100644 ndk-svelte-components/src/lib/event/ElementConnector.svelte delete mode 100644 ndk-svelte-components/src/lib/event/EventCard.svelte delete mode 100644 ndk-svelte-components/src/lib/event/EventCardDropdownMenu.svelte delete mode 100644 ndk-svelte-components/src/lib/event/EventThread.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/EventContent.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/Kind1.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/Kind1063.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/Kind30000.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/Kind30001.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/Kind30023.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/Kind9802.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/NoteContentLink.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/NoteContentNewline.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/NoteContentPerson.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/NoteContentTopic.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/RenderHtml.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/renderer/hashtag.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/renderer/index.ts delete mode 100644 ndk-svelte-components/src/lib/event/content/renderer/link.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/renderer/mention.svelte delete mode 100644 ndk-svelte-components/src/lib/event/content/renderer/nostr-event.svelte delete mode 100644 ndk-svelte-components/src/lib/index.ts delete mode 100644 ndk-svelte-components/src/lib/relay/RelayList.svelte delete mode 100644 ndk-svelte-components/src/lib/relay/RelayListItem.svelte delete mode 100644 ndk-svelte-components/src/lib/relay/RelayName.svelte delete mode 100644 ndk-svelte-components/src/lib/stores/ndk.ts delete mode 100644 ndk-svelte-components/src/lib/user/Avatar.svelte delete mode 100644 ndk-svelte-components/src/lib/user/Name.svelte delete mode 100644 ndk-svelte-components/src/lib/user/Nip05.svelte delete mode 100644 ndk-svelte-components/src/lib/user/Npub.svelte delete mode 100644 ndk-svelte-components/src/lib/user/UserCard.svelte delete mode 100644 ndk-svelte-components/src/lib/utils/event/index.ts delete mode 100644 ndk-svelte-components/src/lib/utils/extensions/event.svelte delete mode 100644 ndk-svelte-components/src/lib/utils/extensions/hashtag.svelte delete mode 100644 ndk-svelte-components/src/lib/utils/extensions/image.svelte delete mode 100644 ndk-svelte-components/src/lib/utils/extensions/mention.svelte delete mode 100644 ndk-svelte-components/src/lib/utils/index.ts delete mode 100644 ndk-svelte-components/src/lib/utils/markdown.ts delete mode 100644 ndk-svelte-components/src/lib/utils/notes.ts delete mode 100644 ndk-svelte-components/src/lib/utils/relay/index.ts delete mode 100644 ndk-svelte-components/src/lib/utils/user/index.ts delete mode 100644 ndk-svelte-components/src/routes/+page.svelte delete mode 100644 ndk-svelte-components/src/stories/Introduction.mdx delete mode 100644 ndk-svelte-components/src/stories/events/EventCard.stories.ts delete mode 100644 ndk-svelte-components/src/stories/events/EventCardDropdownMenu.stories.ts delete mode 100644 ndk-svelte-components/src/stories/events/EventContent.stories.ts delete mode 100644 ndk-svelte-components/src/stories/events/EventThread.stories.ts delete mode 100644 ndk-svelte-components/src/stories/events/kinds/1.stories.ts delete mode 100644 ndk-svelte-components/src/stories/events/kinds/1063.stories.ts delete mode 100644 ndk-svelte-components/src/stories/events/kinds/30023.stories.ts delete mode 100644 ndk-svelte-components/src/stories/events/kinds/9802.stories.ts delete mode 100644 ndk-svelte-components/src/stories/events/kinds/lists/30000.stories.ts delete mode 100644 ndk-svelte-components/src/stories/events/kinds/lists/30001.stories.ts delete mode 100644 ndk-svelte-components/src/stories/relay/RelayList.stories.ts delete mode 100644 ndk-svelte-components/src/stories/user/Avatar.stories.ts delete mode 100644 ndk-svelte-components/src/stories/user/Name.stories.ts delete mode 100644 ndk-svelte-components/src/stories/user/Nip05.stories.ts delete mode 100644 ndk-svelte-components/src/stories/user/Npub.stories.ts delete mode 100644 ndk-svelte-components/src/stories/user/UserCard.stories.ts delete mode 100644 ndk-svelte-components/src/styles/global.css delete mode 100644 ndk-svelte-components/static/favicon.png delete mode 100644 ndk-svelte-components/svelte.config.js delete mode 100644 ndk-svelte-components/tailwind.config.js delete mode 100644 ndk-svelte-components/tsconfig.json delete mode 100644 ndk-svelte-components/vite.config.ts delete mode 100644 ndk-svelte/.gitignore delete mode 100644 ndk-svelte/.prettierignore delete mode 100644 ndk-svelte/CHANGELOG.md delete mode 100644 ndk-svelte/LICENSE delete mode 100644 ndk-svelte/README.md delete mode 100644 ndk-svelte/package.json delete mode 100644 ndk-svelte/src/index.svelte.ts delete mode 100644 ndk-svelte/src/index.ts delete mode 100644 ndk-svelte/tsconfig.json delete mode 100644 ndk-wallet/CHANGELOG.md delete mode 100644 ndk-wallet/README.md delete mode 100644 ndk-wallet/jest.config.ts delete mode 100644 ndk-wallet/package.json delete mode 100644 ndk-wallet/src/index.ts delete mode 100644 ndk-wallet/src/light-bolt11-decoder.d.ts delete mode 100644 ndk-wallet/src/nutzap-monitor/index.ts delete mode 100644 ndk-wallet/src/utils/ln.ts delete mode 100644 ndk-wallet/src/wallets/cashu/decrypt.ts delete mode 100644 ndk-wallet/src/wallets/cashu/deposit-monitor.ts delete mode 100644 ndk-wallet/src/wallets/cashu/deposit.ts delete mode 100644 ndk-wallet/src/wallets/cashu/event-handlers/deletion.ts delete mode 100644 ndk-wallet/src/wallets/cashu/event-handlers/index.ts delete mode 100644 ndk-wallet/src/wallets/cashu/event-handlers/quote.ts delete mode 100644 ndk-wallet/src/wallets/cashu/event-handlers/token.ts delete mode 100644 ndk-wallet/src/wallets/cashu/history.ts delete mode 100644 ndk-wallet/src/wallets/cashu/mint.ts delete mode 100644 ndk-wallet/src/wallets/cashu/mint/utils.ts delete mode 100644 ndk-wallet/src/wallets/cashu/pay.ts delete mode 100644 ndk-wallet/src/wallets/cashu/pay/ln.ts delete mode 100644 ndk-wallet/src/wallets/cashu/pay/nut.test.ts delete mode 100644 ndk-wallet/src/wallets/cashu/pay/nut.ts delete mode 100644 ndk-wallet/src/wallets/cashu/proofs.ts delete mode 100644 ndk-wallet/src/wallets/cashu/quote.ts delete mode 100644 ndk-wallet/src/wallets/cashu/token.ts delete mode 100644 ndk-wallet/src/wallets/cashu/validate.ts delete mode 100644 ndk-wallet/src/wallets/cashu/wallet/index.ts delete mode 100644 ndk-wallet/src/wallets/cashu/wallet/payment.ts delete mode 100644 ndk-wallet/src/wallets/cashu/wallet/state.ts delete mode 100644 ndk-wallet/src/wallets/cashu/wallet/txs.ts delete mode 100644 ndk-wallet/src/wallets/index.ts delete mode 100644 ndk-wallet/src/wallets/nwc/index.ts delete mode 100644 ndk-wallet/src/wallets/nwc/req.ts delete mode 100644 ndk-wallet/src/wallets/nwc/res.ts delete mode 100644 ndk-wallet/src/wallets/nwc/types.ts delete mode 100644 ndk-wallet/src/wallets/webln/index.ts delete mode 100644 ndk-wallet/src/wallets/webln/pay.ts delete mode 100644 ndk-wallet/tsconfig.json delete mode 100644 ndk/.prettierignore delete mode 100644 ndk/CHANGELOG delete mode 100644 ndk/CHANGELOG.md delete mode 100644 ndk/LICENSE delete mode 100644 ndk/OUTBOX.md delete mode 100644 ndk/docs-styles.css delete mode 100644 ndk/jest.config.ts delete mode 100644 ndk/package.json delete mode 100644 ndk/src/app-settings/index.ts delete mode 100644 ndk/src/blossom/index.ts delete mode 100644 ndk/src/cache/index.ts delete mode 100644 ndk/src/dvm/schedule.ts delete mode 100644 ndk/src/events/content-tagger.test.ts delete mode 100644 ndk/src/events/content-tagger.ts delete mode 100644 ndk/src/events/dedup.ts delete mode 100644 ndk/src/events/encode.test.ts delete mode 100644 ndk/src/events/fetch-tagged-event.ts delete mode 100644 ndk/src/events/index.test.ts delete mode 100644 ndk/src/events/index.ts delete mode 100644 ndk/src/events/kind.ts delete mode 100644 ndk/src/events/kinds/NDKRelayList.ts delete mode 100644 ndk/src/events/kinds/article.ts delete mode 100644 ndk/src/events/kinds/classified.ts delete mode 100644 ndk/src/events/kinds/drafts.ts delete mode 100644 ndk/src/events/kinds/dvm/NDKTranscriptionDVM.ts delete mode 100644 ndk/src/events/kinds/dvm/feedback.ts delete mode 100644 ndk/src/events/kinds/dvm/index.ts delete mode 100644 ndk/src/events/kinds/dvm/request.ts delete mode 100644 ndk/src/events/kinds/dvm/result.ts delete mode 100644 ndk/src/events/kinds/highlight.ts delete mode 100644 ndk/src/events/kinds/index.ts delete mode 100644 ndk/src/events/kinds/lists/index.test.ts delete mode 100644 ndk/src/events/kinds/lists/index.ts delete mode 100644 ndk/src/events/kinds/nip89/NDKAppHandler.ts delete mode 100644 ndk/src/events/kinds/nutzap/index.ts delete mode 100644 ndk/src/events/kinds/nutzap/mint-list.ts delete mode 100644 ndk/src/events/kinds/nutzap/proof.ts delete mode 100644 ndk/src/events/kinds/repost.ts delete mode 100644 ndk/src/events/kinds/simple-group/index.ts delete mode 100644 ndk/src/events/kinds/simple-group/member-list.ts delete mode 100644 ndk/src/events/kinds/simple-group/metadata.ts delete mode 100644 ndk/src/events/kinds/subscriptions/amount.ts delete mode 100644 ndk/src/events/kinds/subscriptions/receipt.ts delete mode 100644 ndk/src/events/kinds/subscriptions/subscription-start.ts delete mode 100644 ndk/src/events/kinds/subscriptions/tier.test.ts delete mode 100644 ndk/src/events/kinds/subscriptions/tier.ts delete mode 100644 ndk/src/events/kinds/video.ts delete mode 100644 ndk/src/events/kinds/wiki.ts delete mode 100644 ndk/src/events/nip04.ts delete mode 100644 ndk/src/events/nip19.test.ts delete mode 100644 ndk/src/events/nip19.ts delete mode 100644 ndk/src/events/nip73.ts delete mode 100644 ndk/src/events/repost.ts delete mode 100644 ndk/src/events/serializer.ts delete mode 100644 ndk/src/events/signature.ts delete mode 100644 ndk/src/events/validation.ts delete mode 100644 ndk/src/index.ts delete mode 100644 ndk/src/light-bolt11-decoder.d.ts delete mode 100644 ndk/src/media/index.test.ts delete mode 100644 ndk/src/media/index.ts delete mode 100644 ndk/src/ndk/active-user.ts delete mode 100644 ndk/src/ndk/fetch-event-from-tag.test.ts delete mode 100644 ndk/src/ndk/fetch-event-from-tag.ts delete mode 100644 ndk/src/ndk/index.ts delete mode 100644 ndk/src/ndk/queue/index.ts delete mode 100644 ndk/src/outbox/index.ts delete mode 100644 ndk/src/outbox/read/with-authors.ts delete mode 100644 ndk/src/outbox/relay-ranking.ts delete mode 100644 ndk/src/outbox/tracker.test.ts delete mode 100644 ndk/src/outbox/tracker.ts delete mode 100644 ndk/src/outbox/write.ts delete mode 100644 ndk/src/relay/auth-policies.test.ts delete mode 100644 ndk/src/relay/auth-policies.ts delete mode 100644 ndk/src/relay/connectivity.test.ts delete mode 100644 ndk/src/relay/connectivity.ts delete mode 100644 ndk/src/relay/index.test.ts delete mode 100644 ndk/src/relay/index.ts delete mode 100644 ndk/src/relay/pool/index.test.ts delete mode 100644 ndk/src/relay/pool/index.ts delete mode 100644 ndk/src/relay/publisher.ts delete mode 100644 ndk/src/relay/score.ts delete mode 100644 ndk/src/relay/sets/calculate.test.ts delete mode 100644 ndk/src/relay/sets/calculate.ts delete mode 100644 ndk/src/relay/sets/index.ts delete mode 100644 ndk/src/relay/sets/utils.ts delete mode 100644 ndk/src/relay/sub-manager.ts delete mode 100644 ndk/src/relay/subscription.test.ts delete mode 100644 ndk/src/relay/subscription.ts delete mode 100644 ndk/src/signers/index.ts delete mode 100644 ndk/src/signers/nip07/index.ts delete mode 100644 ndk/src/signers/nip46/backend/connect.ts delete mode 100644 ndk/src/signers/nip46/backend/get-public-key.ts delete mode 100644 ndk/src/signers/nip46/backend/index.ts delete mode 100644 ndk/src/signers/nip46/backend/nip04-decrypt.ts delete mode 100644 ndk/src/signers/nip46/backend/nip04-encrypt.ts delete mode 100644 ndk/src/signers/nip46/backend/nip44-decrypt.ts delete mode 100644 ndk/src/signers/nip46/backend/nip44-encrypt.ts delete mode 100644 ndk/src/signers/nip46/backend/ping.ts delete mode 100644 ndk/src/signers/nip46/backend/sign-event.ts delete mode 100644 ndk/src/signers/nip46/index.test.ts delete mode 100644 ndk/src/signers/nip46/index.ts delete mode 100644 ndk/src/signers/nip46/rpc.ts delete mode 100644 ndk/src/signers/private-key/index.test.ts delete mode 100644 ndk/src/signers/private-key/index.ts delete mode 100644 ndk/src/subscription/grouping.test.ts delete mode 100644 ndk/src/subscription/grouping.ts delete mode 100644 ndk/src/subscription/index.test.ts delete mode 100644 ndk/src/subscription/index.ts delete mode 100644 ndk/src/subscription/manager.ts delete mode 100644 ndk/src/subscription/utils.test.ts delete mode 100644 ndk/src/subscription/utils.ts delete mode 100644 ndk/src/thread/index.test.ts delete mode 100644 ndk/src/thread/index.ts delete mode 100644 ndk/src/user/follows.test.ts delete mode 100644 ndk/src/user/follows.ts delete mode 100644 ndk/src/user/index.test.ts delete mode 100644 ndk/src/user/index.ts delete mode 100644 ndk/src/user/nip05.test.ts delete mode 100644 ndk/src/user/nip05.ts delete mode 100644 ndk/src/user/pin.ts delete mode 100644 ndk/src/user/profile.ts delete mode 100644 ndk/src/utils/get-users-relay-list.ts delete mode 100644 ndk/src/utils/normalize-url.ts delete mode 100644 ndk/src/utils/timeout.ts delete mode 100644 ndk/src/workers/sig-verification.ts delete mode 100644 ndk/src/zap/invoice.ts delete mode 100644 ndk/src/zapper/index.test.ts delete mode 100644 ndk/src/zapper/index.ts delete mode 100644 ndk/src/zapper/ln.ts delete mode 100644 ndk/src/zapper/nip57.ts delete mode 100644 ndk/src/zapper/nip61.ts delete mode 100644 ndk/tsconfig.json delete mode 100644 ndk/typedoc.json delete mode 100644 packages/eslint-config-custom/index.json delete mode 100644 packages/eslint-config-custom/package.json delete mode 100644 packages/tailwind-config/package.json delete mode 100644 packages/tailwind-config/tailwind.config.js delete mode 100644 packages/tsconfig/base.json delete mode 100644 packages/tsconfig/ndk-cache-dexie.json delete mode 100644 packages/tsconfig/ndk-cache-redis.json delete mode 100644 packages/tsconfig/ndk-svelte.json delete mode 100644 packages/tsconfig/ndk.json delete mode 100644 packages/tsconfig/package.json delete mode 100644 tsconfig.json diff --git a/.changeset/README.md b/.changeset/README.md deleted file mode 100644 index e5b6d8d6..00000000 --- a/.changeset/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# 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) diff --git a/.changeset/cold-pianos-tickle.md b/.changeset/cold-pianos-tickle.md deleted file mode 100644 index e7993579..00000000 --- a/.changeset/cold-pianos-tickle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk": minor ---- - -deprecate user.zap/ndk.zap -- use new NDKZapper instead diff --git a/.changeset/config.json b/.changeset/config.json deleted file mode 100644 index 77b04199..00000000 --- a/.changeset/config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json", - "changelog": "@changesets/cli/changelog", - "commit": false, - "fixed": [], - "linked": [], - "access": "public", - "baseBranch": "master", - "updateInternalDependencies": "patch", - "ignore": [] -} diff --git a/.changeset/eighty-toes-refuse.md b/.changeset/eighty-toes-refuse.md deleted file mode 100644 index 21a099c7..00000000 --- a/.changeset/eighty-toes-refuse.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk": patch ---- - -move NWC to ndk-wallet diff --git a/.changeset/fifty-llamas-boil.md b/.changeset/fifty-llamas-boil.md deleted file mode 100644 index 657b902d..00000000 --- a/.changeset/fifty-llamas-boil.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk": patch ---- - -add pubkey hint to e tags diff --git a/.changeset/flat-garlics-taste.md b/.changeset/flat-garlics-taste.md deleted file mode 100644 index e59d34d0..00000000 --- a/.changeset/flat-garlics-taste.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk-mobile": patch ---- - -add useUserProfile hook diff --git a/.changeset/fresh-oranges-guess.md b/.changeset/fresh-oranges-guess.md deleted file mode 100644 index a56d009c..00000000 --- a/.changeset/fresh-oranges-guess.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk-svelte": minor ---- - -add support for Svelte 5's runes diff --git a/.changeset/great-keys-knock.md b/.changeset/great-keys-knock.md deleted file mode 100644 index 11cf8620..00000000 --- a/.changeset/great-keys-knock.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk-mobile": patch ---- - -add LRU cache for profiles diff --git a/.changeset/khaki-pets-smell.md b/.changeset/khaki-pets-smell.md deleted file mode 100644 index 4638c43b..00000000 --- a/.changeset/khaki-pets-smell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk": patch ---- - -fix bug where both a and e tags were going in zap requests diff --git a/.changeset/pretty-berries-talk.md b/.changeset/pretty-berries-talk.md deleted file mode 100644 index 76efd29c..00000000 --- a/.changeset/pretty-berries-talk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk-wallet": patch ---- - -NWC support diff --git a/.changeset/purple-fireants-invite.md b/.changeset/purple-fireants-invite.md deleted file mode 100644 index 5e7433de..00000000 --- a/.changeset/purple-fireants-invite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk-mobile": patch ---- - -add sync profile fetching from cache diff --git a/.changeset/silly-cows-boil.md b/.changeset/silly-cows-boil.md deleted file mode 100644 index f809c2d9..00000000 --- a/.changeset/silly-cows-boil.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk-cache-dexie": patch ---- - -add support in dexie cache to retrieve profile info synchronously diff --git a/.changeset/strong-files-fly.md b/.changeset/strong-files-fly.md deleted file mode 100644 index 2fef01c2..00000000 --- a/.changeset/strong-files-fly.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@nostr-dev-kit/ndk": patch ---- - -add NIP-22 support diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 0ccefc48..00000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -# 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 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 709d82c2..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,29 +0,0 @@ -// 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" -} diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index e5dc490a..00000000 --- a/.eslintignore +++ /dev/null @@ -1,13 +0,0 @@ -.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 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 8b05a81c..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extends: ["@nostr-dev-kit/custom"], -}; diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 605f05db..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,66 +0,0 @@ -# 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 diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index f757754f..00000000 --- a/.prettierignore +++ /dev/null @@ -1,5 +0,0 @@ -dist -docs -coverage -**/.changeset -**/.svelte-kit diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 4431ccbf..00000000 --- a/.prettierrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "useTabs": false, - "tabWidth": 4, - "singleQuote": false, - "semi": true, - "trailingComma": "es5", - "printWidth": 100, - "overrides": [ - { - "files": "*.svelte", - "options": { - "parser": "svelte" - } - } - ] -} diff --git a/BUILD.md b/BUILD.md deleted file mode 100644 index 741a89e4..00000000 --- a/BUILD.md +++ /dev/null @@ -1,20 +0,0 @@ -# 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 -``` diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 2a6ea523..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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. diff --git a/REFERENCES.md b/REFERENCES.md deleted file mode 100644 index 48274ac7..00000000 --- a/REFERENCES.md +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sebastian@sebastix.dev) - - 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/_@utxo.one) - - 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 diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts deleted file mode 100644 index 75669e0d..00000000 --- a/docs/.vitepress/config.mts +++ /dev/null @@ -1,78 +0,0 @@ -import { defineConfig } from 'vitepress' -import { withMermaid } from "vitepress-plugin-mermaid"; - -// https://vitepress.dev/reference/site-config -export default withMermaid(defineConfig({ - title: "NDK", - description: "NDK Docs", - base: "/ndk/", - ignoreDeadLinks: true, - themeConfig: { - // https://vitepress.dev/reference/default-theme-config - nav: [ - { text: 'Home', link: '/' }, - { text: 'API Reference', link: '/api/', target: '_blank' }, - { text: 'Wiki', link: 'https://wikifreedia.xyz/?c=NDK', target: '_blank' }, - ], - - sidebar: [ - { - text: "Getting Started", - items: [ - { text: 'Introduction', link: '/getting-started/introduction' }, - { text: 'Usage', link: '/getting-started/usage' }, - { text: 'Signers', link: '/getting-started/signers' }, - ] - }, - { - text: 'Tutorial', - items: [ - { text: 'Local-first', link: '/tutorial/local-first' }, - { text: 'Publishing', link: '/tutorial/publishing' }, - { text: "Subscription Management", link: '/tutorial/subscription-management' }, - { text: "Speed", link: '/tutorial/speed' }, - { text: 'Zaps', link: '/tutorial/zaps' }, - ] - }, - { - text: "Cache Adapters", - items: [ - { text: 'In-memory + dexie', link: '/cache/dexie' }, - { text: 'Local Nostr Relay', link: '/cache/nostr' }, - ] - }, - { - text: "Wallet", - items: [ - { text: 'Introduction', link: '/wallet/index' }, - { text: 'Nutsack (NIP-60)', link: '/wallet/nutsack' }, - { text: 'Nutzaps', link: '/wallet/nutzaps' }, - ] - }, - { - text: "Wrappers", - items: [ - { text: 'NDK Svelte', link: '/wrappers/svelte' }, - ] - }, - { - text: "Mobile", - items: [ - { text: 'Introduction', link: '/mobile/index' }, - { text: 'Session', link: '/mobile/session' }, - { text: 'Wallet', link: '/mobile/wallet' }, - ] - }, - { - text: "Internals", - items: [ - { text: "Subscription Lifecycle", link: '/internals/subscriptions' }, - ] - } - ], - - socialLinks: [ - { icon: 'github', link: 'https://github.com/nostr-dev-kit/ndk' } - ] - } -})) \ No newline at end of file diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts deleted file mode 100644 index def4cfc8..00000000 --- a/docs/.vitepress/theme/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -// https://vitepress.dev/guide/custom-theme -import { h } from 'vue' -import type { Theme } from 'vitepress' -import DefaultTheme from 'vitepress/theme' -import './style.css' - -export default { - extends: DefaultTheme, - Layout: () => { - return h(DefaultTheme.Layout, null, { - // https://vitepress.dev/guide/extending-default-theme#layout-slots - }) - }, - enhanceApp({ app, router, siteData }) { - // ... - } -} satisfies Theme diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css deleted file mode 100644 index d63aee82..00000000 --- a/docs/.vitepress/theme/style.css +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Customize default theme styling by overriding CSS variables: - * https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css - */ - -/** - * Colors - * - * Each colors have exact same color scale system with 3 levels of solid - * colors with different brightness, and 1 soft color. - * - * - `XXX-1`: The most solid color used mainly for colored text. It must - * satisfy the contrast ratio against when used on top of `XXX-soft`. - * - * - `XXX-2`: The color used mainly for hover state of the button. - * - * - `XXX-3`: The color for solid background, such as bg color of the button. - * It must satisfy the contrast ratio with pure white (#ffffff) text on - * top of it. - * - * - `XXX-soft`: The color used for subtle background such as custom container - * or badges. It must satisfy the contrast ratio when putting `XXX-1` colors - * on top of it. - * - * The soft color must be semi transparent alpha channel. This is crucial - * because it allows adding multiple "soft" colors on top of each other - * to create a accent, such as when having inline code block inside - * custom containers. - * - * - `default`: The color used purely for subtle indication without any - * special meanings attched to it such as bg color for menu hover state. - * - * - `brand`: Used for primary brand colors, such as link text, button with - * brand theme, etc. - * - * - `tip`: Used to indicate useful information. The default theme uses the - * brand color for this by default. - * - * - `warning`: Used to indicate warning to the users. Used in custom - * container, badges, etc. - * - * - `danger`: Used to show error, or dangerous message to the users. Used - * in custom container, badges, etc. - * -------------------------------------------------------------------------- */ - - :root { - --vp-c-default-1: var(--vp-c-gray-1); - --vp-c-default-2: var(--vp-c-gray-2); - --vp-c-default-3: var(--vp-c-gray-3); - --vp-c-default-soft: var(--vp-c-gray-soft); - - --vp-c-brand-1: var(--vp-c-indigo-1); - --vp-c-brand-2: var(--vp-c-indigo-2); - --vp-c-brand-3: var(--vp-c-indigo-3); - --vp-c-brand-soft: var(--vp-c-indigo-soft); - - --vp-c-tip-1: var(--vp-c-brand-1); - --vp-c-tip-2: var(--vp-c-brand-2); - --vp-c-tip-3: var(--vp-c-brand-3); - --vp-c-tip-soft: var(--vp-c-brand-soft); - - --vp-c-warning-1: var(--vp-c-yellow-1); - --vp-c-warning-2: var(--vp-c-yellow-2); - --vp-c-warning-3: var(--vp-c-yellow-3); - --vp-c-warning-soft: var(--vp-c-yellow-soft); - - --vp-c-danger-1: var(--vp-c-red-1); - --vp-c-danger-2: var(--vp-c-red-2); - --vp-c-danger-3: var(--vp-c-red-3); - --vp-c-danger-soft: var(--vp-c-red-soft); -} - -/** - * Component: Button - * -------------------------------------------------------------------------- */ - -:root { - --vp-button-brand-border: transparent; - --vp-button-brand-text: var(--vp-c-white); - --vp-button-brand-bg: var(--vp-c-brand-3); - --vp-button-brand-hover-border: transparent; - --vp-button-brand-hover-text: var(--vp-c-white); - --vp-button-brand-hover-bg: var(--vp-c-brand-2); - --vp-button-brand-active-border: transparent; - --vp-button-brand-active-text: var(--vp-c-white); - --vp-button-brand-active-bg: var(--vp-c-brand-1); -} - -/** - * Component: Home - * -------------------------------------------------------------------------- */ - -:root { - --vp-home-hero-name-color: transparent; - --vp-home-hero-name-background: -webkit-linear-gradient( - 120deg, - #bd34fe 30%, - #41d1ff - ); - - --vp-home-hero-image-background-image: linear-gradient( - -45deg, - #bd34fe 50%, - #47caff 50% - ); - --vp-home-hero-image-filter: blur(44px); -} - -@media (min-width: 640px) { - :root { - --vp-home-hero-image-filter: blur(56px); - } -} - -@media (min-width: 960px) { - :root { - --vp-home-hero-image-filter: blur(68px); - } -} - -/** - * Component: Custom Block - * -------------------------------------------------------------------------- */ - -:root { - --vp-custom-block-tip-border: transparent; - --vp-custom-block-tip-text: var(--vp-c-text-1); - --vp-custom-block-tip-bg: var(--vp-c-brand-soft); - --vp-custom-block-tip-code-bg: var(--vp-c-brand-soft); -} - -/** - * Component: Algolia - * -------------------------------------------------------------------------- */ - -.DocSearch { - --docsearch-primary-color: var(--vp-c-brand-1) !important; -} - diff --git a/docs/api-examples.md b/docs/api-examples.md deleted file mode 100644 index 6bd8bb5c..00000000 --- a/docs/api-examples.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -outline: deep ---- - -# Runtime API Examples - -This page demonstrates usage of some of the runtime APIs provided by VitePress. - -The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files: - -```md - - -## Results - -### Theme Data -
{{ theme }}
- -### Page Data -
{{ page }}
- -### Page Frontmatter -
{{ frontmatter }}
-``` - - - -## Results - -### Theme Data -
{{ theme }}
- -### Page Data -
{{ page }}
- -### Page Frontmatter -
{{ frontmatter }}
- -## More - -Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata). diff --git a/docs/cache/dexie.md b/docs/cache/dexie.md deleted file mode 100644 index 114b53bd..00000000 --- a/docs/cache/dexie.md +++ /dev/null @@ -1,153 +0,0 @@ -# Dexie Cache - -Meant to be used client-side within a browser context. This is a cache adapter for [Dexie](https://dexie.org/), a wrapper around IndexedDB. - -## Usage - -NDK will attempt to use the Dexie adapter to store users, events, and tags. The default behaviour is to always check the cache first and then hit relays, replacing older cached events as needed. - -## Support - -- [x] Events -- [x] User profiles -- [x] Event<>Tag indexes -- [x] NIP-05 lookups -- [x] Unpublished events - -### Install - -``` -pnpm add @nostr-dev-kit/ndk-cache-dexie -``` - -### Add as a cache adapter - -```ts -import NDKCacheAdapterDexie from "@nostr-dev-kit/ndk-cache-dexie"; - -const dexieAdapter = new NDKCacheAdapterDexie({ dbName: 'your-db-name' }); -const ndk = new NDK({cacheAdapter: dexieAdapter, ...other config options}); -``` - -🚨 Because Dexie only exists client-side, this cache adapter will not work in pure node.js environments. You'll need to make sure that you're using the right cache adapter in the right place (e.g. Redis on the backend, Dexie on the frontend). - -## Slowness - -Because IndexDB is painfully slow, this adapter will primarly act via an LRU cache that periodically flushes to the database. Individual read/writes don't directly hit the database. - -## Options - -[**NDK Dexie Cache Adapter**](../README.md) • **Docs** - -*** - -[NDK Dexie Cache Adapter](../globals.md) / NDKCacheAdapterDexieOptions - -# Interface: NDKCacheAdapterDexieOptions - -## Properties - -### dbName? - -> `optional` **dbName**: `string` - -The name of the database to use - -#### Defined in - -[ndk-cache-dexie/src/index.ts:34](https://github.com/nostr-dev-kit/ndk/blob/26ea669eeeadbc93b894cac1f29829e9a41694cb/ndk-cache-dexie/src/index.ts#L34) - -*** - -### debug? - -> `optional` **debug**: `Debugger` - -Debug instance to use for logging - -#### Defined in - -[ndk-cache-dexie/src/index.ts:39](https://github.com/nostr-dev-kit/ndk/blob/26ea669eeeadbc93b894cac1f29829e9a41694cb/ndk-cache-dexie/src/index.ts#L39) - -*** - -### eventCacheSize? - -> `optional` **eventCacheSize**: `number` - -#### Defined in - -[ndk-cache-dexie/src/index.ts:53](https://github.com/nostr-dev-kit/ndk/blob/26ea669eeeadbc93b894cac1f29829e9a41694cb/ndk-cache-dexie/src/index.ts#L53) - -*** - -### eventTagsCacheSize? - -> `optional` **eventTagsCacheSize**: `number` - -#### Defined in - -[ndk-cache-dexie/src/index.ts:54](https://github.com/nostr-dev-kit/ndk/blob/26ea669eeeadbc93b894cac1f29829e9a41694cb/ndk-cache-dexie/src/index.ts#L54) - -*** - -### expirationTime? - -> `optional` **expirationTime**: `number` - -The number of seconds to store events in Dexie (IndexedDB) before they expire -Defaults to 3600 seconds (1 hour) - -#### Defined in - -[ndk-cache-dexie/src/index.ts:45](https://github.com/nostr-dev-kit/ndk/blob/26ea669eeeadbc93b894cac1f29829e9a41694cb/ndk-cache-dexie/src/index.ts#L45) - -*** - -### indexableKinds? - -> `optional` **indexableKinds**: `number`[] \| `"all"` \| `"none"` - -The kinds of events that should be indexed - -#### Default - -```ts -"all" -``` - -#### Defined in - -[ndk-cache-dexie/src/index.ts:60](https://github.com/nostr-dev-kit/ndk/blob/26ea669eeeadbc93b894cac1f29829e9a41694cb/ndk-cache-dexie/src/index.ts#L60) - -*** - -### nip05CacheSize? - -> `optional` **nip05CacheSize**: `number` - -#### Defined in - -[ndk-cache-dexie/src/index.ts:52](https://github.com/nostr-dev-kit/ndk/blob/26ea669eeeadbc93b894cac1f29829e9a41694cb/ndk-cache-dexie/src/index.ts#L52) - -*** - -### profileCacheSize? - -> `optional` **profileCacheSize**: `number` - -Number of profiles to keep in an LRU cache - -#### Defined in - -[ndk-cache-dexie/src/index.ts:50](https://github.com/nostr-dev-kit/ndk/blob/26ea669eeeadbc93b894cac1f29829e9a41694cb/ndk-cache-dexie/src/index.ts#L50) - -*** - -### zapperCacheSize? - -> `optional` **zapperCacheSize**: `number` - -#### Defined in - -[ndk-cache-dexie/src/index.ts:51](https://github.com/nostr-dev-kit/ndk/blob/26ea669eeeadbc93b894cac1f29829e9a41694cb/ndk-cache-dexie/src/index.ts#L51) diff --git a/docs/cache/nostr.md b/docs/cache/nostr.md deleted file mode 100644 index ec166e2a..00000000 --- a/docs/cache/nostr.md +++ /dev/null @@ -1,34 +0,0 @@ -# Nostr Cache Adapter - -NDK cache adapter using a nostr relay as the database. - -This cache adapter is meant to be run against a local relay. This adapter will generate two NDK instances: - -`ndk` -- This talks exclusively to the local relay, with outbox model disabled. -`fallbackNdk` -- This is used to hydrate the cache and uses the outbox model -- each query the cache receives is placed in a queue in the background so that subsequent requests can be served from the cache. All events from other relays - -## Usage - -### Install - -``` -npm add @nostr-dev-kit/ndk-cache-nostr - -``` - -### Add as a cache adapter - -```ts -import NDKCacheAdapterNostr from "@nostr-dev-kit/ndk-cache-nostr"; - -const cacheAdapter = new NDKCacheAdapterNostr({ - relayUrl: 'ws://localhost:5577', -}); -const ndk = new NDK({ cacheAdapter }); -``` - -If running server-side in a NodeJS environment, you should make sure to polyfill `WebSocket`. - -# License - -MIT diff --git a/docs/getting-started/introduction.md b/docs/getting-started/introduction.md deleted file mode 100644 index 50c63b8f..00000000 --- a/docs/getting-started/introduction.md +++ /dev/null @@ -1,35 +0,0 @@ -# Getting started - -## Installation - -```sh -npm add @nostr-dev-kit/ndk -``` - -## Debugging - -NDK uses the `debug` package to assist in understanding what's happening behind the hood. If you are building a package -that runs on the server define the `DEBUG` envionment variable like - -```sh -export DEBUG='ndk:*' -``` - -or in the browser enable it by writing in the DevTools console - -```sh -localStorage.debug = 'ndk:*' -``` - -## Network Debugging - -You can construct NDK passing a netDebug callback to receive network traffic events, particularly useful for debugging applications not running in a browser. - -```ts -const netDebug = (msg: string, relay: NDKRelay, direction?: "send" | "recv") = { - const hostname = new URL(relay.url).hostname; - netDebug(hostname, msg, direction); -} - -ndk = new NDK({ netDebug }); -``` diff --git a/docs/getting-started/signers.md b/docs/getting-started/signers.md deleted file mode 100644 index 47346bef..00000000 --- a/docs/getting-started/signers.md +++ /dev/null @@ -1,38 +0,0 @@ -# Signers - -NDK uses signers _optionally_ passed in to sign events. Note that it is possible to use NDK without signing events (e.g. [to get someone's profile](https://github.com/nostr-dev-kit/ndk-cli/blob/master/src/commands/profile.ts)). - -Signing adapters can be passed in when NDK is instantiated or later during runtime. - -### Using a NIP-07 browser extension (e.g. Alby, nos2x) - -Instatiate NDK with a NIP-07 signer - -```ts -// Import the package, NIP-07 signer and NDK event -import NDK, { NDKEvent, NDKNip07Signer } from "@nostr-dev-kit/ndk"; - -const nip07signer = new NDKNip07Signer(); -const ndk = new NDK({ signer: nip07signer }); -``` - -NDK can now ask for permission, via their NIP-07 extension, to... - -**Read the user's public key** - -```ts -nip07signer.user().then(async (user) => { - if (!!user.npub) { - console.log("Permission granted to read their public key:", user.npub); - } -}); -``` - -**Sign & publish events** - -```ts -const ndkEvent = new NDKEvent(ndk); -ndkEvent.kind = 1; -ndkEvent.content = "Hello, world!"; -ndkEvent.publish(); // This will trigger the extension to ask the user to confirm signing. -``` \ No newline at end of file diff --git a/docs/getting-started/usage.md b/docs/getting-started/usage.md deleted file mode 100644 index 068f985c..00000000 --- a/docs/getting-started/usage.md +++ /dev/null @@ -1,57 +0,0 @@ -# Usage - -## Instantiate an NDK instance - -You can pass an object with several options to a newly created instance of NDK. - -- `explicitRelayUrls` – an array of relay URLs. -- `signer` - an instance of a [signer](#signers). -- `cacheAdapter` - an instance of a [Cache Adapter](#caching) -- `debug` - Debug instance to use for logging. Defaults to `debug("ndk")`. - -```ts -// Import the package -import NDK from "@nostr-dev-kit/ndk"; - -// Create a new NDK instance with explicit relays -const ndk = new NDK({ - explicitRelayUrls: ["wss://a.relay", "wss://another.relay"], -}); -``` - -If the signer implements the `getRelays()` method, NDK will use the relays returned by that method as the explicit relays. - -```ts -// Import the package -import NDK, { NDKNip07Signer } from "@nostr-dev-kit/ndk"; - -// Create a new NDK instance with just a signer (provided the signer implements the getRelays() method) -const nip07signer = new NDKNip07Signer(); -const ndk = new NDK({ signer: nip07signer }); -``` - -Note: In normal client use, it's best practice to instantiate NDK as a singleton class. [See more below](#architecture-decisions--suggestions). - -## Connecting - -After you've instatiated NDK, you need to tell it to connect before you'll be able to interact with any relays. - -```ts -// Import the package -import NDK from "@nostr-dev-kit/ndk"; - -// Create a new NDK instance with explicit relays -const ndk = new NDK({ - explicitRelayUrls: ["wss://a.relay", "wss://another.relay"], -}); -// Now connect to specified relays -await ndk.connect(); -``` - -## Architecture decisions & suggestions - -- Users of NDK should instantiate a single NDK instance. -- That instance tracks state with all relays connected, explicit and otherwise. -- All relays are tracked in a single pool that handles connection errors/reconnection logic. -- RelaySets are assembled ad-hoc as needed depending on the queries set, although some RelaySets might be long-lasting, like the `explicitRelayUrls` specified by the user. -- RelaySets are always a subset of the pool of all available relays. diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 52fac990..00000000 --- a/docs/index.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -# https://vitepress.dev/reference/default-theme-home-page -layout: home - -hero: - name: "NDK Documentation" - tagline: "Nostr Development Kit Docs" - actions: - - theme: brand - text: Getting Started - link: /getting-started/introduction.html - - theme: secondary - text: References - link: https://github.com/nostr-dev-kit/ndk/blob/master/REFERENCES.md - ---- - -NDK is a nostr development kit that makes the experience of building Nostr-related applications, whether they are relays, clients, or anything in between, better, more reliable and overall nicer to work with than existing solutions. \ No newline at end of file diff --git a/docs/internals/subscriptions.md b/docs/internals/subscriptions.md deleted file mode 100644 index ab328ce8..00000000 --- a/docs/internals/subscriptions.md +++ /dev/null @@ -1,205 +0,0 @@ -# Subscriptions Lifecycle -When an application creates a subscription a lot of things happen under the hood. - -Say we want to see `kind:1` events from pubkeys `123`, `456`, and `678`. - -```ts -const subscription = ndk.subscribe({ kinds: [1], authors: [ "123", "456", "678" ]}) -``` - -Since the application level didn't explicitly provide a relay-set, which is the most common use case, NDK will calculate a relay set based on the outbox model plus a variety of some other factors. - -So the first thing we'll do before talking to relays is, decide to *which* relays we should talk to. - -The `calculateRelaySetsFromFilters` function will take care of this and provide us with a map of relay URLs and filters for each relay. - -This means that the query, as specified by the client might be broken into distinct queries specialized for the different relays. - -For example, if we have 3 relays, and the query is for `kind:1` events from pubkeys `a` and `b`, the `calculateRelaySetsFromFilters` function might return something like this: - -```ts -{ - "wss://relay1": { kinds: [1], authors: [ "a" ] }, - "wss://relay2": { kinds: [1], authors: [ "b" ] }, -} -``` - -```mermaid -flowchart TD - Client -->|"kinds: [1], authors: [a, b]"| Subscription1 - Subscription1 -->|"kinds: [1], authors: [a]"| wss://relay1 - Subscription1 -->|"kinds: [1], authors: [b]"| wss://relay2 -``` - -## Subscription bundling -Once the subscription has been split into the filters each relay should receive, the filters are sent to the individual `NDKRelay`'s `NDKRelaySubscriptionManager` instances. - -`NDKRelaySubscriptionManager` is responsible for keeping track of the active and scheduled subscriptions that are pending to be executed within an individual relay. - -This is an important aspect to consider: - -> `NDKSubscription` have a different lifecycle than `NDKRelaySubscription`. For example, a subscription that is set to close after EOSE might still be active within the `NDKSubscription` lifecycle, but it might have been already been closed within the `NDKRelaySubscription` lifecycle, since NDK attempts to keep the minimum amount of open subscriptions at any given time. - -## NDKRelaySubscription -Most NDK subscriptions (by default) are set to be executed with a grouping delay. Will cover what this looks like in practice later, but for now, let's understand than when the `NDKRelaySubscriptionManager` receives an order, it might not execute it right away. - -The different filters that can be grouped together (thus executed as a single `REQ` within a relay) are grouped within the same `NDKRelaySubscription` instance and the execution scheduler is computed respecting what each individual `NDKSubscription` has requested. - -(For example, if a subscription with a `groupingDelay` of `at-least` 500 millisecond has been grouped with another subscription with a `groupingDelay` of `at-least` 1000 milliseconds, the `NDKRelaySubscriptionManager` will wait 1000 ms before sending the `REQ` to this particular relay). - -### Execution -Once the filter is executed at the relay level, the `REQ` is submitted into that relay's `NDKRelayConnectivity` instance, which will take care of monitoring for responses for this particular REQ and communicate them back into the `NDKRelaySubscription` instance. - -Each `EVENT` that comes back as a response to our `REQ` within this `NDKRelaySubscription` instance is then compared with the filters of each `NDKSubscription` that has been grouped and if it matches, it is sent back to the `NDKSubscription` instance. - - -# Example - -If an application requests `kind:1` of pubkeys `123`, `456`, and `789`. It creates an `NDKSubscription`: - -```ts -ndk.subscribe({ kinds: [1], authors: [ "123", "456", "789" ]}, { groupableDelay: 500, groupableDelayType: 'at-least' }) -// results in NDKSubscription1 with filters { kinds: [1], authors: [ "123", "456", "789" ] } -``` - -Some other part of the application requests a kind:7 from pubkey `123` at the same time. - -```ts -ndk.subscribe({ kinds: [7], authors: [ "123" ]}, { groupableDelay: 500, groupableDelayType: 'at-most' }) -// results in NDKSubscription2 with filters { kinds: [7], authors: [ "123" ] } -``` - -```mermaid -flowchart TD - subgraph Subscriptions Lifecycle - A[Application] -->|"kinds: [1], authors: [123, 456, 678], groupingDelay: at-least 500ms"| B[NDKSubscription1] - - A2[Application] -->|"kinds: [7], authors: [123], groupingDelay: at-most 1000ms"| B2[NDKSubscription2] - end -``` - -Both subscriptions have their relayset calculated by NDK and, the resulting filters are sent into the `NDKRelaySubscriptionManager`, which will decide what, and how filters can be grouped. - -```mermaid -flowchart TD - subgraph Subscriptions Lifecycle - A[Application] -->|"kinds: [1], authors: [123, 456, 678], groupingDelay: at-least 500ms"| B[NDKSubscription1] - B --> C{Calculate Relay Sets} - - A2[Application] -->|"kinds: [7], authors: [123], groupingDelay: at-most 1000ms"| B2[NDKSubscription2] - B2 --> C2{Calculate Relay Sets} - end - - subgraph Subscription Bundling - C -->|"kinds: [1], authors: [123]"| E1[wss://relay1 NDKRelaySubscriptionManager] - C -->|"kinds: [1], authors: [456]"| E2[wss://relay2 NDKRelaySubscriptionManager] - C -->|"kinds: [1], authors: [678]"| E3[wss://relay3 NDKRelaySubscriptionManager] - - C2 -->|"kinds: [7], authors: [123]"| E1 - end -``` - -The `NDKRelaySubscriptionManager` will create `NDKRelaySubscription` instances, or add filters to them if `NDKRelaySubscription` with the same filter fingerprint exists. - -```mermaid -flowchart TD - subgraph Subscriptions Lifecycle - A[Application] -->|"kinds: [1], authors: [123, 456, 678], groupingDelay: at-least 500ms"| B[NDKSubscription1] - B --> C{Calculate Relay Sets} - - A2[Application] -->|"kinds: [7], authors: [123], groupingDelay: at-most 1000ms"| B2[NDKSubscription2] - B2 --> C2{Calculate Relay Sets} - end - - subgraph Subscription Bundling - C -->|"kinds: [1], authors: [123]"| E1[wss://relay1 NDKRelaySubscriptionManager] - C -->|"kinds: [1], authors: [456]"| E2[wss://relay2 NDKRelaySubscriptionManager] - C -->|"kinds: [1], authors: [678]"| E3[wss://relay3 NDKRelaySubscriptionManager] - - C2 -->|"kinds: [7], authors: [123]"| E1 - - E1 -->|"Grouping Delay: at-most 1000ms"| F1[NDKRelaySubscription] - E2 -->|"Grouping Delay: at-least 500ms"| F2[NDKRelaySubscription] - E3 -->|"Grouping Delay: at-least 500ms"| F3[NDKRelaySubscription] - end -``` - -Each individual `NDKRelaySubscription` computes the execution schedule of the filters it has received and sends them to the `NDKRelayConnectivity` instance, which in turns sends the `REQ` to the relay. - -```mermaid -flowchart TD - subgraph Subscriptions Lifecycle - A[Application] -->|"kinds: [1], authors: [123, 456, 678], groupingDelay: at-least 500ms"| B[NDKSubscription1] - B --> C{Calculate Relay Sets} - - A2[Application] -->|"kinds: [7], authors: [123], groupingDelay: at-most 1000ms"| B2[NDKSubscription2] - B2 --> C2{Calculate Relay Sets} - end - - subgraph Subscription Bundling - C -->|"kinds: [1], authors: [123]"| E1[wss://relay1 NDKRelaySubscriptionManager] - C -->|"kinds: [1], authors: [456]"| E2[wss://relay2 NDKRelaySubscriptionManager] - C -->|"kinds: [1], authors: [678]"| E3[wss://relay3 NDKRelaySubscriptionManager] - - C2 -->|"kinds: [7], authors: [123]"| E1 - - E1 -->|"Grouping Delay: at-most 1000ms"| F1[NDKRelaySubscription] - E2 -->|"Grouping Delay: at-least 500ms"| F2[NDKRelaySubscription] - E3 -->|"Grouping Delay: at-least 500ms"| F3[NDKRelaySubscription] - - F1 -->|"REQ: kinds: [1, 7], authors: [123]"| G1[NDKRelayConnectivity] - F2 -->|"REQ: kinds: [1], authors: [456]"| G2[NDKRelayConnectivity] - F3 -->|"REQ: kinds: [1], authors: [678]"| G3[NDKRelayConnectivity] - end - - subgraph Execution - G1 -->|"Send REQ to wss://relay1 after 1000ms"| R1[Relay1] - G2 -->|"Send REQ to wss://relay2 after 500ms"| R2[Relay2] - G3 -->|"Send REQ to wss://relay3 after 500ms"| R3[Relay3] - end -``` - -As the events come from the relays, `NDKRelayConnectivity` will send them back to the `NDKRelaySubscription` instance, which will compare the event with the filters of the `NDKSubscription` instances that have been grouped together and send the received event back to the correct `NDKSubscription` instance. - -```mermaid -flowchart TD - subgraph Subscriptions Lifecycle - A[Application] -->|"kinds: [1], authors: [123, 456, 678], groupingDelay: at-least 500ms"| B[NDKSubscription1] - B --> C{Calculate Relay Sets} - - A2[Application] -->|"kinds: [7], authors: [123], groupingDelay: at-most 1000ms"| B2[NDKSubscription2] - B2 --> C2{Calculate Relay Sets} - end - - subgraph Subscription Bundling - C -->|"kinds: [1], authors: [123]"| E1[wss://relay1 NDKRelaySubscriptionManager] - C -->|"kinds: [1], authors: [456]"| E2[wss://relay2 NDKRelaySubscriptionManager] - C -->|"kinds: [1], authors: [678]"| E3[wss://relay3 NDKRelaySubscriptionManager] - - C2 -->|"kinds: [7], authors: [123]"| E1 - - E1 -->|"Grouping Delay: at-most 1000ms"| F1[NDKRelaySubscription] - E2 -->|"Grouping Delay: at-least 500ms"| F2[NDKRelaySubscription] - E3 -->|"Grouping Delay: at-least 500ms"| F3[NDKRelaySubscription] - - F1 -->|"REQ: kinds: [1, 7], authors: [123]"| G1[NDKRelayConnectivity] - F2 -->|"REQ: kinds: [1], authors: [456]"| G2[NDKRelayConnectivity] - F3 -->|"REQ: kinds: [1], authors: [678]"| G3[NDKRelayConnectivity] - end - - subgraph Execution - G1 -->|"Send REQ to wss://relay1 after 1000ms"| R1[Relay1] - G2 -->|"Send REQ to wss://relay2 after 500ms"| R2[Relay2] - G3 -->|"Send REQ to wss://relay3 after 500ms"| R3[Relay3] - - R1 -->|"EVENT: kinds: [1]"| H1[NDKRelaySubscription] - R1 -->|"EVENT: kinds: [7]"| H2[NDKRelaySubscription] - R2 -->|"EVENT"| H3[NDKRelaySubscription] - R3 -->|"EVENT"| H4[NDKRelaySubscription] - - H1 -->|"Matched Filters: kinds: [1]"| I1[NDKSubscription1] - H2 -->|"Matched Filters: kinds: [7]"| I2[NDKSubscription2] - H3 -->|"Matched Filters: kinds: [1]"| I1 - H4 -->|"Matched Filters: kinds: [1]"| I1 - end -``` \ No newline at end of file diff --git a/docs/markdown-examples.md b/docs/markdown-examples.md deleted file mode 100644 index f9258a55..00000000 --- a/docs/markdown-examples.md +++ /dev/null @@ -1,85 +0,0 @@ -# Markdown Extension Examples - -This page demonstrates some of the built-in markdown extensions provided by VitePress. - -## Syntax Highlighting - -VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting: - -**Input** - -````md -```js{4} -export default { - data () { - return { - msg: 'Highlighted!' - } - } -} -``` -```` - -**Output** - -```js{4} -export default { - data () { - return { - msg: 'Highlighted!' - } - } -} -``` - -## Custom Containers - -**Input** - -```md -::: info -This is an info box. -::: - -::: tip -This is a tip. -::: - -::: warning -This is a warning. -::: - -::: danger -This is a dangerous warning. -::: - -::: details -This is a details block. -::: -``` - -**Output** - -::: info -This is an info box. -::: - -::: tip -This is a tip. -::: - -::: warning -This is a warning. -::: - -::: danger -This is a dangerous warning. -::: - -::: details -This is a details block. -::: - -## More - -Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown). diff --git a/docs/mobile/index.md b/docs/mobile/index.md deleted file mode 100644 index e78b9544..00000000 --- a/docs/mobile/index.md +++ /dev/null @@ -1,53 +0,0 @@ -# NDK Mobile - -A React Native/Expo implementation of [NDK (Nostr Development Kit)](https://github.com/nostr-dev-kit/ndk) that provides a complete toolkit for building Nostr applications on mobile platforms. - -## Features - -- 🔐 Multiple signer implementations (NIP-07, NIP-46, Private Key) -- 💾 SQLite-based caching for offline support -- 🔄 Subscription management with automatic reconnection -- 📱 React Native and Expo compatibility -- 🪝 React hooks for easy state management -- 👛 Integrated wallet support - -## Installation - -```sh -npm install @nostr-dev-kit/ndk-mobile -``` - -## Usage - -When using this library don't import `@nostr-dev-kit/ndk` directly, instead import `@nostr-dev-kit/ndk-mobile`. `ndk-mobile` exports the same classes as `ndk`, so you can just swap the import. - -Once you have imported the library, you can use the `NDKProvider` to wrap your application. Pass as props all the typical arguments you would pass to an `new NDK()` call. - -```tsx -function App() { - return {/* your app here */}; -} -``` - -## useNDK() - -`useNDK()` provides access to the `ndk` instance and some other useful information. - -```tsx -function LoginScreen() { - const { ndk, currentUser, login } = useNDK(); - - useEffect(() => { - if (currentUser) alert("you are now logged in as ", +currentUser.pubkey); - }, [currentUser]); - - return - - {#if open} -
    - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - - {#if enableDelete} -
  • - -
  • - {/if} -
- {/if} - - - \ No newline at end of file diff --git a/ndk-svelte-components/src/lib/event/EventThread.svelte b/ndk-svelte-components/src/lib/event/EventThread.svelte deleted file mode 100644 index fa9ec263..00000000 --- a/ndk-svelte-components/src/lib/event/EventThread.svelte +++ /dev/null @@ -1,217 +0,0 @@ - - -
- {#if !skipEvent} -
- {#each Array.from(threadIds.values()).sort(sortThread) as event (event.id)} - - {/each} -
- {/if} - - {#if replyIds.size > 0 || $extraItems} -
- {#each $extraItems??[] as item (item.props.key)} - - - - {/each} - - {#each Array.from(replyIds.values()).sort(sortReplies) as reply (reply.id)} - {#if !whitelistPubkeys || !useWhitelist || whitelistPubkeys.has(reply.pubkey)} - - - - {:else if whitelistPubkeys && useWhitelist && !whitelistPubkeys.has(reply.pubkey)} -
-
- This reply was hidden - -
-
- {/if} - {/each} -
- {/if} -
- - \ No newline at end of file diff --git a/ndk-svelte-components/src/lib/event/content/EventContent.svelte b/ndk-svelte-components/src/lib/event/content/EventContent.svelte deleted file mode 100644 index e9411834..00000000 --- a/ndk-svelte-components/src/lib/event/content/EventContent.svelte +++ /dev/null @@ -1,94 +0,0 @@ - - -{#if event} - {#if event.kind === 1} - - {:else if event.kind === 40} - - {:else if event.kind === 1063} - - {:else if event.kind === 1985} - - {:else if event.kind === 9802} - - {:else if event.kind === 30000} - - {:else if event.kind === 30001} - - {:else if markdownKinds.includes(event.kind)} - - {:else} - - {/if} -{/if} diff --git a/ndk-svelte-components/src/lib/event/content/Kind1.svelte b/ndk-svelte-components/src/lib/event/content/Kind1.svelte deleted file mode 100644 index e9a11e78..00000000 --- a/ndk-svelte-components/src/lib/event/content/Kind1.svelte +++ /dev/null @@ -1,82 +0,0 @@ - - -
-

- {#each groupedContent as { type, value }, i} - {#if type === NEWLINE} - - {:else if type === TOPIC} - - {:else if type === LINK} - - {:else if type === LINKCOLLECTION} - {#if mediaCollectionComponent} - v.value.url)} /> - {:else} -

- {#each value as {type: _type, value: _value}, j} - - {/each} -
- {/if} - {:else if type.match(/^nostr:np(rofile|ub)$/)} - - {:else if type.startsWith('nostr:') && showMedia && isStartOrEnd(i) && value.id !== anchorId} - - {:else if type.startsWith('nostr:')} - - {:else} - {value} - {/if} - {' '} - {/each} -

- -
diff --git a/ndk-svelte-components/src/lib/event/content/Kind1063.svelte b/ndk-svelte-components/src/lib/event/content/Kind1063.svelte deleted file mode 100644 index 4dfab226..00000000 --- a/ndk-svelte-components/src/lib/event/content/Kind1063.svelte +++ /dev/null @@ -1,81 +0,0 @@ - - -
-

File metadata

-
Description: {event.content}
-
-
MIME type: {mimeType}
-
File size: {size}
-
Dimensions: {dim}
- {#if showMedia && SUPPORTED_IMAGE_TYPES.includes(mimeType)} -
File preview:
-
- {event.content} -
- {/if} - {#if showMedia && SUPPORTED_VIDEO_TYPES.includes(mimeType)} -
File preview:
-
- - -
- {/if} -
- - diff --git a/ndk-svelte-components/src/lib/event/content/Kind30000.svelte b/ndk-svelte-components/src/lib/event/content/Kind30000.svelte deleted file mode 100644 index 8b11f1c5..00000000 --- a/ndk-svelte-components/src/lib/event/content/Kind30000.svelte +++ /dev/null @@ -1,29 +0,0 @@ - - -{#each list.items as tag (tag[1])} -
- - -
-{/each} - - \ No newline at end of file diff --git a/ndk-svelte-components/src/lib/event/content/Kind30001.svelte b/ndk-svelte-components/src/lib/event/content/Kind30001.svelte deleted file mode 100644 index 997fd0a3..00000000 --- a/ndk-svelte-components/src/lib/event/content/Kind30001.svelte +++ /dev/null @@ -1,27 +0,0 @@ - - -{#each list.items as tag (tag[1])} -
- -
-{/each} - - \ No newline at end of file diff --git a/ndk-svelte-components/src/lib/event/content/Kind30023.svelte b/ndk-svelte-components/src/lib/event/content/Kind30023.svelte deleted file mode 100644 index 86c33fc5..00000000 --- a/ndk-svelte-components/src/lib/event/content/Kind30023.svelte +++ /dev/null @@ -1,59 +0,0 @@ - - -
- -
- - diff --git a/ndk-svelte-components/src/lib/event/content/Kind9802.svelte b/ndk-svelte-components/src/lib/event/content/Kind9802.svelte deleted file mode 100644 index ae9960b6..00000000 --- a/ndk-svelte-components/src/lib/event/content/Kind9802.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - -
-
- - {@html sanitizeHtml(context || event.content)} -
-
- -{#if ref} -
- -
-{/if} diff --git a/ndk-svelte-components/src/lib/event/content/NoteContentLink.svelte b/ndk-svelte-components/src/lib/event/content/NoteContentLink.svelte deleted file mode 100644 index 1160cc62..00000000 --- a/ndk-svelte-components/src/lib/event/content/NoteContentLink.svelte +++ /dev/null @@ -1,30 +0,0 @@ - - -{#if showMedia && value.isMedia} - {#if !!isImage(value.url)} - {""} - {:else if isVideo(value.url)} - -