diff --git a/README.md b/README.md index a725d91..b9cbf33 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
-
+
addr1qy9m8j6jp32fgnqjljk6ert9hlndcnptwhruzjamyevzgspgewr0dw33mfjfm72t8a2et6w48u4k5uwq2hgltxxs4a6sg6ptd9
diff --git a/pom.xml b/pom.xml
index 1d1e48b..7e0b003 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
404 - The server does not recognise the combination of endpoint and parameters provided
*
* @param stakeAddresses List of Cardano stake address(es) in bech32 format
- * @param extended Controls whether or not certain optional fields supported by a given endpoint are populated as a part of the call
+ * @param extended Controls whether certain optional fields supported by a given endpoint are populated as a part of the call
* @param options Filtering and Pagination options (optional)
* @return Result of Type List of {@link UTxO} associated with stake address
* @throws ApiException if an error occurs while attempting to invoke the API
@@ -99,8 +99,24 @@ public interface AccountService {
* @return Result of Type List of {@link AccountRewards}
* @throws ApiException if an error occurs while attempting to invoke the API
*/
+ @Deprecated
Result 200 - Success!
+ * 401 - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
+ * 404 - The server does not recognise the combination of endpoint and parameters provided
+ *
+ * @param addressList Array of Cardano stake address(es) in bech32 format
+ * @param epochNo Only fetch information for a specific epoch (optional)
+ * @param options Filtering and Pagination options (optional)
+ * @return Result of Type List of {@link AccountRewardHistory}
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result 200 - Success!
+ * 401 - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
+ * 404 - The server does not recognise the combination of endpoint and parameters provided
+ *
+ * @param addressList Array of Cardano stake address(es) in bech32 format (required)
+ * @param options Filtering and Pagination options (optional)
+ * @return Result of Type List of {@link AccountUpdateHistory}
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result 200 - Array of active stake values per epoch
+ * 401 - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
+ * 404 - The server does not recognise the combination of endpoint and parameters provided
+ *
+ * @param addressList Array of Cardano stake address(es) in bech32 format
+ * @param options Filtering and Pagination options (optional)
+ * @return Result of Type List of {@link AccountStakeHistory} active stake values per epoch
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result 404 - The server does not recognise the combination of endpoint and parameters provided
*
* @param addresses List of Cardano payment address(es) in bech32 format
- * @param extended Controls whether or not certain optional fields supported by a given endpoint are populated as a part of the call
+ * @param extended Controls whether certain optional fields supported by a given endpoint are populated as a part of the call
* @param options Filtering and Pagination options (optional)
* @return Result of Type List of address {@link UTxO}s.
* @throws ApiException if an error occurs while attempting to invoke the API
*/
Result 200 - List of basic transaction output information
+ * 401 - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
+ * 404 - The server does not recognise the combination of endpoint and parameters provided
+ *
+ * @param addresses List of Cardano payment address(es) in bech32 format
+ * @param afterBlockHeight Only fetch information after specific block height
+ * @param options Filtering and Pagination options (optional)
+ * @return Result of Type List of address {@link UTxO}s.
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result 404 - The server does not recognise the combination of endpoint and parameters provided
*
* @param paymentCredentials List of Cardano payment credential(s) in hex format
- * @param extended Controls whether or not certain optional fields supported by a given endpoint are populated as a part of the call
+ * @param extended Controls whether certain optional fields supported by a given endpoint are populated as a part of the call
* @param options Filtering and Pagination options (optional)
* @return Result of Type List of address {@link UTxO}s.
* @throws ApiException if an error occurs while attempting to invoke the API
diff --git a/src/main/java/rest/koios/client/backend/api/address/api/AddressApi.java b/src/main/java/rest/koios/client/backend/api/address/api/AddressApi.java
index 257dcfe..7ce3aef 100644
--- a/src/main/java/rest/koios/client/backend/api/address/api/AddressApi.java
+++ b/src/main/java/rest/koios/client/backend/api/address/api/AddressApi.java
@@ -1,5 +1,6 @@
package rest.koios.client.backend.api.address.api;
+import rest.koios.client.backend.api.address.model.AddressOutput;
import rest.koios.client.backend.api.base.common.TxHash;
import rest.koios.client.backend.api.address.model.AddressAsset;
import rest.koios.client.backend.api.address.model.AddressInfo;
@@ -38,6 +39,16 @@ public interface AddressApi {
@POST("address_utxos")
Call 200 - Success!!
+ * 400 - The server cannot process the request due to invalid input
+ * 401 - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
+ * 404 - The server does not recognise the combination of endpoint and parameters provided
+ *
+ * @param options Filtering options (optional)
+ * @return Result of Current Protocol Parameters as raw JSON {@link JsonNode}
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result 200 - Success!
+ * 401 - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
+ * 404 - The server does not recognise the combination of endpoint and parameters provided
+ *
+ * @param poolIds List of Cardano Pool Ids (bech32 format)
+ * @param options Filtering and Pagination options (optional)
+ * @return Result of Type List of {@link PoolOwnerHistory}
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result 200 - Success!
+ * 401 - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
+ * 404 - The server does not recognise the combination of endpoint and parameters provided
+ *
+ * @param options Filtering and Pagination options (optional)
+ * @return Result of Type List of {@link PoolGroup}
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result 200 - Success!
+ * 401 - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
+ * 404 - The server does not recognise the combination of endpoint and parameters provided
+ *
+ * @param options Filtering and Pagination options (optional)
+ * @return Result of Type List of {@link PoolCalidusKey}
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result> getAccountRewards(List
> getAccountRewardHistory(List
> getAccountUpdates(List
> getAccountUpdateHistory(List
> getAccountHistory(List
> getAccountStakeHistory(List
> getAccountRewards(@Body Map
> getAccountRewardHistory(@Body Map
> getAccountUpdates(@Body Map
> getAccountUpdateHistory(@Body Map
> getAccountHistory(@Body Map
> getAccountStakeHistory(@Body Map
> getAccountRewards(List
> getAccountRewardHistory(List
> call = accountApi.getAccountRewardHistory(buildBody("_stake_addresses", addressList, epochNo, null, null), optionsToParamMap(options));
+ return processResponse(call);
+ }
+
@Override
public Result
> getAccountUpdates(List
> getAccountUpdates(List
> getAccountUpdateHistory(List
> call = accountApi.getAccountUpdateHistory(buildBody("_stake_addresses", addressList, null, null, null), optionsToParamMap(options));
+ return processResponse(call);
+ }
+
@Override
public Result
> getAccountAddresses(List
> getAccountHistory(List
> getAccountStakeHistory(List
> call = accountApi.getAccountStakeHistory(buildBody("_stake_addresses", addressList, null, null, null), optionsToParamMap(options));
+ return processResponse(call);
+ }
+
private Map
> getAddressUTxOs(List
> getAddressOutputs(List
> getAddressUTxOs(@Body Map
> getAddressOutputs(@Body Map
> getAddressUTxOs(List
> getAddressOutputs(List
> call = addressApi.getAddressOutputs(buildBody("_addresses", addresses, afterBlockHeight), optionsToParamMap(options));
+ return processResponse(call);
+ }
+
@Override
public Result
> getUTxOsFromPaymentCredentials(List
> getBlockTransactions(List
> getBlockTransactionsCbor(List
> getBlockTransactionsInfo(List
> getBlockTransactions(@Body Map
> getBlockTransactionsCbor(@Body Map
> getBlockTransactionsInfo(@Body Map
> getBlockTransactions(List
> getBlockTransactionsCbor(List
> call = blockApi.getBlockTransactionsCbor(buildBody(blockHashes), optionsToParamMap(options));
+ return processResponse(call);
+ }
+
@Override
public Result
> getBlockTransactionsInfo(List
> getDRepsUpdates(String drepId, Options options) throws ApiException;
+ /**
+ * DReps Voting Power History
+ * History of DReps voting power against each (or requested) epoch
+ *
+ * @param drepId DRep ID in bech32 format
+ * @param epochNo Epoch Number to fetch details for
+ * @param options Filtering Options (optional)
+ * @return History of DReps voting power against each (or requested) epoch
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result
> getDRepsVotingPowerHistory(String drepId, Integer epochNo, Options options) throws ApiException;
+
/**
* DReps Votes
- * List of all votes casted by requested delegated representative (DRep)
+ * List of all votes cast by requested delegated representative (DRep)
*
* @param drepId DRep ID in bech32 format
* @param options Filtering Options (optional)
- * @return List of all votes casted by requested delegated representative (DRep)
+ * @return List of all votes cast by requested delegated representative (DRep)
* @throws ApiException if an error occurs while attempting to invoke the API
*/
+ @Deprecated
Result
> getDRepsVotes(String drepId, Options options) throws ApiException;
/**
@@ -100,11 +113,11 @@ public interface GovernanceService {
/**
* Committee Votes
- * List of all votes casted by a given committee member or collective
+ * List of all votes cast by a given committee member or collective
*
* @param ccHotId Committee member hot key ID in Bech32 format (CIP-5 | CIP-129)
* @param options Filtering Options (optional)
- * @return List of all votes casted by a given committee member or collective
+ * @return List of all votes cast by a given committee member or collective
* @throws ApiException if an error occurs while attempting to invoke the API
*/
Result
> getCommitteeVotes(String ccHotId, Options options) throws ApiException;
@@ -123,7 +136,7 @@ public interface GovernanceService {
* Voter's Proposal List
* List of all governance proposals for specified DRep, SPO or Committee credential
*
- * @param voterId Voter ID (DRep, SPO, Committee Member) in Bech32 format (CIP-5 | CIP-129)
+ * @param voterId Voter ID (DRep, SPO, Committee Member) in Bech32 format (CIP-5 | CIP-129) (optional)
* @param options Filtering Options (optional)
* @return List of all governance action proposals for the specified voter
* @throws ApiException if an error occurs while attempting to invoke the API
@@ -152,14 +165,37 @@ public interface GovernanceService {
*/
Result
> getProposalVotes(String proposalId, Options options) throws ApiException;
+ /**
+ * Vote List
+ * List of all votes posted on-chain
+ *
+ * @param options Filtering Options (optional)
+ * @return List of all votes posted on-chain
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result
> getVoteList(Options options) throws ApiException;
+
+ /**
+ * Pool's Voting Power History
+ * History of Pool voting power against each (or requested) epoch
+ *
+ * @param poolBech32 Pool ID in bech32 format
+ * @param epochNo Epoch Number to fetch details for
+ * @param options Filtering Options (optional)
+ * @return List of all votes cast by the requested pool
+ * @throws ApiException if an error occurs while attempting to invoke the API
+ */
+ Result
> getPoolsVotingPowerHistory(String poolBech32, Integer epochNo, Options options) throws ApiException;
+
/**
* Pool Votes
- * List of all votes casted by a pool
+ * List of all votes cast by a pool
*
* @param poolBech32 Pool ID in bech32 format
* @param options Filtering Options (optional)
- * @return List of all votes casted by the requested pool
+ * @return List of all votes cast by the requested pool
* @throws ApiException if an error occurs while attempting to invoke the API
*/
+ @Deprecated
Result
> getPoolVotes(String poolBech32, Options options) throws ApiException;
}
diff --git a/src/main/java/rest/koios/client/backend/api/governance/api/GovernanceApi.java b/src/main/java/rest/koios/client/backend/api/governance/api/GovernanceApi.java
index 2bc7255..868cc8e 100644
--- a/src/main/java/rest/koios/client/backend/api/governance/api/GovernanceApi.java
+++ b/src/main/java/rest/koios/client/backend/api/governance/api/GovernanceApi.java
@@ -66,6 +66,17 @@ public interface GovernanceApi {
@GET("drep_updates")
Call
> getDRepsUpdates(@Query("_drep_id") String drepId, @QueryMap Map
> getDRepsVotingPowerHistory(@Query("_drep_id") String drepId, @QueryMap Map
> getDRepsVotes(@Query("_drep_id") String drepId, @QueryMap Map
> getVoterProposal(@Query("_voter_id") String voterId, @QueryMap Map
> getVoterProposal(@QueryMap Map
> getProposalVotes(@Query("_proposal_id") String proposalId, @QueryMap Map
> getVoteList(@QueryMap Map
> getPoolsVotingPowerHistory(@Query("_pool_bech32") String poolBech32, @QueryMap Map
> getPoolVotes(@Query("_pool_bech32") String poolBech32, @QueryMap Map
> getDRepsUpdates(String drepId, Options options)
return processResponse(call);
}
+ @Override
+ public Result
> getDRepsVotingPowerHistory(String drepId, Integer epochNo, Options options) throws ApiException {
+ if (epochNo != null) {
+ validateEpoch(epochNo);
+ if (options == null) {
+ options = new Options();
+ }
+ options.getOptionList().add(Filter.of("epoch_no", FilterType.EQ, String.valueOf(epochNo)));
+ }
+ Call
> call = governanceApi.getDRepsVotingPowerHistory(drepId, optionsToParamMap(options));
+ return processResponse(call);
+ }
+
@Override
public Result
> getDRepsVotes(String drepId, Options options) throws ApiException {
Call
> call = governanceApi.getDRepsVotes(drepId, optionsToParamMap(options));
@@ -93,7 +108,16 @@ public Result
> getProposalList(Options options) throws ApiExcepti
@Override
public Result
> getVoterProposals(String voterId, Options options) throws ApiException {
- Call
> call = governanceApi.getVoterProposal(voterId, optionsToParamMap(options));
+ Map
> call = governanceApi.getVoterProposal(paramsMap);
return processResponse(call);
}
@@ -109,6 +133,25 @@ public Result
> getProposalVotes(String proposalId, Options op
return processResponse(call);
}
+ @Override
+ public Result
> getVoteList(Options options) throws ApiException {
+ Call
> call = governanceApi.getVoteList(optionsToParamMap(options));
+ return processResponse(call);
+ }
+
+ @Override
+ public Result
> getPoolsVotingPowerHistory(String poolBech32, Integer epochNo, Options options) throws ApiException {
+ if (epochNo != null) {
+ validateEpoch(epochNo);
+ if (options == null) {
+ options = new Options();
+ }
+ options.getOptionList().add(Filter.of("epoch_no", FilterType.EQ, String.valueOf(epochNo)));
+ }
+ Call
> call = governanceApi.getPoolsVotingPowerHistory(poolBech32, optionsToParamMap(options));
+ return processResponse(call);
+ }
+
@Override
public Result
> getPoolVotes(String poolBech32, Options options) throws ApiException {
Call
> call = governanceApi.getPoolVotes(poolBech32, optionsToParamMap(options));
diff --git a/src/main/java/rest/koios/client/backend/api/governance/model/DRepVotingPowerHistory.java b/src/main/java/rest/koios/client/backend/api/governance/model/DRepVotingPowerHistory.java
new file mode 100644
index 0000000..bee8628
--- /dev/null
+++ b/src/main/java/rest/koios/client/backend/api/governance/model/DRepVotingPowerHistory.java
@@ -0,0 +1,32 @@
+package rest.koios.client.backend.api.governance.model;
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import lombok.*;
+
+/**
+ * DRep Voting Power History
+ */
+@Getter
+@Setter
+@ToString
+@NoArgsConstructor
+@EqualsAndHashCode
+@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
+public class DRepVotingPowerHistory {
+
+ /**
+ * DRep ID in CIP-129 bech32 format
+ */
+ private String drepId;
+
+ /**
+ * Epoch number of the block
+ */
+ private Integer epochNo;
+
+ /**
+ * History of DReps voting power against each (or requested) epoch
+ */
+ private String amount;
+}
diff --git a/src/main/java/rest/koios/client/backend/api/governance/model/PoolsVotingPowerHistory.java b/src/main/java/rest/koios/client/backend/api/governance/model/PoolsVotingPowerHistory.java
new file mode 100644
index 0000000..96a64da
--- /dev/null
+++ b/src/main/java/rest/koios/client/backend/api/governance/model/PoolsVotingPowerHistory.java
@@ -0,0 +1,32 @@
+package rest.koios.client.backend.api.governance.model;
+
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import lombok.*;
+
+/**
+ * Pools Voting Power History
+ */
+@Getter
+@Setter
+@ToString
+@NoArgsConstructor
+@EqualsAndHashCode
+@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
+public class PoolsVotingPowerHistory {
+
+ /**
+ * Pool ID (bech32 format)
+ */
+ private String poolIdBech32;
+
+ /**
+ * Epoch number of the block
+ */
+ private Integer epochNo;
+
+ /**
+ * The voting power for the pool for the epoch
+ */
+ private String amount;
+}
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 96cb155..e1ff34d 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
@@ -1,10 +1,8 @@
package rest.koios.client.backend.api.governance.model;
-import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.*;
-import rest.koios.client.backend.api.transactions.model.TxWithdrawal;
/**
* Proposal Voting Summary
@@ -33,9 +31,14 @@ public class ProposalVotingSummary {
private Integer drepYesVotesCast;
/**
- * Power of 'yes' votes from dreps
+ * Power of 'yes' votes that were explicitly cast
*/
- private Integer drepYesVotePower;
+ private String drepActiveYesVotePower;
+
+ /**
+ * Power of 'yes' votes from dreps (includes explicit yes and inferred via other means)
+ */
+ private String drepYesVotePower;
/**
* Percentage of 'yes' votes from dreps
@@ -48,9 +51,14 @@ public class ProposalVotingSummary {
private Integer drepNoVotesCast;
/**
- * Power of 'no' votes from dreps
+ * Power of 'no' votes that were explicitly cast
+ */
+ private String drepActiveNoVotePower;
+
+ /**
+ * Power of 'no' votes from dreps (includes explicit no and inferred via other means)
*/
- private Integer drepNoVotePower;
+ private String drepNoVotePower;
/**
* Percentage of 'no' votes from dreps
@@ -62,15 +70,35 @@ public class ProposalVotingSummary {
*/
private Integer drepAbstainVotesCast;
+ /**
+ * Power of 'abstain' votes that were explicitly cast
+ */
+ private String drepActiveAbstainVotePower;
+
+ /**
+ * Power of votes delegated to 'always_no_confidence' predefined drep
+ */
+ private String drepAlwaysNoConfidenceVotePower;
+
+ /**
+ * Power of votes delegated to 'always_abstain' predefined drep
+ */
+ private String drepAlwaysAbstainVotePower;
+
/**
* Number of 'yes' votes casted by pools
*/
private Integer poolYesVotesCast;
/**
- * Power of 'yes' votes from pools
+ * Power of 'yes' pool votes that were explicitly cast
+ */
+ private String poolActiveYesVotePower;
+
+ /**
+ * Power of 'yes' votes from pools (includes explicit yes and inferred via other means)
*/
- private Integer poolYesVotePower;
+ private String poolYesVotePower;
/**
* Percentage of 'yes' votes from pools
@@ -83,9 +111,14 @@ public class ProposalVotingSummary {
private Integer poolNoVotesCast;
/**
- * Power of 'no' votes from pools
+ * Power of 'no' pool votes that were explicitly cast
*/
- private Integer poolNoVotePower;
+ private String poolActiveNoVotePower;
+
+ /**
+ * Power of 'no' votes from pools (includes explicit no and inferred via other means)
+ */
+ private String poolNoVotePower;
/**
* Percentage of 'no' votes from pools
@@ -97,6 +130,11 @@ public class ProposalVotingSummary {
*/
private Double poolAbstainVotesCast;
+ /**
+ * Power of 'abstain' pool votes that were explicitly cast
+ */
+ private String poolActiveAbstainVotePower;
+
/**
* Number of non-voting SPO pool reward addresses delegating to 'always_abstain' drep
*/
diff --git a/src/main/java/rest/koios/client/backend/api/governance/model/Vote.java b/src/main/java/rest/koios/client/backend/api/governance/model/Vote.java
new file mode 100644
index 0000000..8394dd9
--- /dev/null
+++ b/src/main/java/rest/koios/client/backend/api/governance/model/Vote.java
@@ -0,0 +1,88 @@
+package rest.koios.client.backend.api.governance.model;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import lombok.*;
+
+/**
+ * Vote
+ */
+@Getter
+@Setter
+@ToString
+@NoArgsConstructor
+@EqualsAndHashCode
+@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
+public class Vote {
+
+ /**
+ * The transaction hash where-in vote was posted
+ */
+ private String voteTxHash;
+
+ /**
+ * The role of the voter (ConstitutionalCommittee, DRep, SPO)
+ */
+ private String voterRole;
+
+ /**
+ * Voter's DRep ID (CIP-129 bech32 format), pool ID (bech32 format) or committee
+ */
+ private String voterId;
+
+ /**
+ * Proposal Action ID in accordance with CIP-129 format
+ */
+ private String proposalId;
+
+ /**
+ * Hash identifier of the proposal transaction
+ */
+ private String proposalTxHash;
+
+ /**
+ * Index of governance proposal in transaction
+ */
+ private Integer proposalIndex;
+
+ /**
+ * Proposal Action Type (ParameterChange, HardForkInitiation, TreasuryWithdrawals, NoConfidence, NewCommittee, NewConstitution, InfoAction)
+ */
+ private String proposalType;
+
+ /**
+ * Epoch number of the block
+ */
+ private Integer epochNo;
+
+ /**
+ * Block Height
+ */
+ private Integer blockHeight;
+
+ /**
+ * UNIX timestamp of the block
+ */
+ private Integer blockTime;
+
+ /**
+ * Actual Vote casted (Yes, No, Abstain)
+ */
+ private String vote;
+
+ /**
+ * A URL to a JSON payload of metadata (null if not applicable)
+ */
+ private String metaUrl;
+
+ /**
+ * A hash of the contents of the metadata URL (null if not applicable)
+ */
+ private String metaHash;
+
+ /**
+ * The payload as JSON
+ */
+ private JsonNode metaJson;
+}
diff --git a/src/main/java/rest/koios/client/backend/api/network/NetworkService.java b/src/main/java/rest/koios/client/backend/api/network/NetworkService.java
index 8ef3f82..d28b425 100644
--- a/src/main/java/rest/koios/client/backend/api/network/NetworkService.java
+++ b/src/main/java/rest/koios/client/backend/api/network/NetworkService.java
@@ -1,5 +1,6 @@
package rest.koios.client.backend.api.network;
+import com.fasterxml.jackson.databind.JsonNode;
import rest.koios.client.backend.api.base.Result;
import rest.koios.client.backend.api.base.exception.ApiException;
import rest.koios.client.backend.api.network.model.*;
@@ -76,6 +77,20 @@ public interface NetworkService {
*/
Result
> getParamUpdateProposals(Options options) throws ApiException;
+ /**
+ * CLI Protocol Parameters
+ * Get Current Protocol Parameters as published by cardano-cli. Note that the output schema of this command is unfortunately fluid on cardano-node and may vary between CLI versions/era. Accordingly, the returned output for this endpoint is left as raw JSON (single row) and any filtering to output should be done on client-side
+ *
> getParamUpdateProposals(@QueryMap Map
> getReserveWithdrawals(@QueryMap Map
> getHistoricalTokenomicStats(Options options) throws
@Override
public Result
> getParamUpdateProposals(Options options) throws ApiException {
Call
> call = networkApi.getParamUpdateProposals(optionsToParamMap(options));
- ;
+ return processResponse(call);
+ }
+
+ @Override
+ public Result
> getPoolBlocks(String poolBech32, Options options) throws ApiException;
+ /**
+ * Return information about pool owner's historical stake and their promised pledge to their pools
+ *
> getPoolOwnerHistory(List
> getPoolRelays(Options options) throws ApiException;
+ /**
+ * Pool Groups with Filtering, Pagination, Ordering Options
+ * List of all registered pool and their groups across sources from pool_groups repository. This is only relevant for mainnet
+ *
> getPoolGroups(Options options) throws ApiException;
+
/**
* Pool Metadata with Filtering, Pagination, Ordering Options
* Metadata(on & off-chain) for all currently registered/retiring (not retired) pools
@@ -234,4 +260,17 @@ public interface PoolService {
* @throws ApiException if an error occurs while attempting to invoke the API
*/
Result
> getPoolMetadata(List
> getPoolCalidusKeys(Options options) throws ApiException;
}
diff --git a/src/main/java/rest/koios/client/backend/api/pool/api/PoolApi.java b/src/main/java/rest/koios/client/backend/api/pool/api/PoolApi.java
index 7c5233a..fe07838 100644
--- a/src/main/java/rest/koios/client/backend/api/pool/api/PoolApi.java
+++ b/src/main/java/rest/koios/client/backend/api/pool/api/PoolApi.java
@@ -84,6 +84,17 @@ public interface PoolApi {
@GET("pool_blocks")
Call
> getPoolBlocks(@Query("_pool_bech32") String poolBech32, @QueryMap Map
> getPoolOwnerHistory(@Body Map
> getPoolRelays(@QueryMap Map
> getPoolGroups(@QueryMap Map
> getPoolMetadata(@Body Map
> getPoolCalidusKeys(@QueryMap Map
> getPoolBlocks(String poolBech32, Options options)
return processResponse(call);
}
+ @Override
+ public Result
> getPoolOwnerHistory(List
> call = poolApi.getPoolOwnerHistory(buildBody(poolIds), optionsToParamMap(options));
+ return processResponse(call);
+ }
+
@Override
public Result
> getPoolRelays(Options options) throws ApiExceptio
return processResponse(call);
}
+ @Override
+ public Result
> getPoolGroups(Options options) throws ApiException {
+ Call
> call = poolApi.getPoolGroups(optionsToParamMap(options));
+ return processResponse(call);
+ }
+
@Override
public Result
> getPoolMetadata(Options options) throws ApiException {
return getPoolMetadata(Collections.emptyList(), options);
@@ -146,6 +161,12 @@ public Result
> getPoolMetadata(List
> getPoolCalidusKeys(Options options) throws ApiException {
+ Call
> call = poolApi.getPoolCalidusKeys(optionsToParamMap(options));
+ return processResponse(call);
+ }
+
private Map
> accountRewardsResult = accountService.getAccountRewards(List.of(stakeAddress), epochNo, Options.EMPTY);
+ Result
> accountRewardsResult = accountService.getAccountRewardHistory(List.of(stakeAddress), epochNo, Options.EMPTY);
Assertions.assertTrue(accountRewardsResult.isSuccessful());
Assertions.assertNotNull(accountRewardsResult.getValue());
- assertEquals(epochNo, accountRewardsResult.getValue().get(0).getRewards().get(0).getEarnedEpoch());
+ assertEquals(epochNo, accountRewardsResult.getValue().get(0).getEarnedEpoch());
log.info(accountRewardsResult.getValue().toString());
}
@Test
void getAccountRewardsBadRequestTest() {
String stakeAddress = "a123sd";
- ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountRewards(List.of(stakeAddress), 294, Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountRewardHistory(List.of(stakeAddress), 294, Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}
@Test
void getAccountUpdatesTest() throws ApiException {
String stakeAddress = "stake1u8yxtugdv63wxafy9d00nuz6hjyyp4qnggvc9a3vxh8yl0ckml2uz";
- Result
> accountUpdatesResult = accountService.getAccountUpdates(List.of(stakeAddress), Options.EMPTY);
+ Result
> accountUpdatesResult = accountService.getAccountUpdateHistory(List.of(stakeAddress), Options.EMPTY);
Assertions.assertTrue(accountUpdatesResult.isSuccessful());
Assertions.assertNotNull(accountUpdatesResult.getValue());
log.info(accountUpdatesResult.getValue().toString());
@@ -133,7 +133,7 @@ void getAccountUpdatesTest() throws ApiException {
@Test
void getAccountUpdatesBadRequestTest() {
String stakeAddress = "a123sd";
- ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountUpdates(List.of(stakeAddress), Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountUpdateHistory(List.of(stakeAddress), Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}
@@ -172,7 +172,7 @@ void getAccountAssetsBadRequestTest() {
@Test
void getAccountHistoryTest() throws ApiException {
String address = "stake1u8yxtugdv63wxafy9d00nuz6hjyyp4qnggvc9a3vxh8yl0ckml2uz";
- Result
> accountHistoryResult = accountService.getAccountHistory(List.of(address), null, Options.EMPTY);
+ Result
> accountHistoryResult = accountService.getAccountStakeHistory(List.of(address), Options.EMPTY);
Assertions.assertTrue(accountHistoryResult.isSuccessful());
Assertions.assertNotNull(accountHistoryResult.getValue());
log.info(accountHistoryResult.getValue().toString());
@@ -181,7 +181,7 @@ void getAccountHistoryTest() throws ApiException {
@Test
void getAccountHistoryBadRequestTest() {
String address = "a123sd";
- ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountHistory(List.of(address), null, Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountStakeHistory(List.of(address), Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}
}
diff --git a/src/test/java/rest/koios/client/backend/api/account/AccountServicePreprodIntegrationTest.java b/src/test/java/rest/koios/client/backend/api/account/AccountServicePreprodIntegrationTest.java
index d65ec6e..0cfee6c 100644
--- a/src/test/java/rest/koios/client/backend/api/account/AccountServicePreprodIntegrationTest.java
+++ b/src/test/java/rest/koios/client/backend/api/account/AccountServicePreprodIntegrationTest.java
@@ -107,26 +107,25 @@ void getAccountTxsBadRequestTest() {
void getAccountRewardsTest() throws ApiException {
int epochNo = 33;
String stakeAddress = "stake_test1uzcmuv8c6pj3ld9mrvml3jhxl7j4hvh4xskr6ce37dvpfdqjmdvh8";
- Result
> accountRewardsResult = accountService.getAccountRewards(List.of(stakeAddress), epochNo, Options.EMPTY);
+ Result
> accountRewardsResult = accountService.getAccountRewardHistory(List.of(stakeAddress), epochNo, Options.EMPTY);
Assertions.assertTrue(accountRewardsResult.isSuccessful());
Assertions.assertNotNull(accountRewardsResult.getValue());
assertFalse(accountRewardsResult.getValue().isEmpty());
- assertFalse(accountRewardsResult.getValue().get(0).getRewards().isEmpty());
- assertEquals(epochNo, accountRewardsResult.getValue().get(0).getRewards().get(0).getEarnedEpoch());
+ assertEquals(epochNo, accountRewardsResult.getValue().get(0).getEarnedEpoch());
log.info(accountRewardsResult.getValue().toString());
}
@Test
void getAccountRewardsBadRequestBadAddressTest() {
String stakeAddress = "a123sd";
- ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountRewards(List.of(stakeAddress), 180, Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountRewardHistory(List.of(stakeAddress), 180, Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}
@Test
void getAccountUpdatesTest() throws ApiException {
String stakeAddress = "stake_test1uzcmuv8c6pj3ld9mrvml3jhxl7j4hvh4xskr6ce37dvpfdqjmdvh8";
- Result
> accountUpdatesResult = accountService.getAccountUpdates(List.of(stakeAddress), Options.EMPTY);
+ Result
> accountUpdatesResult = accountService.getAccountUpdateHistory(List.of(stakeAddress), Options.EMPTY);
Assertions.assertTrue(accountUpdatesResult.isSuccessful());
Assertions.assertNotNull(accountUpdatesResult.getValue());
log.info(accountUpdatesResult.getValue().toString());
@@ -135,7 +134,7 @@ void getAccountUpdatesTest() throws ApiException {
@Test
void getAccountUpdatesBadRequestTest() {
String stakeAddress = "a123sd";
- ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountUpdates(List.of(stakeAddress), Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountUpdateHistory(List.of(stakeAddress), Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}
@@ -174,7 +173,7 @@ void getAccountAssetsBadRequestTest() {
@Test
void getAccountHistoryTest() throws ApiException {
String address = "stake_test1uzcmuv8c6pj3ld9mrvml3jhxl7j4hvh4xskr6ce37dvpfdqjmdvh8";
- Result
> accountHistoryResult = accountService.getAccountHistory(List.of(address),null, Options.EMPTY);
+ Result
> accountHistoryResult = accountService.getAccountStakeHistory(List.of(address), Options.EMPTY);
Assertions.assertTrue(accountHistoryResult.isSuccessful());
Assertions.assertNotNull(accountHistoryResult.getValue());
log.info(accountHistoryResult.getValue().toString());
@@ -183,7 +182,7 @@ void getAccountHistoryTest() throws ApiException {
@Test
void getAccountHistoryBadRequestTest() {
String address = "a123sd";
- ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountHistory(List.of(address), null, Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountStakeHistory(List.of(address), Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}
}
diff --git a/src/test/java/rest/koios/client/backend/api/account/AccountServicePreviewIntegrationTest.java b/src/test/java/rest/koios/client/backend/api/account/AccountServicePreviewIntegrationTest.java
index 7c829e0..529e520 100644
--- a/src/test/java/rest/koios/client/backend/api/account/AccountServicePreviewIntegrationTest.java
+++ b/src/test/java/rest/koios/client/backend/api/account/AccountServicePreviewIntegrationTest.java
@@ -107,24 +107,24 @@ void getAccountTxsBadRequestTest() {
void getAccountRewardsTest() throws ApiException {
int epochNo = 21;
String stakeAddress = "stake_test1uzcmuv8c6pj3ld9mrvml3jhxl7j4hvh4xskr6ce37dvpfdqjmdvh8";
- Result
> accountRewardsResult = accountService.getAccountRewards(List.of(stakeAddress), epochNo, Options.EMPTY);
+ Result
> accountRewardsResult = accountService.getAccountRewardHistory(List.of(stakeAddress), epochNo, Options.EMPTY);
Assertions.assertTrue(accountRewardsResult.isSuccessful());
Assertions.assertNotNull(accountRewardsResult.getValue());
- assertEquals(epochNo, accountRewardsResult.getValue().get(0).getRewards().get(0).getEarnedEpoch());
+ assertEquals(epochNo, accountRewardsResult.getValue().get(0).getEarnedEpoch());
log.info(accountRewardsResult.getValue().toString());
}
@Test
void getAccountRewardsBadRequestBadAddressTest() {
String stakeAddress = "a123sd";
- ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountRewards(List.of(stakeAddress), 180, Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountRewardHistory(List.of(stakeAddress), 180, Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}
@Test
void getAccountUpdatesTest() throws ApiException {
String stakeAddress = "stake_test1uzcmuv8c6pj3ld9mrvml3jhxl7j4hvh4xskr6ce37dvpfdqjmdvh8";
- Result
> accountUpdatesResult = accountService.getAccountUpdates(List.of(stakeAddress), Options.EMPTY);
+ Result
> accountUpdatesResult = accountService.getAccountUpdateHistory(List.of(stakeAddress), Options.EMPTY);
Assertions.assertTrue(accountUpdatesResult.isSuccessful());
Assertions.assertNotNull(accountUpdatesResult.getValue());
log.info(accountUpdatesResult.getValue().toString());
@@ -133,7 +133,7 @@ void getAccountUpdatesTest() throws ApiException {
@Test
void getAccountUpdatesBadRequestTest() {
String stakeAddress = "a123sd";
- ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountUpdates(List.of(stakeAddress), Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountUpdateHistory(List.of(stakeAddress), Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}
@@ -172,7 +172,7 @@ void getAccountAssetsBadRequestTest() {
@Test
void getAccountHistoryTest() throws ApiException {
String address = "stake_test1uzcmuv8c6pj3ld9mrvml3jhxl7j4hvh4xskr6ce37dvpfdqjmdvh8";
- Result
> accountHistoryResult = accountService.getAccountHistory(List.of(address),null, Options.EMPTY);
+ Result
> accountHistoryResult = accountService.getAccountStakeHistory(List.of(address), Options.EMPTY);
Assertions.assertTrue(accountHistoryResult.isSuccessful());
Assertions.assertNotNull(accountHistoryResult.getValue());
log.info(accountHistoryResult.getValue().toString());
@@ -181,7 +181,7 @@ void getAccountHistoryTest() throws ApiException {
@Test
void getAccountHistoryBadRequestTest() {
String address = "a123sd";
- ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountHistory(List.of(address), null, Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> accountService.getAccountStakeHistory(List.of(address), Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}
}
diff --git a/src/test/java/rest/koios/client/backend/api/address/AddressServiceMainnetIntegrationTest.java b/src/test/java/rest/koios/client/backend/api/address/AddressServiceMainnetIntegrationTest.java
index 67cf162..0e2c353 100644
--- a/src/test/java/rest/koios/client/backend/api/address/AddressServiceMainnetIntegrationTest.java
+++ b/src/test/java/rest/koios/client/backend/api/address/AddressServiceMainnetIntegrationTest.java
@@ -5,6 +5,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
+import rest.koios.client.backend.api.address.model.AddressOutput;
import rest.koios.client.backend.api.base.common.TxHash;
import rest.koios.client.backend.api.address.model.AddressAsset;
import rest.koios.client.backend.api.address.model.AddressInfo;
@@ -75,6 +76,16 @@ void getAddressUTxOsBadRequestTest() {
assertInstanceOf(ApiException.class, exception);
}
+ @Test
+ void getAddressOutputs() throws ApiException {
+ List
> addressUTxOsResult = addressService.getAddressOutputs(addresses, 6238675, Options.EMPTY);
+ Assertions.assertTrue(addressUTxOsResult.isSuccessful());
+ Assertions.assertNotNull(addressUTxOsResult.getValue());
+ log.info(addressUTxOsResult.getValue().toString());
+ }
+
@Test
void getUTxOsFromPaymentCredentialsTest() throws ApiException {
List
> blockTransactionsResult = blockService.getBlockTransactionsCbor(List.of(hash), Options.EMPTY);
+ Assertions.assertTrue(blockTransactionsResult.isSuccessful());
+ Assertions.assertNotNull(blockTransactionsResult.getValue());
+ log.info(blockTransactionsResult.getValue().toString());
+ }
+
+ @Test
+ void getBlockTransactionsCborBadRequestTest() {
+ String hash = "test";
+ ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsCbor(List.of(hash), Options.EMPTY));
+ assertInstanceOf(ApiException.class, exception);
+ }
+
@Test
void getBlockTransactionsInfoTest() throws ApiException {
String hash = "f6192a1aaa6d3d05b4703891a6b66cd757801c61ace86cbe5ab0d66e07f601ab";
- Result
> blockTransactionsResult = blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, true, Options.EMPTY);
+ Result
> blockTransactionsResult = blockService.getBlockTransactionsCbor(List.of(hash), Options.EMPTY);
Assertions.assertTrue(blockTransactionsResult.isSuccessful());
Assertions.assertNotNull(blockTransactionsResult.getValue());
log.info(blockTransactionsResult.getValue().toString());
@@ -131,7 +147,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, true, Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsCbor(List.of(hash), 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 ff05eca..2d70832 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
@@ -9,8 +9,8 @@
import rest.koios.client.backend.api.base.exception.ApiException;
import rest.koios.client.backend.api.block.model.Block;
import rest.koios.client.backend.api.block.model.BlockInfo;
+import rest.koios.client.backend.api.block.model.BlockTxCbor;
import rest.koios.client.backend.api.block.model.BlockTxHash;
-import rest.koios.client.backend.api.transactions.model.TxInfo;
import rest.koios.client.backend.factory.BackendFactory;
import rest.koios.client.backend.factory.options.Limit;
import rest.koios.client.backend.factory.options.Options;
@@ -107,10 +107,26 @@ void getBlockTransactionsBadRequestTest() {
assertInstanceOf(ApiException.class, exception);
}
+ @Test
+ void getBlockTransactionsCborTest() throws ApiException {
+ String hash = "065b9f0a52b3d3897160a065a7fe2bcb64b2bf635937294ade457de6a7bfd2a4";
+ Result
> blockTransactionsResult = blockService.getBlockTransactionsCbor(List.of(hash), Options.EMPTY);
+ Assertions.assertTrue(blockTransactionsResult.isSuccessful());
+ Assertions.assertNotNull(blockTransactionsResult.getValue());
+ log.info(blockTransactionsResult.getValue().toString());
+ }
+
+ @Test
+ void getBlockTransactionsCborBadRequestTest() {
+ String hash = "test";
+ ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsCbor(List.of(hash), Options.EMPTY));
+ assertInstanceOf(ApiException.class, exception);
+ }
+
@Test
void getBlockTransactionsInfoTest() throws ApiException {
String hash = "065b9f0a52b3d3897160a065a7fe2bcb64b2bf635937294ade457de6a7bfd2a4";
- Result
> blockTransactionsResult = blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, true, Options.EMPTY);
+ Result
> blockTransactionsResult = blockService.getBlockTransactionsCbor(List.of(hash), Options.EMPTY);
Assertions.assertTrue(blockTransactionsResult.isSuccessful());
Assertions.assertNotNull(blockTransactionsResult.getValue());
log.info(blockTransactionsResult.getValue().toString());
@@ -119,7 +135,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, true, Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsCbor(List.of(hash), 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 173d748..f04b3fc 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
@@ -9,8 +9,8 @@
import rest.koios.client.backend.api.base.exception.ApiException;
import rest.koios.client.backend.api.block.model.Block;
import rest.koios.client.backend.api.block.model.BlockInfo;
+import rest.koios.client.backend.api.block.model.BlockTxCbor;
import rest.koios.client.backend.api.block.model.BlockTxHash;
-import rest.koios.client.backend.api.transactions.model.TxInfo;
import rest.koios.client.backend.factory.BackendFactory;
import rest.koios.client.backend.factory.options.Limit;
import rest.koios.client.backend.factory.options.Options;
@@ -107,10 +107,26 @@ void getBlockTransactionsBadRequestTest() {
assertInstanceOf(ApiException.class, exception);
}
+ @Test
+ void getBlockTransactionsCborTest() throws ApiException {
+ String hash = "501fc2c3e3d03f61ec6d19d3f8feb38f3c3c30df66c68027abbd6c99b5acef0e";
+ Result
> blockTransactionsResult = blockService.getBlockTransactionsCbor(List.of(hash), Options.EMPTY);
+ Assertions.assertTrue(blockTransactionsResult.isSuccessful());
+ Assertions.assertNotNull(blockTransactionsResult.getValue());
+ log.info(blockTransactionsResult.getValue().toString());
+ }
+
+ @Test
+ void getBlockTransactionsCborBadRequestTest() {
+ String hash = "test";
+ ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsCbor(List.of(hash), Options.EMPTY));
+ assertInstanceOf(ApiException.class, exception);
+ }
+
@Test
void getBlockTransactionsInfoTest() throws ApiException {
String hash = "501fc2c3e3d03f61ec6d19d3f8feb38f3c3c30df66c68027abbd6c99b5acef0e";
- Result
> blockTransactionsResult = blockService.getBlockTransactionsInfo(List.of(hash), true, true, true, true, true, true, true, Options.EMPTY);
+ Result
> blockTransactionsResult = blockService.getBlockTransactionsCbor(List.of(hash), Options.EMPTY);
Assertions.assertTrue(blockTransactionsResult.isSuccessful());
Assertions.assertNotNull(blockTransactionsResult.getValue());
log.info(blockTransactionsResult.getValue().toString());
@@ -119,7 +135,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, true, Options.EMPTY));
+ ApiException exception = assertThrows(ApiException.class, () -> blockService.getBlockTransactionsCbor(List.of(hash), 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 93dc672..ff31e29 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
@@ -10,6 +10,8 @@
import rest.koios.client.backend.api.governance.model.*;
import rest.koios.client.backend.factory.BackendFactory;
import rest.koios.client.backend.factory.options.Options;
+import rest.koios.client.backend.factory.options.filters.Filter;
+import rest.koios.client.backend.factory.options.filters.FilterType;
import java.util.List;
@@ -68,10 +70,20 @@ void getDRepsUpdatesTest() throws ApiException {
log.info(result.getValue().toString());
}
+ @Test
+ void getDRepsVotingPowerTest() throws ApiException {
+ int epochNo = 320;
+ String drepId = "drep17l6sywnwqu9aedd6aumev42w39ln5zfl9nw7j4ak6u8swyrwvz3";
+ Result
> result = governanceService.getDRepsVotingPowerHistory(drepId, epochNo, Options.EMPTY);
+ Assertions.assertTrue(result.isSuccessful());
+ Assertions.assertNotNull(result.getValue());
+ log.info(result.getValue().toString());
+ }
+
@Test
void getDRepsVotesTest() throws ApiException {
String drepId = "drep17l6sywnwqu9aedd6aumev42w39ln5zfl9nw7j4ak6u8swyrwvz3";
- Result
> result = governanceService.getDRepsVotes(drepId, Options.EMPTY);
+ Result
> result = governanceService.getVoteList(Options.builder().option(Filter.of("voter_id", FilterType.EQ, drepId)).build());
Assertions.assertTrue(result.isSuccessful());
Assertions.assertNotNull(result.getValue());
log.info(result.getValue().toString());
@@ -138,10 +150,20 @@ void getProposalVotesTest() throws ApiException {
log.info(result.getValue().toString());
}
+ @Test
+ void getPoolsVotingPowerHistoryTest() throws ApiException {
+ int epochNo = 320;
+ String poolBech32 = "pool155efqn9xpcf73pphkk88cmlkdwx4ulkg606tne970qswczg3asc";
+ Result
> result = governanceService.getPoolsVotingPowerHistory(poolBech32, epochNo, Options.EMPTY);
+ Assertions.assertTrue(result.isSuccessful());
+ Assertions.assertNotNull(result.getValue());
+ log.info(result.getValue().toString());
+ }
+
@Test
void getPoolVotesTest() throws ApiException {
String poolBech32 = "pool155efqn9xpcf73pphkk88cmlkdwx4ulkg606tne970qswczg3asc";
- Result
> result = governanceService.getPoolVotes(poolBech32, Options.EMPTY);
+ Result
> result = governanceService.getVoteList(Options.builder().option(Filter.of("voter_id", FilterType.EQ, poolBech32)).build());
Assertions.assertTrue(result.isSuccessful());
Assertions.assertNotNull(result.getValue());
log.info(result.getValue().toString());
diff --git a/src/test/java/rest/koios/client/backend/api/network/NetworkServiceMainnetIntegrationTest.java b/src/test/java/rest/koios/client/backend/api/network/NetworkServiceMainnetIntegrationTest.java
index 4da11c4..ffafed8 100644
--- a/src/test/java/rest/koios/client/backend/api/network/NetworkServiceMainnetIntegrationTest.java
+++ b/src/test/java/rest/koios/client/backend/api/network/NetworkServiceMainnetIntegrationTest.java
@@ -1,5 +1,6 @@
package rest.koios.client.backend.api.network;
+import com.fasterxml.jackson.databind.JsonNode;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
@@ -81,6 +82,14 @@ void getParamUpdateProposalsTest() throws ApiException {
Assertions.assertEquals(10, paramUpdateProposalsResult.getValue().size());
}
+ @Test
+ void getCliProtocolParametersTest() throws ApiException {
+ Result
> poolBlocksResult = poolService.getPoolOwnerHistory(List.of(poolBech32, poolBech32_2, poolBech32_3), Options.EMPTY);
+ Assertions.assertTrue(poolBlocksResult.isSuccessful());
+ Assertions.assertNotNull(poolBlocksResult.getValue());
+ log.info(poolBlocksResult.getValue().toString());
+ }
+
@Test
void getPoolHistoryByEpochTest() throws ApiException {
String poolBech32 = "pool155efqn9xpcf73pphkk88cmlkdwx4ulkg606tne970qswczg3asc";
@@ -206,6 +216,14 @@ void getPoolRelaysLimitTest() throws ApiException {
assertEquals(10, poolRelaysResult.getValue().size());
}
+ @Test
+ void getPoolGroupsTest() throws ApiException {
+ Result
> poolGroupsResult = poolService.getPoolGroups(Options.EMPTY);
+ Assertions.assertTrue(poolGroupsResult.isSuccessful());
+ Assertions.assertNotNull(poolGroupsResult.getValue());
+ log.info(poolGroupsResult.getValue().toString());
+ }
+
@Test
void getPoolMetadataLimitTest() throws ApiException {
Options options = Options.builder().option(Limit.of(10)).build();
@@ -215,4 +233,12 @@ void getPoolMetadataLimitTest() throws ApiException {
log.info(poolMetadataResult.getValue().toString());
assertEquals(10, poolMetadataResult.getValue().size());
}
+
+ @Test
+ void getPoolCalidusKeysTest() throws ApiException {
+ Result
> poolCalidusKeysResult = poolService.getPoolCalidusKeys(Options.EMPTY);
+ Assertions.assertTrue(poolCalidusKeysResult.isSuccessful());
+ Assertions.assertNotNull(poolCalidusKeysResult.getValue());
+ log.info(poolCalidusKeysResult.getValue().toString());
+ }
}