Skip to content

Commit

Permalink
Remove unnecessary SerializedName
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat committed Jul 28, 2023
1 parent 681ddc7 commit 880b21f
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 95 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.stellar.sdk.requests.sorobanrpc;

import com.google.gson.annotations.SerializedName;
import java.util.Collection;
import lombok.Builder;
import lombok.NonNull;
Expand All @@ -10,38 +9,29 @@
@Value
@Builder
public class GetEventsRequest {
@NonNull
@SerializedName("startLedger")
String startLedger;
@NonNull String startLedger;

@SerializedName("filters")
@Singular("filter")
Collection<EventFilter> filters;

@SerializedName("pagination")
PaginationOptions pagination;

@Value
@Builder
public static class PaginationOptions {
@SerializedName("limit")
Long limit;

@SerializedName("cursor")
String cursor;
}

@Builder
@Value
public static class EventFilter {
@SerializedName("type")
EventFilterType type;

@SerializedName("contractIds")
Collection<String> contractIds;

@Singular("topic")
@SerializedName("topics")
Collection<Collection<String>> topics;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package org.stellar.sdk.requests.sorobanrpc;

import com.google.gson.annotations.SerializedName;
import java.util.Collection;
import lombok.AllArgsConstructor;
import lombok.Value;

@AllArgsConstructor
@Value
public class GetLedgerEntriesRequest {
@SerializedName("keys")
Collection<String> keys;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.stellar.sdk.requests.sorobanrpc;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Value;

@Value
@AllArgsConstructor
public class GetTransactionRequest {
@SerializedName("hash")
String hash;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.stellar.sdk.requests.sorobanrpc;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Value;

@AllArgsConstructor
@Value
public class SendTransactionRequest {
@SerializedName("transaction")
String transaction;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.stellar.sdk.requests.sorobanrpc;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Value;

@AllArgsConstructor
@Value
public class SimulateTransactionRequest {
@SerializedName("transaction")
String transaction;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ public class SorobanRpcRequest<T> {
@SerializedName("jsonrpc")
String jsonRpc = "2.0";

@SerializedName("id")
String id;

@SerializedName("method")
String method;

@SerializedName("params")
T params;
}
Original file line number Diff line number Diff line change
@@ -1,55 +1,42 @@
package org.stellar.sdk.responses.sorobanrpc;

import com.google.common.collect.ImmutableList;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Value;
import org.stellar.sdk.requests.sorobanrpc.EventFilterType;

@AllArgsConstructor
@Value
public class GetEventsResponse {
@SerializedName("events")
ImmutableList<EventInfo> events;

@SerializedName("latestLedger")
Long latestLedger;

@AllArgsConstructor
@Value
public static class EventInfo {
@SerializedName("type")
EventFilterType type;

@SerializedName("ledger")
Integer ledger;

@SerializedName("ledgerClosedAt")
String ledgerClosedAt;

@SerializedName("contractId")
String contractId;

@SerializedName("id")
String id;

@SerializedName("pagingToken")
String pagingToken;

@SerializedName("topic")
ImmutableList<String> topic;

@SerializedName("value")
EventInfoValue value;

@SerializedName("inSuccessfulContractCall")
Boolean inSuccessfulContractCall;
}

@AllArgsConstructor
@Value
public static class EventInfoValue {
@SerializedName("xdr")
String xdr;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.stellar.sdk.responses.sorobanrpc;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Value;

@AllArgsConstructor
@Value
public class GetHealthResponse {
@SerializedName("status")
String status;
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package org.stellar.sdk.responses.sorobanrpc;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Value;

@AllArgsConstructor
@Value
public class GetLatestLedgerResponse {
@SerializedName("id")
String id;

@SerializedName("protocolVersion")
Integer protocolVersion;

@SerializedName("sequence")
Integer sequence;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@
@AllArgsConstructor
@Value
public class GetLedgerEntriesResponse {
@SerializedName("entries")
ImmutableList<LedgerEntryResult> entries;

@SerializedName("latestLedger")
Long latestLedger;

@AllArgsConstructor
@Value
public static class LedgerEntryResult {
@SerializedName("key")
String key;

@SerializedName("xdr")
String xdr;

@SerializedName("lastModifiedLedgerSeq")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package org.stellar.sdk.responses.sorobanrpc;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Value;

@AllArgsConstructor
@Value
public class GetNetworkResponse {
@SerializedName("friendbotUrl")
String friendbotUrl;

@SerializedName("passphrase")
String passphrase;

@SerializedName("protocolVersion")
Integer protocolVersion;
}
Original file line number Diff line number Diff line change
@@ -1,56 +1,38 @@
package org.stellar.sdk.responses.sorobanrpc;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Value;

@AllArgsConstructor
@Value
public class GetTransactionResponse {
@SerializedName("status")
GetTransactionStatus status;

@SerializedName("latestLedger")
Long latestLedger;

@SerializedName("latestLedgerCloseTime")
Long latestLedgerCloseTime;

@SerializedName("oldestLedger")
Long oldestLedger;

@SerializedName("oldestLedgerCloseTime")
Long oldestLedgerCloseTime;

@SerializedName("applicationOrder")
Integer applicationOrder;

@SerializedName("feeBump")
Boolean feeBump;

@SerializedName("envelopeXdr")
String envelopeXdr;

@SerializedName("resultXdr")
String resultXdr;

@SerializedName("resultMetaXdr")
String resultMetaXdr;

@SerializedName("ledger")
Long ledger;

@SerializedName("createdAt")
Long createdAt;

public enum GetTransactionStatus {
@SerializedName("NOT_FOUND")
NOT_FOUND,

@SerializedName("SUCCESS")
SUCCESS,

@SerializedName("FAILED")
FAILED
}
}
Original file line number Diff line number Diff line change
@@ -1,38 +1,25 @@
package org.stellar.sdk.responses.sorobanrpc;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Value;

@AllArgsConstructor
@Value
public class SendTransactionResponse {
@SerializedName("status")
SendTransactionStatus status;

@SerializedName("errorResultXdr")
String errorResultXdr;

@SerializedName("hash")
String hash;

@SerializedName("latestLedger")
Long latestLedger;

@SerializedName("latestLedgerCloseTime")
Long latestLedgerCloseTime;

public enum SendTransactionStatus {
@SerializedName("PENDING")
PENDING,

@SerializedName("DUPLICATE")
DUPLICATE,

@SerializedName("TRY_AGAIN_LATER")
TRY_AGAIN_LATER,

@SerializedName("ERROR")
ERROR
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,25 @@
@AllArgsConstructor
@Value
public class SimulateTransactionResponse {
@SerializedName("error")
String error;

@SerializedName("transactionData")
String transactionData;

@SerializedName("events")
ImmutableList<String> events;

@SerializedName("minResourceFee")
Long minResourceFee;

@SerializedName("results")
ImmutableList<SimulateHostFunctionResult> results;

@SerializedName("cost")
SimulateTransactionCost cost;

@SerializedName("latestLedger")
Long latestLedger;

@AllArgsConstructor
@Value
public static class SimulateHostFunctionResult {
@SerializedName("auth")
ImmutableList<String> auth;

@SerializedName("xdr")
String xdr;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,19 @@ public class SorobanRpcResponse<T> extends Response {
@SerializedName("jsonrpc")
private final String jsonRpc;

@SerializedName("id")
private final String id;

@SerializedName("result")
private final T result;

@SerializedName("error")
private final Error error;

@AllArgsConstructor
@Value
public static class Error {
@SerializedName("code")
Integer code;

@SerializedName("message")
String message;

@SerializedName("data")
String data;
}
}

0 comments on commit 880b21f

Please sign in to comment.