Crate whisky

Crate whisky 

Source
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 whisky

or 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
converter
data
derivation_indices
errors
interfaces
maestro
mnemonic
models
parser
root_key
services
transaction
tx_builder
tx_parser
tx_tester
utils
wallet_constants
wrapper

Macros§

impl_constr_fields
impl_constr_n
impl_constr_type
impl_plutus_data_tuple

Structs§

Account
AccountInfo
Action
Addresses
Anchor
Artist
Asset
AudioAssetMetadata
BlockInfo
BlockfrostProvider
Blueprint
Main Blueprint structure containing preamble, validators, and definitions
Budget
CommitteeColdResign
CommitteeHotAuth
DRepDeregistration
DRepRegistration
DRepUpdate
DelegateStake
DeregisterStake
DeserializedAddress
EvalError
File
FungibleAssetMetadata
GovernanceProposalInfo
ImageAssetMetadata
InlineDatumSource
InlineScriptSource
InlineSimpleScriptSource
MaestroProvider
Metadata
MintParameter
MnemonicWallet
MultiHostName
Output
PlutusScriptWithdrawal
PoolMetadata
PoolParams
Protocol
ProvidedDatumSource
ProvidedScriptSource
ProvidedSimpleScriptSource
PubKeyTxIn
PubKeyWithdrawal
Redeemer
RefTxIn
RegisterPool
RegisterStake
RetirePool
RootKeyWallet
RoyaltiesStandard
ScriptCertificate
ScriptMint
ScriptTxIn
ScriptTxInParameter
ScriptVote
SimpleScriptCertificate
SimpleScriptMint
SimpleScriptTxIn
SimpleScriptVote
SimpleScriptWithdrawal
SingleHostAddr
SingleHostName
SlotConfig
Slot configuration for a Cardano network. Contains the parameters needed to convert between slots and POSIX time.
SmartAssetMetadata
StakeAndVoteDelegation
StakeRegistrationAndDelegation
StakeVoteRegistrationAndDelegation
TransactionInfo
TxBuilderBody
TxInParameter
TxTester
UTxO
UtxoInput
UtxoOutput
ValidityRange
VideoAssetMetadata
VoteDelegation
VoteRegistrationAndDelegation
VoteType
VotingProcedure
WError
Wallet
Represents a Cardano wallet.
WhiskyPallas

Enums§

AddressType
AssetMetadata
BuilderDataType
Certificate
CertificateType
Credential
DRep
Datum
DatumSource
EvalResult
LanguageVersion
MintItem
Network
NetworkId
NonFungibleAssetMetadata
OutputScriptSource
RedeemerTag
Relay
ScriptSource
SimpleScriptSource
SimpleScriptTxInParameter
TxIn
Vote
VoteKind
Voter
WalletType
Withdrawal

Constants§

FUNGIBLE_ASSET_KEYS
METADATA_STANDARD_KEYS
ROYALTIES_STANDARD_KEYS

Traits§

Evaluator
Fetcher
Submitter
TxBuildable
TxParsable

Functions§

bytes_to_hex
decrypt_with_cipher
deserialize_address
encrypt_with_cipher
get_cost_models_from_network
get_mainnet_cost_models
get_preprod_cost_models
get_preview_cost_models
get_slot_config
Get the slot configuration for a specific network.
hex_to_bytes
hex_to_string
resolve_epoch_no
Resolve the epoch number for a network at a given time.
resolve_slot_no
Resolve the slot number for a network at a given time.
script_to_address
select_utxos
serialize_address_obj
slot_to_begin_unix_time
Convert a slot number to the beginning POSIX time (in milliseconds).
string_to_hex
unix_time_to_enclosing_slot
Convert a POSIX time to the enclosing slot number.

Derive Macros§

ConstrEnum
ConstrWrapper
ImplConstr