diff --git a/README.md b/README.md index 3fc2dcd..4cfaf14 100644 --- a/README.md +++ b/README.md @@ -404,6 +404,7 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca | Koios Instance | Koios Java Client | |:--------------:|:-----------------:| +| 1.3.0 | 1.20.0 | | 1.2.0 | 1.19.3 | | 1.1.2 | 1.18.2 | | 1.0.10 | 1.17.3 | @@ -422,13 +423,13 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca io.github.cardano-community koios-java-client - 1.19.3 + 1.20.0 ``` - For Gradle, add the following dependency to build.gradle ``` -compile group: 'io.github.cardano-community', name: 'koios-java-client', version: '1.19.3' +compile group: 'io.github.cardano-community', name: 'koios-java-client', version: '1.20.0' ``` ### Get Koios Backend Service (No API Token) diff --git a/pom.xml b/pom.xml index 3c28a1e..6362946 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 io.github.cardano-community koios-java-client - 1.19.3 + 1.20.0 ${project.groupId}:${project.artifactId} Koios Java Client is a Java REST Client library which allows interacting with Koios Server Instances using Java Objects https://github.com/cardano-community/koios-java-client @@ -14,18 +14,18 @@ 11 UTF-8 2.11.0 - 2.17.2 + 2.18.2 4.12.0 1.3.2 2.0.16 2.0.16 4.4 1.18.34 - 1.78.1 - 5.11.0 + 1.79 + 5.11.3 3.13.0 - 3.10.0 - 3.5.0 + 3.11.1 + 3.5.1 1.3.2 0.8.12 3.3.1 diff --git a/src/main/java/rest/koios/client/backend/api/block/BlockService.java b/src/main/java/rest/koios/client/backend/api/block/BlockService.java index a17cae2..a6a6908 100644 --- a/src/main/java/rest/koios/client/backend/api/block/BlockService.java +++ b/src/main/java/rest/koios/client/backend/api/block/BlockService.java @@ -94,12 +94,13 @@ public interface BlockService { * @param assets Controls whether to include assets involved within transaction the result * @param withdrawals Controls whether to include any stake account reward withdrawals in the * @param certs Controls whether to include transaction certificates in the result - * @param scripts Controls whether to include any details regarding + * @param scripts Controls whether to include any details regarding collateral/reference/datum/script objects in the result + * @param byteCode Controls whether to include bytecode for associated reference/plutus scripts * @param options Filtering and Pagination options (optional) * @return Result of Type List of {@link TxInfo} Included Transactions of a specific block * @throws ApiException if an error occurs while attempting to invoke the API * */ Result> getBlockTransactionsInfo(List blockHashes, Boolean inputs, Boolean metadata, Boolean assets, - Boolean withdrawals, Boolean certs, Boolean scripts, Options options) throws ApiException; + Boolean withdrawals, Boolean certs, Boolean scripts, Boolean byteCode, Options options) throws ApiException; } diff --git a/src/main/java/rest/koios/client/backend/api/block/impl/BlockServiceImpl.java b/src/main/java/rest/koios/client/backend/api/block/impl/BlockServiceImpl.java index 0287d87..3373d92 100644 --- a/src/main/java/rest/koios/client/backend/api/block/impl/BlockServiceImpl.java +++ b/src/main/java/rest/koios/client/backend/api/block/impl/BlockServiceImpl.java @@ -72,15 +72,19 @@ public Result> getBlockTransactions(List blockHashes, } @Override - public Result> getBlockTransactionsInfo(List blockHashes, Boolean inputs, Boolean metadata, Boolean assets, Boolean withdrawals, Boolean certs, Boolean scripts, Options options) throws ApiException { + public Result> getBlockTransactionsInfo(List blockHashes, Boolean inputs, Boolean metadata, + Boolean assets, Boolean withdrawals, Boolean certs, + Boolean scripts, Boolean byteCode, Options options) throws ApiException { for (String blockHash : blockHashes) { validateHexFormat(blockHash); } - Call> call = blockApi.getBlockTransactionsInfo(buildBodyBlockTxInfo(blockHashes, inputs, metadata, assets, withdrawals, certs, scripts), optionsToParamMap(options)); + Call> call = blockApi.getBlockTransactionsInfo(buildBodyBlockTxInfo(blockHashes, inputs, metadata, assets, withdrawals, certs, scripts, byteCode), optionsToParamMap(options)); return processResponse(call); } - private Map buildBodyBlockTxInfo(List blockHashes, Boolean inputs, Boolean metadata, Boolean assets, Boolean withdrawals, Boolean certs, Boolean scripts) { + private Map buildBodyBlockTxInfo(List blockHashes, Boolean inputs, Boolean metadata, + Boolean assets, Boolean withdrawals, Boolean certs, + Boolean scripts, Boolean byteCode) { Map bodyMap = new HashMap<>(); bodyMap.put("_block_hashes", blockHashes); bodyMap.put("_inputs", Optional.ofNullable(inputs).orElse(false)); @@ -89,6 +93,7 @@ private Map buildBodyBlockTxInfo(List blockHashes, Boole bodyMap.put("_withdrawals", Optional.ofNullable(withdrawals).orElse(false)); bodyMap.put("_certs", Optional.ofNullable(certs).orElse(false)); bodyMap.put("_scripts", Optional.ofNullable(scripts).orElse(false)); + bodyMap.put("_bytecode", Optional.ofNullable(byteCode).orElse(false)); return bodyMap; } diff --git a/src/main/java/rest/koios/client/backend/api/governance/model/DRep.java b/src/main/java/rest/koios/client/backend/api/governance/model/DRep.java index 5812094..36d884a 100644 --- a/src/main/java/rest/koios/client/backend/api/governance/model/DRep.java +++ b/src/main/java/rest/koios/client/backend/api/governance/model/DRep.java @@ -1,5 +1,6 @@ package rest.koios.client.backend.api.governance.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import lombok.*; @@ -12,6 +13,7 @@ @ToString @NoArgsConstructor @EqualsAndHashCode +@JsonIgnoreProperties(ignoreUnknown = true) @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) public class DRep { diff --git a/src/main/java/rest/koios/client/backend/api/governance/model/DRepInfo.java b/src/main/java/rest/koios/client/backend/api/governance/model/DRepInfo.java index a1a2d4e..004a2c7 100644 --- a/src/main/java/rest/koios/client/backend/api/governance/model/DRepInfo.java +++ b/src/main/java/rest/koios/client/backend/api/governance/model/DRepInfo.java @@ -58,10 +58,10 @@ public class DRepInfo { /** * A URL to a JSON payload of metadata (null if not applicable) */ - private String url; + private String metaUrl; /** * A hash of the contents of the metadata URL (null if not applicable) */ - private String hash; + private String meatHash; } diff --git a/src/main/java/rest/koios/client/backend/api/governance/model/DRepMetadata.java b/src/main/java/rest/koios/client/backend/api/governance/model/DRepMetadata.java index f26e812..a4d7237 100644 --- a/src/main/java/rest/koios/client/backend/api/governance/model/DRepMetadata.java +++ b/src/main/java/rest/koios/client/backend/api/governance/model/DRepMetadata.java @@ -34,17 +34,17 @@ public class DRepMetadata { /** * A URL to a JSON payload of metadata (null if not applicable) */ - private String url; + private String metaUrl; /** * A hash of the contents of the metadata URL (null if not applicable) */ - private String hash; + private String metaHash; /** * The raw bytes of the payload (null if not applicable) */ - private JsonNode json; + private JsonNode metaJson; /** * A warning that occurred while validating the metadata (null if not applicable) diff --git a/src/main/java/rest/koios/client/backend/api/governance/model/ProposalVotingSummary.java b/src/main/java/rest/koios/client/backend/api/governance/model/ProposalVotingSummary.java index 83e75b5..96cb155 100644 --- a/src/main/java/rest/koios/client/backend/api/governance/model/ProposalVotingSummary.java +++ b/src/main/java/rest/koios/client/backend/api/governance/model/ProposalVotingSummary.java @@ -57,6 +57,11 @@ public class ProposalVotingSummary { */ private Double drepNoPct; + /** + * Number of active 'abstain' votes from dreps + */ + private Integer drepAbstainVotesCast; + /** * Number of 'yes' votes casted by pools */ @@ -87,6 +92,31 @@ public class ProposalVotingSummary { */ private Double poolNoPct; + /** + * Percentage of 'abstain' votes from pools + */ + private Double poolAbstainVotesCast; + + /** + * Number of non-voting SPO pool reward addresses delegating to 'always_abstain' drep + */ + private Integer poolPassiveAlwaysAbstainVotesAssigned; + + /** + * Combined power of non-voting SPO pool votes where reward addresses delegate to 'always_abstain' + */ + private Integer poolPassiveAlwaysAbstainVotePower; + + /** + * Number of non-voting SPO pool reward addresses delegating to 'always_no_confidence' drep + */ + private Integer poolPassiveAlwaysNoConfidenceVotesAssigned; + + /** + * Combined power of non-voting SPO pool votes where reward addresses delegate to + */ + private Integer poolPassiveAlwaysNoConfidenceVotePower; + /** * Number of 'yes' votes casted by committee */ @@ -106,4 +136,9 @@ public class ProposalVotingSummary { * Percentage of 'no' votes from committee */ private Double committeeNoPct; + + /** + * Percentage of 'abstain' votes from committee + */ + private Double committeeAbstainVotesCast; } diff --git a/src/main/java/rest/koios/client/backend/api/pool/model/Pool.java b/src/main/java/rest/koios/client/backend/api/pool/model/Pool.java index 0bfc711..62b6263 100644 --- a/src/main/java/rest/koios/client/backend/api/pool/model/Pool.java +++ b/src/main/java/rest/koios/client/backend/api/pool/model/Pool.java @@ -89,6 +89,11 @@ public class Pool { */ private String poolStatus; + /** + * Amount of delegated stake to this pool at the time of epoch snapshot + */ + private String activeStake; + /** * Announced retiring epoch (nullable) */ diff --git a/src/main/java/rest/koios/client/backend/api/pool/model/PoolInfo.java b/src/main/java/rest/koios/client/backend/api/pool/model/PoolInfo.java index baf9824..1e43953 100644 --- a/src/main/java/rest/koios/client/backend/api/pool/model/PoolInfo.java +++ b/src/main/java/rest/koios/client/backend/api/pool/model/PoolInfo.java @@ -64,6 +64,11 @@ public class PoolInfo { */ private String rewardAddr; + /** + * Reward address' current delegation status to DRep ID in CIP-129 Bech32 format + */ + private String rewardAddrDelegatedDrep; + /** * List of Pool (co)owner address */ @@ -143,4 +148,9 @@ public class PoolInfo { * Pool live saturation (decimal format) */ private Double liveSaturation; + + /** + * Current voting power (lovelaces) of this stake pool + */ + private String votingPower; } diff --git a/src/main/java/rest/koios/client/backend/api/transactions/model/RawTx.java b/src/main/java/rest/koios/client/backend/api/transactions/model/RawTx.java index f5e9e2f..096ff05 100644 --- a/src/main/java/rest/koios/client/backend/api/transactions/model/RawTx.java +++ b/src/main/java/rest/koios/client/backend/api/transactions/model/RawTx.java @@ -24,7 +24,17 @@ public class RawTx { /** * Hash identifier of the transaction */ - private String txHash = null; + private String txHash; + + private String blockHash; + + private Long blockHeight; + + private Integer epochNo; + + private Long absoluteSlot; + + private Long txTimestamp; /** * Raw Tx in CBOR format diff --git a/src/main/java/rest/koios/client/backend/api/transactions/model/TxMetadata.java b/src/main/java/rest/koios/client/backend/api/transactions/model/TxMetadata.java index aa98e81..d36a951 100644 --- a/src/main/java/rest/koios/client/backend/api/transactions/model/TxMetadata.java +++ b/src/main/java/rest/koios/client/backend/api/transactions/model/TxMetadata.java @@ -1,5 +1,6 @@ package rest.koios.client.backend.api.transactions.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; @@ -15,6 +16,7 @@ @Setter @ToString @NoArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) public class TxMetadata { diff --git a/src/test/java/rest/koios/client/backend/api/block/BlockServiceMainnetIntegrationTest.java b/src/test/java/rest/koios/client/backend/api/block/BlockServiceMainnetIntegrationTest.java index 52c9652..81a39e7 100644 --- a/src/test/java/rest/koios/client/backend/api/block/BlockServiceMainnetIntegrationTest.java +++ b/src/test/java/rest/koios/client/backend/api/block/BlockServiceMainnetIntegrationTest.java @@ -122,7 +122,7 @@ void getBlockTransactionsBadRequestTest() { @Test void getBlockTransactionsInfoTest() throws ApiException { String hash = "f6192a1aaa6d3d05b4703891a6b66cd757801c61ace86cbe5ab0d66e07f601ab"; - Result> blockTransactionsResult = blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, Options.EMPTY); + Result> blockTransactionsResult = blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, true, Options.EMPTY); Assertions.assertTrue(blockTransactionsResult.isSuccessful()); Assertions.assertNotNull(blockTransactionsResult.getValue()); log.info(blockTransactionsResult.getValue().toString()); @@ -131,7 +131,7 @@ void getBlockTransactionsInfoTest() throws ApiException { @Test void getBlockTransactionsInfoBadRequestTest() { String hash = "test"; - ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, Options.EMPTY)); + ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, true, Options.EMPTY)); assertInstanceOf(ApiException.class, exception); } } diff --git a/src/test/java/rest/koios/client/backend/api/block/BlockServicePreprodIntegrationTest.java b/src/test/java/rest/koios/client/backend/api/block/BlockServicePreprodIntegrationTest.java index 510ed70..ff05eca 100644 --- a/src/test/java/rest/koios/client/backend/api/block/BlockServicePreprodIntegrationTest.java +++ b/src/test/java/rest/koios/client/backend/api/block/BlockServicePreprodIntegrationTest.java @@ -110,7 +110,7 @@ void getBlockTransactionsBadRequestTest() { @Test void getBlockTransactionsInfoTest() throws ApiException { String hash = "065b9f0a52b3d3897160a065a7fe2bcb64b2bf635937294ade457de6a7bfd2a4"; - Result> blockTransactionsResult = blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, Options.EMPTY); + Result> blockTransactionsResult = blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, true, Options.EMPTY); Assertions.assertTrue(blockTransactionsResult.isSuccessful()); Assertions.assertNotNull(blockTransactionsResult.getValue()); log.info(blockTransactionsResult.getValue().toString()); @@ -119,7 +119,7 @@ void getBlockTransactionsInfoTest() throws ApiException { @Test void getBlockTransactionsInfoBadRequestTest() { String hash = "test"; - ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, Options.EMPTY)); + ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, true, Options.EMPTY)); assertInstanceOf(ApiException.class, exception); } } diff --git a/src/test/java/rest/koios/client/backend/api/block/BlockServicePreviewIntegrationTest.java b/src/test/java/rest/koios/client/backend/api/block/BlockServicePreviewIntegrationTest.java index 107241b..173d748 100644 --- a/src/test/java/rest/koios/client/backend/api/block/BlockServicePreviewIntegrationTest.java +++ b/src/test/java/rest/koios/client/backend/api/block/BlockServicePreviewIntegrationTest.java @@ -110,7 +110,7 @@ void getBlockTransactionsBadRequestTest() { @Test void getBlockTransactionsInfoTest() throws ApiException { String hash = "501fc2c3e3d03f61ec6d19d3f8feb38f3c3c30df66c68027abbd6c99b5acef0e"; - Result> blockTransactionsResult = blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, Options.EMPTY); + Result> blockTransactionsResult = blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, true, Options.EMPTY); Assertions.assertTrue(blockTransactionsResult.isSuccessful()); Assertions.assertNotNull(blockTransactionsResult.getValue()); log.info(blockTransactionsResult.getValue().toString()); @@ -119,7 +119,7 @@ void getBlockTransactionsInfoTest() throws ApiException { @Test void getBlockTransactionsInfoBadRequestTest() { String hash = "test"; - ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, Options.EMPTY)); + ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, true, Options.EMPTY)); assertInstanceOf(ApiException.class, exception); } } diff --git a/src/test/java/rest/koios/client/backend/api/governance/GovernanceServiceMainnetIntegrationTest.java b/src/test/java/rest/koios/client/backend/api/governance/GovernanceServiceMainnetIntegrationTest.java index 8e0d013..93dc672 100644 --- a/src/test/java/rest/koios/client/backend/api/governance/GovernanceServiceMainnetIntegrationTest.java +++ b/src/test/java/rest/koios/client/backend/api/governance/GovernanceServiceMainnetIntegrationTest.java @@ -52,7 +52,7 @@ void getDRepsInfoTest() throws ApiException { @Test void getDRepsMetadataTest() throws ApiException { - List drepIds = List.of("drep17l6sywnwqu9aedd6aumev42w39ln5zfl9nw7j4ak6u8swyrwvz3", "drep1s9q5uyddsvza4uk2n9wswy90n8wx9d2jmrq4zgcvlyv055007av"); + List drepIds = List.of("drep1y2ltat8kjqrmnff3lkkpxy0j5tn66d3m0gy64dc92asft5g6dl9ws", "drep1s9q5uyddsvza4uk2n9wswy90n8wx9d2jmrq4zgcvlyv055007av"); Result> result = governanceService.getDRepsMetadata(drepIds, Options.EMPTY); Assertions.assertTrue(result.isSuccessful()); Assertions.assertNotNull(result.getValue());