From 7c7ec66d257d679c5a1063d2b5c15d0cae72b881 Mon Sep 17 00:00:00 2001 From: matthewjames Date: Fri, 22 Nov 2024 22:58:19 -0500 Subject: [PATCH] Clean up visibility for implementation classes in teh client --- client/build.gradle | 7 +- .../client/api/AddressTableLookup.java | 35 -------- .../solana4j/client/api/BlockResponse.java | 59 ------------- .../client/api/ProgramAccountResponse.java | 24 ----- .../solana4j/client/api/SignatureInfo.java | 56 ------------ .../api/SimulateTransactionResponse.java | 2 +- .../lmax/solana4j/client/api/Transaction.java | 24 ----- .../client/jsonrpc/AccountInfoDataDTO.java | 2 +- .../client/jsonrpc/AccountKeysDTO.java | 6 +- .../client/jsonrpc/AddressTableLookupDTO.java | 50 ----------- .../solana4j/client/jsonrpc/BalanceDTO.java | 2 +- .../client/jsonrpc/BlockResponseDTO.java | 88 ------------------- .../lmax/solana4j/client/jsonrpc/DataDTO.java | 4 +- .../client/jsonrpc/LoadedAddressesDTO.java | 4 +- .../jsonrpc/ProgramAccountResponseDTO.java | 42 --------- .../jsonrpc/SignatureForAddressDTO.java | 4 +- .../client/jsonrpc/SignatureInfoDTO.java | 82 ----------------- .../SimulateTransactionResponseDTO.java | 11 +-- .../jsonrpc/TokenAccountsByOwnerDTO.java | 2 +- .../client/jsonrpc/TransactionDTO.java | 43 --------- .../client/jsonrpc/TransactionDataDTO.java | 4 +- .../jsonrpc/TransactionDetailLevel.java | 9 -- config/checkstyle/checkstyle.xml | 6 ++ 23 files changed, 30 insertions(+), 536 deletions(-) delete mode 100644 client/src/main/java/com/lmax/solana4j/client/api/AddressTableLookup.java delete mode 100644 client/src/main/java/com/lmax/solana4j/client/api/BlockResponse.java delete mode 100644 client/src/main/java/com/lmax/solana4j/client/api/ProgramAccountResponse.java delete mode 100644 client/src/main/java/com/lmax/solana4j/client/api/SignatureInfo.java delete mode 100644 client/src/main/java/com/lmax/solana4j/client/api/Transaction.java delete mode 100644 client/src/main/java/com/lmax/solana4j/client/jsonrpc/AddressTableLookupDTO.java delete mode 100644 client/src/main/java/com/lmax/solana4j/client/jsonrpc/BlockResponseDTO.java delete mode 100644 client/src/main/java/com/lmax/solana4j/client/jsonrpc/ProgramAccountResponseDTO.java delete mode 100644 client/src/main/java/com/lmax/solana4j/client/jsonrpc/SignatureInfoDTO.java delete mode 100644 client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDTO.java delete mode 100644 client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDetailLevel.java diff --git a/client/build.gradle b/client/build.gradle index c065c817..75263032 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -48,9 +48,9 @@ sourceSets { dependencies { // main dependencies - api 'com.fasterxml.jackson.core:jackson-databind:2.17.2' - api 'com.fasterxml.jackson.core:jackson-annotations:2.17.2' - api 'com.fasterxml.jackson.core:jackson-core:2.17.2' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2' + implementation 'com.fasterxml.jackson.core:jackson-annotations:2.17.2' + implementation 'com.fasterxml.jackson.core:jackson-core:2.17.2' // integration test dependencies integrationTestImplementation project(path: ':shared', configuration: 'sharedTestSupport') @@ -108,7 +108,6 @@ tasks.processTestResources { check.dependsOn unitTest check.dependsOn integrationTest check.dependsOn checkstyleMain -check.dependsOn checkstyleTest check.dependsOn checkstyleIntegrationTest javadoc { diff --git a/client/src/main/java/com/lmax/solana4j/client/api/AddressTableLookup.java b/client/src/main/java/com/lmax/solana4j/client/api/AddressTableLookup.java deleted file mode 100644 index d7470b3e..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/api/AddressTableLookup.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.lmax.solana4j.client.api; - -import java.util.List; - -/** - * Represents an address table lookup used in Solana transactions. - * This interface provides methods to access the account key associated with the lookup - * and the indexes of writable and readonly accounts in the table. - */ -public interface AddressTableLookup -{ - /** - * Returns the base58-encoded public key of the account associated with the address lookup table. - * This account key is used to reference the address lookup table in Solana transactions. - * - * @return the base58-encoded string representing the account key for the address lookup table - */ - String getAccountKey(); - - /** - * Returns a list of indexes that refer to the writable accounts in the address lookup table. - * The indexes correspond to the writable entries within the address lookup table. - * - * @return a list of indexes representing writable accounts in the lookup table - */ - List getWritableIndexes(); - - /** - * Returns a list of indexes that refer to the readonly accounts in the address lookup table. - * The indexes correspond to the readonly entries within the address lookup table. - * - * @return a list of indexes representing readonly accounts in the lookup table - */ - List getReadonlyIndexes(); -} \ No newline at end of file diff --git a/client/src/main/java/com/lmax/solana4j/client/api/BlockResponse.java b/client/src/main/java/com/lmax/solana4j/client/api/BlockResponse.java deleted file mode 100644 index b843bf6f..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/api/BlockResponse.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.lmax.solana4j.client.api; - -import java.util.List; - -/** - * Represents the response data for a block on the Solana blockchain. - * This interface provides access to various details about a block, such as its height, - * hash, time, transactions, and the parent block information. - */ -public interface BlockResponse -{ - /** - * Returns the height of the block. - * The block height is the number of blocks preceding the current block in the blockchain. - * - * @return the height of the block, or null if not available - */ - Long getBlockHeight(); - - /** - * Returns the timestamp of the block. - * The block time represents the approximate Unix timestamp (in seconds) when the block was produced. - * - * @return the block time as a Unix timestamp, or null if not available - */ - Long getBlockTime(); - - /** - * Returns the base58-encoded blockhash for the current block. - * The blockhash uniquely identifies the block on the Solana blockchain. - * - * @return the base58-encoded string representing the blockhash - */ - String getBlockhash(); - - /** - * Returns the parent slot for the block. - * The parent slot refers to the slot number of the parent block in the Solana blockchain. - * - * @return the parent slot of the block - */ - long getParentSlot(); - - /** - * Returns the base58-encoded blockhash of the previous block. - * This allows linking the current block to the previous block in the blockchain. - * - * @return the base58-encoded string representing the previous blockhash - */ - String getPreviousBlockhash(); - - /** - * Returns a list of transactions included in the block. - * Each transaction represents an action or set of actions that occurred in the block. - * - * @return a list of {@link Transaction} objects representing the block's transactions - */ - List getTransactions(); -} \ No newline at end of file diff --git a/client/src/main/java/com/lmax/solana4j/client/api/ProgramAccountResponse.java b/client/src/main/java/com/lmax/solana4j/client/api/ProgramAccountResponse.java deleted file mode 100644 index cca841da..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/api/ProgramAccountResponse.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.lmax.solana4j.client.api; - -/** - * Represents a response for a program account on the Solana blockchain. - * This interface provides access to the public key of the program account and the associated account information. - */ -public interface ProgramAccountResponse -{ - /** - * Returns the public key of the program account. - * The public key is a base58-encoded string representing the program account on the Solana blockchain. - * - * @return the base58-encoded public key of the program account - */ - String getPubKey(); - - /** - * Returns the account information associated with the program account. - * This provides detailed information about the account, such as lamports, owner, and other data. - * - * @return the {@link AccountInfo} object representing the account information - */ - AccountInfo getAccount(); -} \ No newline at end of file diff --git a/client/src/main/java/com/lmax/solana4j/client/api/SignatureInfo.java b/client/src/main/java/com/lmax/solana4j/client/api/SignatureInfo.java deleted file mode 100644 index 7d8de901..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/api/SignatureInfo.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.lmax.solana4j.client.api; - -/** - * Represents information about a signature on the Solana blockchain. - * This interface provides details about the signature, such as the slot, block time, status, and memo associated with it. - */ -public interface SignatureInfo -{ - /** - * Returns the base58-encoded transaction signature. - * The signature is a unique identifier for a transaction on the Solana blockchain. - * - * @return the base58-encoded string representing the transaction signature - */ - String getSignature(); - - /** - * Returns the slot in which the transaction was confirmed. - * The slot refers to the point in the Solana blockchain where the transaction was processed. - * - * @return the slot number in which the transaction was confirmed - */ - long getSlot(); - - /** - * Returns the error information associated with the transaction, if any. - * This method returns an object representing the error, or null if the transaction was successful. - * - * @return an object representing the error, or null if no error occurred - */ - Object getErr(); - - /** - * Returns the memo associated with the transaction, if any. - * A memo is an optional string field that can include additional data or context for the transaction. - * - * @return the memo as a string, or null if no memo is associated with the transaction - */ - String getMemo(); - - /** - * Returns the block time when the transaction was confirmed, if available. - * The block time is a Unix timestamp representing when the block containing the transaction was confirmed. - * - * @return the block time as a Unix timestamp, or null if not available - */ - Long getBlockTime(); - - /** - * Returns the confirmation status of the transaction. - * The confirmation status indicates the level of finality for the transaction, such as processed, confirmed, or finalized. - * - * @return the {@link Commitment} representing the confirmation status of the transaction - */ - Commitment getConfirmationStatus(); -} \ No newline at end of file diff --git a/client/src/main/java/com/lmax/solana4j/client/api/SimulateTransactionResponse.java b/client/src/main/java/com/lmax/solana4j/client/api/SimulateTransactionResponse.java index 1624c65b..bac90361 100644 --- a/client/src/main/java/com/lmax/solana4j/client/api/SimulateTransactionResponse.java +++ b/client/src/main/java/com/lmax/solana4j/client/api/SimulateTransactionResponse.java @@ -10,7 +10,7 @@ public interface SimulateTransactionResponse AccountInfoData getAccounts(); - List getInnerInstructions(); + List getInnerInstructions(); Blockhash getReplacementBlockhash(); diff --git a/client/src/main/java/com/lmax/solana4j/client/api/Transaction.java b/client/src/main/java/com/lmax/solana4j/client/api/Transaction.java deleted file mode 100644 index 678ef361..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/api/Transaction.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.lmax.solana4j.client.api; - -/** - * Represents a transaction on the Solana blockchain. - * This interface provides access to the metadata of the transaction and the core transaction data. - */ -public interface Transaction -{ - /** - * Returns the metadata associated with the transaction. - * The metadata contains additional information about the transaction, such as fees, pre- and post-transaction balances, and log messages. - * - * @return the {@link TransactionMetadata} object representing the metadata of the transaction - */ - TransactionMetadata getMeta(); - - /** - * Returns the transaction data and the encoding used. - * The transaction data contains essential components such as instructions, signatures, and account keys involved in the transaction. - * - * @return a list representing the core transaction data and its encoding - */ - TransactionData getTransaction(); -} \ No newline at end of file diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AccountInfoDataDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AccountInfoDataDTO.java index 363e7f4c..f0212863 100644 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AccountInfoDataDTO.java +++ b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AccountInfoDataDTO.java @@ -15,7 +15,7 @@ @JsonDeserialize(using = AccountInfoDataDTO.AccountInfoDataDeserializer.class) -class AccountInfoDataDTO implements AccountInfoData +final class AccountInfoDataDTO implements AccountInfoData { private final List accountInfoEncoded; private final AccountInfoParsedData accountInfoParsed; diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AccountKeysDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AccountKeysDTO.java index c5632a04..a4f050d1 100644 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AccountKeysDTO.java +++ b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AccountKeysDTO.java @@ -14,12 +14,12 @@ import java.util.List; @JsonDeserialize(using = AccountKeysDTO.AccountKeyDeserializer.class) -public class AccountKeysDTO implements AccountKeys +final class AccountKeysDTO implements AccountKeys { private final List accountKeysEncoded; private final List accountKeysParsed; - public AccountKeysDTO(final List accountKeysEncoded, final List accountKeysParsed) + AccountKeysDTO(final List accountKeysEncoded, final List accountKeysParsed) { this.accountKeysEncoded = accountKeysEncoded; this.accountKeysParsed = accountKeysParsed; @@ -93,7 +93,7 @@ public String toString() } } - public static class AccountKeyDeserializer extends JsonDeserializer + static class AccountKeyDeserializer extends JsonDeserializer { @Override public AccountKeysDTO deserialize(final JsonParser parser, final DeserializationContext context) throws IOException diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AddressTableLookupDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AddressTableLookupDTO.java deleted file mode 100644 index 38c79a93..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/AddressTableLookupDTO.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.lmax.solana4j.client.jsonrpc; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.lmax.solana4j.client.api.AddressTableLookup; - -import java.util.List; - -final class AddressTableLookupDTO implements AddressTableLookup -{ - public final String accountKey; - public final List writableIndexes; - public final List readonlyIndexes; - - @JsonCreator - AddressTableLookupDTO( - final @JsonProperty("accountKey") String accountKey, - final @JsonProperty("writableIndexes") List writableIndexes, - final @JsonProperty("readonlyIndexes") List readonlyIndexes) - { - this.accountKey = accountKey; - this.writableIndexes = writableIndexes; - this.readonlyIndexes = readonlyIndexes; - } - - public String getAccountKey() - { - return accountKey; - } - - public List getWritableIndexes() - { - return writableIndexes; - } - - public List getReadonlyIndexes() - { - return readonlyIndexes; - } - - @Override - public String toString() - { - return "AddressTableLookupDTO{" + - "accountKey='" + accountKey + '\'' + - ", writableIndexes=" + writableIndexes + - ", readonlyIndexes=" + readonlyIndexes + - '}'; - } -} diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/BalanceDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/BalanceDTO.java index 22cab82b..8b30cd41 100644 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/BalanceDTO.java +++ b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/BalanceDTO.java @@ -5,7 +5,7 @@ import com.lmax.solana4j.client.api.Context; import com.lmax.solana4j.client.api.SolanaRpcResponse; -public final class BalanceDTO implements SolanaRpcResponse +final class BalanceDTO implements SolanaRpcResponse { private final ContextDTO context; private final Long value; diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/BlockResponseDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/BlockResponseDTO.java deleted file mode 100644 index c669323a..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/BlockResponseDTO.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.lmax.solana4j.client.jsonrpc; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.lmax.solana4j.client.api.BlockResponse; -import com.lmax.solana4j.client.api.Transaction; - -import java.util.List; - -import static java.util.Collections.unmodifiableList; - -public final class BlockResponseDTO implements BlockResponse -{ - private final Long blockHeight; - private final Long blockTime; - private final String blockhash; - private final long parentSlot; - private final String previousBlockhash; - private final List transactions; - - @JsonCreator - BlockResponseDTO( - final @JsonProperty("blockHeight") Long blockHeight, - final @JsonProperty("blockTime") Long blockTime, - final @JsonProperty("blockhash") String blockhash, - final @JsonProperty("parentSlot") long parentSlot, - final @JsonProperty("previousBlockhash") String previousBlockhash, - final @JsonProperty("transactions") List transactions) - { - this.blockHeight = blockHeight; - this.blockTime = blockTime; - this.blockhash = blockhash; - this.parentSlot = parentSlot; - this.previousBlockhash = previousBlockhash; - this.transactions = unmodifiableList(transactions); - } - - @Override - public Long getBlockHeight() - { - return blockHeight; - } - - @Override - public Long getBlockTime() - { - return blockTime; - } - - @Override - public String getBlockhash() - { - return blockhash; - } - - @Override - public long getParentSlot() - { - return parentSlot; - } - - @Override - public String getPreviousBlockhash() - { - return previousBlockhash; - } - - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public List getTransactions() - { - return (List) transactions; - } - - @Override - public String toString() - { - return "BlockResponse{" + - "blockHeight=" + blockHeight + - ", blockTime=" + blockTime + - ", blockhash='" + blockhash + '\'' + - ", parentSlot=" + parentSlot + - ", previousBlockhash='" + previousBlockhash + '\'' + - ", transactions=" + transactions + - '}'; - } - -} diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/DataDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/DataDTO.java index 84dc53c9..02e5d308 100644 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/DataDTO.java +++ b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/DataDTO.java @@ -5,12 +5,12 @@ import java.util.List; -public class DataDTO implements Data +final class DataDTO implements Data { private final String programId; private final List data; - public DataDTO(final @JsonProperty("programId") String programId, final @JsonProperty("data") List data) + DataDTO(final @JsonProperty("programId") String programId, final @JsonProperty("data") List data) { this.programId = programId; this.data = data; diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/LoadedAddressesDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/LoadedAddressesDTO.java index 9e789b43..7443ee3a 100644 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/LoadedAddressesDTO.java +++ b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/LoadedAddressesDTO.java @@ -6,13 +6,13 @@ import java.util.List; -public class LoadedAddressesDTO implements LoadedAddresses +final class LoadedAddressesDTO implements LoadedAddresses { private final List readonly; private final List writable; @JsonCreator - public LoadedAddressesDTO(final @JsonProperty("readonly") List readonly, final @JsonProperty("writable") List writable) + LoadedAddressesDTO(final @JsonProperty("readonly") List readonly, final @JsonProperty("writable") List writable) { this.readonly = readonly; this.writable = writable; diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/ProgramAccountResponseDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/ProgramAccountResponseDTO.java deleted file mode 100644 index c1c09ced..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/ProgramAccountResponseDTO.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.lmax.solana4j.client.jsonrpc; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.lmax.solana4j.client.api.AccountInfo; -import com.lmax.solana4j.client.api.ProgramAccountResponse; - -final class ProgramAccountResponseDTO implements ProgramAccountResponse -{ - private final String pubKey; - private final AccountInfoDTO.AccountInfoValueDTO account; - - @JsonCreator - ProgramAccountResponseDTO( - final @JsonProperty("pubKey") String pubKey, - final @JsonProperty("account") AccountInfoDTO.AccountInfoValueDTO account) - { - this.pubKey = pubKey; - this.account = account; - } - - @Override - public String getPubKey() - { - return pubKey; - } - - @Override - public AccountInfo getAccount() - { - return account; - } - - @Override - public String toString() - { - return "ProgramAccountsResponse{" + - "pubKey='" + pubKey + '\'' + - ", account=" + account + - '}'; - } -} diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SignatureForAddressDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SignatureForAddressDTO.java index a02597cf..ee80bfd4 100644 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SignatureForAddressDTO.java +++ b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SignatureForAddressDTO.java @@ -5,7 +5,7 @@ import com.lmax.solana4j.client.api.Commitment; import com.lmax.solana4j.client.api.SignatureForAddress; -public class SignatureForAddressDTO implements SignatureForAddress +final class SignatureForAddressDTO implements SignatureForAddress { private final Object err; private final String memo; @@ -15,7 +15,7 @@ public class SignatureForAddressDTO implements SignatureForAddress private final Commitment confirmationStatus; @JsonCreator - public SignatureForAddressDTO( + SignatureForAddressDTO( final @JsonProperty("err") Object err, final @JsonProperty("memo") String memo, final @JsonProperty("signature") String signature, diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SignatureInfoDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SignatureInfoDTO.java deleted file mode 100644 index d7f90c63..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SignatureInfoDTO.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.lmax.solana4j.client.jsonrpc; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.lmax.solana4j.client.api.Commitment; -import com.lmax.solana4j.client.api.SignatureInfo; - -final class SignatureInfoDTO implements SignatureInfo -{ - private final String signature; - private final long slot; - private final Object err; - private final String memo; - private final Long blockTime; - private final Commitment confirmationStatus; - - @JsonCreator - SignatureInfoDTO( - final @JsonProperty("signature") String signature, - final @JsonProperty("slot") long slot, - final @JsonProperty("err") Object err, - final @JsonProperty("memo") String memo, - final @JsonProperty("blockTime") Long blockTime, - final @JsonProperty("confirmationStatus") Commitment confirmationStatus) - { - this.signature = signature; - this.slot = slot; - this.err = err; - this.memo = memo; - this.blockTime = blockTime; - this.confirmationStatus = confirmationStatus; - } - - @Override - public String getSignature() - { - return signature; - } - - @Override - public long getSlot() - { - return slot; - } - - @Override - public Object getErr() - { - return err; - } - - @Override - public String getMemo() - { - return memo; - } - - @Override - public Long getBlockTime() - { - return blockTime; - } - - @Override - public Commitment getConfirmationStatus() - { - return confirmationStatus; - } - - @Override - public String toString() - { - return "SignatureInfoDTO{" + - "signature='" + signature + '\'' + - ", slot=" + slot + - ", err=" + err + - ", memo='" + memo + '\'' + - ", blockTime=" + blockTime + - ", confirmationStatus=" + confirmationStatus + - '}'; - } -} diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SimulateTransactionResponseDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SimulateTransactionResponseDTO.java index 411626a3..d8e2ed13 100644 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SimulateTransactionResponseDTO.java +++ b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/SimulateTransactionResponseDTO.java @@ -5,8 +5,8 @@ import com.lmax.solana4j.client.api.AccountInfoData; import com.lmax.solana4j.client.api.Blockhash; import com.lmax.solana4j.client.api.Context; -import com.lmax.solana4j.client.api.Instruction; import com.lmax.solana4j.client.api.Data; +import com.lmax.solana4j.client.api.InnerInstruction; import com.lmax.solana4j.client.api.SimulateTransactionResponse; import com.lmax.solana4j.client.api.SolanaRpcResponse; @@ -52,7 +52,7 @@ public static final class SimulateTransactionValueDTO implements SimulateTransac private final Object err; private final List logs; private final AccountInfoData accounts; - private final List innerInstructions; + private final List innerInstructions; private final BlockhashDTO.BlockhashValueDTO replacementBlockhash; private final DataDTO returnData; private final int unitsConsumed; @@ -62,7 +62,7 @@ public static final class SimulateTransactionValueDTO implements SimulateTransac final @JsonProperty("err") Object err, final @JsonProperty("logs") List logs, final @JsonProperty("accounts") AccountInfoData accounts, - final @JsonProperty("innerInstructions") List innerInstructions, + final @JsonProperty("innerInstructions") List innerInstructions, final @JsonProperty("replacementBlockhash") BlockhashDTO.BlockhashValueDTO replacementBlockhash, final @JsonProperty("returnData") DataDTO returnData, final @JsonProperty("unitsConsumed") int unitsConsumed) @@ -95,9 +95,10 @@ public AccountInfoData getAccounts() } @Override - public List getInnerInstructions() + @SuppressWarnings({"unchecked", "rawtypes"}) + public List getInnerInstructions() { - return innerInstructions; + return (List) innerInstructions; } @Override diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TokenAccountsByOwnerDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TokenAccountsByOwnerDTO.java index 0252b65e..4fbaf48f 100644 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TokenAccountsByOwnerDTO.java +++ b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TokenAccountsByOwnerDTO.java @@ -8,7 +8,7 @@ import java.util.List; -public class TokenAccountsByOwnerDTO implements SolanaRpcResponse> +final class TokenAccountsByOwnerDTO implements SolanaRpcResponse> { private final Context context; private final List value; diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDTO.java deleted file mode 100644 index f0c344eb..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDTO.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.lmax.solana4j.client.jsonrpc; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.lmax.solana4j.client.api.Transaction; -import com.lmax.solana4j.client.api.TransactionData; -import com.lmax.solana4j.client.api.TransactionMetadata; - -final class TransactionDTO implements Transaction -{ - private final MetaDTO metaImpl; - private final TransactionDataDTO transaction; - - @JsonCreator - TransactionDTO( - final @JsonProperty("meta") MetaDTO metaImpl, - final @JsonProperty("transaction") TransactionDataDTO transaction) - { - this.metaImpl = metaImpl; - this.transaction = transaction; - } - - @Override - public TransactionMetadata getMeta() - { - return metaImpl; - } - - @Override - public TransactionData getTransaction() - { - return transaction; - } - - @Override - public String toString() - { - return "Transaction{" + - "meta=" + metaImpl + - ", transaction=" + transaction + - '}'; - } -} diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDataDTO.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDataDTO.java index 93a10436..1e90ddcb 100644 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDataDTO.java +++ b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDataDTO.java @@ -15,12 +15,12 @@ import java.util.List; @JsonDeserialize(using = TransactionDataDTO.TransactionDataDeserializer.class) -public class TransactionDataDTO implements TransactionData +class TransactionDataDTO implements TransactionData { private final List transactionDataEncoded; private final TransactionDataParsed transactionDataParsed; - public TransactionDataDTO( + TransactionDataDTO( final List transactionDataEncoded, final TransactionDataParsed transactionDataParsed) { diff --git a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDetailLevel.java b/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDetailLevel.java deleted file mode 100644 index 18f89cdf..00000000 --- a/client/src/main/java/com/lmax/solana4j/client/jsonrpc/TransactionDetailLevel.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.lmax.solana4j.client.jsonrpc; - -enum TransactionDetailLevel -{ - FULL, - ACCOUNTS, - SIGNATURES, - NONE -} \ No newline at end of file diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 7ba89202..58c4d2ba 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -172,6 +172,12 @@ + + + + + +