Skip to content

Commit

Permalink
Koios Alignment with 1.2.0 Bump Version to 1.19.0 + Bugfixes #161, #167
Browse files Browse the repository at this point in the history
  • Loading branch information
edridudi committed Sep 2, 2024
1 parent 0efa579 commit e08b4bd
Show file tree
Hide file tree
Showing 49 changed files with 2,223 additions and 597 deletions.
64 changes: 61 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,63 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca
<td>Asset Transactions</td>
<td>Get the list of all asset transaction hashes (newest first)</td>
</tr>
<tr>
<td rowspan="14">Governance</td>
<td>DReps Epoch Summary</td>
<td>Summary of voting power and DRep count for each epoch</td>
</tr>
<tr>
<td>DReps List</td>
<td>List of all active delegated representatives (DReps)</td>
</tr>
<tr>
<td>DReps Info</td>
<td>Get detailed information about requested delegated representatives (DReps)</td>
</tr>
<tr>
<td>DReps Metadata</td>
<td>List metadata for requested delegated representatives (DReps)</td>
</tr>
<tr>
<td>DReps Updates</td>
<td>List of updates for requested (or all) delegated representatives (DReps)</td>
</tr>
<tr>
<td>DReps Votes</td>
<td>List of all votes casted by requested delegated representative (DRep)</td>
</tr>
<tr>
<td>DReps Delegators</td>
<td>List of all delegators to requested delegated representative (DRep).</td>
</tr>
<tr>
<td>Committee Information</td>
<td>Information about active committee and its members</td>
</tr>
<tr>
<td>Committee Votes</td>
<td>List of all votes casted by given committee member or collective</td>
</tr>
<tr>
<td>Proposals List</td>
<td>List of all governance proposals</td>
</tr>
<tr>
<td>Voter's Proposal List</td>
<td>List of all governance proposals for specified DRep, SPO or Committee credential</td>
</tr>
<tr>
<td>Proposal Voting Summary</td>
<td>Summary of votes for given proposal</td>
</tr>
<tr>
<td>Proposal Votes</td>
<td>List of all votes cast on specified governance action</td>
</tr>
<tr>
<td>Pool Votes</td>
<td>List of all votes casted by a pool</td>
</tr>
<tr>
<td rowspan="12">Pool</td>
<td>Pool List</td>
Expand Down Expand Up @@ -343,7 +400,8 @@ Resource and maintenance requirements for Cardano blockchain components (e.g. ca

| Koios Instance | Koios Java Client |
|:--------------:|:-----------------:|
| 1.1.1 | 1.18.2 |
| 1.2.0 | 1.19.0 |
| 1.1.2 | 1.18.2 |
| 1.0.10 | 1.17.3 |
| 1.0.9 | 1.16.3 |
| 1.0.8 | 1.15.2 |
Expand All @@ -360,13 +418,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.18.2</version>
<version>1.18.3</version>
</dependency>
```

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

### 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.18.2</version>
<version>1.19.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 @@ -9,9 +9,7 @@
import rest.koios.client.backend.api.base.exception.ApiException;
import rest.koios.client.backend.factory.options.Options;
import retrofit2.Call;
import retrofit2.Response;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -37,12 +35,7 @@ public AccountServiceImpl(String baseUrl, String apiToken) {
@Override
public Result<List<StakeAddress>> getAccountList(Options options) throws ApiException {
Call<List<StakeAddress>> call = accountApi.getAccountList(optionsToParamMap(options));
try {
Response<List<StakeAddress>> response = (Response) execute(call);
return processResponse(response);
} catch (IOException e) {
throw new ApiException(e.getMessage(), e);
}
return processResponse(call);
}

@Override
Expand All @@ -51,12 +44,7 @@ public Result<List<AccountInfo>> getAccountInformation(List<String> stakeAddress
validateBech32(address);
}
Call<List<AccountInfo>> call = accountApi.getAccountInformation(buildBody("_stake_addresses", stakeAddresses, null, null, null), optionsToParamMap(options));
try {
Response<List<AccountInfo>> response = (Response) execute(call);
return processResponse(response);
} catch (IOException e) {
throw new ApiException(e.getMessage(), e);
}
return processResponse(call);
}

@Override
Expand All @@ -65,12 +53,7 @@ public Result<List<AccountInfo>> getCachedAccountInformation(List<String> stakeA
validateBech32(address);
}
Call<List<AccountInfo>> call = accountApi.getCachedAccountInformation(buildBody("_stake_addresses", stakeAddresses, null, null, null), optionsToParamMap(options));
try {
Response<List<AccountInfo>> response = (Response) execute(call);
return processResponse(response);
} catch (IOException e) {
throw new ApiException(e.getMessage(), e);
}
return processResponse(call);
}

@Override
Expand All @@ -79,12 +62,7 @@ public Result<List<UTxO>> getAccountUTxOs(List<String> stakeAddresses, boolean e
validateBech32(stakeAddress);
}
Call<List<UTxO>> call = accountApi.getAccountUTxOs(buildBodyUTxOs(stakeAddresses, extended), optionsToParamMap(options));
try {
Response<List<UTxO>> response = (Response) execute(call);
return processResponse(response);
} catch (IOException e) {
throw new ApiException(e.getMessage(), e);
}
return processResponse(call);
}

@Override
Expand All @@ -97,12 +75,7 @@ public Result<List<AccountTx>> getAccountTxs(String stakeAddress, Integer afterB
throw new ApiException("Non Positive \"afterBlockHeight\" Value");
}
Call<List<AccountTx>> call = accountApi.getAccountTxs(stakeAddress, afterBlockHeight, optionsToParamMap(options));
try {
Response<List<AccountTx>> response = (Response) execute(call);
return processResponse(response);
} catch (IOException e) {
throw new ApiException(e.getMessage(), e);
}
return processResponse(call);
}

@Override
Expand All @@ -114,12 +87,7 @@ public Result<List<AccountRewards>> getAccountRewards(List<String> addressList,
validateEpoch(epochNo);
}
Call<List<AccountRewards>> call = accountApi.getAccountRewards(buildBody("_stake_addresses", addressList, epochNo, null, null), optionsToParamMap(options));
try {
Response<List<AccountRewards>> response = (Response) execute(call);
return processResponse(response);
} catch (IOException e) {
throw new ApiException(e.getMessage(), e);
}
return processResponse(call);
}

@Override
Expand All @@ -128,12 +96,7 @@ public Result<List<AccountUpdates>> getAccountUpdates(List<String> addressList,
validateBech32(address);
}
Call<List<AccountUpdates>> call = accountApi.getAccountUpdates(buildBody("_stake_addresses", addressList, null, null, null), optionsToParamMap(options));
try {
Response<List<AccountUpdates>> response = (Response) execute(call);
return processResponse(response);
} catch (IOException e) {
throw new ApiException(e.getMessage(), e);
}
return processResponse(call);
}

@Override
Expand All @@ -142,12 +105,7 @@ public Result<List<AccountAddress>> getAccountAddresses(List<String> addressList
validateBech32(address);
}
Call<List<AccountAddress>> call = accountApi.getAccountAddresses(buildBody("_stake_addresses", addressList, null, firstOnly, empty), optionsToParamMap(options));
try {
Response<List<AccountAddress>> response = (Response) execute(call);
return processResponse(response);
} catch (IOException e) {
throw new ApiException(e.getMessage(), e);
}
return processResponse(call);
}

@Override
Expand All @@ -159,12 +117,7 @@ public Result<List<AccountAsset>> getAccountAssets(List<String> addressList, Int
validateEpoch(epochNo);
}
Call<List<AccountAsset>> call = accountApi.getAccountAssets(buildBody("_stake_addresses", addressList, epochNo, null, null), optionsToParamMap(options));
try {
Response<List<AccountAsset>> response = (Response) execute(call);
return processResponse(response);
} catch (IOException e) {
throw new ApiException(e.getMessage(), e);
}
return processResponse(call);
}

@Override
Expand All @@ -176,12 +129,7 @@ public Result<List<AccountHistory>> getAccountHistory(List<String> addressList,
validateEpoch(epochNo);
}
Call<List<AccountHistory>> call = accountApi.getAccountHistory(buildBody("_stake_addresses", addressList, epochNo, null, null), optionsToParamMap(options));
try {
Response<List<AccountHistory>> response = (Response) execute(call);
return processResponse(response);
} catch (IOException e) {
throw new ApiException(e.getMessage(), e);
}
return processResponse(call);
}

private Map<String, Object> buildBody(String arrayObjString, List<String> list, Integer epochNo, Boolean firstOnly, Boolean empty) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,58 @@ public class AccountInfo {
private String stakeAddress;

/**
* Account Status
* Stake address status
* Allowed: registered | not registered
*/
private String status;

/**
* Delegated Pool
* Account's current delegation status to DRep ID in CIP-129 Bech32 format
*/
private String delegatedDrep;

/**
* Delegated Pool ID (bech32 format)
*/
private String delegatedPool;

/**
* Account Balance
* Total balance of the account including UTxO, rewards and MIRs (in number)
*/
private String totalBalance;

/**
* Utxo Balance
* Total UTxO balance of the account
*/
private String utxo;

/**
* Rewards Balance
* Total rewards earned by the account
*/
private String rewards;

/**
* Withdrawals Amount
* Total rewards withdrawn by the account
*/
private String withdrawals;

/**
* Rewards Available Amount
* Total rewards available for withdrawal
*/
private String rewardsAvailable;

/**
* Reserves Amount
* Total deposit available for withdrawal
*/
private String deposit;

/**
* Total reserves MIR value of the account
*/
private String reserves;

/**
* Treasury Amount
* Total treasury MIR value of the account
*/
private String treasury;
}
Loading

0 comments on commit e08b4bd

Please sign in to comment.