-
Notifications
You must be signed in to change notification settings - Fork 27
feat: add NIP-40 expiration event example #347
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 NIP-40 expiration event example #347
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds NIP-40 expiration event functionality to the nostr-java library by introducing example code for creating and sending expiration events, along with an example for text note creation using the NIP01 helper class.
- Adds
ExpirationEventExampleshowing how to manually craft NIP-40 expiration tags - Adds
SpringClientTextEventExampledemonstrating simplified text note creation with NIP01 - Updates documentation to reorganize examples and provide clearer guidance on custom tags
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ExpirationEventExample.java | New example demonstrating NIP-40 expiration event creation and sending |
| SpringClientTextEventExample.java | New example showing simplified text note creation using NIP01 helper |
| CODEBASE_OVERVIEW.md | Updated documentation to reorganize examples and add guidance for new functionality |
| } | ||
|
|
||
| private static void sendWithSpringClient(GenericEvent event) throws Exception { | ||
| try (SpringWebSocketClient client = new SpringWebSocketClient(new StandardWebSocketClient(RELAY_URI), RELAY_URI)) { |
Copilot
AI
Aug 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SpringWebSocketClient constructor is being passed RELAY_URI twice - once as a parameter to StandardWebSocketClient and once directly. This appears redundant and could indicate an incorrect API usage pattern.
| try (SpringWebSocketClient client = new SpringWebSocketClient(new StandardWebSocketClient(RELAY_URI), RELAY_URI)) { | |
| try (SpringWebSocketClient client = new SpringWebSocketClient(new StandardWebSocketClient(RELAY_URI))) { |
nostr-java-examples/src/main/java/nostr/examples/ExpirationEventExample.java
Outdated
Show resolved
Hide resolved
…ntExample.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
GenericTaginExpirationEventExampleNIP01helper to create, sign, and send a text note inSpringClientTextEventExampleTesting
mvn -q verify(fails: Could not find a valid Docker environment. Please see logs and check configuration)https://chatgpt.com/codex/tasks/task_b_689a94c7d4e48331bd0b17086ef05df5