Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca

| Koios Instance | Koios Java Client |
|:--------------:|:-----------------:|
| 1.3.2 | 1.21.0 |
| 1.3.2 | 1.21.1 |
| 1.3.0 | 1.20.1 |
| 1.2.0 | 1.19.3 |
| 1.1.2 | 1.18.2 |
Expand All @@ -428,13 +428,13 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<dependency>
<groupId>io.github.cardano-community</groupId>
<artifactId>koios-java-client</artifactId>
<version>1.21.0</version>
<version>1.21.1</version>
</dependency>
```

- For Gradle, add the following dependency to build.gradle
```
compile group: 'io.github.cardano-community', name: 'koios-java-client', version: '1.21.0'
compile group: 'io.github.cardano-community', name: 'koios-java-client', version: '1.21.1'
```

### Get Koios Backend Service (No API Token)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.cardano-community</groupId>
<artifactId>koios-java-client</artifactId>
<version>1.21.0</version>
<version>1.21.1</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>Koios Java Client is a Java REST Client library which allows interacting with Koios Server Instances using Java Objects</description>
<url>https://github.com/cardano-community/koios-java-client</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ public interface TransactionsService {
*/
Result<List<RawTx>> getRawTransaction(List<String> txHashes, Options options) throws ApiException;

default Result<TxInfo> getTransactionInformation(String txHash) throws ApiException {
return getTransactionInformation(txHash, true, true, true, true, true, true, true);
}

default Result<List<TxInfo>> getTransactionInformation(List<String> txHashes, Options options) throws ApiException {
return getTransactionInformation(txHashes, true, true, true, true, true, true, true, options);
}

/**
* Transaction Information for Specific Transaction
* Get detailed information about transaction
Expand All @@ -51,7 +59,7 @@ public interface TransactionsService {
* @return Result of Type List of {@link TxInfo} detailed information about transaction(s)
* @throws ApiException if an error occurs while attempting to invoke the API
*/
Result<TxInfo> getTransactionInformation(String txHash) throws ApiException;
Result<TxInfo> getTransactionInformation(String txHash, boolean isInputs, boolean isMetadata, boolean isAssets, boolean isWithdrawals, boolean isCertificates, boolean isScripts, boolean isByteCode) throws ApiException;

/**
* Transaction Information
Expand All @@ -65,7 +73,7 @@ public interface TransactionsService {
* @return Result of Type List of {@link TxInfo} detailed information about transaction(s)
* @throws ApiException if an error occurs while attempting to invoke the API
*/
Result<List<TxInfo>> getTransactionInformation(List<String> txHashes, Options options) throws ApiException;
Result<List<TxInfo>> getTransactionInformation(List<String> txHashes, boolean isInputs, boolean isMetadata, boolean isAssets, boolean isWithdrawals, boolean isCertificates, boolean isScripts, boolean isByteCode, Options options) throws ApiException;

/**
* Transaction Metadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ public Result<List<RawTx>> getRawTransaction(List<String> txHashes, Options opti
}

@Override
public Result<TxInfo> getTransactionInformation(String txHash) throws ApiException {
public Result<TxInfo> getTransactionInformation(String txHash, boolean isInputs, boolean isMetadata, boolean isAssets, boolean isWithdrawals, boolean isCertificates, boolean isScripts, boolean isByteCode) throws ApiException {
validateHexFormat(txHash);
Call<List<TxInfo>> call = transactionApi.getTransactionInformation(buildTxInfoBody(List.of(txHash)), Collections.emptyMap());
Call<List<TxInfo>> call = transactionApi.getTransactionInformation(buildTxInfoBody(List.of(txHash), isInputs, isMetadata, isAssets, isWithdrawals, isCertificates, isScripts, isByteCode), Collections.emptyMap());
return processResponseGetOne(call);
}

@Override
public Result<List<TxInfo>> getTransactionInformation(List<String> txHashes, Options options) throws ApiException {
public Result<List<TxInfo>> getTransactionInformation(List<String> txHashes, boolean isInputs, boolean isMetadata, boolean isAssets, boolean isWithdrawals, boolean isCertificates, boolean isScripts, boolean isByteCode, Options options) throws ApiException {
for (String tx : txHashes) {
validateHexFormat(tx);
}
Call<List<TxInfo>> call = transactionApi.getTransactionInformation(buildTxInfoBody(txHashes), optionsToParamMap(options));
Call<List<TxInfo>> call = transactionApi.getTransactionInformation(buildTxInfoBody(txHashes, isInputs, isMetadata, isAssets, isWithdrawals, isCertificates, isScripts, isByteCode), optionsToParamMap(options));
return processResponse(call);
}

Expand Down Expand Up @@ -97,16 +97,16 @@ public Result<List<TxStatus>> getTransactionStatus(List<String> txHashes, Option
return processResponse(call);
}

private Map<String, Object> buildTxInfoBody(List<String> txHashes) {
private Map<String, Object> buildTxInfoBody(List<String> txHashes, boolean isInputs, boolean isMetadata, boolean isAssets, boolean isWithdrawals, boolean isCertificates, boolean isScripts, boolean isByteCode) {
Map<String, Object> bodyMap = new HashMap<>();
bodyMap.put("_tx_hashes", txHashes);
bodyMap.put("_inputs", true);
bodyMap.put("_metadata", true);
bodyMap.put("_assets", true);
bodyMap.put("_withdrawals", true);
bodyMap.put("_certs", true);
bodyMap.put("_scripts", true);
bodyMap.put("_bytecode", true);
bodyMap.put("_inputs", isInputs);
bodyMap.put("_metadata", isMetadata);
bodyMap.put("_assets", isAssets);
bodyMap.put("_withdrawals", isWithdrawals);
bodyMap.put("_certs", isCertificates);
bodyMap.put("_scripts", isScripts);
bodyMap.put("_bytecode", isByteCode);
return bodyMap;
}

Expand Down