Skip to content

Commit

Permalink
Tx Info CollateralOutput Field Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
edridudi committed Sep 4, 2024
1 parent ed832c2 commit 9e657e8
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca

| Koios Instance | Koios Java Client |
|:--------------:|:-----------------:|
| 1.2.0 | 1.19.0 |
| 1.2.0 | 1.19.1 |
| 1.1.2 | 1.18.2 |
| 1.0.10 | 1.17.3 |
| 1.0.9 | 1.16.3 |
Expand All @@ -422,13 +422,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.19.0</version>
<version>1.19.1</version>
</dependency>
```

- For Gradle, add the following dependency to build.gradle
```
compile group: 'io.github.cardano-community', name: 'koios-java-client', version: '1.19.0'
compile group: 'io.github.cardano-community', name: 'koios-java-client', version: '1.19.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.19.0</version>
<version>1.19.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
@@ -0,0 +1,66 @@
package rest.koios.client.backend.api.transactions.model;

import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import rest.koios.client.backend.api.base.common.InlineDatum;
import rest.koios.client.backend.api.base.common.ReferenceScript;

/**
* Collateral Output
*/
@Getter
@Setter
@ToString
@NoArgsConstructor
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public class CollateralOutput {

/**
* A Cardano payment/base address for transaction's input/output UTxO
*/
private TxPaymentAddress paymentAddr;

/**
* A Cardano staking address (reward account, bech32 encoded) for transaction's input/output UTxO
*/
private String stakeAddr;

/**
* Hash of this transaction
*/
private String txHash;

/**
* Index of output UTxO
*/
private Integer txIndex;

/**
* Total sum on the output address
*/
private String value;

/**
* Hash of datum (if any) connected to UTxO
*/
private String datumHash;

/**
* Allows datums to be attached to UTxO (CIP-32)
*/
private InlineDatum inlineDatum;

/**
* Allow reference scripts to be used to satisfy script requirements during validation, rather than requiring the spending transaction to do so. (CIP-33)
*/
private ReferenceScript referenceScript;

/**
* assets included in input/output UTxO
*/
private String assetList;
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class TxInfo {
/**
* List of collateral outputs
*/
private TxIO collateralOutput = null;
private CollateralOutput collateralOutput = null;

/**
* Reference Inputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void getUTxOInfoTest() throws ApiException {

@Test
void getTransactionInformationTest() throws ApiException {
String txHash = "f144a8264acf4bdfe2e1241170969c930d64ab6b0996a4a45237b623f1dd670e";
String txHash = "8c549208e00ca8027e62429b3daf1bce9557104968870a7e6c0efc914364aaa5";
String txHash2 = "f5eb5ecd1737ee254bbe94ba6ddb295d90d3e80c138c7ac4e26497ccaf34b00f";
Result<List<TxInfo>> transactionInformationResult = transactionsService.getTransactionInformation(List.of(txHash, txHash2), Options.EMPTY);
Assertions.assertTrue(transactionInformationResult.isSuccessful());
Expand Down

0 comments on commit 9e657e8

Please sign in to comment.