Skip to content

Conversation

@nogringo
Copy link
Collaborator

@nogringo nogringo commented Aug 2, 2025

No description provided.

@codecov
Copy link

codecov bot commented Aug 2, 2025

Codecov Report

❌ Patch coverage is 70.23256% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.50%. Comparing base (118de83) to head (83f2d35).
⚠️ Report is 39 commits behind head on master.

Files with missing lines Patch % Lines
...ndk/lib/domain_layer/usecases/bunkers/bunkers.dart 60.52% 30 Missing ⚠️
...n_layer/usecases/bunkers/models/nostr_connect.dart 0.00% 18 Missing ⚠️
...yer/usecases/bunkers/models/bunker_connection.dart 10.00% 9 Missing ⚠️
...layer/repositories/signers/nip46_event_signer.dart 96.59% 3 Missing ⚠️
...k/lib/domain_layer/usecases/accounts/accounts.dart 70.00% 3 Missing ⚠️
packages/ndk/lib/presentation_layer/ndk.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
+ Coverage   71.23%   71.50%   +0.26%     
==========================================
  Files         119      124       +5     
  Lines        4178     4393     +215     
==========================================
+ Hits         2976     3141     +165     
- Misses       1202     1252      +50     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@1-leo 1-leo self-requested a review August 3, 2025 08:56
@1-leo 1-leo added the enhancement New feature or request label Aug 3, 2025
@1-leo 1-leo added this to ndk-dev Aug 3, 2025
@1-leo 1-leo moved this to In Progress in ndk-dev Aug 3, 2025
@1-leo 1-leo added this to the 0.6 milestone Aug 3, 2025
@1-leo 1-leo linked an issue Aug 3, 2025 that may be closed by this pull request
Copy link
Contributor

@1-leo 1-leo left a comment

Choose a reason for hiding this comment

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

Interesting approach using a separate NDK instance. Actually has some benefits.
Have you thought about integrating it directly? Not possible?

I think it makes sense to move the code into the NDK package. We can still use a separate NDK if it makes sense architecturally.

I marked one problem with generateRandomString().

Thx for implementing!

@1-leo
Copy link
Contributor

1-leo commented Aug 3, 2025

When merging, we should also add a method to the accounts usecase to make it even more integrated.

@nogringo nogringo requested a review from 1-leo August 3, 2025 16:36
Copy link
Contributor

@1-leo 1-leo left a comment

Choose a reason for hiding this comment

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

Noticed some minor issues. Overall, very solid!
We can fine-tune the API in another PR if you need this feaure soon.
On Wednesday we should discuss whether to make getPublicKeyAsync the default.

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably good to split it into several steps.
Like:

connectionSettings first time

  1. send login request
  2. auth with url param
  3. create and store connectionSettings

connectionSettings already stored

  1. read connection settings
  2. create signer
  3. login with ndk

In general what do you think about automating this further. Like providing connectionSettins storage and (semi)autoLogin if a connectionSetting is stored?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's a good idea to persist everything.

@@ -0,0 +1,41 @@
import 'package:ndk/shared/nips/nip01/helpers.dart';

enum BunkerRequestMethods {
Copy link
Contributor

Choose a reason for hiding this comment

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

you could use connect('connect') or getPublicKey('get_public_key') here, making methodToString redundant.


late Bip340EventSigner localEventSigner;

Nip46EventSigner({required this.connectionSettings}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

a good thing to have would be to pass in other EventVerifiers (like rust verifier) as an optional parameter

@frnandu frnandu self-requested a review August 6, 2025 15:32
Copy link
Collaborator

@frnandu frnandu left a comment

Choose a reason for hiding this comment

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

see #213

@1-leo
Copy link
Contributor

1-leo commented Aug 13, 2025

  • tests (needs support in mock relay)
  • docs

@nogringo nogringo merged commit 447e42b into master Aug 14, 2025
2 of 4 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in ndk-dev Aug 14, 2025
@nogringo nogringo deleted the nip46-event-signer branch August 14, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

nsecbunker nip46 | nip05login

4 participants