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

0.6 #159

Merged
merged 149 commits into from
May 6, 2024
Merged

0.6 #159

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
584ec73
Removing dependencies unnecessaries
guilhermegps Feb 17, 2024
c22ad24
NIP01 refact
guilhermegps Feb 18, 2024
8a533db
Typifying events for nips
guilhermegps Feb 24, 2024
a90b7ef
NIP04 refact
guilhermegps Feb 24, 2024
af86be7
Fixing NIP04
guilhermegps Feb 26, 2024
c977a9b
NIP08 refact
guilhermegps Feb 29, 2024
8ccea9e
I was "fixing" this until to notice that NIP08 was deprecated in favor
guilhermegps Mar 1, 2024
3a7266e
NIP-04: Encrypted Direct Message --- unrecommended: deprecated in favor
guilhermegps Mar 1, 2024
4426dfd
NIP09 refact
guilhermegps Mar 6, 2024
f2052ac
Refacting NIP16 and NIP33
guilhermegps Mar 6, 2024
9b15908
Refacting NIP25
guilhermegps Mar 6, 2024
ee22680
Example ReplaceableEvent
guilhermegps Mar 7, 2024
9ba2336
NIP44 implementation
Mar 7, 2024
16f34f1
Refactoring NIP05
guilhermegps Mar 9, 2024
c4240f6
Refactoring NIP30
guilhermegps Mar 9, 2024
cca58d1
Refactoring. Implementing NIP-44
Mar 11, 2024
bbee3ae
Merge pull request #91 from tcheeric/feature/changes_modularization
tcheeric Mar 11, 2024
3e62d63
Merge pull request #93 from tcheeric/feature/#92_NIP-30
tcheeric Mar 11, 2024
a7a342f
Merge remote-tracking branch 'upstream/develop' into develop
avlo Mar 11, 2024
279e25b
initial merge
avlo Mar 12, 2024
2803d11
Fixing NIP01 search by filters
guilhermegps Mar 12, 2024
4c7ff82
Refactoring.
Mar 11, 2024
be8be4e
Merge branch '0.4-SNAPSHOT' into develop
Mar 12, 2024
7089abe
nip99
avlo Mar 12, 2024
acf4a83
Implemented NIP-44
Mar 13, 2024
567cf9e
Merge branch 'NIP-44' into feature/#92_NIP-01_filters
tcheeric Mar 13, 2024
3220722
Merge pull request #96 from tcheeric/feature/#92_NIP-01_filters
tcheeric Mar 13, 2024
dd19a5c
Add missing import.
Mar 13, 2024
4492b4f
Merge pull request #95 from tcheeric/feature/#92_NIP-01_filters
guilhermegps Mar 13, 2024
6762510
Merge branch 'develop' into NIP-44-and-PR95_filters
guilhermegps Mar 13, 2024
85d2ff3
Merge pull request #97 from tcheeric/NIP-44-and-PR95_filters
guilhermegps Mar 13, 2024
4db386e
ongoing
avlo Mar 14, 2024
b3b6aae
Refactoring
Mar 14, 2024
b90f3f7
Minimal logging changes
Mar 15, 2024
a63c6db
merge upstream develop
avlo Mar 15, 2024
14c5b3a
integrating nip99
avlo Mar 16, 2024
096853b
rename
avlo Mar 16, 2024
f4bcd14
working snapshot
avlo Mar 16, 2024
dd680ea
Using single class imports
Mar 17, 2024
bc87c6b
Issue #100
Mar 17, 2024
5ffe0fd
Merge pull request #103 from tcheeric/NIP-44-improvements
guilhermegps Mar 17, 2024
e052295
Removing non-existent dependency
guilhermegps Mar 17, 2024
bfe2b40
https://github.com/tcheeric/nostr-java/issues/98
Mar 18, 2024
d42fb30
https://github.com/tcheeric/nostr-java/issues/98
Mar 18, 2024
c01bd8d
https://github.com/tcheeric/nostr-java/issues/98
Mar 18, 2024
8f0cf68
https://github.com/tcheeric/nostr-java/issues/98
Mar 18, 2024
adaccd6
https://github.com/tcheeric/nostr-java/issues/98
Mar 18, 2024
71d80a6
https://github.com/tcheeric/nostr-java/issues/98
Mar 18, 2024
8d50615
https://github.com/tcheeric/nostr-java/issues/98
Mar 18, 2024
682aa25
Refactoring
Mar 18, 2024
504ef0a
Refactoring
Mar 18, 2024
2041ac4
Merge pull request #105 from tcheeric/feature/fix_98
guilhermegps Mar 19, 2024
d84c77b
Merge branch 'develop' into feature/0.4-SNAPSHOT-refatoring
guilhermegps Mar 19, 2024
ea7e4bd
Merge pull request #106 from tcheeric/feature/0.4-SNAPSHOT-refatoring
guilhermegps Mar 19, 2024
a5ee3ad
Multiple filters per REQ request #88
Mar 23, 2024
b8c401f
Added the Nostr Public Channel id.
Mar 23, 2024
8f86c87
Added the Nostr Public Channel id.
Mar 23, 2024
5383c53
addition NIP99
avlo Mar 23, 2024
52036c6
Merge pull request #107 from tcheeric/feature/Issue_88
guilhermegps Mar 23, 2024
5780629
nip33 replaced and simplified in NIP-01
avlo Mar 23, 2024
2f08fbe
merge upstream developer branch
avlo Mar 24, 2024
e695590
cleanup
avlo Mar 24, 2024
7807b27
pom secp256k1 removal
avlo Mar 24, 2024
1bf139b
removed unnecessary ClassifiedListingEventMessage
avlo Mar 25, 2024
0bd965b
Upgrade lombat patch version to avoid java.lang.NoSuchFieldError
kuiperanon Mar 26, 2024
a5d246d
Substitute openbeans for java.beans to support Android
kuiperanon Mar 26, 2024
417749d
Merge pull request #121 from kuiperanon/develop
tcheeric Mar 26, 2024
db4d3b3
Merge branch 'develop' of github.com:tcheeric/nostr-java into develop…
avlo Mar 26, 2024
212d4cd
Merge branch 'develop' into develop-support-android
kuiperanon Mar 27, 2024
6830781
Use property defined in root pom.xml for openbeans value
kuiperanon Mar 27, 2024
e9e2b4f
NIP-42 - Relay Authentication #80
Apr 2, 2024
6188874
NIP-42 - Relay Authentication #80
Apr 2, 2024
ee5e1cd
NIP-42 - Relay Authentication #80
Apr 2, 2024
1c6a608
REQ message filters are not serialized correctly #124
Apr 2, 2024
afe5a38
REQ message filters are not serialized correctly #124
Apr 2, 2024
18c9da5
REQ message filters are not serialized correctly #124
Apr 2, 2024
9b9ceaa
Merge pull request #125 from tcheeric/feature/bug_124
tcheeric Apr 2, 2024
98fbb85
added ValueTag interface and updated EventTag and PubKeyTag to implem…
avlo Apr 3, 2024
c4ffb58
Merge branch 'develop' of github.com:tcheeric/nostr-java into develop
avlo Apr 3, 2024
2ae7f0c
Merge branch 'add-value_tag-interface' into develop__add-value_tag-in…
avlo Apr 3, 2024
dc624a7
Restructure NIP46 JSON serializable objects
kuiperanon Apr 3, 2024
05acb5f
updates
avlo Apr 3, 2024
531b0cc
updates
avlo Apr 3, 2024
3b4345c
parameter updates
avlo Apr 3, 2024
f56fa1a
Merge pull request #128 from kuiperanon/develop-fix-nip46
tcheeric Apr 3, 2024
ac9c7b8
Merge pull request #122 from kuiperanon/develop-support-android
tcheeric Apr 3, 2024
56ae792
NIP-42 - Relay Authentication #80
Apr 4, 2024
266f3dc
NIP-42 - Relay Authentication #80
Apr 4, 2024
1859ab5
ongoing classified event
avlo Apr 4, 2024
50702b7
arraylist parameter into list parameter
avlo Apr 5, 2024
f71d5d9
Merge branch 'develop' of github.com:tcheeric/nostr-java into develop
avlo Apr 5, 2024
2872a95
Merge branch 'develop' into classified-event-tags
avlo Apr 5, 2024
a379667
Relay Connection Management #130
Apr 5, 2024
e70ce6a
Relay Connection Management #130
Apr 5, 2024
f6ee8b7
Refactoring
Apr 5, 2024
7e1ecfe
Only send AUTH messages to the relay mentioned in the tag #129
Apr 6, 2024
06ceeca
classified price tag is single item, not array
avlo Apr 6, 2024
a3069eb
NIP-42 - Relay Authentication #80
Apr 6, 2024
573cb13
NIP-42 - Relay Authentication #80
Apr 6, 2024
614eda9
NIP-42 - Relay Authentication #80
Apr 6, 2024
75e3b92
0.5-SNAPSHOT
Apr 6, 2024
800c5ba
price tag fixes
avlo Apr 7, 2024
3c95264
fixed id
avlo Apr 7, 2024
0a38a1a
Replace jetty with jdk's native libraries for http and websocket con…
Apr 12, 2024
164f45e
Replace jetty with jdk's native libraries for http and websocket con…
Apr 12, 2024
59547e3
Replace jetty with jdk's native libraries for http and websocket con…
Apr 12, 2024
b75c064
Replace jetty with jdk's native libraries for http and websocket con…
Apr 12, 2024
5109235
Minor changes
Apr 12, 2024
d436638
Use ThreadPool in the ThreadUtil class #136
Apr 12, 2024
9cf0fcc
Minor changes
Apr 12, 2024
7cd36c0
Minor changes
Apr 12, 2024
76d90db
Bouncy Castle For Java LDAP injection vulnerability #135
Apr 13, 2024
a347589
Remove unused, deprecated class from the base module #142
Apr 13, 2024
5ef525b
Throw an exception when the client cannot connect to the relay #141
Apr 13, 2024
a7e6112
Fix test method ClientTest.disconnect #132
Apr 13, 2024
fe205b8
genericTagQueryList does not correctly serialize #144
Apr 17, 2024
fe646bc
genericTagQueryList does not correctly serialize #144
Apr 21, 2024
3d87051
genericTagQueryList does not correctly serialize #144
Apr 21, 2024
7c39481
Merge branch 'feature/0.6-SNAPSHOT' into feature/Issue_144
tcheeric Apr 21, 2024
b6080b9
Merge pull request #149 from tcheeric/feature/Issue_144
tcheeric Apr 21, 2024
e4b198a
Fixing console log
guilhermegps Apr 20, 2024
d939f80
Fixing connetion with relays
guilhermegps Apr 21, 2024
fa48ae1
Merge pull request #150 from tcheeric/feature/0.6-SNAPSHOT-GPS
tcheeric Apr 21, 2024
06e786d
Fix issue with websocket listeners and connection errors
Apr 21, 2024
b5b39f9
fix #147
Apr 23, 2024
d37cec0
NIP-42 - Relay Authentication #80
Apr 24, 2024
eb34a14
Code cleanup
Apr 24, 2024
1355db1
Improve logging #152
Apr 25, 2024
98ef90f
Fix #153
Apr 25, 2024
2d1f6d3
Fix #153
Apr 25, 2024
7ca68f6
Deprecate NipUtil.checkSupport(...) #154
Apr 25, 2024
b15584a
Remove unused classes
Apr 25, 2024
434ca2b
README file #98
Apr 25, 2024
1b6e284
genericTagQueryList does not correctly serialize #144
Apr 17, 2024
1b1d62a
Merge branch 'feature/0.6-SNAPSHOT' into develop
Apr 25, 2024
64b4839
Deprecate NipUtil.checkSupport(...) #154
Apr 25, 2024
2cdb090
Merge remote-tracking branch 'upstream/develop' into develop
avlo Apr 25, 2024
e75062f
merge
avlo Apr 26, 2024
9f91f11
Minor typo
Apr 26, 2024
b31f6cd
Merge remote-tracking branch 'upstream/develop' into develop
avlo Apr 29, 2024
a39d50a
new classes added as per NIP-99 specification (ClassifiedListingEvent…
avlo Apr 29, 2024
0974591
Tag cleanup
avlo Apr 29, 2024
61d27bc
writeNumber() is appropriate serializer for BigDecimal
avlo Apr 29, 2024
3d48079
maintain original formatting
avlo Apr 29, 2024
37e8f35
Merge pull request #156 from avlo/develop
tcheeric Apr 29, 2024
6650525
Event signature verification #157
May 1, 2024
1888164
Merge pull request #158 from tcheeric/feature/Issue_157
tcheeric May 1, 2024
261d393
version 0.6
May 6, 2024
35982a7
Merge remote-tracking branch 'origin/develop' into develop
May 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ nbdist/

### NetBeans specific ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml

Expand Down
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,45 @@

Introducing the nostr-java library, a solution written in java for generating, signing, and publishing nostr events to relays.

For detailed instructions on how to utilise the library, please refer to the [nostr-client](https://github.com/tcheeric/nostr-client/) repository.
## Requirements
- Maven
- Java 19+

## Usage
To use the library in your project, add the following dependency to your pom.xml file:
```xml
<dependency>
<groupId>com.github.tcheeric.nostr-java</groupId>
<artifactId>nostr-java-api</artifactId>
<version>${nostr.java.version}</version>
</dependency>
```

I recommend having a look at the [nostr-example](https://github.com/tcheeric/nostr-java/tree/main/nostr-java-examples) module and the [nostr-client](https://github.com/tcheeric/nostr-client/) project for a simple example on how to use the library.

## Supported NIPs
The following NIPs are supported by the API out-of-the-box:
- [NIP-1](https://github.com/nostr-protocol/nips/blob/master/01.md)
- [NIP-2](https://github.com/nostr-protocol/nips/blob/master/02.md)
- [NIP-3](https://github.com/nostr-protocol/nips/blob/master/03.md)
- [NIP-4](https://github.com/nostr-protocol/nips/blob/master/04.md)
- [NIP-5](https://github.com/nostr-protocol/nips/blob/master/05.md)
- [NIP-8](https://github.com/nostr-protocol/nips/blob/master/08.md)
- [NIP-9](https://github.com/nostr-protocol/nips/blob/master/09.md)
- [NIP-12](https://github.com/nostr-protocol/nips/blob/master/12.md)
- [NIP-14](https://github.com/nostr-protocol/nips/blob/master/14.md)
- [NIP-15](https://github.com/nostr-protocol/nips/blob/master/15.md)
- [NIP-20](https://github.com/nostr-protocol/nips/blob/master/20.md)
- [NIP-23](https://github.com/nostr-protocol/nips/blob/master/23.md)
- [NIP-25](https://github.com/nostr-protocol/nips/blob/master/25.md)
- [NIP-28](https://github.com/nostr-protocol/nips/blob/master/28.md)
- [NIP-30](https://github.com/nostr-protocol/nips/blob/master/30.md)
- [NIP-32](https://github.com/nostr-protocol/nips/blob/master/32.md)
- [NIP-40](https://github.com/nostr-protocol/nips/blob/master/40.md)
- [NIP-42](https://github.com/nostr-protocol/nips/blob/master/42.md)
- [NIP-44](https://github.com/nostr-protocol/nips/blob/master/44.md)
- [NIP-46](https://github.com/nostr-protocol/nips/blob/master/46.md)
- [NIP-57](https://github.com/nostr-protocol/nips/blob/master/57.md)

## Dev Discussion Group:
- Nostr Public Channel: nostr:nevent1qqszqdmxg26sehmnyrcu2ler8azz6wyj6fh0qg3ad5fnnm6xfqqvhzcppamhxue69uhkummnw3ezumt0d5pzpl7nwh45p66gvet2q28dhjpcyh6clux4cjsm5gh7waza9pzjnmgglv06ew
17 changes: 11 additions & 6 deletions nostr-java-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>nostr-java</groupId>
<artifactId>nostr-java</artifactId>
<version>0.3.1</version>
<version>0.6</version>
</parent>
<artifactId>nostr-java-api</artifactId>
<packaging>jar</packaging>
Expand All @@ -26,17 +26,22 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nostr-java-ws-handler-interface</artifactId>
<artifactId>nostr-java-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nostr-java-client</artifactId>
<groupId>nostr-java</groupId>
<artifactId>nostr-java-encryption</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nostr-java-ws-handler-command-provider</artifactId>
<groupId>nostr-java</groupId>
<artifactId>nostr-java-encryption-nip04</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>nostr-java</groupId>
<artifactId>nostr-java-encryption-nip44</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Expand Down
11 changes: 6 additions & 5 deletions nostr-java-api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/module-info.java to edit this template
*/

module nostr.api {
requires nostr.base;
requires nostr.util;
requires nostr.event;
requires nostr.id;
requires nostr.client;
requires nostr.context;
requires nostr.context.impl;
requires nostr.encryption;
requires nostr.encryption.nip04dm;
requires nostr.encryption.nip44dm;

requires com.fasterxml.jackson.databind;

requires lombok;
requires java.logging;
requires nostr.crypto;

exports nostr.api;
}
102 changes: 102 additions & 0 deletions nostr-java-api/src/main/java/nostr/api/EventNostr.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package nostr.api;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import nostr.api.factory.impl.GenericEventFactory;
import nostr.base.PublicKey;
import nostr.event.BaseTag;
import nostr.event.impl.GenericEvent;
import nostr.id.Identity;

import java.util.Map;

/**
* @author guilhermegps
*/
@Getter
@NoArgsConstructor
public abstract class EventNostr<T extends GenericEvent> extends Nostr {

@Setter
private T event;

private PublicKey recipient;

public EventNostr(@NonNull Identity sender) {
super(sender);
}

public EventNostr sign() {
super.sign(getSender(), event);

return this;
}

public T send() {
return this.send(getRelays());
}

public T send(Map<String, String> relays) {
super.send(this.event, relays);

return this.event;
}

public T signAndSend() {
return this.signAndSend(getRelays());
}

public T signAndSend(Map<String, String> relays) {
return (T) sign().send(relays);
}

public EventNostr setSender(@NonNull Identity sender) {
super.setSender(sender);

return this;
}

public EventNostr setRelays(@NonNull Map<String, String> relays) {
super.setRelays(relays);

return this;
}

public EventNostr setRecipient(@NonNull PublicKey recipient) {
this.recipient = recipient;

return this;
}

public EventNostr addTag(@NonNull BaseTag tag) {
getEvent().addTag(tag);
return this;
}

@NoArgsConstructor
public static class GenericEventNostr<T extends GenericEvent> extends EventNostr<T> {

public GenericEventNostr(@NonNull Identity sender) {
super.setSender(sender);
}

/**
* @param content
* @return
*/
public GenericEventNostr createGenericEvent(@NonNull Integer kind, @NonNull String content) {
var factory = new GenericEventFactory(getSender(), kind, content);
var event = factory.create();
setEvent((T) event);

return this;
}

}
}
Loading