bloxbean / cardano-client-lib

Cardano client library in Java
https://cardano-client.dev
MIT License
120 stars 51 forks source link

Aiken Tx Evaluator support #260

Open satran004 opened 1 year ago

satran004 commented 1 year ago

Goal: Application should be able to perform offline script cost evaluation

Description Offline script cost evaluation is now possible with Aiken. This capability is exposed for Java applications through aiken-java-binding project.

In CCL 0.5.0, transaction evaluation is done through TransactionEvaluator interface. Currently we have only two implementations for this interface Blockfrost and Ogmios.

Tasks:

satran004 commented 1 year ago

CCL compatible AikenTransactionEvaluator is now available in aiken-java-binding 0.0.7. A Java app needs to add aiken-java-binding dependency to use that.

Sample usage:

 Result<String> result = quickTxBuilder.compose(tx)
                .feePayer(senderAddress)
                .withSigner(SignerProviders.signerFrom(sender))
                .withTxEvaluator(new AikenTransactionEvaluator(backendService))
                .completeAndWait(System.out::println);
satran004 commented 1 year ago

This issue needs some more work to provide better support in case of reference inputs.