v0.2.0-beta3
Key Changes
-
Project restructuring and new backends
- cardano-client-lib : This is the core module. It contains low level serialization apis, high-level apis and composable functions to build transactions.
- cardano-client-backend : This module contains backend service apis.
- Backend modules : The following backend modules are currently supported for different providers.
- cardano-client-backend-blockfrost (Status: Stable)
- cardano-client-backend-koios (Status: Beta)
- cardano-client-backend-ogmios (Status: Experimental. Only submitTransaction & evaluateTx api)
- cardano-client-backend-gql (Status: Deprecated) -
A new abstraction layer to avoid direct dependencies with
BackendService
. The core module provides 3 simple interfaces which can be implemented by an application to build and submit transactions to Cardano blockchain- UtxoSupplier : To supply utxos
- ProtocolParamsSupplier : To provide protocol prarameters
- TransactionProcessor : To submit a transaction to Cardano node.
Note: The out-of-box implementations of above interfaces use backend service api.
-
Staking related cbor serialization. The following staking related use cases are now possible.
- Staking key registration
- Stake Delegation
- Staking key de-registration -
Added new UtxoSelection strategies
- RandomImproveUtxoSelectionStrategy
- LargestFirstUtxoSelectionStrategy -
Evaluate Tx method in TransactionService to calculate ExUnits. This method is currently implemented for Blockfrost and Ogmios backends.
-
Util method to calculate tx hash from a transaction object. (
TransactionUtil
)
Breaking Changes
BackendFactory
class has been removed. To create an instance ofBackendService
, use backend specific implementation class. Example:BFBackendService
,KoiosBackendService
,OgmiosBackendService
etc.- Fixed typo in
BlockService.getLatestBlock()
method name
To remove Backend api's dependency from core
ScriptUtxoFinders.findFirstByDatum
takesUtxoSupplier
as parameter instead ofUtxoService
DefaultUtxoSelectionStrategy
’s constructor takesUtxoSupplier
as parameter instead ofUtxoService
DefaultUtxoSelector
’s constructor takesUtxoSupplier
as parameter instead ofUtxoService
TxBuilderContext.init
method takesUtxoSupplier
,ProtocolParamsSupplier
as parameters instead ofBackendService
Package name changes:
Please refer to below old and new package names to know package name changes.
New Packages
com.bloxbean.cardano.client.api.model.Result
com.bloxbean.cardano.client.api.model.Utxo
com.bloxbean.cardano.client.api.helper.model.TransactionResult
com.bloxbean.cardano.client.api.exception.ApiException
com.bloxbean.cardano.client.api.exception.ApiRuntimeException
com.bloxbean.cardano.client.api.model.ProtocolParams
Old Packages:
com.bloxbean.cardano.client.backend.model.Result
com.bloxbean.cardano.client.backend.model.Utxo
com.bloxbean.cardano.client.backend.api.helper.model.TransactionResult
com.bloxbean.cardano.client.backend.exception.ApiException
com.bloxbean.cardano.client.backend.exception.ApiRuntimeException
com.bloxbean.cardano.client.backend.model.ProtocolParams
PRs / Other Changes
- Refactored UtxoSelectionStrategy + added RandomImproveUtxoSelectionStrategy by @stikkos in #80
- Fix [#79] - Retry fee calculation (with amount = amount - fee) in cas… by @satran004 in #84
- UTXO supplier abstraction by @stikkos in #88
- Add Koios Backend Support by @edridudi in #87
- Fix: Koios backend failed integration test (#89) + Move Koios Urls to a Constant class in koios main module bloxbean (#90) by @edridudi in #91
- [#75] Implemented staking related cbor serialization and tests by @satran004 in #92
- Updated project structure to avoid core module's direct dependency with Backend service apis by @satran004 in #93
- Ogmios backend initial implementation by @satran004 in #95
- Bump Koios Java Lib to 1.6 by @edridudi in #97
- Fix Koios Backend Functionality following Integration Tests by @edridudi in #99
- add util to get tx_hash by @SomeReason in #100
- Koios Java Lib Version Bump to 1.9 - Add Support for UTxO Ordering by @edridudi in #101
- Cosmetics by @edridudi in #102
Full Changelog: v0.2.0-beta2...v0.2.0-beta3
Dependencies
- Core module
<dependency>
<groupId>com.bloxbean.cardano</groupId>
<artifactId>cardano-client-lib</artifactId>
<version>0.2.0-beta3</version>
</dependency>
- Backend modules
- For backend support, use one of the following supported backend module
<!-- For Blockfrost backend -->
<dependency>
<groupId>com.bloxbean.cardano</groupId>
<artifactId>cardano-client-backend-blockfrost</artifactId>
<version>0.2.0-beta3</version>
</dependency>
<!-- For Koios backend -->
<dependency>
<groupId>com.bloxbean.cardano</groupId>
<artifactId>cardano-client-backend-koios</artifactId>
<version>0.2.0-beta3</version>
</dependency>
<!-- For Ogmios backend -->
<dependency>
<groupId>com.bloxbean.cardano</groupId>
<artifactId>cardano-client-backend-ogmios</artifactId>
<version>0.2.0-beta3</version>
</dependency>
<!-- For Cardano Graphql backend -->
<dependency>
<groupId>com.bloxbean.cardano</groupId>
<artifactId>cardano-client-backend-gql</artifactId>
<version>0.2.0-beta3</version>
</dependency>
For Gradle, add the following dependencies to build.gradle
- Core Module
implementation 'com.bloxbean.cardano:cardano-client-lib:0.2.0-beta3'
- Backend modules
- For backend support, use one of the following supported backend module
//For Blockfrost
implementation 'com.bloxbean.cardano:cardano-client-backend-blockfrost:0.2.0-beta3'
//For Koios
implementation 'com.bloxbean.cardano:cardano-client-backend-koios:0.2.0-beta3'
//For Ogmios
implementation 'com.bloxbean.cardano:cardano-client-backend-ogmios:0.2.0-beta3'
//For Cardano Graphql
implementation 'com.bloxbean.cardano:cardano-client-backend-gql:0.2.0-beta3'