Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides some Tweak
s that add or remove inputs and outputs
from transactions. Some also operate on the minted value.
Synopsis
- ensureInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m (Maybe (TxOutRef, TxSkelRedeemer))
- addInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m ()
- removeInputTweak :: MonadTweak m => (TxOutRef -> TxSkelRedeemer -> Bool) -> m [(TxOutRef, TxSkelRedeemer)]
- ensureOutputTweak :: MonadTweak m => TxSkelOut -> m (Maybe TxSkelOut)
- addOutputTweak :: MonadTweak m => TxSkelOut -> m ()
- removeOutputTweak :: MonadTweak m => (TxSkelOut -> Bool) -> m [TxSkelOut]
- addMintTweak :: MonadTweak m => (Versioned MintingPolicy, TxSkelRedeemer, TokenName, Integer) -> m ()
- removeMintTweak :: MonadTweak m => ((Versioned MintingPolicy, TxSkelRedeemer, TokenName, Integer) -> Bool) -> m [(Versioned MintingPolicy, TxSkelRedeemer, TokenName, Integer)]
Documentation
ensureInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m (Maybe (TxOutRef, TxSkelRedeemer)) Source #
Ensure that a given TxOutRef
is being spent with a given
TxSkelRedeemer
. The return value will be Just
the added data, if anything
changed.
addInputTweak :: MonadTweak m => TxOutRef -> TxSkelRedeemer -> m () Source #
Add an input to a transaction. If the given TxOutRef
is already being
consumed by the transaction, fail.
removeInputTweak :: MonadTweak m => (TxOutRef -> TxSkelRedeemer -> Bool) -> m [(TxOutRef, TxSkelRedeemer)] Source #
Remove transaction inputs according to a given predicate. The returned list contains all removed inputs.
ensureOutputTweak :: MonadTweak m => TxSkelOut -> m (Maybe TxSkelOut) Source #
Ensure that a certain output is produced by a transaction. The return value
will be Just
the added output, when applicable.
addOutputTweak :: MonadTweak m => TxSkelOut -> m () Source #
Add a transaction output, at the end of the current list of outputs, thus retaining the initial outputs order.
removeOutputTweak :: MonadTweak m => (TxSkelOut -> Bool) -> m [TxSkelOut] Source #
Remove transaction outputs according to some predicate. The returned list contains all the removed outputs.
addMintTweak :: MonadTweak m => (Versioned MintingPolicy, TxSkelRedeemer, TokenName, Integer) -> m () Source #
Add a new entry to the TxSkelMints
of the transaction skeleton under
modification. As this is implemented in terms of addToTxSkelMints
, the same
caveats apply as do to that function!
removeMintTweak :: MonadTweak m => ((Versioned MintingPolicy, TxSkelRedeemer, TokenName, Integer) -> Bool) -> m [(Versioned MintingPolicy, TxSkelRedeemer, TokenName, Integer)] Source #
Remove some entries from the TxSkelMints
of a transaction, according to
some predicate. The returned list holds the removed entries.