Expand description
§whisky
whisky is built with the same pattern as MeshJS’s lower level APIs where Rust Cardano developer can import directly for use.
§Install
In your Rust project, run the below
cargo add whiskyor add the dependency in Cargo.toml
[dependencies]
whisky = "^<the-latest-version>"§Feature Flags
By default, all features are enabled. You can selectively enable features:
# Full (default) - all features
whisky = "1.0.18"
# Just common types (minimal)
whisky = { version = "1.0.18", default-features = false }
# Wallet only (includes csl + common)
whisky = { version = "1.0.18", default-features = false, features = ["wallet"] }
# Provider only (includes csl + common)
whisky = { version = "1.0.18", default-features = false, features = ["provider"] }
# CSL only (transaction building without wallet/provider)
whisky = { version = "1.0.18", default-features = false, features = ["csl"] }§Getting Started
ⓘ
use whisky::*;
async fn my_first_whisky_tx(
recipient_address: &str,
my_address: &str,
inputs: &[UTxO],
) -> String {
let mut mesh = TxBuilder::new_core();
mesh.tx_out(
&recipient_address,
&[Asset::new_from_str("lovelace", "1000000")],
)
.change_address(my_address)
.select_utxos_from(inputs, 5000000)
.complete(None)
.await;
mesh.tx_hex()
}§APIs
All user facing APIs are documentation at the builder interface.
Re-exports§
pub use builder::*;pub use parser::*;pub use transaction::*;pub use utils::*;
Modules§
- algo
- blockfrost
- builder
- constants
- csl
- data
- derivation_
indices - errors
- interfaces
- maestro
- mnemonic
- models
- parser
- root_
key - services
- transaction
- tx_
builder - tx_
parser - tx_
prototype - tx_
tester - utils
- wallet_
constants
Macros§
Structs§
- Account
- Account
Info - Action
- Addresses
- Anchor
- Anchor
Prototype - Artist
- Asset
- Audio
Asset Metadata - Auxiliary
Data Prototype - Block
Info - Blockfrost
Provider - Blueprint
- Main Blueprint structure containing preamble, validators, and definitions
- Bootstrap
Witness Prototype - Budget
- CSLParser
- Committee
Cold Resign - Committee
Cold Resign Prototype - Committee
HotAuth - Committee
HotAuth Prototype - Committee
Member Prototype - Committee
Prototype - Constitution
Prototype - CoreCSL
- DRep
Deregistration - DRep
Deregistration Prototype - DRep
Registration - DRep
Registration Prototype - DRep
Update - DRep
Update Prototype - DRep
Voting Thresholds Prototype - Delegate
Stake - Deregister
Stake - Deserialized
Address - Eval
Error - ExUnit
Prices Prototype - ExUnits
Prototype - File
- Fungible
Asset Metadata - Genesis
KeyDelegation Prototype - Governance
Action IdPrototype - Governance
Proposal Info - Hard
Fork Initiation Action Prototype - Image
Asset Metadata - Inline
Datum Source - Inline
Script Source - Inline
Simple Script Source - Json
Slot Config - Maestro
Provider - Metadata
- Mint
Parameter - Mnemonic
Wallet - Move
Instantaneous Reward Prototype - Move
Instantaneous Rewards Cert Prototype - Multi
Host Name - Multi
Host Name Prototype - NewConstitution
Action Prototype - NoConfidence
Action Prototype - Nonce
Prototype - Output
- Parameter
Change Action Prototype - Plutus
List Prototype - Plutus
Script Withdrawal - Pool
Metadata - Pool
Metadata Prototype - Pool
Params - Pool
Params Prototype - Pool
Registration Prototype - Pool
Retirement Prototype - Pool
Voting Thresholds Prototype - Protocol
- Protocol
Param Update Prototype - Protocol
Version Prototype - Provided
Datum Source - Provided
Script Source - Provided
Simple Script Source - PubKey
TxIn - PubKey
Withdrawal - Redeemer
- Redeemer
Prototype - RefTxIn
- Register
Pool - Register
Stake - Retire
Pool - Root
KeyWallet - Royalties
Standard - Script
AllPrototype - Script
AnyPrototype - Script
Certificate - Script
Mint - ScriptN
OfKPrototype - Script
Pubkey Prototype - Script
TxIn - Script
TxIn Parameter - Script
Vote - Simple
Script Certificate - Simple
Script Mint - Simple
Script TxIn - Simple
Script Vote - Simple
Script Withdrawal - Single
Host Addr - Single
Host Addr Prototype - Single
Host Name - Single
Host Name Prototype - Smart
Asset Metadata - Stake
AndVote Delegation - Stake
AndVote Delegation Prototype - Stake
Delegation Prototype - Stake
Deregistration Prototype - Stake
Registration AndDelegation - Stake
Registration AndDelegation Prototype - Stake
Registration Prototype - Stake
ToCoin Prototype - Stake
Vote Registration AndDelegation - Stake
Vote Registration AndDelegation Prototype - Timelock
Expiry Prototype - Timelock
Start Prototype - Transaction
Body Prototype - Transaction
Info - Transaction
Input Prototype - Transaction
Output Prototype - Transaction
Prototype - Transaction
Unspent Output Prototype - Transaction
Witness SetPrototype - Treasury
Withdrawals Action Prototype - TxBuilder
Body - TxIn
Parameter - TxTester
- UTxO
- Unit
Interval Prototype - Update
Committee Action Prototype - Update
Prototype - Utxo
Input - Utxo
Output - Validity
Range - Value
Prototype - Video
Asset Metadata - Vkeywitness
Prototype - Vote
Delegation - Vote
Delegation Prototype - Vote
Prototype - Vote
Registration AndDelegation - Vote
Registration AndDelegation Prototype - Vote
Type - Voter
Votes Prototype - Voting
Procedure - Voting
Procedure Prototype - Voting
Proposal Prototype - WError
- Wallet
- Represents a Cardano wallet.
- WhiskyCSL
Enums§
- Address
Type - Asset
Metadata - Builder
Data Type - Certificate
- Certificate
Prototype - Certificate
Type - Cred
Type Prototype - Credential
- DRep
- DRep
Prototype - Data
Option Prototype - Datum
- Datum
Source - Eval
Result - Governance
Action Prototype - Language
Kind Prototype - Language
Version - MIREnum
Prototype - MIRPot
Prototype - Metadatum
Prototype - Mint
Item - Native
Script Prototype - Network
- Network
Id - Network
IdPrototype - NonFungible
Asset Metadata - Output
Script Source - Plutus
Data - Plutus
Data Variant - Redeemer
Tag - Redeemer
TagPrototype - Relay
- Relay
Prototype - Script
Source - Simple
Script Source - Simple
Script TxIn Parameter - TxIn
- Vote
- Vote
Kind - Vote
Kind Prototype - Voter
- Voter
Prototype - Wallet
Type - Withdrawal
Constants§
Traits§
- Evaluator
- Fetcher
- Plutus
Data Cbor - Extension trait that adds CBOR serialization/deserialization capabilities
to any type implementing
PlutusDataJson. - Submitter
- TxBuildable
- TxParsable
Functions§
- apply_
double_ cbor_ encoding - apply_
params_ to_ plutus_ script - apply_
params_ to_ script - build_
csl_ cost_ models - build_
tx_ builder - bytes_
to_ hex - calculate_
tx_ hash - decrypt_
with_ cipher - deserialize_
address - encrypt_
with_ cipher - evaluate_
tx_ scripts - get_
cost_ mdls - get_
cost_ models_ from_ network - get_
mainnet_ cost_ models - get_
min_ utxo_ value - get_
native_ script_ hash - get_
preprod_ cost_ models - get_
preview_ cost_ models - get_
script_ hash - hex_
to_ bytes - hex_
to_ string - map_
error_ to_ eval_ error - map_
eval_ result - map_
redeemer_ tag - map_
redeemer_ to_ action - proto_
to_ anchor - Convert AnchorPrototype to CSL Anchor
- proto_
to_ assets - Convert AssetsPrototype to CSL Assets
- proto_
to_ auxiliary_ data - Convert AuxiliaryDataPrototype to CSL AuxiliaryData
- proto_
to_ bignum - Convert a string to BigNum (for Prototype types)
- proto_
to_ certificate - Convert CertificatePrototype to CSL Certificate
- proto_
to_ certificates - Convert Vec
to CSL Certificates - proto_
to_ credential - Convert CredTypePrototype to CSL Credential
- proto_
to_ csl_ transaction - Convert TransactionPrototype to CSL Transaction
- proto_
to_ data_ option - Convert DataOptionPrototype to CSL data representation
Returns (Option
, Option ) for output usage - proto_
to_ drep - Convert DRepPrototype to CSL DRep
- proto_
to_ ex_ units - Convert ExUnitsPrototype to CSL ExUnits
- proto_
to_ governance_ action - Convert GovernanceActionPrototype to CSL GovernanceAction
- proto_
to_ governance_ action_ id - Convert GovernanceActionIdPrototype to CSL GovernanceActionId
- proto_
to_ int - Convert a string to Int (can be negative)
- proto_
to_ ipv4 - Convert Ipv4Prototype to CSL Ipv4
- proto_
to_ ipv6 - Convert Ipv6Prototype to CSL Ipv6
- proto_
to_ language - Convert LanguageKindPrototype to CSL Language
- proto_
to_ mint - Convert MintPrototype to CSL Mint MintPrototype is MultiAssetPrototype matching CSL’s Mint structure Note: Mint uses Int (can be negative for burning) while MultiAsset uses BigNum
- proto_
to_ multiasset - Convert MultiAssetPrototype to CSL MultiAsset
- proto_
to_ native_ script - Convert NativeScriptPrototype to CSL NativeScript
- proto_
to_ network_ id - Convert NetworkIdPrototype to CSL NetworkId
- proto_
to_ plutus_ data - Convert PlutusData to CSL PlutusData (recursive)
- proto_
to_ plutus_ data_ from_ variant - Convert PlutusDataVariant to CSL PlutusData This handles both CBOR hex and manual construction
- proto_
to_ protocol_ version - Convert ProtocolVersionPrototype to CSL ProtocolVersion
- proto_
to_ redeemer_ tag - Convert RedeemerTagPrototype to CSL RedeemerTag
- proto_
to_ script_ ref - Convert ScriptRefPrototype (hex string) to CSL ScriptRef Handles both regular format and “82” prefixed format that needs CBOR tag 24 wrapping
- proto_
to_ transaction_ body - Convert TransactionBodyPrototype to CSL TransactionBody
- proto_
to_ transaction_ bytes - Convert TransactionPrototype to CBOR bytes
- proto_
to_ transaction_ hex - Convert TransactionPrototype to hex string
- proto_
to_ transaction_ input - Convert TransactionInputPrototype to CSL TransactionInput
- proto_
to_ transaction_ inputs - Convert Vec
to CSL TransactionInputs - proto_
to_ transaction_ output - Convert TransactionOutputPrototype to CSL TransactionOutput
- proto_
to_ transaction_ outputs - Convert Vec
to CSL TransactionOutputs - proto_
to_ transaction_ witness_ set - Convert TransactionWitnessSetPrototype to CSL TransactionWitnessSet
- proto_
to_ unit_ interval - Convert UnitIntervalPrototype to CSL UnitInterval
- proto_
to_ value - Convert ValuePrototype to CSL Value
- proto_
to_ vote_ kind - Convert VoteKindPrototype to CSL VoteKind
- proto_
to_ voter - Convert VoterPrototype to CSL Voter
- proto_
to_ voter_ votes - Convert VoterVotesPrototype to CSL VotingProcedures (one voter’s votes)
- proto_
to_ voting_ procedure - Convert VotingProcedurePrototype to CSL VotingProcedure
- proto_
to_ voting_ procedures - Convert Vec
to CSL VotingProcedures - proto_
to_ voting_ proposal - Convert VotingProposalPrototype to CSL VotingProposal
- proto_
to_ voting_ proposals - Convert Vec
to CSL VotingProposals - script_
hash_ to_ stake_ address - script_
to_ address - select_
utxos - serialize_
address_ obj - sign_
transaction - string_
to_ hex - to_
bignum - to_
csl_ anchor - to_
csl_ cert - to_
csl_ drep - to_
csl_ redeemer - to_
csl_ script_ source - to_
csl_ simple_ script_ source - to_
csl_ vote_ kind - to_
csl_ voter - to_
pallas_ datum - to_
pallas_ multi_ asset_ value - to_
pallas_ script_ ref - to_
pallas_ utxos - to_
pallas_ value - to_
value - validate_
tx
Type Aliases§
- Address
Prototype - Anchor
Data Hash Prototype - Asset
Name Prototype - Asset
Names Prototype - Assets
Prototype - Auxiliary
Data Hash Prototype - Auxiliary
Data SetPrototype - BigInt
Prototype - BigNum
Prototype - Block
Hash Prototype - Bootstrap
Witnesses Prototype - Certificates
Prototype - Cost
Model Prototype - Costmdls
Prototype - Credential
Prototype - Credentials
Prototype - DNSRecord
AorAAAA Prototype - DNSRecordSRV
Prototype - Data
Hash Prototype - Ed25519
KeyHash Prototype - Ed25519
KeyHashes Prototype - Ed25519
Signature Prototype - Genesis
Delegate Hash Prototype - Genesis
Hash Prototype - Genesis
Hashes Prototype - Governance
Action IdsPrototype - Info
Action Prototype - IntPrototype
- Ipv4
Prototype - Ipv6
Prototype - KESV
KeyPrototype - Language
Prototype - Languages
Prototype - MIRTo
Stake Credentials Prototype - Mint
Prototype - Multi
Asset Prototype - Native
Scripts Prototype - Nonce
Hash Prototype - Plutus
Script Prototype - Plutus
Scripts Prototype - Pool
Metadata Hash Prototype - Proposed
Protocol Parameter Updates Prototype - Public
KeyPrototype - Redeemers
Prototype - Relays
Prototype - Reward
Address Prototype - Reward
Addresses Prototype - Script
Data Hash Prototype - Script
Hash Prototype - Script
Hashes Prototype - Script
RefPrototype - ScriptRef is stored as a CBOR hex string
- Transaction
Bodies Prototype - Transaction
Hash Prototype - Transaction
Inputs Prototype - Transaction
Outputs Prototype - Transaction
Unspent Outputs Prototype - Treasury
Withdrawals Prototype - TxMetadata
Prototype - URLPrototype
- Vkey
Prototype - Vkeywitnesses
Prototype - Voters
Prototype - Voting
Procedures Prototype - Voting
Proposals Prototype - Withdrawals
Prototype