-
Notifications
You must be signed in to change notification settings - Fork 3
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
12 changed files
with
336 additions
and
44 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
45 changes: 44 additions & 1 deletion
45
client/src/main/java/com/lmax/solana4j/client/api/SignatureForAddress.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 |
---|---|---|
@@ -1,16 +1,59 @@ | ||
package com.lmax.solana4j.client.api; | ||
|
||
/** | ||
* Represents a transaction signature associated with a specific address on the Solana blockchain. | ||
* This interface provides access to details such as errors, memos, signatures, slots, block times, | ||
* and confirmation statuses. | ||
*/ | ||
public interface SignatureForAddress | ||
{ | ||
|
||
/** | ||
* Retrieves the error information associated with the transaction, if any. | ||
* If the transaction was successful, this method returns {@code null}. | ||
* | ||
* @return an object representing the error, or {@code null} if the transaction was successful | ||
*/ | ||
Object getErr(); | ||
|
||
/** | ||
* Retrieves the memo associated with the transaction. | ||
* If no memo is present, this method returns {@code null}. | ||
* | ||
* @return a string containing the memo, or {@code null} if no memo is present | ||
*/ | ||
String getMemo(); | ||
|
||
/** | ||
* Retrieves the base58-encoded signature of the transaction. | ||
* | ||
* @return a string representing the transaction's signature | ||
*/ | ||
String getSignature(); | ||
|
||
/** | ||
* Retrieves the slot number in which the transaction was confirmed. | ||
* The slot is a specific point in the Solana blockchain where the transaction was processed. | ||
* | ||
* @return the slot number where the transaction was confirmed | ||
*/ | ||
Long getSlot(); | ||
|
||
/** | ||
* Retrieves the estimated production time of the block containing the transaction. | ||
* The block time is represented as a Unix timestamp (seconds since the Unix epoch). | ||
* If the block time is not available, this method returns {@code null}. | ||
* | ||
* @return the block time as a Unix timestamp, or {@code null} if not available | ||
*/ | ||
Long getBlockTime(); | ||
|
||
/** | ||
* Retrieves the confirmation status of the transaction. | ||
* The confirmation status indicates the level of finality reached for the transaction, | ||
* such as processed, confirmed, or finalized. | ||
* | ||
* @return the {@link Commitment} representing the confirmation status of the transaction | ||
*/ | ||
Commitment getConfirmationStatus(); | ||
} | ||
} |
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
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
35 changes: 34 additions & 1 deletion
35
client/src/main/java/com/lmax/solana4j/client/api/SolanaClientResponse.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 |
---|---|---|
@@ -1,17 +1,50 @@ | ||
package com.lmax.solana4j.client.api; | ||
|
||
/** | ||
* Represents a response from the Solana client, encapsulating either a successful result or an error. | ||
* | ||
* @param <T> the type of the successful response payload | ||
*/ | ||
public interface SolanaClientResponse<T> | ||
{ | ||
/** | ||
* Retrieves the response payload in case of a successful operation. | ||
* | ||
* @return the response payload, or {@code null} if the operation was not successful | ||
*/ | ||
T getResponse(); | ||
|
||
/** | ||
* Retrieves the error details in case of a failed operation. | ||
* | ||
* @return an instance of {@link SolanaClientError} containing error information, or {@code null} if the operation was successful | ||
*/ | ||
SolanaClientError getError(); | ||
|
||
/** | ||
* Indicates whether the operation was successful. | ||
* | ||
* @return {@code true} if the operation was successful; {@code false} otherwise | ||
*/ | ||
boolean isSuccess(); | ||
|
||
/** | ||
* Represents an error encountered during a Solana client operation. | ||
*/ | ||
interface SolanaClientError | ||
{ | ||
/** | ||
* Retrieves the error code associated with the failure. | ||
* | ||
* @return the error code | ||
*/ | ||
long getErrorCode(); | ||
|
||
/** | ||
* Retrieves the error message providing details about the failure. | ||
* | ||
* @return the error message | ||
*/ | ||
String getErrorMessage(); | ||
} | ||
} | ||
} |
Oops, something went wrong.