Skip to content

Update NDK to v2.12.2 #2041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 2, 2025
Merged

Update NDK to v2.12.2 #2041

merged 3 commits into from
Apr 2, 2025

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented Mar 29, 2025

Description

This fixes #2038. The issue was not a timeout (there is no timeout for authentication) but we had to upgrade NDK.

Additional context

I don't know what changed in NDK to make it work. NDK has no documentation of releases, no changelog or working developer documentation. Maybe the spec changed, but I see no breaking change in its history.

Guess I have to run a diff myself. Will do so tomorrow. Converting to draft until we can be sure there is nothing sketchy going on.

TODO:

  • find out what changed such that it broke?
  • test remote signing
  • test nwc
  • test zap receipts
  • test crossposting

(do we have other nostr stuff?)

Video

2025-03-28.23-55-40.mp4

Checklist

Are your changes backwards compatible? Please answer below:

yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

7. Tested with nak, see video. Also tested other nostr stuff, see checkboxes.

For frontend changes: Tested on mobile, light and dark mode? Please answer below:

n/a

Did you introduce any new environment variables? If so, call them out explicitly here:

no

Copy link

socket-security bot commented Mar 29, 2025

New and updated dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@cashu/[email protected] network +6 2.39 MB egge21m
npm/@noble/[email protected]1.8.1 None 0 1.64 MB paulmillr
npm/@nostr-dev-kit/[email protected] Transitive: environment, eval, filesystem, network +32 29.6 MB pablof7z
npm/@nostr-dev-kit/[email protected]2.12.2 Transitive: environment, eval, filesystem +27 6.29 MB pablof7z

View full report↗︎

@ekzyis ekzyis marked this pull request as draft March 29, 2025 05:17
@ekzyis
Copy link
Member Author

ekzyis commented Mar 29, 2025

Tested attaching NWC send. It broke:

_nostr_dev_kit_ndk__WEBPACK_IMPORTED_MODULE_3__.NDKNwc is not a constructor

@ekzyis ekzyis changed the title Update NDK to v2.12.5 Update NDK to v2.12.2 Mar 29, 2025
@ekzyis ekzyis force-pushed the fix-nip46 branch 2 times, most recently from cff79f2 to 6030b58 Compare March 30, 2025 20:51
@@ -17,10 +17,12 @@
"@apollo/server": "^4.11.0",
"@as-integrations/next": "^3.1.0",
"@auth/prisma-adapter": "^2.7.0",
"@cashu/cashu-ts": "^2.4.1",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunately required even though it's supposed to be a peer dependency of ndk-wallet (which is itself a peer dependency).

If I don't install this, the app fails to start:

app  | 2025-03-30T21:06:26.954347000Z  ⨯ ./node_modules/@nostr-dev-kit/ndk-wallet/dist/index.mjs:344:1
app  | 2025-03-30T21:06:26.954485000Z Module not found: Can't resolve '@cashu/cashu-ts'
app  | 2025-03-30T21:06:26.954523000Z
app  | 2025-03-30T21:06:26.954556000Z https://nextjs.org/docs/messages/module-not-found
app  | 2025-03-30T21:06:26.954595000Z
app  | 2025-03-30T21:06:26.954632000Z Import trace for requested module:
app  | 2025-03-30T21:06:26.954660000Z ./wallets/nwc/index.js
app  | 2025-03-30T21:06:26.954684000Z ./wallets/nwc/client.js
app  | 2025-03-30T21:06:26.954706000Z ./wallets/client.js
app  | 2025-03-30T21:06:26.954740000Z ./wallets/index.js
app  | 2025-03-30T21:06:26.954769000Z ./components/pay-bounty.js
app  | 2025-03-30T21:06:26.954795000Z ./components/comment.js
app  | 2025-03-30T21:06:26.954822000Z ./components/items.js
app  | 2025-03-30T21:06:26.954850000Z ./pages/~/index.js
app  | 2025-03-30T21:06:26.982840000Z    automatically enabled Fast Refresh for 1 custom loader
app  | 2025-03-30T21:06:29.830712000Z  ⨯ ./node_modules/@nostr-dev-kit/ndk-wallet/dist/index.mjs:344:1
app  | 2025-03-30T21:06:29.830824000Z Module not found: Can't resolve '@cashu/cashu-ts'
app  | 2025-03-30T21:06:29.830861000Z
app  | 2025-03-30T21:06:29.830892000Z https://nextjs.org/docs/messages/module-not-found
app  | 2025-03-30T21:06:29.830928000Z
app  | 2025-03-30T21:06:29.830959000Z Import trace for requested module:
app  | 2025-03-30T21:06:29.831002000Z ./wallets/nwc/index.js
app  | 2025-03-30T21:06:29.831036000Z ./wallets/nwc/client.js
app  | 2025-03-30T21:06:29.831068000Z ./wallets/client.js
app  | 2025-03-30T21:06:29.831098000Z ./wallets/index.js
app  | 2025-03-30T21:06:29.831141000Z ./pages/_app.js

@ekzyis
Copy link
Member Author

ekzyis commented Mar 30, 2025

Attached the diff of ndk v2.10.5 to v.2.12.2. The answer to why it broke should be in there.

commit c2930cde14ac9c7b2f9a6e8494d43e03a99262ad
Author: ekzyis <[email protected]>
Date:   Sat Mar 29 13:08:49 2025 -0500

    ndk-2.10.5 > ndk-2.12.2

 dist/index.d.mts                           | 1571 +++--
 dist/index.d.ts                            | 1571 +++--
 dist/index.js                              | 9586 +++++++++++++++-------------
 dist/index.mjs                             | 9576 ++++++++++++++-------------
 dist/test/index.d.mts                      | 2522 ++++++++
 dist/test/index.d.ts                       | 2522 ++++++++
 dist/test/index.js                         | 4897 ++++++++++++++
 dist/test/index.mjs                        | 4859 ++++++++++++++
 package.json                               |   14 +-
 src/cache/index.ts                         |   19 +-
 src/events/content-tagger.test.ts          |   21 +-
 src/events/content-tagger.ts               |   52 +-
 src/events/encryption.test.ts              |  220 +
 src/events/encryption.ts                   |   83 +
 src/events/gift-wrapping.ts                |  108 +
 src/events/index.test.ts                   |  187 +-
 src/events/index.ts                        |  254 +-
 src/events/kinds/cashu/token.ts            |  154 +
 src/events/kinds/cashu/tx.test.ts          |   43 +
 src/events/kinds/cashu/tx.ts               |  180 +
 src/events/kinds/image.ts                  |   50 +
 src/events/kinds/index.ts                  |   25 +-
 src/events/kinds/lists/index.ts            |   13 +
 src/events/kinds/nutzap/index.ts           |   76 +-
 src/events/kinds/video.ts                  |   40 +-
 src/events/nip04.ts                        |   47 -
 src/events/nip19.test.ts                   |    4 +-
 src/events/nip19.ts                        |    4 +-
 src/events/repost.test.ts                  |   34 +
 src/events/repost.ts                       |    9 +-
 src/events/serializer.ts                   |    4 +-
 src/events/wrap.ts                         |   39 +
 src/index.ts                               |   44 +-
 src/ndk/index.ts                           |  156 +-
 src/nwc/get_balance.ts                     |   10 -
 src/nwc/get_info.ts                        |   16 -
 src/nwc/index.test.ts                      |   34 -
 src/nwc/index.ts                           |  190 -
 src/nwc/pay_invoice.ts                     |   13 -
 src/nwc/req.ts                             |   93 -
 src/relay/auth-policies.ts                 |   12 +-
 src/relay/connectivity.test.ts             |    2 +-
 src/relay/connectivity.ts                  |   12 +-
 src/relay/index.test.ts                    |    3 +-
 src/relay/index.ts                         |    6 +-
 src/relay/pool/index.test.ts               |    7 +-
 src/relay/pool/index.ts                    |   81 +-
 src/relay/sets/index.ts                    |   17 +-
 src/relay/sub-manager.ts                   |   28 +-
 src/relay/subscription.test.ts             |    4 +-
 src/relay/subscription.ts                  |   41 +-
 src/signers/index.ts                       |   47 +-
 src/signers/nip07/index.ts                 |  123 +-
 src/signers/nip46/backend/nip04-decrypt.ts |    2 +-
 src/signers/nip46/backend/nip04-encrypt.ts |    2 +-
 src/signers/nip46/backend/nip44-decrypt.ts |    2 +-
 src/signers/nip46/backend/nip44-encrypt.ts |    2 +-
 src/signers/nip46/index.test.ts            |   16 +-
 src/signers/nip46/index.ts                 |   83 +-
 src/signers/nip46/rpc.ts                   |   55 +-
 src/signers/private-key/index.test.ts      |    2 +-
 src/signers/private-key/index.ts           |   75 +-
 src/subscription/grouping.test.ts          |   34 +-
 src/subscription/grouping.ts               |   10 +-
 src/subscription/index.ts                  |  225 +-
 src/subscription/manager.test.ts           |   45 +
 src/subscription/manager.ts                |   64 +-
 src/subscription/utils.ts                  |    4 +-
 src/thread/index.test.ts                   |   49 +-
 src/thread/index.ts                        |   90 +-
 src/types.ts                               |    1 +
 src/user/index.test.ts                     |   19 +-
 src/user/index.ts                          |  249 +-
 src/user/profile.ts                        |   14 +-
 src/utils/filter.ts                        |   38 +
 src/utils/get-users-relay-list.ts          |   11 +-
 src/utils/imeta.test.ts                    |   92 +
 src/utils/imeta.ts                         |   71 +
 src/utils/normalize-url.ts                 |    7 +-
 src/zapper/index.test.ts                   |   23 +-
 src/zapper/index.ts                        |  453 +-
 src/zapper/nip57.ts                        |    5 +
 src/zapper/nip61.ts                        |   12 +-
 83 files changed, 29791 insertions(+), 11687 deletions(-)

diff-ndk-2.10.5-to-2.12.2.txt

@ekzyis ekzyis marked this pull request as ready for review March 30, 2025 21:36
@ekzyis ekzyis requested a review from huumn March 30, 2025 21:36
@huumn huumn merged commit 2cf0f1d into master Apr 2, 2025
6 checks passed
@huumn huumn deleted the fix-nip46 branch April 2, 2025 22:20
@ekzyis ekzyis mentioned this pull request Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Login with Amber doesn't work
2 participants