-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
451 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package bitwheeze.golos.goloslib; | ||
|
||
import bitwheeze.golos.goloslib.model.ApiResponse; | ||
import bitwheeze.golos.goloslib.model.api.MarketHistoryMethods; | ||
import bitwheeze.golos.goloslib.model.api.NftMethods; | ||
import bitwheeze.golos.goloslib.model.nft.NftResponses; | ||
import bitwheeze.golos.goloslib.model.nft.NftTokenQuery; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
import reactor.core.publisher.Mono; | ||
|
||
@Slf4j | ||
@Component | ||
public class NftApi extends GolosApiReactive { | ||
|
||
|
||
public NftApi(@Qualifier("golos_api") WebClient client) { | ||
super(client); | ||
} | ||
|
||
public Mono<NftResponses.GetNftTokenResponse> getNftToken(NftTokenQuery query) { | ||
var method = NftMethods.getNftTokens(); | ||
method.getMethodParams()[0] = query; | ||
return send(method, NftResponses.GetNftTokenResponse.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
20 changes: 20 additions & 0 deletions
20
src/main/java/bitwheeze/golos/goloslib/model/VestingDelegation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package bitwheeze.golos.goloslib.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Data | ||
@ToString | ||
public class VestingDelegation { | ||
int id; //: 195170, | ||
String delegator;// ": "prizm", | ||
String delegatee;// ": "payme", | ||
Asset vestingShares; //": "8619571271.824690 GESTS", | ||
int interestRate; //": 10000, | ||
LocalDateTime minDelegationTime; //": "2024-02-25T13:00:09", | ||
@JsonProperty("is_emission") | ||
boolean isEmission; //": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/bitwheeze/golos/goloslib/model/api/NftMethods.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package bitwheeze.golos.goloslib.model.api; | ||
|
||
|
||
public class NftMethods extends ApiMethod { | ||
|
||
public static NftMethods getNftTokens() {return new NftMethods("get_nft_tokens", new String[]{"query"});}; | ||
|
||
|
||
public NftMethods(String method, String [] paramNames) { | ||
|
||
super("nft_api", method, paramNames); | ||
} | ||
|
||
public static void main(String[] args) { | ||
//ApiRequest req = new ApiRequest("database_api", "get_dynamic_global_properties") | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/bitwheeze/golos/goloslib/model/nft/NftResponses.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package bitwheeze.golos.goloslib.model.nft; | ||
|
||
import bitwheeze.golos.goloslib.model.ApiResponse; | ||
import bitwheeze.golos.goloslib.model.op.virtual.Event; | ||
|
||
import java.util.List; | ||
|
||
public class NftResponses { | ||
|
||
public static class GetNftTokenResponse extends ApiResponse<List<NftToken>> {}; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/bitwheeze/golos/goloslib/model/nft/NftToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package bitwheeze.golos.goloslib.model.nft; | ||
|
||
import bitwheeze.golos.goloslib.model.Asset; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
import java.math.BigDecimal; | ||
import java.time.LocalDateTime; | ||
|
||
@Data | ||
@ToString | ||
public class NftToken { | ||
String id; | ||
String creator; | ||
String name; | ||
String owner; | ||
int token_id; | ||
Asset issueCost; | ||
Asset lastBuyPrice; | ||
String jsonMetadata; | ||
LocalDateTime issued; | ||
LocalDateTime lastUpdate; | ||
boolean selling; | ||
BigDecimal priceReal; | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/bitwheeze/golos/goloslib/model/nft/NftTokenQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package bitwheeze.golos.goloslib.model.nft; | ||
|
||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
@Data | ||
@Builder | ||
@ToString | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class NftTokenQuery { | ||
String owner; | ||
@JsonProperty("start_token_id") | ||
Integer startTokenId; | ||
Integer limit; // принцип работы пагинации описан на примере getNftCollections | ||
|
||
@JsonProperty("select_collections") | ||
String[] selectCollections; // выбирает токены из заданных коллекций | ||
@JsonProperty("collections_limit") | ||
Integer collectionLimit; // Например - чтобы в списке коллекций (getNftCollections) добавить к каждой коллекции информацию о первом токене в ней | ||
|
||
@JsonProperty("select_token_ids") | ||
Integer[] selectTokenIds; // выборка конкретных токенов | ||
|
||
@JsonProperty("filter_creators") | ||
String[] filterCreators; | ||
|
||
@JsonProperty("filter_token_ids") | ||
Integer[] filterTokenIds; | ||
|
||
@JsonProperty("filter_names") | ||
String [] filterNames; // игнорировать токены из этих коллекций | ||
|
||
public enum TokenState { | ||
any, selling_one, not_selling_one; | ||
} | ||
|
||
TokenState state; // или 'selling_one' - только токены которые выставлены на продажу, или 'not_selling_one' - только которые не выставлены | ||
|
||
public enum TokenSortOrder { | ||
by_name, by_issued, by_last_update, by_last_price; | ||
} | ||
|
||
TokenSortOrder sort; // by_issued, by_last_update, by_last_price | ||
@JsonProperty("reverse_sort") | ||
Boolean reverseSort; | ||
} |
Empty file modified
0
src/main/java/bitwheeze/golos/goloslib/model/op/AccountCreateWithInvite.java
100755 → 100644
Empty file.
Empty file.
Empty file modified
0
src/main/java/bitwheeze/golos/goloslib/model/op/DelegateVestingSharesWithInterest.java
100755 → 100644
Empty file.
Empty file modified
0
src/main/java/bitwheeze/golos/goloslib/model/op/DeleteComment.java
100755 → 100644
Empty file.
Empty file.
22 changes: 22 additions & 0 deletions
22
src/main/java/bitwheeze/golos/goloslib/model/op/NftBuy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package bitwheeze.golos.goloslib.model.op; | ||
|
||
import bitwheeze.golos.goloslib.model.Asset; | ||
import com.fasterxml.jackson.databind.JsonDeserializer; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
@Data | ||
@ToString | ||
@JsonDeserialize(using = JsonDeserializer.None.class) | ||
@OpName("nft_buy") | ||
@AllArgsConstructor | ||
public class NftBuy extends Operation { | ||
private String buyer; | ||
private String name; | ||
private int tokenId; | ||
private int orderId; | ||
private Asset price; | ||
private String[] extensions; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/bitwheeze/golos/goloslib/model/op/NftCancelOrder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package bitwheeze.golos.goloslib.model.op; | ||
|
||
import bitwheeze.golos.goloslib.model.Asset; | ||
import com.fasterxml.jackson.databind.JsonDeserializer; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
@Data | ||
@ToString | ||
@JsonDeserialize(using = JsonDeserializer.None.class) | ||
@OpName("nft_cancel_order") | ||
@AllArgsConstructor | ||
public class NftCancelOrder extends Operation { | ||
private String owner; | ||
private int orderId; | ||
private String[] extensions; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/bitwheeze/golos/goloslib/model/op/NftCollection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package bitwheeze.golos.goloslib.model.op; | ||
|
||
import bitwheeze.golos.goloslib.model.Asset; | ||
import com.fasterxml.jackson.databind.JsonDeserializer; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
@Data | ||
@ToString | ||
@JsonDeserialize(using = JsonDeserializer.None.class) | ||
@OpName("nft_collection") | ||
@AllArgsConstructor | ||
public class NftCollection extends Operation { | ||
private String creator; | ||
private String name; | ||
private String jsonMetadata; | ||
private int maxTokenCount; | ||
private String[] extensions; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/bitwheeze/golos/goloslib/model/op/NftCollectionDelete.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package bitwheeze.golos.goloslib.model.op; | ||
|
||
import com.fasterxml.jackson.databind.JsonDeserializer; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
@Data | ||
@ToString | ||
@JsonDeserialize(using = JsonDeserializer.None.class) | ||
@OpName("nft_collection_delete") | ||
@AllArgsConstructor | ||
public class NftCollectionDelete extends Operation { | ||
private String creator; | ||
private String name; | ||
private String[] extensions; | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/bitwheeze/golos/goloslib/model/op/NftIssue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package bitwheeze.golos.goloslib.model.op; | ||
|
||
import com.fasterxml.jackson.databind.JsonDeserializer; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
@Data | ||
@ToString | ||
@JsonDeserialize(using = JsonDeserializer.None.class) | ||
@OpName("nft_issue") | ||
@AllArgsConstructor | ||
public class NftIssue extends Operation { | ||
private String creator; | ||
private String name; | ||
private String to; | ||
private String jsonMetadata; | ||
private String[] extensions; | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/bitwheeze/golos/goloslib/model/op/NftSell.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package bitwheeze.golos.goloslib.model.op; | ||
|
||
import bitwheeze.golos.goloslib.model.Asset; | ||
import com.fasterxml.jackson.databind.JsonDeserializer; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
@Data | ||
@ToString | ||
@JsonDeserialize(using = JsonDeserializer.None.class) | ||
@OpName("nft_sell") | ||
@AllArgsConstructor | ||
public class NftSell extends Operation { | ||
private String seller; | ||
private int tokenId; | ||
private String buyer; | ||
private int orderId; | ||
private Asset price; | ||
private String[] extensions; | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/bitwheeze/golos/goloslib/model/op/NftTransfer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package bitwheeze.golos.goloslib.model.op; | ||
|
||
import com.fasterxml.jackson.databind.JsonDeserializer; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
@Data | ||
@ToString | ||
@JsonDeserialize(using = JsonDeserializer.None.class) | ||
@OpName("nft_transfer") | ||
@AllArgsConstructor | ||
public class NftTransfer extends Operation { | ||
private int tokenId; | ||
private String from; | ||
private String to; | ||
private String memo; | ||
private String[] extensions; | ||
} |
Empty file modified
0
src/main/java/bitwheeze/golos/goloslib/model/op/TransferToVesting.java
100755 → 100644
Empty file.
Empty file modified
0
src/main/java/bitwheeze/golos/goloslib/model/op/WithdrawVesting.java
100755 → 100644
Empty file.
Empty file modified
0
src/main/java/bitwheeze/golos/goloslib/model/op/WithnessUpdate.java
100755 → 100644
Empty file.
5 changes: 5 additions & 0 deletions
5
src/main/java/bitwheeze/golos/goloslib/types/DelegationType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package bitwheeze.golos.goloslib.types; | ||
|
||
public enum DelegationType { | ||
received, delegated; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.