module Plutus.Script.Utils.V1.Tx
( scriptTxOut
, scriptAddressTxOut
) where
import Plutus.Script.Utils.Scripts (datumHash)
import Plutus.Script.Utils.V1.Address (mkValidatorAddress)
import Plutus.V1.Ledger.Api (Address, Datum, TxOut (TxOut), Validator, Value)
scriptTxOut :: Validator -> Value -> Datum -> TxOut
scriptTxOut :: Validator -> Value -> Datum -> TxOut
scriptTxOut Validator
validator = Address -> Value -> Datum -> TxOut
scriptAddressTxOut (Validator -> Address
mkValidatorAddress Validator
validator)
scriptAddressTxOut :: Address -> Value -> Datum -> TxOut
scriptAddressTxOut :: Address -> Value -> Datum -> TxOut
scriptAddressTxOut Address
address Value
val Datum
datum = Address -> Value -> Maybe DatumHash -> TxOut
TxOut Address
address Value
val (DatumHash -> Maybe DatumHash
forall a. a -> Maybe a
Just (Datum -> DatumHash
datumHash Datum
datum))