Skip to content
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

Fail while creating NDK with nip07signer if no extension present #291

Open
ktecho opened this issue Dec 24, 2024 · 2 comments
Open

Fail while creating NDK with nip07signer if no extension present #291

ktecho opened this issue Dec 24, 2024 · 2 comments

Comments

@ktecho
Copy link

ktecho commented Dec 24, 2024

I'm using this so I can get and publish message to relays:

const nip07signer = new NDKNip07Signer();
const ndk = new NDK({
  explicitRelayUrls: [
    ...
  ],
  signer: nip07signer
});
await ndk.connect(2000);

If a user tries to use this page with no Nostr extension, it fails with NIP-07 extension not available. I think it should create NDK and connect fine, and fail only when trying to do a write (publish), but it should work fine if the user is just trying to read (getUser or fetchEvents).

@ktecho ktecho changed the title Fail at connect with nip07signer if no extension present Fail while creating NDK with nip07signer if no extension present Dec 24, 2024
@pablof7z
Copy link
Collaborator

If you try to use a NIP-07 signer and one is not available it should fail; to be clear, the ndk creation and connection would happen, it’s just the instantiation of the signer when it can’t start is throwing

@ktecho
Copy link
Author

ktecho commented Dec 24, 2024

If you try to use a NIP-07 signer and one is not available it should fail; to be clear, the ndk creation and connection would happen, it’s just the instantiation of the signer when it can’t start is throwing

It fails while doing the new NDK for me, and then again while connecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants