Socket
Socket
Sign inDemoInstall

com.bloxbean.cardano:aiken-java-binding

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.bloxbean.cardano:aiken-java-binding

A Java binding for Aiken Smart Contract Language Library


Version published
Maintainers
2
Source

Clean, Build IntegrationTest

Aiken Java Binding

Java binding for Aiken, a modern smart contract platform for Cardano Blockchain.

This library enables Java apps to evaluate script costs without relying on external services. It uses aiken-jna-wrapper to access Aiken Rust libraries.

Current Version:

Current Limitations

  • The current version doesn't work for a transaction with reference inputs. Issue

Workaround : During the transaction cost evaluation, remove the reference inputs from the transaction and add the plutus script to the witness set. After calculating the script cost, you can add back the reference input again.

Supported Operating Systems / Archs

  • Apple MacOS (Intel and Apple Silicon)
  • Linux (x86_64) (Ubuntu 20.04 or compatible ...)
  • Windows 64bits (x86_64)

For another platform, please create a PR / request here

Dependencies

Maven (pom.xml)


<dependency>
    <groupId>com.bloxbean.cardano</groupId>
    <artifactId>aiken-java-binding</artifactId>
    <version>${version}</version>
</dependency>

Gradle (build.gradle)

implementation 'com.bloxbean.cardano:aiken-java-binding:${version}'

Other dependencies

You also need to provide cardano-client-lib and jna dependencies if not already there.

<dependency>
   <groupId>com.bloxbean.cardano</groupId>
   <artifactId>cardano-client-lib</artifactId>
   <version>0.5.0</version>
</dependency>
<dependency>
   <groupId>net.java.dev.jna</groupId>
   <artifactId>jna</artifactId>
   <version>5.13.0</version>
</dependency>
<dependency>
   <groupId>net.java.dev.jna</groupId>
   <artifactId>jna-platform</artifactId>
   <version>5.13.0</version>
</dependency>

How to use ?

You can use the TxEvaluator class to evaluate script execution costs for a transaction. The evaluateTx method returns a list of redeemers with updated execution units. You can set these execution units in the final transaction's redeemers before submitting the transaction.

 TxEvaluator txEvaluator = new TxEvaluator();
 CostMdls costMdls = new CostMdls();
 
 //Get cost models from protocol parameters or provide hardcoded value
 costMdls.add(CostModelUtil.getCostModelFromProtocolParams(protocolParamsSupplier.getProtocolParams(), Language.PLUTUS_V2).orElseThrow());

 //Evaluate
 List<Redeemer> evalReedemers = txEvaluator.evaluateTx(txn, inputUtxos, costMdls);

Any questions, ideas or issues?

If this project helps you reduce time to develop on Cardano or if you just want to support this project, you can delegate to our pool:

BLOXB

Support this project

FAQs

Package last updated on 19 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc