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

feat: add NWC client method to get wallet service supported methods #206

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

rolznz
Copy link
Contributor

@rolznz rolznz commented Feb 22, 2024

As per https://github.com/nostr-protocol/nips/blob/master/47.md#theory-of-operation to get "info" (actually just supported methods) from the relay

src/NWCClient.ts Outdated Show resolved Hide resolved
src/NWCClient.ts Outdated
@@ -181,6 +181,35 @@ export class NWCClient {
return new NWCClient(options);
}

static async getWalletServiceSupportedMethods(
Copy link
Contributor

Choose a reason for hiding this comment

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

how about making on the instance? why do you think it should be on the class level?

client = NWCClient.withNewSecret(options);
await client.supportedMethods();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense. Sorry, I originally thought we could request the methods just using the relay URL, but then they can't be filtered by the wallet service pubkey (just in case).

Thanks!

@rolznz rolznz merged commit 30fc479 into master Feb 22, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants