├── .github ├── logo.png ├── qr.png ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── idea.md │ ├── idea-proposal.md │ ├── bug.md │ ├── issue-report.md │ └── feature_request.md ├── dependabot.yml ├── workflows │ ├── codecov.yml │ ├── mainnet.yml │ ├── preview.yml │ ├── preprod.yml │ └── codeql-analysis.yml └── discord.svg ├── .gitignore ├── src ├── test │ ├── resources │ │ └── log4j.properties │ └── java │ │ └── rest │ │ └── koios │ │ └── client │ │ ├── backend │ │ └── api │ │ │ └── base │ │ │ └── BaseServiceTest.java │ │ └── utils │ │ └── Bech32PreviewUtilTest.java └── main │ └── java │ └── rest │ └── koios │ └── client │ ├── backend │ ├── factory │ │ ├── options │ │ │ ├── SortType.java │ │ │ ├── filters │ │ │ │ ├── LogicalOperatorFilterType.java │ │ │ │ ├── FilterType.java │ │ │ │ ├── Filter.java │ │ │ │ ├── NotOperatorFilter.java │ │ │ │ └── LogicalOperatorFilter.java │ │ │ ├── OptionType.java │ │ │ ├── Option.java │ │ │ ├── Offset.java │ │ │ ├── Limit.java │ │ │ ├── Order.java │ │ │ └── Options.java │ │ ├── ApiVersion.java │ │ ├── OperationType.java │ │ └── BackendService.java │ └── api │ │ ├── base │ │ ├── Result.java │ │ ├── exception │ │ │ └── ApiException.java │ │ ├── common │ │ │ ├── InlineDatum.java │ │ │ ├── TxHash.java │ │ │ ├── Asset.java │ │ │ ├── ReferenceScript.java │ │ │ └── UTxO.java │ │ └── interceptor │ │ │ └── GzipInterceptor.java │ │ ├── transactions │ │ ├── model │ │ │ ├── Purpose.java │ │ │ ├── TxMetadataLabels.java │ │ │ ├── Unit.java │ │ │ ├── PlutusScriptInput.java │ │ │ ├── Datum.java │ │ │ ├── TxWithdrawal.java │ │ │ ├── TxStatus.java │ │ │ ├── PlutusScriptOutput.java │ │ │ ├── TxNativeScript.java │ │ │ ├── Metadata.java │ │ │ ├── TxPaymentAddress.java │ │ │ ├── RawTx.java │ │ │ ├── TxMetadata.java │ │ │ ├── PlutusScriptRedeemer.java │ │ │ ├── TxCertificate.java │ │ │ ├── TxPlutusContract.java │ │ │ ├── VotingProcedure.java │ │ │ ├── CollateralOutput.java │ │ │ ├── ProposalProcedure.java │ │ │ └── TxIO.java │ │ └── api │ │ │ └── TransactionApi.java │ │ ├── script │ │ ├── model │ │ │ ├── NativeScriptType.java │ │ │ ├── ScriptRedeemer.java │ │ │ ├── ScriptInner.java │ │ │ ├── PlutusScript.java │ │ │ ├── NativeScript.java │ │ │ ├── DatumInfo.java │ │ │ ├── ScriptInfo.java │ │ │ └── Redeemer.java │ │ └── api │ │ │ └── ScriptApi.java │ │ ├── pool │ │ └── model │ │ │ ├── PoolRelay.java │ │ │ ├── MetaJson.java │ │ │ ├── PoolMetadata.java │ │ │ ├── PoolDelegatorHistory.java │ │ │ ├── PoolDelegator.java │ │ │ ├── Relay.java │ │ │ ├── PoolBlock.java │ │ │ ├── PoolGroup.java │ │ │ ├── PoolStakeSnapshot.java │ │ │ ├── PoolOwnerHistory.java │ │ │ ├── PoolStatus.java │ │ │ ├── PoolCalidusKey.java │ │ │ ├── PoolHistory.java │ │ │ ├── PoolUpdate.java │ │ │ ├── Pool.java │ │ │ └── PoolInfo.java │ │ ├── asset │ │ └── model │ │ │ ├── Asset.java │ │ │ ├── PaymentAddress.java │ │ │ ├── TokenRegistryMetadata.java │ │ │ ├── PolicyAsset.java │ │ │ ├── AssetAddress.java │ │ │ ├── AssetHistory.java │ │ │ ├── MintingTx.java │ │ │ ├── AssetSummary.java │ │ │ ├── AssetTokenRegistry.java │ │ │ ├── PolicyAssetMint.java │ │ │ ├── PolicyAssetInfo.java │ │ │ └── AssetInformation.java │ │ ├── account │ │ └── model │ │ │ ├── AccountAsset.java │ │ │ ├── AccountUpdates.java │ │ │ ├── AccountHistory.java │ │ │ ├── AccountRewards.java │ │ │ ├── StakeAddress.java │ │ │ ├── AccountAddress.java │ │ │ ├── AccountHistoryInner.java │ │ │ ├── AccountTx.java │ │ │ ├── AccountStakeHistory.java │ │ │ ├── AccountReward.java │ │ │ ├── AccountUpdate.java │ │ │ ├── AccountRewardHistory.java │ │ │ ├── AccountUpdateHistory.java │ │ │ └── AccountInfo.java │ │ ├── address │ │ ├── model │ │ │ ├── AddressAsset.java │ │ │ ├── AddressInfo.java │ │ │ ├── AddressOutput.java │ │ │ └── AddressUtxo.java │ │ └── api │ │ │ └── AddressApi.java │ │ ├── governance │ │ └── model │ │ │ ├── PoolsVotingPowerHistory.java │ │ │ ├── DRepVotingPowerHistory.java │ │ │ ├── DRepEpochSummary.java │ │ │ ├── DRep.java │ │ │ ├── DRepDelegator.java │ │ │ ├── CommitteeInfo.java │ │ │ ├── CommitteeMember.java │ │ │ ├── DRepVote.java │ │ │ ├── PoolVote.java │ │ │ ├── CommitteeVote.java │ │ │ ├── ProposalVote.java │ │ │ ├── DRepInfo.java │ │ │ ├── DRepMetadata.java │ │ │ ├── DRepUpdate.java │ │ │ └── Vote.java │ │ ├── epoch │ │ ├── model │ │ │ ├── EpochBlockProtocols.java │ │ │ └── EpochInfo.java │ │ └── api │ │ │ └── EpochApi.java │ │ ├── block │ │ ├── model │ │ │ ├── BlockTxHash.java │ │ │ ├── BlockTxCbor.java │ │ │ ├── Block.java │ │ │ └── BlockInfo.java │ │ └── api │ │ │ └── BlockApi.java │ │ └── network │ │ ├── model │ │ ├── ParamUpdateProposal.java │ │ ├── Tip.java │ │ ├── Withdrawal.java │ │ ├── Totals.java │ │ └── Genesis.java │ │ ├── api │ │ └── NetworkApi.java │ │ └── impl │ │ └── NetworkServiceImpl.java │ └── utils │ ├── Tuple.java │ └── HexUtil.java ├── SPONSORS.md ├── CONTRIBUTING.md └── postman └── environment ├── Preview.postman_environment.json ├── Preprod.postman_environment.json └── Mainnet.postman_environment.json /.github/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardano-community/koios-java-client/HEAD/.github/logo.png -------------------------------------------------------------------------------- /.github/qr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardano-community/koios-java-client/HEAD/.github/qr.png -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [edridudi] 4 | # custom: ['https://cardano-israel.com/support-this-project'] 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/idea.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: idea 3 | about: Propose a new idea 4 | title: 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | #### Describe your idea, in simple words. 11 | 12 | #### Why is it a good idea? 13 | 14 | #### Are you willing to work on it yourself? 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | release.properties 7 | dependency-reduced-pom.xml 8 | buildNumber.properties 9 | .mvn/timing.properties 10 | .mvn/wrapper/maven-wrapper.jar 11 | .idea 12 | application.log 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/idea-proposal.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Idea Proposal 3 | about: Propose a new idea 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | #### Describe your idea, in simple words. 11 | 12 | #### Why is it a good idea? 13 | 14 | #### Are you willing to work on it yourself? 15 | -------------------------------------------------------------------------------- /src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=DEBUG, consoleAppender 2 | 3 | log4j.appender.consoleAppender=org.apache.log4j.ConsoleAppender 4 | log4j.appender.consoleAppender.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.consoleAppender.layout.ConversionPattern=%d{dd-MM-yyyy HH:mm:ss.SSS} [%t] %-5p %c %x - %m%n 6 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/SortType.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options; 2 | 3 | /** 4 | * Sort Type 5 | */ 6 | public enum SortType { 7 | /** 8 | * Ascending Order 9 | */ 10 | ASC, 11 | 12 | /** 13 | * Descending Order 14 | */ 15 | DESC 16 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 3 | about: 4 | title: 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | #### What operating system are you using, and which version? 11 | 12 | - [ ] Linux / Ubuntu 13 | - [ ] Linux / Other 14 | - [ ] OSX 15 | - [ ] Windows 16 | 17 | #### Steps to Reproduce 18 | 19 | #### Expected Behavior 20 | 21 | #### Actual Behavior 22 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/filters/LogicalOperatorFilterType.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options.filters; 2 | 3 | /** 4 | * Logical Operator Filter Type 5 | */ 6 | public enum LogicalOperatorFilterType { 7 | 8 | /** 9 | * logical OR operator 10 | */ 11 | OR, 12 | 13 | /** 14 | * logical AND operator 15 | */ 16 | AND 17 | } 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Issue Report 3 | about: Report an issue 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | #### What operating system are you using, and which version? 11 | 12 | - [ ] Linux / Ubuntu 13 | - [ ] Linux / Other 14 | - [ ] OSX 15 | - [ ] Windows 16 | 17 | #### Steps to Reproduce 18 | 19 | #### Expected Behavior 20 | 21 | #### Actual Behavior 22 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/ApiVersion.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * API Version 7 | */ 8 | @Getter 9 | public enum ApiVersion { 10 | 11 | /** 12 | * Version 1 13 | */ 14 | VERSION_1("v1"); 15 | 16 | private final String version; 17 | 18 | ApiVersion(String version) { 19 | this.version = version; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/base/Result.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.base; 2 | 3 | import lombok.Builder; 4 | import lombok.Getter; 5 | import lombok.ToString; 6 | 7 | /** 8 | * Result Object Of type T 9 | * @param Result Type 10 | */ 11 | @Getter 12 | @Builder 13 | @ToString 14 | public class Result { 15 | 16 | boolean successful; 17 | String response; 18 | int code; 19 | T value; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/Purpose.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | /** 4 | * Kind of validation of redeemer 5 | */ 6 | public enum Purpose { 7 | /** 8 | * Spend 9 | */ 10 | spend, 11 | 12 | /** 13 | * Mint 14 | */ 15 | mint, 16 | 17 | /** 18 | * Cert 19 | */ 20 | cert, 21 | 22 | /** 23 | * Reward 24 | */ 25 | reward 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/script/model/NativeScriptType.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.script.model; 2 | 3 | /** 4 | * Native Script Type 5 | */ 6 | public enum NativeScriptType { 7 | 8 | /** 9 | * Plutus Version 1 10 | */ 11 | plutusV1, 12 | 13 | /** 14 | * Plutus Version 2 15 | */ 16 | plutusV2, 17 | 18 | /** 19 | * Time Locked 20 | */ 21 | timelock, 22 | 23 | /** 24 | * Multi Signature 25 | */ 26 | multisig 27 | } 28 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "maven" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/utils/Tuple.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.utils; 2 | 3 | /** 4 | * Tuple Of 2 Types 5 | * 6 | * @param Type T Param 1 7 | * @param Type Z Param 2 8 | */ 9 | public class Tuple { 10 | 11 | /** 12 | * First Parameter 13 | */ 14 | public final T _1; 15 | 16 | /** 17 | * Second Parameter 18 | */ 19 | public final Z _2; 20 | 21 | /** 22 | * Tuple Constructor 23 | * 24 | * @param _1 First Parameter 25 | * @param _2 Second Parameter 26 | */ 27 | public Tuple(T _1, Z _2) { 28 | this._1 = _1; 29 | this._2 = _2; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/OptionType.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options; 2 | 3 | /** 4 | * Option Type 5 | */ 6 | public enum OptionType { 7 | 8 | /** 9 | * FILTERING OPTION TYPE 10 | */ 11 | FILTER, 12 | 13 | /** 14 | * LOGICAL FILTERING OPTION TYPE 15 | */ 16 | LOGICAL_FILTER, 17 | 18 | /** 19 | * NOT OPERATOR FILTERING OPTION TYPE 20 | */ 21 | NOT_OPERATOR, 22 | 23 | /** 24 | * OFFSET OPTION TYPE 25 | */ 26 | OFFSET, 27 | 28 | /** 29 | * LIMIT OPTION TYPE 30 | */ 31 | LIMIT, 32 | 33 | /** 34 | * ORDER OPTION TYPE 35 | */ 36 | ORDER 37 | } 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolRelay.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | import java.util.ArrayList; 8 | 9 | /** 10 | * Pool Relay 11 | */ 12 | @Getter 13 | @Setter 14 | @ToString 15 | @NoArgsConstructor 16 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 17 | public class PoolRelay { 18 | 19 | /** 20 | * Pool ID (bech32 format) 21 | */ 22 | private String poolIdBech32; 23 | 24 | /** 25 | * Relays 26 | */ 27 | private ArrayList relays; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/TxMetadataLabels.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Transaction Metadata Labels 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class TxMetadataLabels { 19 | 20 | /** 21 | * A distinct known metalabel 22 | **/ 23 | private String key = null; 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/base/exception/ApiException.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.base.exception; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | /** 7 | * ApiException 8 | */ 9 | @Getter 10 | @Setter 11 | public class ApiException extends Exception { 12 | 13 | /** 14 | * ApiException Constructor 15 | * 16 | * @param message message 17 | */ 18 | public ApiException(String message) { 19 | super(message); 20 | } 21 | 22 | /** 23 | * ApiException Constructor 24 | * 25 | * @param message message 26 | * @param e Exception 27 | */ 28 | public ApiException(String message, Exception e) { 29 | super(message, e); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SPONSORS.md: -------------------------------------------------------------------------------- 1 | # Sponsors 2 | 3 | Want to sponsor the project and give some financial support? Your support is welcome and much appreciated :pray:.
4 | If you do send some **ADA (₳)** this way, let us know -- or make sure to attach metadata to your transaction! 5 | 6 | We'll be happy to show your name in the sponsor list. 7 | 8 |

9 | 10 |
11 | qr 12 |
13 |
14 | addr1qy9m8j6jp32fgnqjljk6ert9hlndcnptwhruzjamyevzgspgewr0dw33mfjfm72t8a2et6w48u4k5uwq2hgltxxs4a6sg6ptd9 15 |

16 | 17 |
18 |

19 | Thank you. :heart: 20 |

21 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/Asset.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Asset 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 15 | public class Asset { 16 | 17 | /** 18 | * Asset Policy ID (hex) 19 | */ 20 | private String policyId; 21 | 22 | /** 23 | * Asset Name (hex) 24 | */ 25 | private String assetName; 26 | 27 | /** 28 | * The CIP14 fingerprint of the asset 29 | */ 30 | private String fingerprint; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/script/model/ScriptRedeemer.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.script.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Script Redeemer 11 | */ 12 | @Getter 13 | @Setter 14 | @ToString 15 | @NoArgsConstructor 16 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 17 | public class ScriptRedeemer { 18 | 19 | /** 20 | * Hash of Transaction for which details are being shown 21 | */ 22 | private String scriptHash; 23 | 24 | /** 25 | * List of {@link Redeemer} 26 | */ 27 | private List redeemers = null; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/Unit.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Unit 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class Unit { 19 | 20 | /** 21 | * The budget in Cpu steps to run a script 22 | */ 23 | private Long steps; 24 | 25 | /** 26 | * The budget in Memory to run a script 27 | */ 28 | private Integer mem; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountAsset.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | import rest.koios.client.backend.api.base.common.Asset; 10 | 11 | /** 12 | * Account Assets 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class AccountAsset extends Asset { 20 | 21 | /** 22 | * Cardano staking address (reward account) in bech32 format 23 | */ 24 | private String stakeAddress; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/PlutusScriptInput.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Plutus Script Input 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PlutusScriptInput { 19 | 20 | /** 21 | * Plutus Script Redeemer 22 | */ 23 | private PlutusScriptRedeemer redeemer; 24 | 25 | /** 26 | * Datum 27 | */ 28 | private Datum datum; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/address/model/AddressAsset.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.address.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | import rest.koios.client.backend.api.base.common.Asset; 10 | 11 | /** 12 | * Address Asset 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class AddressAsset extends Asset { 20 | 21 | /** 22 | * A Cardano payment/base address (bech32 encoded) for transaction's input UTxO 23 | */ 24 | private String address; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/base/common/InlineDatum.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.base.common; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Inline Datum 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class InlineDatum { 20 | 21 | /** 22 | * Datum bytes (hex) 23 | */ 24 | private String bytes; 25 | 26 | /** 27 | * Value (json) 28 | */ 29 | private JsonNode value; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/MetaJson.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Meta Json 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 15 | public class MetaJson { 16 | 17 | /** 18 | * Pool name 19 | */ 20 | private String name; 21 | 22 | /** 23 | * Pool ticker 24 | */ 25 | private String ticker; 26 | 27 | /** 28 | * Pool homepage URL 29 | */ 30 | private String homepage; 31 | 32 | /** 33 | * Pool description 34 | */ 35 | private String description; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/Datum.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Datum 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class Datum { 20 | 21 | /** 22 | * The Hash of the Plutus Data 23 | */ 24 | private String hash; 25 | 26 | /** 27 | * The actual data in json format 28 | */ 29 | private JsonNode value; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/TxWithdrawal.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * withdrawals within a transaction 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class TxWithdrawal { 19 | 20 | /** 21 | * Withdrawal amount (in lovelaces) 22 | */ 23 | private String amount; 24 | 25 | /** 26 | * List of withdrawals with-in a transaction (if any) 27 | */ 28 | private String stakeAddr; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/OperationType.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * Operation Type 7 | */ 8 | @Getter 9 | public enum OperationType { 10 | 11 | /** 12 | * Mainnet 13 | */ 14 | KOIOS_MAINNET("https://api.koios.rest/api/"), 15 | /** 16 | * GuildNet 17 | */ 18 | KOIOS_GUILD("https://guild.koios.rest/api/"), 19 | /** 20 | * Preview 21 | */ 22 | KOIOS_PREVIEW("https://preview.koios.rest/api/"), 23 | /** 24 | * PreProd 25 | */ 26 | KOIOS_PREPROD("https://preprod.koios.rest/api/"); 27 | 28 | private final String baseUrl; 29 | 30 | OperationType() { 31 | baseUrl = null; 32 | } 33 | 34 | OperationType(String baseUrl) { 35 | this.baseUrl = baseUrl; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/TxStatus.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Transaction Status 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class TxStatus { 19 | 20 | /** 21 | * Hash of the transaction for which details are being shown 22 | */ 23 | private String txHash = null; 24 | 25 | /** 26 | * Number of block confirmations 27 | */ 28 | private Integer numConfirmations = null; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/base/common/TxHash.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.base.common; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Transaction Hash 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 15 | public class TxHash { 16 | 17 | /** 18 | * Transaction Hash 19 | */ 20 | private String txHash; 21 | 22 | /** 23 | * Epoch number of the block 24 | */ 25 | private Integer epochNo; 26 | 27 | /** 28 | * Block Height 29 | */ 30 | private Integer blockHeight; 31 | 32 | /** 33 | * UNIX timestamp of the block 34 | */ 35 | private Integer blockTime; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountUpdates.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Account Updates 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @NoArgsConstructor 19 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 20 | public class AccountUpdates { 21 | 22 | /** 23 | * Cardano staking address (reward account) in bech32 format 24 | */ 25 | private String stakeAddress; 26 | 27 | /** 28 | * List of Account Updates 29 | */ 30 | private List updates; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolMetadata.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Pool Metadata 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 15 | public class PoolMetadata { 16 | 17 | /** 18 | * Pool ID (bech32 format) 19 | */ 20 | private String poolIdBech32; 21 | 22 | /** 23 | * Pool metadata URL 24 | */ 25 | private String metaUrl; 26 | 27 | /** 28 | * Pool metadata hash 29 | */ 30 | private String metaHash; 31 | 32 | /** 33 | * Metadata Json Object 34 | */ 35 | private MetaJson metaJson; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/PlutusScriptOutput.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Plutus Script Output 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class PlutusScriptOutput { 20 | 21 | /** 22 | * The Hash of the Plutus Data 23 | */ 24 | private String hash; 25 | 26 | /** 27 | * The actual data in json format 28 | */ 29 | private JsonNode value; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/PoolsVotingPowerHistory.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Pools Voting Power History 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class PoolsVotingPowerHistory { 17 | 18 | /** 19 | * Pool ID (bech32 format) 20 | */ 21 | private String poolIdBech32; 22 | 23 | /** 24 | * Epoch number of the block 25 | */ 26 | private Integer epochNo; 27 | 28 | /** 29 | * The voting power for the pool for the epoch 30 | */ 31 | private String amount; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountHistory.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Account History 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @NoArgsConstructor 19 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 20 | public class AccountHistory { 21 | 22 | /** 23 | * Cardano staking address (reward account) in bech32 format 24 | */ 25 | private String stakeAddress; 26 | 27 | /** 28 | * List of Account History 29 | */ 30 | private List history; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountRewards.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Account Rewards 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @NoArgsConstructor 19 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 20 | public class AccountRewards { 21 | 22 | /** 23 | * Cardano staking address (reward account) in bech32 format 24 | */ 25 | private String stakeAddress; 26 | 27 | /** 28 | * List of Account Rewards 29 | */ 30 | private List rewards; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/PaymentAddress.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Asset Address 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PaymentAddress { 19 | 20 | /** 21 | * A Cardano payment/base address (bech32 encoded) for transaction's input UTxO 22 | */ 23 | private String paymentAddress; 24 | 25 | /** 26 | * Cardano staking address (reward account) in bech32 format 27 | */ 28 | private String stakeAddress; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/script/model/ScriptInner.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.script.model; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | import lombok.ToString; 8 | 9 | import java.util.ArrayList; 10 | 11 | /** 12 | * Script Inner 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | public class ScriptInner { 19 | 20 | /** 21 | * Script Type 22 | */ 23 | private String type; 24 | 25 | /** 26 | * Script Key Hash 27 | */ 28 | @JsonProperty("keyHash") 29 | private String keyHash; 30 | 31 | /** 32 | * Script Slot 33 | */ 34 | private Long slot; 35 | 36 | /** 37 | * Lvl 2 Script Inner 38 | */ 39 | private ArrayList scripts; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/Option.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * Option 7 | */ 8 | @Getter 9 | public abstract class Option { 10 | 11 | private final OptionType optionType; 12 | 13 | /** 14 | * Option Constructor 15 | * 16 | * @param optionType optionType 17 | */ 18 | public Option(OptionType optionType) { 19 | this.optionType = optionType; 20 | } 21 | 22 | /** 23 | * getValue 24 | * 25 | * @return abstract value per child Objects 26 | */ 27 | public abstract String getValue(); 28 | 29 | /** 30 | * getOptionTypeValue 31 | * 32 | * @return OptionType Name in lower case 33 | */ 34 | public String getOptionTypeValue() { 35 | return optionType.name().toLowerCase(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/epoch/model/EpochBlockProtocols.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.epoch.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Epoch's Block Protocols 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class EpochBlockProtocols { 17 | 18 | /** 19 | * Protocol major version 20 | */ 21 | private Integer protoMajor = null; 22 | 23 | /** 24 | * Protocol minor version 25 | */ 26 | private Integer protoMinor = null; 27 | 28 | /** 29 | * Amount of blocks with specified major and protocol combination 30 | */ 31 | private Integer blocks = null; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/DRepVotingPowerHistory.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * DRep Voting Power History 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class DRepVotingPowerHistory { 17 | 18 | /** 19 | * DRep ID in CIP-129 bech32 format 20 | */ 21 | private String drepId; 22 | 23 | /** 24 | * Epoch number of the block 25 | */ 26 | private Integer epochNo; 27 | 28 | /** 29 | * History of DReps voting power against each (or requested) epoch 30 | */ 31 | private String amount; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/TxNativeScript.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Native Script 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class TxNativeScript { 20 | 21 | /** 22 | * Hash of a script 23 | */ 24 | private String scriptHash; 25 | 26 | /** 27 | * JSON representation of the timelock script (null for other script types) 28 | */ 29 | private JsonNode scriptJson; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/StakeAddress.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Stake Address 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 15 | public class StakeAddress { 16 | 17 | /** 18 | * Cardano staking address (reward account) in bech32 format 19 | */ 20 | private String stakeAddress; 21 | 22 | /** 23 | * Cardano staking address (reward account) in hex format 24 | */ 25 | private String stakeAddressHex; 26 | 27 | /** 28 | * Script hash in case the stake address is locked by a script 29 | */ 30 | private String scriptHash; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/Metadata.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Metadata present within a transaction (if any) 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class Metadata { 20 | 21 | /** 22 | * Metadata key (index) 23 | */ 24 | private String key; 25 | 26 | /** 27 | * A JSON containing details about metadata within a transaction 28 | */ 29 | private JsonNode json; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/TxPaymentAddress.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * A Cardano payment/base address for transaction's input/output UTxO 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class TxPaymentAddress { 19 | 20 | /** 21 | * A Cardano payment/base address (bech32 encoded) for transaction's input/output UTxO 22 | */ 23 | private String bech32; 24 | 25 | /** 26 | * Payment credential 27 | */ 28 | private String cred; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/TokenRegistryMetadata.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Token Registry Metadata 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class TokenRegistryMetadata { 19 | 20 | private String name; 21 | 22 | private String description; 23 | 24 | private String ticker; 25 | 26 | private String url; 27 | 28 | /** 29 | * A PNG image file as a byte string 30 | */ 31 | private String logo; 32 | 33 | private Integer decimals; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/Offset.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * Offset 7 | */ 8 | @Getter 9 | public class Offset extends Option { 10 | 11 | private final long offset; 12 | 13 | /** 14 | * Offset Option Constructor 15 | * 16 | * @param offset records offset value 17 | */ 18 | public Offset(long offset) { 19 | super(OptionType.OFFSET); 20 | this.offset = offset; 21 | } 22 | 23 | /** 24 | * Offset.of Static Constructor 25 | * 26 | * @param offset records offset value 27 | * @return new Offset Option Object 28 | */ 29 | public static Offset of(long offset) { 30 | return new Offset(offset); 31 | } 32 | 33 | @Override 34 | public String getValue() { 35 | return String.valueOf(offset); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/DRepEpochSummary.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * DRep Epoch Summary 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class DRepEpochSummary { 17 | 18 | /** 19 | * Epoch number of the block 20 | */ 21 | private Integer epochNo; 22 | 23 | /** 24 | * The total amount of voting power between all DReps including pre-defined roles for the epoch 25 | */ 26 | private String amount; 27 | 28 | /** 29 | * The total number of DReps with vote power for the epoch 30 | */ 31 | private Integer dreps; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/script/model/PlutusScript.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.script.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Plutus Script 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 15 | public class PlutusScript { 16 | 17 | /** 18 | * Hash of a script 19 | */ 20 | private String scriptHash; 21 | 22 | /** 23 | * Hash of the script creation transaction 24 | */ 25 | private String creationTxHash; 26 | 27 | /** 28 | * Type of the script 29 | */ 30 | private NativeScriptType type; 31 | 32 | /** 33 | * The size of the CBOR serialised script (in bytes) 34 | */ 35 | private Integer size; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountAddress.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Account Address 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @NoArgsConstructor 19 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 20 | public class AccountAddress { 21 | 22 | /** 23 | * Cardano staking address (reward account) in bech32 format 24 | */ 25 | private String stakeAddress; 26 | 27 | /** 28 | * List of A Cardano payment/base address (bech32 encoded) for transaction's input UTxO 29 | */ 30 | private List addresses; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountHistoryInner.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Account History Inner 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class AccountHistoryInner { 19 | 20 | /** 21 | * Bech32 representation of pool ID 22 | */ 23 | private String poolId = null; 24 | 25 | /** 26 | * Epoch number 27 | */ 28 | private Integer epochNo = null; 29 | 30 | /** 31 | * Active stake amount (in lovelaces) 32 | */ 33 | private String activeStake = null; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/base/common/Asset.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.base.common; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Asset 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 15 | public class Asset { 16 | 17 | /** 18 | * Asset Policy ID (hex) 19 | */ 20 | private String policyId; 21 | 22 | /** 23 | * Asset Name (hex) 24 | */ 25 | private String assetName; 26 | 27 | /** 28 | * The CIP14 fingerprint of the asset 29 | */ 30 | private String fingerprint; 31 | 32 | /** 33 | * Asset decimals 34 | */ 35 | private Integer decimals; 36 | 37 | /** 38 | * Sum of assets for output UTxO 39 | */ 40 | private String quantity; 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/PolicyAsset.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Policy Asset 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PolicyAsset { 19 | 20 | /** 21 | * Asset Name (hex) 22 | */ 23 | private String assetName; 24 | 25 | /** 26 | * The CIP14 fingerprint of the asset 27 | */ 28 | private String fingerprint; 29 | 30 | /** 31 | * Total Supply 32 | */ 33 | private String totalSupply; 34 | 35 | /** 36 | * Asset decimals 37 | */ 38 | private Integer decimals; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolDelegatorHistory.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Pool Delegator History 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PoolDelegatorHistory { 19 | 20 | /** 21 | * Cardano staking address (reward account) in bech32 format 22 | */ 23 | private String stakeAddress; 24 | 25 | /** 26 | * Current delegator live stake (in lovelace) 27 | */ 28 | private String amount; 29 | 30 | /** 31 | * Epoch number for the delegation history 32 | */ 33 | private Integer epochNo; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountTx.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Account Tx 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class AccountTx { 19 | 20 | /** 21 | * Hash identifier of the transaction 22 | */ 23 | private String txHash; 24 | 25 | /** 26 | * Epoch number of the block 27 | */ 28 | private Integer epochNo; 29 | 30 | /** 31 | * Block height 32 | */ 33 | private Integer blockHeight; 34 | 35 | /** 36 | * UNIX timestamp of the block 37 | */ 38 | private Integer blockTime; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/RawTx.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Raw Transaction 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class RawTx { 19 | 20 | /** 21 | * Hash identifier of the transaction 22 | */ 23 | private String txHash; 24 | 25 | private String blockHash; 26 | 27 | private Long blockHeight; 28 | 29 | private Integer epochNo; 30 | 31 | private Long absoluteSlot; 32 | 33 | private Long txTimestamp; 34 | 35 | /** 36 | * Raw Tx in CBOR format 37 | */ 38 | private String cbor = null; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolDelegator.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Pool Delegator 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 15 | public class PoolDelegator { 16 | 17 | /** 18 | * Cardano staking address (reward account) in bech32 format 19 | */ 20 | private String stakeAddress; 21 | 22 | /** 23 | * Current delegator live stake (in lovelace) 24 | */ 25 | private String amount; 26 | 27 | /** 28 | * Epoch number in which the delegation becomes active 29 | */ 30 | private Integer activeEpochNo; 31 | 32 | /** 33 | * Latest transaction hash used for delegation by the account 34 | */ 35 | private String latestDelegationTxHash; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/script/model/NativeScript.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.script.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Native Script 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class NativeScript { 19 | 20 | /** 21 | * Hash of a script 22 | */ 23 | private String scriptHash; 24 | 25 | /** 26 | * Hash of the script creation transaction 27 | */ 28 | private String creationTxHash; 29 | 30 | /** 31 | * Type of the script 32 | */ 33 | private NativeScriptType type; 34 | 35 | /** 36 | * The size of the CBOR serialised script (in bytes) 37 | */ 38 | private Integer size; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/Relay.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | import lombok.ToString; 8 | 9 | /** 10 | * Relay 11 | */ 12 | @Getter 13 | @Setter 14 | @ToString 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class Relay { 17 | 18 | /** 19 | * DNS name of the relay (nullable) 20 | */ 21 | private String dns; 22 | 23 | /** 24 | * DNS service name of the relay (nullable) 25 | */ 26 | private String srv; 27 | 28 | /** 29 | * IPv4 address of the relay (nullable) 30 | */ 31 | private String ipv4; 32 | 33 | /** 34 | * IPv6 address of the relay (nullable) 35 | */ 36 | private String ipv6; 37 | 38 | /** 39 | * Port number of the relay (nullable) 40 | */ 41 | private Integer port; 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/Limit.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * Limit 7 | */ 8 | @Getter 9 | public class Limit extends Option { 10 | 11 | private final long limit; 12 | 13 | /** 14 | * Limit Option Constructor 15 | * 16 | * @param limit records limit value 17 | */ 18 | public Limit(long limit) { 19 | super(OptionType.LIMIT); 20 | this.limit = limit; 21 | } 22 | 23 | /** 24 | * Limit.of Static Constructor 25 | * 26 | * @param limit records limit value 27 | * @return new Limit Option Object 28 | */ 29 | public static Limit of(long limit) { 30 | if (limit >= 0) { 31 | return new Limit(limit); 32 | } else { 33 | throw new IllegalStateException("Can only Limit by a positive Value"); 34 | } 35 | } 36 | 37 | @Override 38 | public String getValue() { 39 | return String.valueOf(limit); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/script/model/DatumInfo.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.script.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Datum Info 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class DatumInfo { 20 | 21 | /** 22 | * The Hash of the Plutus Data 23 | */ 24 | private String datumHash; 25 | 26 | /** 27 | * Hash of the script creation transaction 28 | */ 29 | private String creationTxHash; 30 | 31 | /** 32 | * The actual data in json format 33 | */ 34 | private JsonNode value; 35 | 36 | /** 37 | * Script bytes (cborSeq) 38 | */ 39 | private String bytes; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/TxMetadata.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.databind.JsonNode; 5 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 6 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 7 | import lombok.Getter; 8 | import lombok.NoArgsConstructor; 9 | import lombok.Setter; 10 | import lombok.ToString; 11 | 12 | /** 13 | * Transaction Metadata 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @NoArgsConstructor 19 | @JsonIgnoreProperties(ignoreUnknown = true) 20 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 21 | public class TxMetadata { 22 | 23 | /** 24 | * Hash of the transaction for which details are being shown 25 | */ 26 | private String txHash = null; 27 | 28 | /** 29 | * A JSON array containing details about metadata within transaction 30 | */ 31 | private JsonNode metadata = null; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/PlutusScriptRedeemer.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Plutus Script Redeemer 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PlutusScriptRedeemer { 19 | 20 | /** 21 | * What kind of validation this redeemer is used for 22 | */ 23 | private Purpose purpose; 24 | 25 | /** 26 | * The budget in fees to run a script - the fees depend on the ExUnits and the current prices 27 | */ 28 | private String fee; 29 | 30 | /** 31 | * Unit 32 | */ 33 | private Unit unit; 34 | 35 | /** 36 | * Datum 37 | */ 38 | private Datum datum; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/DRep.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.*; 7 | 8 | /** 9 | * DRep 10 | */ 11 | @Getter 12 | @Setter 13 | @ToString 14 | @NoArgsConstructor 15 | @EqualsAndHashCode 16 | @JsonIgnoreProperties(ignoreUnknown = true) 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class DRep { 19 | 20 | /** 21 | * DRep ID in CIP-129 bech32 format 22 | */ 23 | private String drepId; 24 | 25 | /** 26 | * DRep ID in hex format 27 | */ 28 | private String hex; 29 | 30 | /** 31 | * Flag which shows if this credential is a script hash 32 | */ 33 | private Boolean hasScript; 34 | 35 | /** 36 | * Flag to show if the DRep is currently registered 37 | */ 38 | private Boolean registered; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolBlock.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Pool Block 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 15 | public class PoolBlock { 16 | 17 | /** 18 | * Epoch number 19 | */ 20 | private Integer epochNo; 21 | 22 | /** 23 | * Slot number of the block in epoch 24 | */ 25 | private Integer epochSlot; 26 | 27 | /** 28 | * Absolute slot number of the block 29 | */ 30 | private Integer absSlot; 31 | 32 | /** 33 | * Block height 34 | */ 35 | private Integer blockHeight; 36 | 37 | /** 38 | * Hash of the block 39 | */ 40 | private String blockHash; 41 | 42 | /** 43 | * Timestamp of the block 44 | */ 45 | private Integer blockTime; 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountStakeHistory.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Account Stake History 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class AccountStakeHistory { 19 | 20 | /** 21 | * Cardano staking address (reward account) in bech32 format 22 | */ 23 | private String stakeAddress; 24 | 25 | /** 26 | * Bech32 representation of pool ID 27 | */ 28 | private String poolIdBech32 = null; 29 | 30 | /** 31 | * Epoch number 32 | */ 33 | private Integer epochNo = null; 34 | 35 | /** 36 | * Active stake amount (in numbers) 37 | */ 38 | private String activeStake = null; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/AssetAddress.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Asset Address 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class AssetAddress extends PaymentAddress { 19 | 20 | /** 21 | * Asset Name (hex) 22 | */ 23 | private String assetName; 24 | 25 | /** 26 | * A Cardano payment/base address (bech32 encoded) 27 | */ 28 | private String paymentAddress; 29 | 30 | /** 31 | * Cardano staking address (reward account) in bech32 format 32 | */ 33 | private String stakeAddress; 34 | 35 | /** 36 | * Asset balance on the payment address 37 | */ 38 | private String quantity; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/AssetHistory.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Asset History 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @NoArgsConstructor 19 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 20 | public class AssetHistory { 21 | 22 | /** 23 | * Asset Policy ID (hex) 24 | */ 25 | private String policyId = null; 26 | 27 | /** 28 | * Asset Name (hex) 29 | */ 30 | private String assetName = null; 31 | 32 | /** 33 | * The CIP14 fingerprint of the asset 34 | */ 35 | private String fingerprint = null; 36 | 37 | /** 38 | * List of all mint/burn transactions for an asset 39 | */ 40 | private List mintingTxs = null; 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/block/model/BlockTxHash.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.block.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Block Tx Hash 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class BlockTxHash { 19 | 20 | /** 21 | * Hash of the block 22 | */ 23 | private String blockHash; 24 | 25 | /** 26 | * Hash identifier of the transaction 27 | */ 28 | private String txHash; 29 | 30 | /** 31 | * Epoch number of the block 32 | */ 33 | private Integer epochNo; 34 | 35 | /** 36 | * Block height 37 | */ 38 | private Integer blockHeight; 39 | 40 | /** 41 | * UNIX timestamp of the block 42 | */ 43 | private Integer blockTime; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/base/common/ReferenceScript.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.base.common; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Reference Script 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class ReferenceScript { 20 | 21 | /** 22 | * Hash of referenced script 23 | */ 24 | private String hash; 25 | 26 | /** 27 | * Size in bytes 28 | */ 29 | private Integer size; 30 | 31 | /** 32 | * Type of script 33 | */ 34 | private String type; 35 | 36 | /** 37 | * Script bytes (hex) 38 | */ 39 | private String bytes; 40 | 41 | /** 42 | * Value (json) 43 | */ 44 | private JsonNode value; 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/script/model/ScriptInfo.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.script.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | import lombok.ToString; 8 | 9 | /** 10 | * Script Information 11 | */ 12 | @Getter 13 | @Setter 14 | @ToString 15 | @NoArgsConstructor 16 | public class ScriptInfo { 17 | 18 | /** 19 | * Hash of a script 20 | */ 21 | private String scriptHash; 22 | 23 | /** 24 | * Hash of the script creation transaction 25 | */ 26 | private String creationTxHash; 27 | 28 | /** 29 | * Type of the script: plutusV1 | plutusV2 | timelock | multisig 30 | */ 31 | private NativeScriptType type; 32 | 33 | /** 34 | * Script JSON Object; 35 | */ 36 | private JsonNode value; 37 | 38 | /** 39 | * Script bytes (cborSeq) 40 | */ 41 | private String bytes; 42 | 43 | /** 44 | * The size of the CBOR serialised script (in bytes) 45 | */ 46 | private Integer size; 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/MintingTx.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Minting Transaction 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class MintingTx { 20 | 21 | /** 22 | * Transaction Hash 23 | */ 24 | private String txHash; 25 | 26 | /** 27 | * UNIX timestamp of the block 28 | */ 29 | private Integer blockTime; 30 | 31 | /** 32 | * Quantity minted/burned (negative numbers indicate burn transactions) 33 | */ 34 | private String quantity; 35 | 36 | /** 37 | * A JSON array containing details about metadata within transaction 38 | */ 39 | private JsonNode metadata; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/Order.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * Limit 7 | */ 8 | @Getter 9 | public class Order extends Option { 10 | 11 | private final String param; 12 | private final SortType sortType; 13 | 14 | /** 15 | * Limit Option Constructor 16 | * 17 | * @param param Param to Order By 18 | * @param sortType SortType ASC or DESC 19 | */ 20 | public Order(String param, SortType sortType) { 21 | super(OptionType.ORDER); 22 | this.param = param; 23 | this.sortType = sortType; 24 | } 25 | 26 | /** 27 | * Limit.of Static Constructor 28 | * 29 | * @param param Parameter to Order By 30 | * @param sortType SortType - ASC or DESC 31 | * @return new Limit Option Object 32 | */ 33 | public static Order by(String param, SortType sortType) { 34 | return new Order(param, sortType); 35 | } 36 | 37 | @Override 38 | public String getValue() { 39 | return param+"."+sortType.name().toLowerCase(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/TxCertificate.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Certificates present within a transaction 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class TxCertificate { 20 | 21 | /** 22 | * Certificate index 23 | */ 24 | private Integer index; 25 | 26 | /** 27 | * Type of certificate (could be delegation, stake_registration, stake_deregistraion, pool_update, pool_retire, param_proposal, reserve_MIR, treasury_MIR, drep_registration, vote_delegation) 28 | */ 29 | private String type; 30 | 31 | /** 32 | * A JSON array containing information from the certificate 33 | */ 34 | private JsonNode info; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountReward.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Account Rewards Inner 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class AccountReward { 19 | 20 | /** 21 | * Earned Rewards Epoch 22 | */ 23 | private Integer earnedEpoch; 24 | 25 | /** 26 | * Spendable Epoch 27 | */ 28 | private Integer spendableEpoch; 29 | 30 | /** 31 | * Amount of rewards earned (in lovelace) 32 | */ 33 | private String amount; 34 | 35 | /** 36 | * The source of the rewards 37 | * Allowed: member|leader|treasury|reserves 38 | */ 39 | private String type; 40 | 41 | /** 42 | * Bech32 representation of pool ID 43 | */ 44 | private String poolId; 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolGroup.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Pool Group 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PoolGroup { 19 | 20 | /** 21 | * Pool ID (bech32 format) 22 | */ 23 | private String poolIdBech32; 24 | 25 | /** 26 | * A group that the pool was identified to be associated with 27 | */ 28 | private String poolGroup; 29 | 30 | /** 31 | * Pool ticker 32 | */ 33 | private String ticker; 34 | 35 | /** 36 | * The pool's group identification as per adastat.net 37 | */ 38 | private String adastatGroup; 39 | 40 | /** 41 | * The pool's group identification as per balanceanalytics.io 42 | */ 43 | private String balanceanalyticsGroup; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolStakeSnapshot.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Pool Stake Snapshot 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PoolStakeSnapshot { 19 | 20 | /** 21 | * 22 | * Type of snapshot ("Mark", "Set" or "Go") 23 | */ 24 | private String snapshot; 25 | 26 | /** 27 | * Epoch number for the snapshot entry 28 | */ 29 | private Integer epochNo; 30 | 31 | /** 32 | * The nonce value for this epoch 33 | */ 34 | private String nonce; 35 | 36 | /** 37 | * Pool's Active Stake for the given epoch 38 | */ 39 | private String poolStake; 40 | 41 | /** 42 | * Total Active Stake for the given epoch 43 | */ 44 | private String activeStake; 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/network/model/ParamUpdateProposal.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.network.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * ParamUpdateProposal 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class ParamUpdateProposal { 20 | 21 | /** 22 | * Hash identifier of the transaction 23 | */ 24 | private String txHash; 25 | 26 | /** 27 | * Block height 28 | */ 29 | private Integer blockHeight; 30 | 31 | /** 32 | * UNIX timestamp of the block 33 | */ 34 | private Integer blockTime; 35 | 36 | /** 37 | * Epoch number 38 | */ 39 | private Integer epochNo; 40 | 41 | /** 42 | * JSON encoded data with details about the parameter update 43 | */ 44 | private JsonNode data; 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/address/model/AddressInfo.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.address.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | import java.util.Set; 8 | 9 | /** 10 | * Address Information 11 | */ 12 | @Getter 13 | @Setter 14 | @ToString 15 | @NoArgsConstructor 16 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 17 | public class AddressInfo { 18 | 19 | /** 20 | * A Cardano payment/base address (bech32 encoded) for transaction's input UTxO 21 | */ 22 | private String address; 23 | 24 | /** 25 | * Balance of Address for which details are being shown 26 | */ 27 | private String balance; 28 | 29 | /** 30 | * Cardano staking address in bech32 format 31 | */ 32 | private String stakeAddress; 33 | 34 | /** 35 | * Signifies whether the address is a script address 36 | */ 37 | private Boolean scriptAddress; 38 | 39 | /** 40 | * Set of UTxOs of Address for which details are being shown 41 | */ 42 | private Set utxoSet; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolOwnerHistory.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Pool Calidus Key 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PoolOwnerHistory { 19 | 20 | /** 21 | * Pool ID (bech32 format) 22 | */ 23 | private String poolIdBech32; 24 | 25 | /** 26 | * Individual Stake account registered as (one of the) pool owner(s) 27 | */ 28 | private String stakeAddress; 29 | 30 | /** 31 | * Pool pledge in number 32 | */ 33 | private String declaredPledge; 34 | 35 | /** 36 | * Epoch for which the pool history data is shown 37 | */ 38 | private Integer epoch; 39 | 40 | /** 41 | * Amount of delegated stake to this pool at the time of epoch snapshot 42 | */ 43 | private String activeStake; 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/DRepDelegator.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * DRep Delegator 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class DRepDelegator { 17 | 18 | /** 19 | * Cardano staking address (reward account) in bech32 format 20 | */ 21 | private String stakeAddress; 22 | 23 | /** 24 | * Cardano staking address (reward account) in hex format 25 | */ 26 | private String stakeAddressHex; 27 | 28 | /** 29 | * Script hash in case the stake address is locked by a script (null if not applicable) 30 | */ 31 | private String scriptHash; 32 | 33 | /** 34 | * Epoch when vote delegation was made 35 | */ 36 | private Integer epochNo; 37 | 38 | /** 39 | * Total balance of the account including UTxO, rewards, and MIRs (in number) 40 | */ 41 | private String amount; 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/filters/FilterType.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options.filters; 2 | 3 | /** 4 | * Filter Type 5 | */ 6 | public enum FilterType { 7 | 8 | /** 9 | * equals 10 | */ 11 | EQ, 12 | 13 | /** 14 | * greater than 15 | */ 16 | GT, 17 | 18 | /** 19 | * greater than or equal 20 | */ 21 | GTE, 22 | 23 | /** 24 | * less than 25 | */ 26 | LT, 27 | 28 | /** 29 | * less than or equal 30 | */ 31 | LTE, 32 | 33 | /** 34 | * not equal 35 | */ 36 | NEQ, 37 | 38 | /** 39 | * LIKE operator (use * in place of %) 40 | */ 41 | LIKE, // TODO Not Supported 42 | 43 | /** 44 | * one of a list of values, e.g. ?a=in.("hi,there","yes,you") 45 | */ 46 | IN, // TODO Not Supported 47 | 48 | /** 49 | * checking for exact equality (null,true,false,unknown) 50 | */ 51 | IS, // TODO Not Supported 52 | 53 | /** 54 | * contains e.g. ?tags=cs.{example, new} 55 | */ 56 | CS, // TODO Not Supported 57 | 58 | /** 59 | * contained in e.g. ?values=cd.{1,2,3} 60 | */ 61 | CD // TODO Not Supported 62 | } -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/AssetSummary.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Asset Summary 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 15 | public class AssetSummary { 16 | 17 | /** 18 | * Asset Policy ID (hex) 19 | */ 20 | private String policyId; 21 | 22 | /** 23 | * Asset Name (hex) 24 | */ 25 | private String assetName; 26 | 27 | /** 28 | * Total number of transactions including the given asset 29 | */ 30 | private Long totalTransactions; 31 | 32 | /** 33 | * Total number of registered wallets holding the given asset 34 | */ 35 | private Long stakedWallets; 36 | 37 | /** 38 | * Total number of payment addresses (not belonging to registered wallets) holding the given asset 39 | */ 40 | private Long unstakedAddresses; 41 | 42 | /** 43 | * Total number of unique addresses holding the given asset 44 | */ 45 | private Long addresses; 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/TxPlutusContract.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Plutus Contract 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class TxPlutusContract { 19 | 20 | /** 21 | * Plutus script address 22 | */ 23 | private String address; 24 | 25 | /** 26 | * Hash of a script 27 | */ 28 | private String scriptHash; 29 | 30 | /** 31 | * CBOR-encoded Plutus script data 32 | */ 33 | private String bytecode; 34 | 35 | /** 36 | * The size of the CBOR serialised script (in bytes) 37 | */ 38 | private Integer size; 39 | 40 | /** 41 | * True if the contract is valid or there is no contract 42 | */ 43 | private Boolean validContract; 44 | 45 | /** 46 | * Plutus Script Input 47 | */ 48 | private PlutusScriptInput input; 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolStatus.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Pool Status 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PoolStatus { 19 | 20 | /** 21 | * Pool ID (bech32 format) 22 | */ 23 | private String poolIdBech32; 24 | 25 | /** 26 | * Hash identifier of the transaction 27 | */ 28 | private String txHash; 29 | 30 | /** 31 | * Hash of the block 32 | */ 33 | private String blockHash; 34 | 35 | /** 36 | * Block height 37 | */ 38 | private Integer blockHeight; 39 | 40 | /** 41 | * Epoch number 42 | */ 43 | private Integer epochNo; 44 | 45 | /** 46 | * Slot number of the block in epoch 47 | */ 48 | private Integer epochSlot; 49 | 50 | /** 51 | * Epoch number in which the update becomes active 52 | */ 53 | private Integer activeEpochNo; 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/block/model/BlockTxCbor.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.block.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Block Tx Cbor 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class BlockTxCbor { 19 | 20 | /** 21 | * Hash identifier of the transaction 22 | */ 23 | private String txHash; 24 | 25 | /** 26 | * Hash of the block 27 | */ 28 | private String blockHash; 29 | 30 | /** 31 | * Block height 32 | */ 33 | private Integer blockHeight; 34 | 35 | /** 36 | * Epoch number of the block 37 | */ 38 | private Integer epochNo; 39 | 40 | /** 41 | * Absolute slot number of the block 42 | */ 43 | private Integer absoluteSlot; 44 | 45 | /** 46 | * UNIX timestamp of the transaction 47 | */ 48 | private Integer txTimestamp; 49 | 50 | /** 51 | * CBOR encoded raw transaction 52 | */ 53 | private String cbor; 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountUpdate.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Account Update 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class AccountUpdate { 19 | 20 | /** 21 | * Type of certificate submitted 22 | * Allowed: registration | delegation | withdrawal | deregistration 23 | */ 24 | private String actionType; 25 | 26 | /** 27 | * Hash identifier of the transaction 28 | */ 29 | private String txHash; 30 | 31 | /** 32 | * Epoch number of the block 33 | */ 34 | private Integer epochNo; 35 | 36 | /** 37 | * Slot number of the block in epoch 38 | */ 39 | private Integer epochSlot; 40 | 41 | /** 42 | * Absolute slot number of the block 43 | */ 44 | private Integer absoluteSlot; 45 | 46 | /** 47 | * UNIX timestamp of the block 48 | */ 49 | private Integer blockTime; 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/AssetTokenRegistry.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Asset 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class AssetTokenRegistry { 19 | 20 | /** 21 | * Asset Policy ID (hex) 22 | */ 23 | private String policyId; 24 | 25 | /** 26 | * Asset Name (hex) 27 | */ 28 | private String assetName; 29 | 30 | /** 31 | * Asset Name (ASCII) 32 | */ 33 | private String assetNameAscii; 34 | 35 | /** 36 | * Ticker 37 | */ 38 | private String ticker; 39 | 40 | /** 41 | * Description 42 | */ 43 | private String description; 44 | 45 | /** 46 | * Url 47 | */ 48 | private String url; 49 | 50 | /** 51 | * Decimals 52 | */ 53 | private Integer decimals; 54 | 55 | /** 56 | * A PNG image file as a byte string 57 | */ 58 | private String logo; 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountRewardHistory.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Account Reward History 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class AccountRewardHistory { 19 | 20 | /** 21 | * Cardano staking address (reward account) in bech32 format 22 | */ 23 | private String stakeAddress; 24 | 25 | /** 26 | * Earned Rewards Epoch 27 | */ 28 | private Integer earnedEpoch; 29 | 30 | /** 31 | * Spendable Epoch 32 | */ 33 | private Integer spendableEpoch; 34 | 35 | /** 36 | * Amount of rewards earned (in lovelace) 37 | */ 38 | private String amount; 39 | 40 | /** 41 | * The source of the rewards 42 | * Allowed: member|leader|treasury|reserves 43 | */ 44 | private String type; 45 | 46 | /** 47 | * Bech32 representation of pool ID 48 | */ 49 | private String poolIdBech32; 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/CommitteeInfo.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Committee Info 11 | */ 12 | @Getter 13 | @Setter 14 | @ToString 15 | @NoArgsConstructor 16 | @EqualsAndHashCode 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class CommitteeInfo { 19 | 20 | /** 21 | * Proposal Action ID in accordance with CIP-129 format 22 | */ 23 | private String proposalId; 24 | 25 | /** 26 | * Hash identifier of the transaction 27 | */ 28 | private String proposalTxHash; 29 | 30 | /** 31 | * Index of governance proposal in transaction 32 | */ 33 | private Integer proposalIndex; 34 | 35 | /** 36 | * Quorum numerator for governance proposal 37 | */ 38 | private Integer quorumNumerator; 39 | 40 | /** 41 | * Quorum denominator for governance proposal 42 | */ 43 | private Integer quorumDenominator; 44 | 45 | /** 46 | * Array of all members part of active governance committee 47 | */ 48 | private List members; 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/network/model/Tip.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.network.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Tip 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class Tip { 19 | 20 | /** 21 | * Block Hash in hex 22 | **/ 23 | private String hash = null; 24 | 25 | /** 26 | * Epoch number 27 | **/ 28 | private Integer epochNo = null; 29 | 30 | /** 31 | * Absolute Slot number (slots not divided into epochs) 32 | **/ 33 | private Integer absSlot = null; 34 | 35 | /** 36 | * Slot number within Epoch 37 | **/ 38 | private Integer epochSlot = null; 39 | 40 | /** 41 | * Block Height number on chain 42 | **/ 43 | @Deprecated 44 | private Integer blockNo = null; 45 | 46 | /** 47 | * Block Height 48 | */ 49 | private Integer blockHeight; 50 | 51 | /** 52 | * UNIX timestamp of the block 53 | **/ 54 | private Long blockTime = null; 55 | } 56 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## How can you contribute? 4 | 5 | 1. #### Feedback 6 | Contributions in the form of feedback and issue is very much welcome. Might it be a suggestion, a bug report or maybe some questions that you have. It helps improving Koios in the long run and these are probably the best kind of contributions to start with. 7 | 2. #### Code 8 | The project follows a quite strict architecture as detailed in the README and coding standards are enforced using tools and configuration defined on the repository. Make sure to configure your editor to pick them up. Pull requests are welcome, but we do recommend opening an issue to bring any idea to discussion first! 9 | 3. #### Donation 10 | Want to drop some Ada to give some financial support? Have a look at the [Sponsor page](https://github.com/cardano-community/koios-java-client/blob/master/SPONSORS.md) for more details. 11 | 12 | ## More 13 | 14 | ### :bug: Found an Issue? 15 | Open an [Issue Ticket](https://github.com/cardano-community/koios-java-client/issues/new?template=bug.md). 16 | 17 | ### :bulb: Have an idea? 18 | Open a [Proposal ticket](https://github.com/cardano-community/koios-java-client/issues/new?template=idea.md). 19 | 20 | ### :question: Have a question? 21 | Open a [Question ticket](https://github.com/cardano-community/koios-java-client/issues/new). 22 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/network/api/NetworkApi.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.network.api; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import rest.koios.client.backend.api.network.model.*; 5 | import retrofit2.Call; 6 | import retrofit2.http.GET; 7 | import retrofit2.http.Query; 8 | import retrofit2.http.QueryMap; 9 | 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | /** 14 | * Network API 15 | */ 16 | public interface NetworkApi { 17 | 18 | @GET("tip") 19 | Call> getChainTip(); 20 | 21 | @GET("genesis") 22 | Call> getGenesisInfo(); 23 | 24 | @GET("totals") 25 | Call> getHistoricalTokenomicStatsByEpoch(@Query("_epoch_no") Integer epochNo); 26 | 27 | @GET("totals") 28 | Call> getHistoricalTokenomicStats(@QueryMap Map paramsMap); 29 | 30 | @GET("param_updates") 31 | Call> getParamUpdateProposals(@QueryMap Map paramsMap); 32 | 33 | @GET("cli_protocol_params") 34 | Call getCliProtocolParameters(@QueryMap Map paramsMap); 35 | 36 | @GET("reserve_withdrawals") 37 | Call> getReserveWithdrawals(@QueryMap Map paramsMap); 38 | 39 | @GET("treasury_withdrawals") 40 | Call> getTreasuryWithdrawals(@QueryMap Map paramsMap); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/VotingProcedure.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Voting Procedure 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class VotingProcedure { 20 | 21 | /** 22 | * Hash identifier of the transaction 23 | */ 24 | private String proposalTxHash; 25 | 26 | /** 27 | * Index of governance proposal in transaction 28 | */ 29 | private Integer proposalIndex; 30 | 31 | /** 32 | * The role of the voter 33 | * Allowed: ConstitutionalCommittee|DRep|SPO 34 | */ 35 | private String voterRole; 36 | 37 | /** 38 | * Voter's DRep ID (CIP-129 bech32 format), pool ID (bech32 format) or committee hot ID (CIP-129 bech32 format) 39 | */ 40 | private String voter; 41 | 42 | /** 43 | * Voter's DRep ID , pool ID or committee hash in hex format 44 | */ 45 | private String voterHex; 46 | 47 | /** 48 | * Actual Vote casted 49 | * Allowed: Yes|No|Abstain 50 | */ 51 | private String vote; 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountUpdateHistory.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Account Update History 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class AccountUpdateHistory { 19 | 20 | /** 21 | * Cardano staking address (reward account) in bech32 format 22 | */ 23 | private String stakeAddress; 24 | 25 | /** 26 | * Type of certificate submitted 27 | * Allowed: registration | delegation | withdrawal | deregistration 28 | */ 29 | private String actionType; 30 | 31 | /** 32 | * Hash identifier of the transaction 33 | */ 34 | private String txHash; 35 | 36 | /** 37 | * Epoch number of the block 38 | */ 39 | private Integer epochNo; 40 | 41 | /** 42 | * Slot number of the block in epoch 43 | */ 44 | private Integer epochSlot; 45 | 46 | /** 47 | * Absolute slot number of the block 48 | */ 49 | private Integer absoluteSlot; 50 | 51 | /** 52 | * UNIX timestamp of the block 53 | */ 54 | private Integer blockTime; 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/CommitteeMember.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Committee Member 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class CommitteeMember { 17 | 18 | /** 19 | * Member authentication status (authorized, not_authorized, resigned) 20 | */ 21 | private String status; 22 | 23 | private String ccHotd; 24 | 25 | private String ccColdId; 26 | 27 | /** 28 | * Committee member key hash from last valid hot key authorization certificate in hex format (null if not applicable) 29 | */ 30 | private String ccHotHex; 31 | 32 | /** 33 | * Committee member cold key hash in hex format 34 | */ 35 | private String ccColdHex; 36 | 37 | /** 38 | * Epoch number in which the committee member vote rights expire 39 | */ 40 | private Integer expirationEpoch; 41 | 42 | /** 43 | * Flag which shows if this credential is a script hash (null if not applicable) 44 | */ 45 | private Boolean ccHotHasScript; 46 | 47 | /** 48 | * Flag which shows if this credential is a script hash 49 | */ 50 | private Boolean ccColdHasScript; 51 | } -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/DRepVote.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * DRep Vote 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class DRepVote { 17 | 18 | /** 19 | * Proposal Action ID in accordance with CIP-129 format 20 | */ 21 | private String proposalId; 22 | 23 | /** 24 | * Hash identifier of the proposal transaction 25 | */ 26 | private String proposalTxHash; 27 | 28 | /** 29 | * Index of governance proposal in transaction 30 | */ 31 | private Integer proposalIndex; 32 | 33 | /** 34 | * Hash identifier of the vote transaction 35 | */ 36 | private String voteTxHash; 37 | 38 | /** 39 | * UNIX timestamp of the block 40 | */ 41 | private Long blockTime; 42 | 43 | /** 44 | * Actual Vote casted (Yes, No, Abstain) 45 | */ 46 | private String vote; 47 | 48 | /** 49 | * A URL to a JSON payload of metadata (null if not applicable) 50 | */ 51 | private String metaUrl; 52 | 53 | /** 54 | * A hash of the contents of the metadata URL (null if not applicable) 55 | */ 56 | private String metaHash; 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/PoolVote.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Pool Vote 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class PoolVote { 17 | 18 | /** 19 | * Proposal Action ID in accordance with CIP-129 format 20 | */ 21 | private String proposalId; 22 | 23 | /** 24 | * Hash identifier of the proposal transaction 25 | */ 26 | private String proposalTxHash; 27 | 28 | /** 29 | * Index of governance proposal in transaction 30 | */ 31 | private Integer proposalIndex; 32 | 33 | /** 34 | * Hash identifier of the vote transaction 35 | */ 36 | private String voteTxHash; 37 | 38 | /** 39 | * UNIX timestamp of the block 40 | */ 41 | private Long blockTime; 42 | 43 | /** 44 | * Actual Vote casted (Yes, No, Abstain) 45 | */ 46 | private String vote; 47 | 48 | /** 49 | * A URL to a JSON payload of metadata (null if not applicable) 50 | */ 51 | private String metaUrl; 52 | 53 | /** 54 | * A hash of the contents of the metadata URL (null if not applicable) 55 | */ 56 | private String metaHash; 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/CommitteeVote.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Committee Vote 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class CommitteeVote { 17 | 18 | /** 19 | * Proposal Action ID in accordance with CIP-129 format 20 | */ 21 | private String proposalId; 22 | 23 | /** 24 | * Hash identifier of the proposal transaction 25 | */ 26 | private String proposalTxHash; 27 | 28 | /** 29 | * Index of governance proposal in transaction 30 | */ 31 | private Integer proposalIndex; 32 | 33 | /** 34 | * Hash identifier of the vote transaction 35 | */ 36 | private String voteTxHash; 37 | 38 | /** 39 | * UNIX timestamp of the block 40 | */ 41 | private Long blockTime; 42 | 43 | /** 44 | * Actual Vote casted (Yes, No, Abstain) 45 | */ 46 | private String vote; 47 | 48 | /** 49 | * A URL to a JSON payload of metadata (null if not applicable) 50 | */ 51 | private String metaUrl; 52 | 53 | /** 54 | * A hash of the contents of the metadata URL (null if not applicable) 55 | */ 56 | private String metaHash; 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/filters/Filter.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options.filters; 2 | 3 | import lombok.Getter; 4 | import rest.koios.client.backend.factory.options.Option; 5 | import rest.koios.client.backend.factory.options.OptionType; 6 | 7 | /** 8 | * Filter 9 | */ 10 | @Getter 11 | public class Filter extends Option { 12 | 13 | private final FilterType filterType; 14 | private final String field; 15 | private final String value; 16 | 17 | /** 18 | * Filter Constructor 19 | * 20 | * @param field field 21 | * @param filterType filterType 22 | * @param value value 23 | */ 24 | public Filter(String field, FilterType filterType, String value) { 25 | super(OptionType.FILTER); 26 | this.filterType = filterType; 27 | this.field = field; 28 | this.value = value; 29 | } 30 | 31 | /** 32 | * Filter.of Static Constructor 33 | * 34 | * @param field field 35 | * @param filterType filterType 36 | * @param value value 37 | * @return new Limit Option Object 38 | */ 39 | public static Filter of(String field, FilterType filterType, String value) { 40 | return new Filter(field, filterType, value); 41 | } 42 | 43 | @Override 44 | public String getOptionTypeValue() { 45 | return field; 46 | } 47 | 48 | @Override 49 | public String getValue() { 50 | return filterType.name().toLowerCase()+"."+value; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /.github/workflows/codecov.yml: -------------------------------------------------------------------------------- 1 | name: Codecov 2 | on: [push] 3 | jobs: 4 | run: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Checkout Repository 8 | uses: actions/checkout@v2 9 | - name: Set up JDK 11 10 | uses: actions/setup-java@v2 11 | with: 12 | java-version: '11' 13 | distribution: 'temurin' 14 | 15 | - name: Ensure ~/.m2/repository exists 16 | run: mkdir -p ~/.m2/repository 17 | 18 | - name: Cache Maven packages 19 | uses: actions/cache@v3 20 | with: 21 | path: ~/.m2/repository 22 | key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} 23 | restore-keys: | 24 | maven-${{ runner.os }}- 25 | 26 | - name: Set up Maven settings 27 | run: | 28 | mkdir -p $HOME/.m2 29 | cat < $HOME/.m2/settings.xml 30 | 31 | 32 | 33 | github 34 | ${{ github.actor }} 35 | ${{ secrets.GH_TOKEN }} 36 | 37 | 38 | 39 | EOF 40 | 41 | - name: Install Dependencies 42 | run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V -Dgpg.skip 43 | - name: Run tests and collect coverage 44 | run: mvn '-Dtest=*Preview*' -B test -Dgpg.skip 45 | - name: Upload coverage to Codecov 46 | uses: codecov/codecov-action@v3 47 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolCalidusKey.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Pool Calidus Key 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PoolCalidusKey { 19 | 20 | /** 21 | * Pool ID (bech32 format) 22 | */ 23 | private String poolIdBech32; 24 | 25 | /** 26 | * Pool status (registered | retiring | retired) 27 | */ 28 | private String poolStatus; 29 | 30 | /** 31 | * Unique nonce for pool's calidus key 32 | */ 33 | private Integer calidusNonce; 34 | 35 | /** 36 | * Calidus public key as per CIP-88 37 | */ 38 | private String calidusPubKey; 39 | 40 | /** 41 | * Calidus key in bech32 format as per CIP-88 42 | */ 43 | private String calidusIdBech32; 44 | 45 | /** 46 | * Hash identifier of the transaction 47 | */ 48 | private String txHash; 49 | 50 | /** 51 | * Epoch number 52 | */ 53 | private Integer epochNo; 54 | 55 | /** 56 | * Block Height 57 | */ 58 | private Integer blockHeight; 59 | 60 | /** 61 | * UNIX timestamp of the block 62 | */ 63 | private Integer blockTime; 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/network/model/Withdrawal.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.network.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Withdrawal 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class Withdrawal { 19 | 20 | /** 21 | * Epoch number 22 | **/ 23 | private Integer epochNo; 24 | 25 | /** 26 | * Slot number of the block in epoch 27 | **/ 28 | private Integer epochSlot; 29 | 30 | /** 31 | * Hash identifier of the transaction 32 | **/ 33 | private String txHash; 34 | 35 | /** 36 | * Hash of the block 37 | **/ 38 | private String blockHash; 39 | 40 | /** 41 | * Block height 42 | **/ 43 | private Integer blockHeight; 44 | 45 | /** 46 | * Current delegator live stake (in lovelace) 47 | **/ 48 | private String amount; 49 | 50 | /** 51 | * Cardano staking address (reward account) in bech32 format 52 | **/ 53 | private String stakeAddress; 54 | 55 | /** 56 | * Epoch where amount is earned 57 | */ 58 | private Integer earnedEpoch; 59 | 60 | /** 61 | * Epoch where the earned amount can be spent 62 | */ 63 | private Integer spendableEpoch; 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/address/model/AddressOutput.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.address.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Address Output 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @EqualsAndHashCode 14 | @NoArgsConstructor 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class AddressOutput { 17 | 18 | /** 19 | * A Cardano payment/base address (bech32 encoded) 20 | */ 21 | private String address; 22 | 23 | /** 24 | * Hash identifier of the transaction 25 | */ 26 | private String txHash; 27 | 28 | /** 29 | * Index of UTxO in the transaction 30 | */ 31 | private Integer txIndex; 32 | 33 | /** 34 | * Total sum of ADA on the UTxO 35 | */ 36 | private String value; 37 | 38 | /** 39 | * Cardano staking address (reward account) in bech32 40 | */ 41 | private String stakeAddress; 42 | 43 | /** 44 | * Payment credential 45 | */ 46 | private String paymentCred; 47 | 48 | /** 49 | * Epoch number of the block 50 | */ 51 | private Integer epochNo; 52 | 53 | /** 54 | * Block height 55 | */ 56 | private Integer blockHeight; 57 | 58 | /** 59 | * Timestamp of the block 60 | */ 61 | private Integer blockTime; 62 | 63 | /** 64 | * True if the UTXO has been spent 65 | */ 66 | private Boolean isSpent; 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/ProposalVote.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Proposal Vote 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class ProposalVote { 17 | 18 | /** 19 | * UNIX timestamp of the block 20 | */ 21 | private Long blockTime; 22 | 23 | /** 24 | * The role of the voter (ConstitutionalCommittee, DRep, SPO) 25 | */ 26 | private String voterRole; 27 | 28 | /** 29 | * Voter's DRep ID (CIP-129 bech32 format), pool ID (bech32 format) or committee hot ID (CIP-129 bech32 format) 30 | */ 31 | private String voterId; 32 | 33 | /** 34 | * Voter's DRep ID, pool ID, or committee hash in hex format 35 | */ 36 | private String voterHex; 37 | 38 | /** 39 | * Flag which shows if this credential is a script hash 40 | */ 41 | private Boolean voterHasScript; 42 | 43 | /** 44 | * Actual Vote casted (Yes, No, Abstain) 45 | */ 46 | private String vote; 47 | 48 | /** 49 | * A URL to a JSON payload of metadata (null if not applicable) 50 | */ 51 | private String metaUrl; 52 | 53 | /** 54 | * A hash of the contents of the metadata URL (null if not applicable) 55 | */ 56 | private String metaHash; 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/script/model/Redeemer.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.script.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Redeemer 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class Redeemer { 20 | 21 | /** 22 | * Hash of Transaction containing the redeemer 23 | */ 24 | private String txHash; 25 | 26 | /** 27 | * The index of the redeemer pointer in the transaction 28 | */ 29 | private Integer txIndex; 30 | 31 | /** 32 | * The budget in Memory to run a script 33 | */ 34 | private Integer unitMem; 35 | 36 | /** 37 | * The budget in Cpu steps to run a script 38 | */ 39 | private Long unitSteps; 40 | 41 | /** 42 | * The budget in fees to run a script - the fees depend on the ExUnits and the current prices 43 | */ 44 | private String fee; 45 | 46 | /** 47 | * What kind pf validation this redeemer is used for, it can be one of 'spend', 'mint', 'cert', 'reward' 48 | */ 49 | private String purpose; 50 | 51 | /** 52 | * The Hash of the Plutus Data 53 | */ 54 | private String datumHash; 55 | 56 | /** 57 | * The actual data in json format 58 | */ 59 | private JsonNode datumValue; 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/PolicyAssetMint.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Policy Asset Info 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class PolicyAssetMint { 20 | 21 | /** 22 | * Asset Name (hex) 23 | */ 24 | private String assetName; 25 | 26 | /** 27 | * Asset Name (ASCII) 28 | */ 29 | private String assetNameAscii; 30 | 31 | /** 32 | * The CIP14 fingerprint of the asset 33 | */ 34 | private String fingerprint; 35 | 36 | /** 37 | * Hash of the latest mint transaction 38 | */ 39 | private String mintingTxHash; 40 | 41 | /** 42 | * Total Supply 43 | */ 44 | private String totalSupply; 45 | 46 | /** 47 | * Count of total mint transactions 48 | */ 49 | private Integer mintCnt; 50 | 51 | /** 52 | * Count of total burn transactions 53 | */ 54 | private Integer burnCnt; 55 | 56 | /** 57 | * Creation Time 58 | */ 59 | private Integer creationTime; 60 | 61 | /** 62 | * A JSON array containing details about metadata within transaction 63 | */ 64 | private JsonNode mintingTxMetadata; 65 | 66 | private Integer decimals; 67 | } 68 | -------------------------------------------------------------------------------- /.github/workflows/mainnet.yml: -------------------------------------------------------------------------------- 1 | name: Mainnet 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | schedule: 7 | - cron: '0 0 * * *' 8 | 9 | env: 10 | KOIOS_JAVA_LIB_LOGGING: true 11 | 12 | jobs: 13 | mainnet: 14 | name: Mainnet 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout Repository 18 | uses: actions/checkout@v2 19 | 20 | - name: Set up JDK 11 21 | uses: actions/setup-java@v2 22 | with: 23 | java-version: '11' 24 | distribution: 'temurin' 25 | 26 | - name: Ensure ~/.m2/repository exists 27 | run: mkdir -p ~/.m2/repository 28 | 29 | - name: Cache Maven packages 30 | uses: actions/cache@v3 31 | with: 32 | path: ~/.m2/repository 33 | key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} 34 | restore-keys: | 35 | maven-${{ runner.os }}- 36 | 37 | - name: Set up Maven settings 38 | run: | 39 | mkdir -p $HOME/.m2 40 | cat < $HOME/.m2/settings.xml 41 | 42 | 43 | 44 | github 45 | ${{ github.actor }} 46 | ${{ secrets.GH_TOKEN }} 47 | 48 | 49 | 50 | EOF 51 | 52 | - name: Run Tests 53 | run: | 54 | mvn '-Dtest=*Mainnet*' verify -Djacoco.destFile=exportJacoco/jacoco-mainnet.exec -Dgpg.skip 55 | - name: Upload Jacoco Results 56 | uses: actions/upload-artifact@v4 57 | with: 58 | name: mainnet-tests-jacoco 59 | path: exportJacoco/jacoco-mainnet.exec 60 | -------------------------------------------------------------------------------- /.github/workflows/preview.yml: -------------------------------------------------------------------------------- 1 | name: Preview 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | schedule: 7 | - cron: '0 0 * * *' 8 | 9 | env: 10 | KOIOS_JAVA_LIB_LOGGING: true 11 | 12 | jobs: 13 | preview: 14 | name: Preview 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout Repository 18 | uses: actions/checkout@v2 19 | 20 | - name: Set up JDK 11 21 | uses: actions/setup-java@v2 22 | with: 23 | java-version: '11' 24 | distribution: 'temurin' 25 | 26 | - name: Ensure ~/.m2/repository exists 27 | run: mkdir -p ~/.m2/repository 28 | 29 | - name: Cache Maven packages 30 | uses: actions/cache@v3 31 | with: 32 | path: ~/.m2/repository 33 | key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} 34 | restore-keys: | 35 | maven-${{ runner.os }}- 36 | 37 | - name: Set up Maven settings 38 | run: | 39 | mkdir -p $HOME/.m2 40 | cat < $HOME/.m2/settings.xml 41 | 42 | 43 | 44 | github 45 | ${{ github.actor }} 46 | ${{ secrets.GH_TOKEN }} 47 | 48 | 49 | 50 | EOF 51 | - name: Run tests 52 | run: | 53 | mvn '-Dtest=*Preview*' verify -Djacoco.destFile=exportJacoco/jacoco-preview.exec -Dgpg.skip 54 | - name: Upload Jacoco Results 55 | uses: actions/upload-artifact@v4 56 | with: 57 | name: preview-tests-jacoco 58 | path: exportJacoco/jacoco-preview.exec -------------------------------------------------------------------------------- /.github/workflows/preprod.yml: -------------------------------------------------------------------------------- 1 | name: Preprod 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | schedule: 7 | - cron: '0 0 * * *' 8 | 9 | env: 10 | KOIOS_JAVA_LIB_LOGGING: true 11 | 12 | jobs: 13 | preprod: 14 | name: Preprod 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout Repository 18 | uses: actions/checkout@v2 19 | 20 | - name: Set up JDK 11 21 | uses: actions/setup-java@v2 22 | with: 23 | java-version: '11' 24 | distribution: 'temurin' 25 | 26 | - name: Ensure ~/.m2/repository exists 27 | run: mkdir -p ~/.m2/repository 28 | 29 | - name: Cache Maven packages 30 | uses: actions/cache@v3 31 | with: 32 | path: ~/.m2/repository 33 | key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} 34 | restore-keys: | 35 | maven-${{ runner.os }}- 36 | 37 | - name: Set up Maven settings 38 | run: | 39 | mkdir -p $HOME/.m2 40 | cat < $HOME/.m2/settings.xml 41 | 42 | 43 | 44 | github 45 | ${{ github.actor }} 46 | ${{ secrets.GH_TOKEN }} 47 | 48 | 49 | 50 | EOF 51 | 52 | - name: Run tests 53 | run: | 54 | mvn '-Dtest=*Preprod*' verify -Djacoco.destFile=exportJacoco/jacoco-preview.exec -Dgpg.skip 55 | - name: Upload Jacoco Results 56 | uses: actions/upload-artifact@v4 57 | with: 58 | name: preview-tests-jacoco 59 | path: exportJacoco/jacoco-preview.exec -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/filters/NotOperatorFilter.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options.filters; 2 | 3 | import lombok.Getter; 4 | import rest.koios.client.backend.factory.options.Option; 5 | import rest.koios.client.backend.factory.options.OptionType; 6 | 7 | /** 8 | * Not Operator Logical Operator Filter 9 | */ 10 | @Getter 11 | public class NotOperatorFilter extends Option { 12 | 13 | private final Option option; 14 | 15 | /** 16 | * LogicalOperatorFilter Constructor 17 | * 18 | * @param option Option to negate 19 | */ 20 | public NotOperatorFilter(Option option) { 21 | super(OptionType.NOT_OPERATOR); 22 | this.option = option; 23 | } 24 | 25 | /** 26 | * Filter.of Static Constructor 27 | * 28 | * @param option Option to negate 29 | * @return new NotOperatorFilter Option Object 30 | */ 31 | public static NotOperatorFilter of(Option option) { 32 | if (option == null) { 33 | throw new IllegalStateException("Cannot Negate null Option"); 34 | } 35 | return new NotOperatorFilter(option); 36 | } 37 | 38 | @Override 39 | public String getOptionTypeValue() { 40 | if (option.getOptionType() == OptionType.LOGICAL_FILTER) { 41 | return "not." + getOption().getOptionTypeValue(); 42 | } else { 43 | return getOption().getOptionTypeValue(); 44 | } 45 | } 46 | 47 | @Override 48 | public String getValue() { 49 | if (option.getOptionType() == OptionType.LOGICAL_FILTER) { 50 | return getOption().getValue(); 51 | } else { 52 | return "not." + getOption().getValue(); 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /src/test/java/rest/koios/client/backend/api/base/BaseServiceTest.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.base; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.junit.jupiter.api.TestInstance; 7 | import rest.koios.client.backend.api.base.exception.ApiException; 8 | import rest.koios.client.backend.factory.OperationType; 9 | 10 | @Slf4j 11 | @TestInstance(TestInstance.Lifecycle.PER_CLASS) 12 | class BaseServiceTest { 13 | 14 | private final BaseService baseService = new BaseService(OperationType.KOIOS_MAINNET.getBaseUrl()); 15 | 16 | @Test 17 | void validateHexFormatTest() { 18 | Assertions.assertDoesNotThrow(() -> baseService.validateHexFormat("")); 19 | Assertions.assertDoesNotThrow(() -> baseService.validateHexFormat("0123456789abcdef")); 20 | Assertions.assertThrows(ApiException.class, () -> baseService.validateHexFormat("asdf")); 21 | Assertions.assertThrows(NullPointerException.class, () -> baseService.validateHexFormat(null)); 22 | } 23 | 24 | @Test 25 | void validateEpochTest() { 26 | Assertions.assertDoesNotThrow(() -> baseService.validateEpoch(123)); 27 | Assertions.assertThrows(ApiException.class, () -> baseService.validateEpoch(-123)); 28 | Assertions.assertThrows(ApiException.class, () -> baseService.validateEpoch(null)); 29 | } 30 | 31 | @Test 32 | void validateBech32Test() { 33 | Assertions.assertDoesNotThrow(() -> baseService.validateBech32("addr1qy8rxq8r59dkd5vwq42dmsyjf7w6q0ypsys0jzcg99sas2hdl6k7kz4erhgrn30sc8ky06rzfpjw8mt7suk2w3qerlus6jrfqy")); 34 | Assertions.assertThrows(ApiException.class, () -> baseService.validateBech32("123")); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/PolicyAssetInfo.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Policy Asset Info 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class PolicyAssetInfo { 20 | 21 | /** 22 | * Asset Name (hex) 23 | */ 24 | private String assetName; 25 | 26 | /** 27 | * Asset Name (ASCII) 28 | */ 29 | private String assetNameAscii; 30 | 31 | /** 32 | * The CIP14 fingerprint of the asset 33 | */ 34 | private String fingerprint; 35 | 36 | /** 37 | * Hash of the latest mint transaction 38 | */ 39 | private String mintingTxHash; 40 | 41 | /** 42 | * Total Supply 43 | */ 44 | private String totalSupply; 45 | 46 | /** 47 | * Count of total mint transactions 48 | */ 49 | private Integer mintCnt; 50 | 51 | /** 52 | * Count of total burn transactions 53 | */ 54 | private Integer burnCnt; 55 | 56 | /** 57 | * Creation Time 58 | */ 59 | private Integer creationTime; 60 | 61 | /** 62 | * A JSON array containing details about metadata within transaction 63 | */ 64 | private JsonNode mintingTxMetadata; 65 | 66 | /** 67 | * Asset metadata registered on the Cardano Token Registry 68 | */ 69 | private TokenRegistryMetadata tokenRegistryMetadata; 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/DRepInfo.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * DRep Information 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class DRepInfo { 17 | 18 | /** 19 | * DRep ID in CIP-129 bech32 format 20 | */ 21 | private String drepId; 22 | 23 | /** 24 | * DRep ID in hex format 25 | */ 26 | private String hex; 27 | 28 | /** 29 | * Flag which shows if this credential is a script hash 30 | */ 31 | private Boolean hasScript; 32 | 33 | /** 34 | * Flag to show if the DRep is currently registered 35 | */ 36 | private Boolean registered; 37 | 38 | /** 39 | * DRep's registration deposit in number (null if not applicable) 40 | */ 41 | private String deposit; 42 | 43 | /** 44 | * Flag to show if the DRep is active (i.e., not expired) 45 | */ 46 | private Boolean active; 47 | 48 | /** 49 | * After which epoch DRep is considered inactive (null if not applicable) 50 | */ 51 | private Integer expiresEpochNo; 52 | 53 | /** 54 | * The total amount of voting power this DRep is delegated 55 | */ 56 | private String amount; 57 | 58 | /** 59 | * A URL to a JSON payload of metadata (null if not applicable) 60 | */ 61 | private String metaUrl; 62 | 63 | /** 64 | * A hash of the contents of the metadata URL (null if not applicable) 65 | */ 66 | private String metaHash; 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/epoch/api/EpochApi.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.epoch.api; 2 | 3 | import rest.koios.client.backend.api.epoch.model.EpochBlockProtocols; 4 | import rest.koios.client.backend.api.epoch.model.EpochInfo; 5 | import rest.koios.client.backend.api.epoch.model.EpochParams; 6 | import retrofit2.Call; 7 | import retrofit2.http.GET; 8 | import retrofit2.http.Query; 9 | import retrofit2.http.QueryMap; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /** 15 | * Epoch API 16 | */ 17 | public interface EpochApi { 18 | 19 | 20 | @GET("epoch_info") 21 | Call> getEpochInformation(@Query("_epoch_no") Integer epochNo, @Query("_include_next_epoch") boolean includeNextEpoch, @QueryMap Map paramsMap); 22 | 23 | @GET("epoch_params") 24 | Call> getEpochParametersByEpoch(@Query("_epoch_no") Integer epochNo); 25 | 26 | @GET("epoch_params") 27 | Call> getEpochParameters(@QueryMap Map paramsMap); 28 | 29 | /** 30 | * Epoch's Block Protocols 31 | * Get the information about block protocol distribution in epoch 32 | * 33 | * @param paramsMap Options and Filters Map 34 | * @return List of {@link EpochParams} 35 | */ 36 | @GET("epoch_block_protocols") 37 | Call> getEpochBlockProtocols(@QueryMap Map paramsMap); 38 | 39 | /** 40 | * Epoch's Block Protocols By Epoch 41 | * Get the information about block protocol distribution in epoch 42 | * 43 | * @param epochNo Epoch Number to fetch details for 44 | * @return List of {@link EpochParams} 45 | */ 46 | @GET("epoch_block_protocols") 47 | Call> getEpochBlockProtocolsByEpoch(@Query("_epoch_no") Integer epochNo); 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/DRepMetadata.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.*; 7 | 8 | /** 9 | * DRep Metadata 10 | */ 11 | @Getter 12 | @Setter 13 | @ToString 14 | @NoArgsConstructor 15 | @EqualsAndHashCode 16 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 17 | public class DRepMetadata { 18 | 19 | /** 20 | * DRep ID in CIP-129 bech32 format 21 | */ 22 | private String drepId; 23 | 24 | /** 25 | * DRep ID in hex format 26 | */ 27 | private String hex; 28 | 29 | /** 30 | * Flag which shows if this credential is a script hash 31 | */ 32 | private Boolean hasScript; 33 | 34 | /** 35 | * A URL to a JSON payload of metadata (null if not applicable) 36 | */ 37 | private String metaUrl; 38 | 39 | /** 40 | * A hash of the contents of the metadata URL (null if not applicable) 41 | */ 42 | private String metaHash; 43 | 44 | /** 45 | * The raw bytes of the payload (null if not applicable) 46 | */ 47 | private JsonNode metaJson; 48 | 49 | /** 50 | * A warning that occurred while validating the metadata (null if not applicable) 51 | */ 52 | private String warning; 53 | 54 | /** 55 | * The language described in the context of the metadata as per CIP-100 (null if not applicable) 56 | */ 57 | private String language; 58 | 59 | /** 60 | * Comment attached to the metadata (null if not applicable) 61 | */ 62 | private String comment; 63 | 64 | /** 65 | * Indicate whether data is invalid 66 | */ 67 | private Boolean isValid; 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/governance/model/DRepUpdate.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.governance.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.*; 7 | 8 | /** 9 | * DRep Update 10 | */ 11 | @Getter 12 | @Setter 13 | @ToString 14 | @NoArgsConstructor 15 | @EqualsAndHashCode 16 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 17 | public class DRepUpdate { 18 | 19 | /** 20 | * DRep ID in CIP-129 bech32 format 21 | */ 22 | private String drepId; 23 | 24 | /** 25 | * DRep ID in hex format 26 | */ 27 | private String hex; 28 | 29 | /** 30 | * Flag which shows if this credential is a script hash 31 | */ 32 | private Boolean hasScript; 33 | 34 | /** 35 | * Hash identifier of the transaction 36 | */ 37 | private String updateTxHash; 38 | 39 | /** 40 | * The index of this certificate within the transaction 41 | */ 42 | private Integer certIndex; 43 | 44 | /** 45 | * UNIX timestamp of the block 46 | */ 47 | private Long blockTime; 48 | 49 | /** 50 | * Effective action for this DRep Update certificate (updated, registered, deregistered) 51 | */ 52 | private String action; 53 | 54 | /** 55 | * DRep's registration deposit in number (null if not applicable) 56 | */ 57 | private String deposit; 58 | 59 | /** 60 | * A URL to a JSON payload of metadata (null if not applicable) 61 | */ 62 | private String metaUrl; 63 | 64 | /** 65 | * A hash of the contents of the metadata URL (null if not applicable) 66 | */ 67 | private String metaHash; 68 | 69 | /** 70 | * JSON object containing the metadata payload 71 | */ 72 | private JsonNode metaJson; 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/CollateralOutput.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | import rest.koios.client.backend.api.base.common.InlineDatum; 10 | import rest.koios.client.backend.api.base.common.ReferenceScript; 11 | 12 | /** 13 | * Collateral Output 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @NoArgsConstructor 19 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 20 | public class CollateralOutput { 21 | 22 | /** 23 | * A Cardano payment/base address for transaction's input/output UTxO 24 | */ 25 | private TxPaymentAddress paymentAddr; 26 | 27 | /** 28 | * A Cardano staking address (reward account, bech32 encoded) for transaction's input/output UTxO 29 | */ 30 | private String stakeAddr; 31 | 32 | /** 33 | * Hash of this transaction 34 | */ 35 | private String txHash; 36 | 37 | /** 38 | * Index of output UTxO 39 | */ 40 | private Integer txIndex; 41 | 42 | /** 43 | * Total sum on the output address 44 | */ 45 | private String value; 46 | 47 | /** 48 | * Hash of datum (if any) connected to UTxO 49 | */ 50 | private String datumHash; 51 | 52 | /** 53 | * Allows datums to be attached to UTxO (CIP-32) 54 | */ 55 | private InlineDatum inlineDatum; 56 | 57 | /** 58 | * Allow reference scripts to be used to satisfy script requirements during validation, rather than requiring the spending transaction to do so. (CIP-33) 59 | */ 60 | private ReferenceScript referenceScript; 61 | 62 | /** 63 | * assets included in input/output UTxO 64 | */ 65 | private String assetList; 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/epoch/model/EpochInfo.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.epoch.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | 7 | /** 8 | * Epoch Information 9 | */ 10 | @Getter 11 | @Setter 12 | @ToString 13 | @NoArgsConstructor 14 | @EqualsAndHashCode 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class EpochInfo { 17 | 18 | /** 19 | * Epoch number 20 | */ 21 | private Integer epochNo = null; 22 | 23 | /** 24 | * Total output value across all transactions in epoch 25 | */ 26 | private String outSum = null; 27 | 28 | /** 29 | * Total fees incurred by transactions in epoch 30 | */ 31 | private String fees = null; 32 | 33 | /** 34 | * Number of transactions submitted in epoch 35 | */ 36 | private Integer txCount = null; 37 | 38 | /** 39 | * Number of blocks created in epoch 40 | */ 41 | private Integer blkCount = null; 42 | 43 | /** 44 | * UNIX timestamp of the epoch start 45 | */ 46 | private Long startTime; 47 | 48 | /** 49 | * UNIX timestamp of the epoch end 50 | */ 51 | private Long endTime; 52 | 53 | /** 54 | * UNIX timestamp of the epoch's first block 55 | */ 56 | private Long firstBlockTime = null; 57 | 58 | /** 59 | * UNIX timestamp of the epoch's last block 60 | */ 61 | private Long lastBlockTime = null; 62 | 63 | /** 64 | * Rewards accumulated as of given epoch (in lovelaces) 65 | */ 66 | private String activeStake = null; 67 | 68 | /** 69 | * Total rewards earned in epoch (null for pre-Shelley epochs) 70 | */ 71 | private String totalRewards; 72 | 73 | /** 74 | * Average block reward for epoch (null for pre-Shelley epochs) 75 | */ 76 | private String avgBlkReward; 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/network/model/Totals.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.network.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Totals 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class Totals { 19 | 20 | /** 21 | * Epoch number 22 | **/ 23 | private Integer epochNo = null; 24 | 25 | /** 26 | * Circulating UTxOs for given epoch (in lovelaces) 27 | **/ 28 | private String circulation = null; 29 | 30 | /** 31 | * Funds in treasury for given epoch (in lovelaces) 32 | **/ 33 | private String treasury = null; 34 | 35 | /** 36 | * Rewards accumulated as of given epoch (in lovelaces) 37 | **/ 38 | private String reward = null; 39 | 40 | /** 41 | * Total Active Supply (sum of treasury funds, rewards, UTxOs, deposits and fees) for given epoch (in lovelaces) 42 | **/ 43 | private String supply = null; 44 | 45 | /** 46 | * Total Reserves yet to be unlocked on chain 47 | **/ 48 | private String reserves = null; 49 | 50 | /** 51 | * The amount (in Lovelace) in the fee pot 52 | */ 53 | private String fees; 54 | 55 | /** 56 | * The amount (in Lovelace) in the obligation pot coming from stake key and pool deposits. 57 | */ 58 | private String depositsStake; 59 | 60 | /** 61 | * The amount (in Lovelace) in the obligation pot coming from drep registrations deposits. 62 | */ 63 | private String depositsDrep; 64 | 65 | /** 66 | * The amount (in Lovelace) in the obligation pot coming from governance proposal deposits. 67 | */ 68 | private String depositsProposal; 69 | } 70 | -------------------------------------------------------------------------------- /.github/discord.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/asset/model/AssetInformation.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.asset.model; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | import lombok.ToString; 10 | 11 | /** 12 | * Asset Information 13 | */ 14 | @Getter 15 | @Setter 16 | @ToString 17 | @NoArgsConstructor 18 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 19 | public class AssetInformation { 20 | 21 | /** 22 | * Asset Policy ID (hex) 23 | */ 24 | private String policyId; 25 | 26 | /** 27 | * Asset Name (hex) 28 | */ 29 | private String assetName; 30 | 31 | /** 32 | * Asset Name (ASCII) 33 | */ 34 | private String assetNameAscii; 35 | 36 | /** 37 | * The CIP14 fingerprint of the asset 38 | */ 39 | private String fingerprint; 40 | 41 | /** 42 | * Hash of the first mint transaction 43 | */ 44 | private String mintingTxHash; 45 | 46 | /** 47 | * Total supply for the asset 48 | */ 49 | private String totalSupply; 50 | 51 | /** 52 | * Count of total mint transactions 53 | */ 54 | private Integer mintCnt; 55 | 56 | /** 57 | * Count of total burn transactions 58 | */ 59 | private Integer burnCnt; 60 | 61 | /** 62 | * UNIX timestamp of the first asset mint 63 | */ 64 | private Long creationTime; 65 | 66 | /** 67 | * Latest minting transaction metadata (aligns with CIP-25) 68 | */ 69 | private JsonNode mintingTxMetadata; 70 | 71 | /** 72 | * Asset metadata registered on the Cardano Token Registry 73 | */ 74 | private TokenRegistryMetadata tokenRegistryMetadata; 75 | 76 | /** 77 | * CIP 68 metadata if present for asset 78 | */ 79 | private JsonNode cip68Metadata; 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/ProposalProcedure.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Proposal Procedure 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @NoArgsConstructor 19 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 20 | public class ProposalProcedure { 21 | 22 | /** 23 | * Index of governance proposal in transaction 24 | */ 25 | private Integer index; 26 | 27 | /** 28 | * Proposal Action Type 29 | * Allowed: ParameterChange|HardForkInitiation|TreasuryWithdrawals|NoConfidence|NewCommittee|NewConstitution|InfoAction 30 | */ 31 | private String type; 32 | 33 | /** 34 | * Description for Proposal Action 35 | */ 36 | private Object description; 37 | 38 | /** 39 | * DRep's registration deposit in number 40 | */ 41 | private String deposit; 42 | 43 | /** 44 | * The StakeAddress index of the reward address to receive the deposit when it is repaid. 45 | */ 46 | private String returnAddress; 47 | 48 | /** 49 | * Shows the epoch at which this governance action is expected to expire. 50 | */ 51 | private Long expiration; 52 | 53 | /** 54 | * A URL to a JSON payload of metadata 55 | */ 56 | private String metaUrl; 57 | 58 | /** 59 | * A hash of the contents of the metadata URL 60 | */ 61 | private String metaHash; 62 | 63 | /** 64 | * If not null, the amount withdrawn from treasury into stake address by this this proposal 65 | */ 66 | private List withdrawal; 67 | 68 | /** 69 | * If not null, the proposed new parameter set 70 | */ 71 | private List paramProposal; 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/base/interceptor/GzipInterceptor.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.base.interceptor; 2 | 3 | 4 | import java.io.IOException; 5 | import java.util.Objects; 6 | 7 | import okhttp3.Headers; 8 | import okhttp3.Interceptor; 9 | import okhttp3.Request; 10 | import okhttp3.Response; 11 | import okhttp3.ResponseBody; 12 | import okio.GzipSource; 13 | import okio.Okio; 14 | import org.jetbrains.annotations.NotNull; 15 | 16 | public class GzipInterceptor implements Interceptor { 17 | @NotNull 18 | @Override 19 | public Response intercept(Chain chain) throws IOException { 20 | Request.Builder newRequest = chain.request().newBuilder(); 21 | newRequest.addHeader("Accept-Encoding", "deflate, gzip"); 22 | Response response = chain.proceed(newRequest.build()); 23 | 24 | if (isGzipped(response)) { 25 | return unzip(response); 26 | } else { 27 | return response; 28 | } 29 | } 30 | 31 | private Response unzip(final Response response) throws IOException { 32 | 33 | if (response.body() == null) { 34 | return response; 35 | } 36 | 37 | GzipSource gzipSource = new GzipSource(response.body().source()); 38 | String bodyString = Okio.buffer(gzipSource).readUtf8(); 39 | 40 | ResponseBody responseBody = ResponseBody.create(bodyString, response.body().contentType()); 41 | 42 | Headers strippedHeaders = response.headers().newBuilder() 43 | .removeAll("Content-Encoding") 44 | .removeAll("Content-Length") 45 | .build(); 46 | return response.newBuilder() 47 | .headers(strippedHeaders) 48 | .body(responseBody) 49 | .message(response.message()) 50 | .build(); 51 | 52 | } 53 | 54 | private Boolean isGzipped(Response response) { 55 | return response.header("Content-Encoding") != null && Objects.equals(response.header("Content-Encoding"), "gzip"); 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/transactions/model/TxIO.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.transactions.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | import rest.koios.client.backend.api.base.common.Asset; 10 | import rest.koios.client.backend.api.base.common.InlineDatum; 11 | import rest.koios.client.backend.api.base.common.ReferenceScript; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * TX Input or Output 17 | */ 18 | @Getter 19 | @Setter 20 | @ToString 21 | @NoArgsConstructor 22 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 23 | public class TxIO { 24 | 25 | /** 26 | * A Cardano payment/base address for transaction's input/output UTxO 27 | */ 28 | private TxPaymentAddress paymentAddr; 29 | 30 | /** 31 | * A Cardano staking address (reward account, bech32 encoded) for transaction's input/output UTxO 32 | */ 33 | private String stakeAddr; 34 | 35 | /** 36 | * Hash of this transaction 37 | */ 38 | private String txHash; 39 | 40 | /** 41 | * Index of output UTxO 42 | */ 43 | private Integer txIndex; 44 | 45 | /** 46 | * Total sum on the output address 47 | */ 48 | private String value; 49 | 50 | /** 51 | * Hash of datum (if any) connected to UTxO 52 | */ 53 | private String datumHash; 54 | 55 | /** 56 | * Allows datums to be attached to UTxO (CIP-32) 57 | */ 58 | private InlineDatum inlineDatum; 59 | 60 | /** 61 | * Allow reference scripts to be used to satisfy script requirements during validation, rather than requiring the spending transaction to do so. (CIP-33) 62 | */ 63 | private ReferenceScript referenceScript; 64 | 65 | /** 66 | * An array of assets included in input/output UTxO 67 | */ 68 | private List assetList; 69 | } 70 | -------------------------------------------------------------------------------- /src/test/java/rest/koios/client/utils/Bech32PreviewUtilTest.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.utils; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.lang.reflect.Constructor; 6 | import java.lang.reflect.InvocationTargetException; 7 | import java.lang.reflect.Modifier; 8 | 9 | import static org.junit.jupiter.api.Assertions.*; 10 | 11 | class Bech32PreviewUtilTest { 12 | 13 | @Test 14 | void invalidCharsTest() { 15 | assertFalse(Bech32Util.hasValidChars(null)); 16 | 17 | assertFalse(Bech32Util.hasValidChars("")); 18 | 19 | assertFalse(Bech32Util.hasValidChars("IQoJb3JpZ2luX2VjEJP//////////wEaCXVzLWVhc3QtMSJGMEQCIFEdcXP1FbfLBZSp1OCWP6eB6pofyWx/plHVZe4BSuUEAiAKVZYe5340wvB5uDvg/K1SbBJzvEBEyZLPDMZvlb+hjCr4AQjr//////////8BEAAaDDA1NjYxMjc1NDY1OCIMxtO9x0MsdST4bqy0KswBXPQZkMVN6+NRKkhvhkBsKnkrFn43TBFbwNJPRD0y4j2Ov1dikgpzzWGK+gff4pDec6e/vhcK0rZtQ3X7J7Id6NyoKrrt+XAzXdg8s7DWzMw6FkN0yaGIhvtqQATIkt+X5rKm0M9wwS+eNjurTQlqJdYjm94MuVCGWiQ1/xD/ZM2ECKfAV8FcnKLI+scT/kfP+weCQy1+iv8v8caS+uE8LclFINf4UOcBl4fF80vlU8qmXPVQjxXV/j9GqIwJ1+F08gEe2XbiYfHe/+g+MOXC8pAGOpkBeHgMzPDkljTJ244SO/vk1BGNNBrJeBZKLLTPsH/bynI2QSQlZcq8zreLh4GoalS+0QSRcsvPhCainLeZkxOqsK1+kfUBJpe3TW6lGLaqc8DIqUBMkhCwCbSDKWMe/o2RmlzLKZSSeJ/gABoNulUXxPpkfIBemCYi377DD5szO6dWAcLdny1FK2cZqVtRNDwh7XLpunvhMsiA")); 20 | 21 | assertFalse(Bech32Util.hasValidChars("pooL1rcsezjrma577f06yp40lsz76uvwh7gne35afx3zrq2ktx50f8t8")); 22 | } 23 | 24 | @Test 25 | void testConstructorIsPrivate() throws NoSuchMethodException { 26 | Constructor constructor = Bech32Util.class.getDeclaredConstructor(); 27 | assertTrue(Modifier.isPrivate(constructor.getModifiers())); 28 | constructor.setAccessible(true); 29 | InvocationTargetException exception = assertThrows(InvocationTargetException.class, constructor::newInstance); 30 | assertInstanceOf(InvocationTargetException.class, exception); 31 | assertInstanceOf(IllegalStateException.class, exception.getCause()); 32 | assertEquals("Utility Class", exception.getCause().getMessage()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/block/model/Block.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.block.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Block 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class Block { 19 | 20 | /** 21 | * Hash of the block 22 | */ 23 | private String hash = null; 24 | 25 | /** 26 | * Epoch number of the block 27 | */ 28 | private Integer epochNo = null; 29 | 30 | /** 31 | * Absolute slot number of the block 32 | */ 33 | private Integer absSlot = null; 34 | 35 | /** 36 | * Slot number of the block in epoch 37 | */ 38 | private Integer epochSlot = null; 39 | 40 | /** 41 | * Block Height 42 | */ 43 | private Integer blockHeight = null; 44 | 45 | /** 46 | * Block size in bytes 47 | */ 48 | private Integer blockSize = null; 49 | 50 | /** 51 | * UNIX timestamp of the block 52 | */ 53 | private Long blockTime = null; 54 | 55 | /** 56 | * Number of transactions in the block 57 | */ 58 | private Integer txCount = null; 59 | 60 | /** 61 | * VRF key of the block producer 62 | */ 63 | private String vrfKey = null; 64 | 65 | /** 66 | * Pool ID in bech32 format 67 | */ 68 | private String pool = null; 69 | 70 | /** 71 | * Counter value of the operational certificate used to create this block 72 | */ 73 | private Integer opCertCounter = null; 74 | 75 | /** 76 | * The protocol major version 77 | */ 78 | private Integer protoMajor; 79 | 80 | /** 81 | * The protocol minor version 82 | */ 83 | private Integer protoMinor; 84 | 85 | /** 86 | * Previous Hash of the current block 87 | */ 88 | private String parentHash; 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/address/model/AddressUtxo.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.address.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.*; 6 | import rest.koios.client.backend.api.base.common.Asset; 7 | import rest.koios.client.backend.api.base.common.InlineDatum; 8 | import rest.koios.client.backend.api.base.common.ReferenceScript; 9 | 10 | import java.util.ArrayList; 11 | 12 | /** 13 | * Address UTxO 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @EqualsAndHashCode 19 | @NoArgsConstructor 20 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 21 | public class AddressUtxo implements Comparable { 22 | 23 | /** 24 | * Hash of the UTxO 25 | */ 26 | private String txHash; 27 | 28 | /** 29 | * Index of UTxO 30 | */ 31 | private Integer txIndex; 32 | 33 | /** 34 | * Block height 35 | */ 36 | private Integer blockHeight; 37 | 38 | /** 39 | * Timestamp of the block 40 | */ 41 | private Integer blockTime; 42 | 43 | /** 44 | * Total sum on the output address 45 | */ 46 | private String value; 47 | 48 | /** 49 | * The Hash of the Plutus Data 50 | */ 51 | private String datumHash; 52 | 53 | /** 54 | * Allows datums to be attached to UTxO (CIP-32) 55 | */ 56 | private InlineDatum inlineDatum; 57 | 58 | /** 59 | * Allow reference scripts to be used to satisfy script requirements during validation, rather than requiring the spending transaction to do so. (CIP-33) 60 | */ 61 | private ReferenceScript referenceScript; 62 | 63 | /** 64 | * An array of assets which are included in the UTxO 65 | */ 66 | private ArrayList assetList; 67 | 68 | @Override 69 | public int compareTo(AddressUtxo other) { 70 | int comparison1 = getBlockHeight().compareTo(other.getBlockHeight()); 71 | if (comparison1 == 0) { 72 | return getTxIndex().compareTo(other.getTxIndex()); 73 | } 74 | return comparison1; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/account/model/AccountInfo.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.account.model; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 6 | import lombok.*; 7 | 8 | /** 9 | * Account Information 10 | */ 11 | @Getter 12 | @Setter 13 | @ToString 14 | @NoArgsConstructor 15 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 16 | public class AccountInfo { 17 | 18 | /** 19 | * Cardano staking address (reward account) in bech32 format 20 | */ 21 | private String stakeAddress; 22 | 23 | /** 24 | * Stake address status 25 | * Allowed: registered | not registered 26 | */ 27 | private String status; 28 | 29 | /** 30 | * Account's current delegation status to DRep ID in CIP-129 Bech32 format 31 | */ 32 | private String delegatedDrep; 33 | 34 | /** 35 | * Delegated Pool ID (bech32 format) 36 | */ 37 | private String delegatedPool; 38 | 39 | /** 40 | * Total balance of the account including UTxO, rewards and MIRs (in number) 41 | */ 42 | private String totalBalance; 43 | 44 | /** 45 | * Total UTxO balance of the account 46 | */ 47 | private String utxo; 48 | 49 | /** 50 | * Total rewards earned by the account 51 | */ 52 | private String rewards; 53 | 54 | /** 55 | * Total rewards withdrawn by the account 56 | */ 57 | private String withdrawals; 58 | 59 | /** 60 | * Total rewards available for withdrawal 61 | */ 62 | private String rewardsAvailable; 63 | 64 | /** 65 | * Total deposit available for withdrawal 66 | */ 67 | private String deposit; 68 | 69 | /** 70 | * Total reserves MIR value of the account 71 | */ 72 | private String reserves; 73 | 74 | /** 75 | * Total treasury MIR value of the account 76 | */ 77 | private String treasury; 78 | 79 | /** 80 | * Total proposal refund for this account 81 | */ 82 | @JsonProperty("proposal-refund") 83 | private String proposalRefund; 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/base/common/UTxO.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.base.common; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * UTxO 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @NoArgsConstructor 19 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 20 | public class UTxO { 21 | 22 | /** 23 | * Hash identifier of the transaction 24 | */ 25 | private String txHash; 26 | 27 | /** 28 | * Index of UTxO in the transaction 29 | */ 30 | private Integer txIndex; 31 | 32 | /** 33 | * A Cardano payment/base address (bech32 encoded) 34 | */ 35 | private String address; 36 | 37 | /** 38 | * Total sum of ADA on the UTxO 39 | */ 40 | private String value; 41 | 42 | /** 43 | * Cardano staking address (reward account) in bech32 format 44 | */ 45 | private String stakeAddress; 46 | 47 | /** 48 | * Payment credential 49 | */ 50 | private String paymentCred; 51 | 52 | /** 53 | * Epoch number of the block 54 | */ 55 | private Integer epochNo; 56 | 57 | /** 58 | * Block height 59 | */ 60 | private Integer blockHeight; 61 | 62 | /** 63 | * UNIX timestamp of the block 64 | */ 65 | private Integer blockTime; 66 | 67 | /** 68 | * The Hash of the Plutus Data 69 | */ 70 | private String datumHash; 71 | 72 | /** 73 | * Allows datums to be attached to UTxO (CIP-32) 74 | */ 75 | private InlineDatum inlineDatum; 76 | 77 | /** 78 | * Allow reference scripts to be used to satisfy script requirements during validation, rather than requiring the spending transaction to do so. (CIP-33) 79 | */ 80 | private ReferenceScript referenceScript; 81 | 82 | /** 83 | * List of assets on the UTxO 84 | */ 85 | private List assetList; 86 | 87 | /** 88 | * True if the UTXO has been spent 89 | */ 90 | private Boolean isSpent; 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/api/pool/model/PoolHistory.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.api.pool.model; 2 | 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; 5 | import lombok.Getter; 6 | import lombok.NoArgsConstructor; 7 | import lombok.Setter; 8 | import lombok.ToString; 9 | 10 | /** 11 | * Pool History 12 | */ 13 | @Getter 14 | @Setter 15 | @ToString 16 | @NoArgsConstructor 17 | @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) 18 | public class PoolHistory { 19 | 20 | /** 21 | * Epoch for which the pool history data is shown 22 | */ 23 | private Integer epochNo; 24 | 25 | /** 26 | * Amount of delegated stake to this pool at the time of epoch snapshot (in lovelaces) 27 | */ 28 | private String activeStake; 29 | 30 | /** 31 | * Active stake for the pool, expressed as a percentage of total active stake on network 32 | */ 33 | private Double activeStakePct; 34 | 35 | /** 36 | * Saturation percentage of a pool at the time of snapshot (2 decimals) 37 | */ 38 | private Double saturationPct; 39 | 40 | /** 41 | * Number of blocks pool created in that epoc 42 | */ 43 | private Integer blockCnt; 44 | 45 | /** 46 | * Number of delegators to the pool for that epoch snapshot 47 | */ 48 | private Integer delegatorCnt; 49 | 50 | /** 51 | * Margin (decimal format) 52 | */ 53 | private Double margin; 54 | 55 | /** 56 | * Pool fixed cost per epoch (in lovelaces) 57 | */ 58 | private String fixedCost; 59 | 60 | /** 61 | * Total amount of fees earned by pool owners in that epoch (in lovelaces) 62 | */ 63 | private String poolFees; 64 | 65 | /** 66 | * Total amount of rewards earned by delegators in that epoch (in lovelaces) 67 | */ 68 | private String delegRewards; 69 | 70 | /** 71 | * Total amount of rewards earned by members (delegator - owner) in that epoch (in lovelaces) 72 | */ 73 | private String memberRewards; 74 | 75 | /** 76 | * Annualized ROS (return on staking) for delegators for this epoch 77 | */ 78 | private Double epochRos; 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/rest/koios/client/backend/factory/options/filters/LogicalOperatorFilter.java: -------------------------------------------------------------------------------- 1 | package rest.koios.client.backend.factory.options.filters; 2 | 3 | import lombok.Getter; 4 | import rest.koios.client.backend.factory.options.Option; 5 | import rest.koios.client.backend.factory.options.OptionType; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | import java.util.StringJoiner; 10 | import java.util.stream.Collectors; 11 | 12 | /** 13 | * Logical Operator Filter 14 | */ 15 | @Getter 16 | public class LogicalOperatorFilter extends Option { 17 | 18 | private final List