#whisky #sdk #tx-builder #mesh-js

whisky

The Cardano Rust SDK, inspired by MeshJS

68 releases (4 stable)

new 1.0.3 Apr 17, 2025
0.9.21 Feb 6, 2025
0.9.16 Dec 29, 2024
0.9.6 Nov 17, 2024
0.6.10 Jul 15, 2024

#286 in Magic Beans

Download history 212/week @ 2024-12-27 13/week @ 2025-01-03 5/week @ 2025-01-10 122/week @ 2025-01-17 58/week @ 2025-01-24 367/week @ 2025-01-31 138/week @ 2025-02-07 19/week @ 2025-02-14 3/week @ 2025-02-21 287/week @ 2025-04-04 524/week @ 2025-04-11

813 downloads per month
Used in deltadefi

Apache-2.0

125KB
2K SLoC


Whisky Whisky - Cardano Rust SDK

Licence Test Publish Docs

Twitter/X Crates.io NPM


whisky

Whisky is an open-source Cardano Rust SDK, containing following modules:

  • whisky - The core Rust crate supporting Cardano DApp development in Rust.
  • whisky-common - Serving universal types and utilities.
  • whisky-csl - The crate to implement most cardano-serialization-lib wrapper.
  • whisky-provider - The crate to connect external services like blockfrost or maestro.
  • whisky-wallet - The crate to handle wallet signing and provide key encryption utility.
  • whisky-js - An point of output for wasm package for @meshsdk/core-csl.

With whisky, you can

  • Builder transaction with cardano-cli-like APIs, supporting serious DApps’ backend on the Rust codebase.
  • Handling transaction signing in Rust
  • Interacting with blockchain with provider services like Maestro and Blockfrost
  • Off-node evaluation on transaction execution units, and updating the transaction accordingly with TxPipe's uplc integrated.

Installation

Rust Library

cargo add whisky

JS / TS WASM Lib

# For nodejs package
yarn add @sidan-lab/whisky-js-nodejs
# For browser package
yarn add @sidan-lab/whisky-js-browser

Getting Started

use whisky::*;

pub fn send_lovelace(
    recipient_address: &str,
    my_address: &str,
    inputs: &[UTxO],
) -> Result<String, WError> {
    let mut tx_builder = TxBuilder::new_core();
    tx_builder
        .tx_out(
            recipient_address,
            &[Asset::new_from_str("lovelace", "1000000")],
        )
        .change_address(my_address)
        .select_utxos_from(inputs, 5000000)
        .complete_sync(None)?;

    Ok(tx_builder.tx_hex())
}

APIs

Please refer to the hosted documentation for the list of endpoints.

Alt

Dependencies

~25–40MB
~740K SLoC