Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Koios Java Client 1.18.0 Alignment with Koios Instance v1.1.0 #140

Merged
merged 12 commits into from
Nov 8, 2023
105 changes: 73 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
</thead>
<tbody>
<tr>
<td rowspan="4">Network</td>
<td rowspan="6">Network</td>
<td>Chain Tip</td>
<td>Get the tip info about the latest block seen by chain</td>
</tr>
Expand All @@ -66,13 +66,21 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<td>Get the Genesis parameters used to start specific era on chain</td>
</tr>
<tr>
<td>Get historical tokenomic stats</td>
<td>Historical tokenomic stats</td>
<td>Get the circulating utxo, treasury, rewards, supply and reserves in lovelace for specified epoch, all epochs if empty</td>
</tr>
<tr>
<td>Param Update Proposals</td>
<td>Get all parameter update proposals submitted to the chain starting Shelley era</td>
</tr>
<tr>
<td>Reserve Withdrawals</td>
<td>List of all withdrawals from reserves against stake accounts</td>
</tr>
<tr>
<td>Treasury Withdrawals</td>
<td>List of all withdrawals from treasury against stake accounts</td>
</tr>
<tr>
<td rowspan="3">Epoch</td>
<td>Epoch Information</td>
Expand Down Expand Up @@ -101,12 +109,12 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
</tr>
<tr>
<td rowspan="6">Transactions</td>
<td>Transaction Information</td>
<td>Get detailed information about transaction(s)</td>
<td>UTxO Info</td>
<td>Get UTxO set for requested UTxO references</td>
</tr>
<tr>
<td>Transaction UTxOs</td>
<td>Get UTxO set (inputs/outputs) of transactions.</td>
<td>Transaction Information</td>
<td>Get detailed information about transaction(s)</td>
</tr>
<tr>
<td>Transaction Metadata</td>
Expand All @@ -125,38 +133,50 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<td>Get the number of block confirmations for a given transaction hash list</td>
</tr>
<tr>
<td rowspan="4">Address</td>
<td rowspan="6">Address</td>
<td>Address Information</td>
<td>Get address info - balance, associated stake address (if any) and UTxO set</td>
</tr>
<tr>
<td>Address Transactions</td>
<td>Get the transaction hash list of input address array, optionally filtering after specified block height (inclusive)</td>
<td>Address UTxOs</td>
<td>Get UTxO set for given addresses</td>
</tr>
<tr>
<td>Address Assets</td>
<td>Get the list of all the assets (policy, name and quantity) for a given address</td>
<td>UTxOs from payment credentials</td>
<td>Get UTxO details for requested payment credentials</td>
</tr>
<tr>
<td>Address Transactions</td>
<td>Get the transaction hash list of input address array, optionally filtering after specified block height (inclusive)</td>
</tr>
<tr>
<td>Transactions from payment credentials</td>
<td>Get the transaction hash list of input payment credential array, optionally filtering after specified block height (inclusive)</td>
</tr>
<tr>
<td rowspan="9">Stake Account</td>
<td>Address Assets</td>
<td>Get the list of all the assets (policy, name and quantity) for a given address</td>
</tr>
<tr>
<td rowspan="10">Stake Account</td>
<td>Account List</td>
<td>Get a list of all accounts</td>
</tr>
<tr>
<td>Account Information</td>
<td>Get the account info of any (payment or staking) address</td>
</tr>
<tr>
<td>Account Information (Cached)</td>
<td>Get the cached account information for given stake addresses (accounts)</td>
</tr>
<tr>
<td>Account UTxOs</td>
<td>Get a list of all UTxOs for a given stake address (account)</td>
<td>Get a list of all UTxOs for given stake addresses (account)s</td>
</tr>
<tr>
<td>Account Information (Cached)</td>
<td>Get the cached account information for given stake addresses (accounts)</td>
<td>Account Txs</td>
<td>Get a list of all Txs for a given stake address (account)</td>
</tr>
<tr>
<td>Account Rewards</td>
Expand All @@ -179,21 +199,17 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<td>Get the staking history of an account</td>
</tr>
<tr>
<td rowspan="12">Asset</td>
<td rowspan="13">Asset</td>
<td>Asset List</td>
<td>Get the list of all native assets (paginated)</td>
</tr>
<tr>
<td>Asset Token Registry</td>
<td>Get a list of assets registered via token registry on github</td>
</tr>
<tr>
<td>Asset Addresses</td>
<td>Get the list of all addresses holding a given asset</td>
<td>Policy Asset List</td>
<td>Get the list of asset under the given policy (including balances)</td>
</tr>
<tr>
<td>NFT Address</td>
<td>Get the address where specified NFT currently reside on</td>
<td>Asset Token Registry</td>
<td>Get a list of assets registered via token registry on github</td>
</tr>
<tr>
<td>Asset Information</td>
Expand All @@ -203,10 +219,22 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<td>Asset Information (Bulk)</td>
<td>Get the information of a list of assets including first minting & token registry metadata</td>
</tr>
<tr>
<td>Asset UTxOs</td>
<td>Get the UTXO information of a list of assets including</td>
</tr>
<tr>
<td>Asset History</td>
<td>Get the mint/burn history of an asset</td>
</tr>
<tr>
<td>Asset Addresses</td>
<td>Get the list of all addresses holding a given asset</td>
</tr>
<tr>
<td>NFT Address</td>
<td>Get the address where specified NFT currently reside on</td>
</tr>
<tr>
<td>Policy Asset Address List</td>
<td>Get the list of addresses with quantity for each asset on the given policy.</td>
Expand All @@ -215,10 +243,6 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<td>Policy Asset Information</td>
<td>Get the information for all assets under the same policy</td>
</tr>
<tr>
<td>Policy Asset List</td>
<td>Get the list of asset under the given policy (including balances)</td>
</tr>
<tr>
<td>Asset Summary</td>
<td>Get the summary of an asset (total transactions exclude minting/total wallets include only wallets with asset balance)</td>
Expand All @@ -228,7 +252,7 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<td>Get the list of all asset transaction hashes (newest first)</td>
</tr>
<tr>
<td rowspan="10">Pool</td>
<td rowspan="12">Pool</td>
<td>Pool List</td>
<td>A list of all currently registered/retiring (not retired) pools</td>
</tr>
Expand Down Expand Up @@ -260,6 +284,14 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<td>Pool Updates (History)</td>
<td>Return all pool updates for all pools or only updates for specific pool if specified</td>
</tr>
<tr>
<td>Pool Registrations</td>
<td>Return all pool registrations initiated in the requested epoch</td>
</tr>
<tr>
<td>Pool Retirements</td>
<td>Return all pool retirements initiated in the requested epoch</td>
</tr>
<tr>
<td>Pool Relays</td>
<td>A list of registered relays for all currently registered/retiring (not retired) pools</td>
Expand All @@ -269,7 +301,11 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<td>Metadata (on & off-chain) for all currently registered/retiring (not retired) pools</td>
</tr>
<tr>
<td rowspan="4">Script</td>
<td rowspan="6">Script</td>
<td>Script Information</td>
<td>List of script information for given script hashes</td>
</tr>
<tr>
<td>Native Script List</td>
<td>List of all existing native script hashes along with their creation transaction hashes</td>
</tr>
Expand All @@ -281,6 +317,10 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<td>Script Redeemers</td>
<td>List of all redeemers for a given script hash</td>
</tr>
<tr>
<td>Script UTxOs</td>
<td>List of all UTXOs for a given script hash</td>
</tr>
<tr>
<td>Datum Information</td>
<td>List of datum information for given datum hashes</td>
Expand All @@ -294,6 +334,7 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca

| Koios Instance | Koios Java Client |
|:--------------:|:-----------------:|
| 1.1.0 | 1.18.0 |
| 1.0.10 | 1.17.3 |
| 1.0.9 | 1.16.3 |
| 1.0.8 | 1.15.2 |
Expand All @@ -310,13 +351,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.17.3</version>
<version>1.18.0</version>
</dependency>
```

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

### Get Koios Backend Service
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.17.3</version>
<version>1.18.0</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 @@ -2,6 +2,7 @@

import rest.koios.client.backend.api.account.model.*;
import rest.koios.client.backend.api.base.Result;
import rest.koios.client.backend.api.base.common.UTxO;
import rest.koios.client.backend.api.base.exception.ApiException;
import rest.koios.client.backend.factory.options.Options;

Expand Down Expand Up @@ -39,34 +40,51 @@ public interface AccountService {
*/
Result<List<AccountInfo>> getAccountInformation(List<String> stakeAddresses, Options options) throws ApiException;

/**
* Account Information (Cached)
* Get the cached account information for given stake addresses (accounts)
* <p><b>200</b> - Success!
* <p><b>401</b> - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
* <p><b>404</b> - The server does not recognise the combination of endpoint and parameters provided
*
* @param stakeAddresses List of Cardano stake address(es) in bech32 format (required)
* @param options Filtering and Pagination options (optional)
* @return Result of Type List of {@link AccountInfo} per the specified payment or staking address
* @throws ApiException if an error occurs while attempting to invoke the API
*/
Result<List<AccountInfo>> getCachedAccountInformation(List<String> stakeAddresses, Options options) throws ApiException;

/**
* Account UTxOs
* Get a list of all UTxOs for a given stake address (account)
* Get a list of all UTxOs for a given stake address (account)s
* <p><b>200</b> - List of account UTxOs associated with stake address
* <p><b>400</b> - The server cannot process the request due to invalid input
* <p><b>401</b> - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
* <p><b>404</b> - The server does not recognise the combination of endpoint and parameters provided
*
* @param stakeAddress Cardano staking address (reward account) in bech32 format
* @param options Filtering and Pagination options (optional)
* @return Result of Type List of {@link AccountUTxO} associated with stake address
* @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 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
*/
Result<List<AccountUTxO>> getAccountUTxOs(String stakeAddress, Options options) throws ApiException;
Result<List<UTxO>> getAccountUTxOs(List<String> stakeAddresses, boolean extended, Options options) throws ApiException;

/**
* Account Information (Cached)
* Get the cached account information for given stake addresses (accounts)
* <p><b>200</b> - Success!
* Account Txs
* Get a list of all Txs for a given stake address (account)
* <p><b>200</b> - List of Txs associated with stake address (account)
* <p><b>400</b> - The server cannot process the request due to invalid input
* <p><b>401</b> - The selected server has restricted the endpoint to be only usable via authentication. The authentication supplied was not authorized to access the endpoint
* <p><b>404</b> - The server does not recognise the combination of endpoint and parameters provided
*
* @param stakeAddresses List of Cardano stake address(es) in bech32 format (required)
* @param options Filtering and Pagination options (optional)
* @return Result of Type List of {@link AccountInfo} per the specified payment or staking address
* @param stakeAddress Cardano staking address (reward account) in bech32 format
* @param afterBlockHeight Block height for specifying time delta
* @param options Filtering and Pagination options (optional)
* @return Result of Type List of {@link AccountTx} associated with stake address (account)
* @throws ApiException if an error occurs while attempting to invoke the API
*/
Result<List<AccountInfo>> getCachedAccountInformation(List<String> stakeAddresses, Options options) throws ApiException;
Result<List<AccountTx>> getAccountTxs(String stakeAddress, Integer afterBlockHeight, Options options) throws ApiException;

/**
* Account Rewards
Expand Down Expand Up @@ -124,10 +142,10 @@ public interface AccountService {
* @param addressList Array of Cardano stake address(es) in bech32 format (required)
* @param epochNo Only fetch information for a specific epoch (optional)
* @param options Filtering and Pagination options (optional)
* @return Result of Type List of {@link AccountAssets}
* @return Result of Type List of {@link AccountAsset}
* @throws ApiException if an error occurs while attempting to invoke the API
*/
Result<List<AccountAssets>> getAccountAssets(List<String> addressList, Integer epochNo, Options options) throws ApiException;
Result<List<AccountAsset>> getAccountAssets(List<String> addressList, Integer epochNo, Options options) throws ApiException;

/**
* Account History
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rest.koios.client.backend.api.account.api;

import rest.koios.client.backend.api.account.model.*;
import rest.koios.client.backend.api.base.common.UTxO;
import retrofit2.Call;
import retrofit2.http.*;

Expand Down Expand Up @@ -31,16 +32,6 @@ public interface AccountApi {
@POST("account_info")
Call<List<AccountInfo>> getAccountInformation(@Body Map<String, Object> requestBody, @QueryMap Map<String, String> paramsMap);

/**
* Get Account UTxOs
*
* @param stakeAddress Cardano staking address (reward account) in bech32 format
* @param paramsMap Query Params
* @return List of account UTxOs associated with stake address
*/
@GET("account_utxos")
Call<List<AccountUTxO>> getAccountUTxOs(@Query("_stake_address") String stakeAddress, @QueryMap Map<String, String> paramsMap);

/**
* Get Account Information (Cached)
*
Expand All @@ -51,6 +42,27 @@ public interface AccountApi {
@POST("account_info_cached")
Call<List<AccountInfo>> getCachedAccountInformation(@Body Map<String, Object> requestBody, @QueryMap Map<String, String> paramsMap);

/**
* Get Account UTxOs
*
* @param requestBody Json Body containing List of Cardano stake address(es) in bech32 format
* @param paramsMap Query Params
* @return List of account UTxOs associated with stake address
*/
@POST("account_utxos")
Call<List<UTxO>> getAccountUTxOs(@Body Map<String, Object> requestBody, @QueryMap Map<String, String> paramsMap);

/**
* Get Account Txs
*
* @param paramsMap Query Params
* @param stakeAddress Cardano staking address (reward account) in bech32 format
* @param blockHeight Block height for specifying time delta
* @return List of Txs associated with stake address (account)
*/
@GET("account_txs")
Call<List<AccountTx>> getAccountTxs(@Query("_stake_address") String stakeAddress, @Query("_after_block_height") Integer blockHeight, @QueryMap Map<String, String> paramsMap);

/**
* Get Account Rewards
*
Expand Down Expand Up @@ -89,7 +101,7 @@ public interface AccountApi {
* @return Native asset balance of an account
*/
@POST("account_assets")
Call<List<AccountAssets>> getAccountAssets(@Body Map<String, Object> requestBody, @QueryMap Map<String, String> paramsMap);
Call<List<AccountAsset>> getAccountAssets(@Body Map<String, Object> requestBody, @QueryMap Map<String, String> paramsMap);

/**
* Get Account History
Expand Down
Loading