Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Utilities to building transactions on top of the cardano-api.
Synopsis
- unsafeBuildTransaction :: HasCallStack => TxBodyContent BuildTx -> Tx
- data InvalidTransactionException = InvalidTransactionException {
- txBodyError :: TxBodyError
- builder :: TxBodyContent BuildTx
- addTxInsSpending :: [TxIn] -> TxBodyContent BuildTx -> TxBodyContent BuildTx
- mintTokens :: ToScriptData redeemer => PlutusScript -> redeemer -> [(AssetName, Quantity)] -> TxBodyContent BuildTx -> TxBodyContent BuildTx
- burnTokens :: ToScriptData redeemer => PlutusScript -> redeemer -> [(AssetName, Quantity)] -> TxBodyContent BuildTx -> TxBodyContent BuildTx
Executing
unsafeBuildTransaction :: HasCallStack => TxBodyContent BuildTx -> Tx Source #
Construct a transction from a builder. It is said unsafe
because the
underlying implementation will perform some sanity check on a transaction;
for example, check that it has at least one input, that no outputs are
negatives and whatnot.
We use the builder only internally for on-chain transaction crafted in the context of Hydra.
data InvalidTransactionException Source #
A runtime exception to capture (programmer) failures when building transactions. This should never happened in practice (famous last words...)!
InvalidTransactionException | |
|
Instances
addTxInsSpending :: [TxIn] -> TxBodyContent BuildTx -> TxBodyContent BuildTx Source #
Like addInputs
but only for vk inputs which requires no additional data.
mintTokens :: ToScriptData redeemer => PlutusScript -> redeemer -> [(AssetName, Quantity)] -> TxBodyContent BuildTx -> TxBodyContent BuildTx Source #
Mint tokens with given plutus minting script and redeemer.
burnTokens :: ToScriptData redeemer => PlutusScript -> redeemer -> [(AssetName, Quantity)] -> TxBodyContent BuildTx -> TxBodyContent BuildTx Source #
Burn tokens with given plutus minting script and redeemer.
This is really just mintTokens
with negated Quantity
.