Module

Ctl.Internal.Types.TxConstraints

#DatumPresence

data DatumPresence

DatumPresence describes how datum should be stored in the transaction when paying to a script.

Constructors

  • DatumInline

    DatumInline asserts the datum should be stored in the TransactionOutput as an inline datum.

  • DatumWitness

    DatumWitness asserts the datum's hash be stored in the TransactionOutput, and the datum added to the transactions witnesses.

Instances

#InputWithScriptRef

data InputWithScriptRef

InputWithScriptRef specifies whether the underlying utxo with the reference script should be included in the transaction as a reference input.

Constructors

Instances

#TxConstraint

data TxConstraint

Constraints on transactions that want to spend script outputs

Constructors

Instances

#TxConstraints

type TxConstraints = Array TxConstraint

Restrictions placed on the allocation of funds to outputs of transactions.

#mustBeSignedBy

mustBeSignedBy :: Warn TxConstraintsDeprecated => PaymentPubKeyHash -> TxConstraints

Require the transaction to be signed by the public key.

#mustIncludeDatum

mustIncludeDatum :: Warn TxConstraintsDeprecated => PlutusData -> TxConstraints

Require the transaction to include a datum.

#mustMintCurrency

mustMintCurrency :: Warn TxConstraintsDeprecated => ScriptHash -> AssetName -> Int -> TxConstraints

Create the given amount of the currency. The amount to mint must not be zero.

#mustMintCurrencyUsingScriptRef

mustMintCurrencyUsingScriptRef :: Warn TxConstraintsDeprecated => ScriptHash -> AssetName -> Int -> InputWithScriptRef -> TxConstraints

Create the given amount of the currency using a reference minting policy. The amount to mint must not be zero.

#mustMintCurrencyWithRedeemer

mustMintCurrencyWithRedeemer :: Warn TxConstraintsDeprecated => ScriptHash -> RedeemerDatum -> AssetName -> Int -> TxConstraints

Create the given amount of the currency. The amount to mint must not be zero.

#mustMintCurrencyWithRedeemerUsingScriptRef

mustMintCurrencyWithRedeemerUsingScriptRef :: Warn TxConstraintsDeprecated => ScriptHash -> RedeemerDatum -> AssetName -> Int -> InputWithScriptRef -> TxConstraints

Create the given amount of the currency using a reference minting policy. The amount to mint must not be zero.

#mustMintValue

mustMintValue :: Warn TxConstraintsDeprecated => Mint -> TxConstraints

Mint the given Value The amount to mint must not be zero.

#mustMintValueWithRedeemer

mustMintValueWithRedeemer :: Warn TxConstraintsDeprecated => RedeemerDatum -> Mint -> TxConstraints

Mint the given Value by accessing non-Ada assets. The amount to mint must not be zero.

#mustNotBeValid

mustNotBeValid :: Warn TxConstraintsDeprecated => TxConstraints

Marks the transaction as invalid, requiring at least one script execution to fail. Despite failure, the transaction can still be submitted into the chain and collateral will be lost.

#mustPayToPubKey

mustPayToPubKey :: Warn (Text "Some wallets may not recognize addresses without a staking key component. Consider using mustPayToPubKeyAddress") => Warn TxConstraintsDeprecated => PaymentPubKeyHash -> Value -> TxConstraints

Lock the value with a public key. (Enterprise Address)

#mustPayToPubKeyAddress

mustPayToPubKeyAddress :: Warn TxConstraintsDeprecated => PaymentPubKeyHash -> StakePubKeyHash -> Value -> TxConstraints

Lock the value with a public key address. (Base Address)

#mustPayToPubKeyAddressWithDatum

#mustPayToPubKeyAddressWithDatumAndScriptRef

mustPayToPubKeyAddressWithDatumAndScriptRef :: Warn TxConstraintsDeprecated => PaymentPubKeyHash -> StakePubKeyHash -> PlutusData -> DatumPresence -> ScriptRef -> Value -> TxConstraints

Lock the value, datum and reference script with a public key address.

#mustPayToPubKeyAddressWithScriptRef

mustPayToPubKeyAddressWithScriptRef :: Warn TxConstraintsDeprecated => PaymentPubKeyHash -> StakePubKeyHash -> ScriptRef -> Value -> TxConstraints

Lock the value and reference script with a public key address.

#mustPayToPubKeyWithDatum

mustPayToPubKeyWithDatum :: Warn TxConstraintsDeprecated => PaymentPubKeyHash -> PlutusData -> DatumPresence -> Value -> TxConstraints

Lock the value and datum with a payment public key hash.

#mustPayToPubKeyWithDatumAndScriptRef

mustPayToPubKeyWithDatumAndScriptRef :: PaymentPubKeyHash -> PlutusData -> DatumPresence -> ScriptRef -> Value -> TxConstraints

Lock the value, datum and reference script with a payment public key hash.

#mustPayToPubKeyWithScriptRef

mustPayToPubKeyWithScriptRef :: Warn TxConstraintsDeprecated => PaymentPubKeyHash -> ScriptRef -> Value -> TxConstraints

Lock the value and reference script with a payment public key hash.

#mustPayToScript

mustPayToScript :: Warn TxConstraintsDeprecated => ScriptHash -> PlutusData -> DatumPresence -> Value -> TxConstraints

Note that CTL does not have explicit equivalents of Plutus' mustPayToTheScript or mustPayToOtherScript, as we have no notion of a "current" script. Thus, we have the single constraint mustPayToScript, and all scripts must be explicitly provided to build the transaction.

#mustPayToScriptAddressWithScriptRef

mustPayToScriptAddressWithScriptRef :: Warn TxConstraintsDeprecated => ScriptHash -> Credential -> PlutusData -> DatumPresence -> ScriptRef -> Value -> TxConstraints

Lock the value, datum and reference script with a script. Note that the provided reference script does not necessarily need to control the spending of the output, i.e. both scripts can be different.

#mustPayToScriptWithScriptRef

mustPayToScriptWithScriptRef :: Warn TxConstraintsDeprecated => ScriptHash -> PlutusData -> DatumPresence -> ScriptRef -> Value -> TxConstraints

Lock the value, datum and reference script with a script. Note that the provided reference script does not necessarily need to control the spending of the output, i.e. both scripts can be different.

#mustProduceAtLeast

mustProduceAtLeast :: Warn TxConstraintsDeprecated => Value -> TxConstraints

Requirement to produce outputs with at least the given value

#mustReferenceOutput

mustReferenceOutput :: Warn TxConstraintsDeprecated => TransactionInput -> TxConstraints

Require the transaction to reference (not spend!) the given unspent transaction output.

#mustSatisfyAnyOf

mustSatisfyAnyOf :: forall (f :: Type -> Type). Foldable f => Warn TxConstraintsDeprecated => f (TxConstraints) -> TxConstraints

Attempts to solve, in order, a sequence of constraints until the first successful try. mustSatisfyaAnyOf is just a way to define a chain of try-catch expressions in a declarative manner. It does not do any analysis of the constraints' semantics.

#mustSpendAtLeast

mustSpendAtLeast :: Warn TxConstraintsDeprecated => Value -> TxConstraints

Requirement to spend inputs with at least the given value

#mustSpendPubKeyOutput

mustSpendPubKeyOutput :: Warn TxConstraintsDeprecated => TransactionInput -> TxConstraints

Spend the given unspent transaction public key output.

#mustSpendScriptOutput

mustSpendScriptOutput :: Warn TxConstraintsDeprecated => TransactionInput -> RedeemerDatum -> TxConstraints

Spend the given unspent transaction script output.

#mustSpendScriptOutputUsingScriptRef

mustSpendScriptOutputUsingScriptRef :: Warn TxConstraintsDeprecated => TransactionInput -> RedeemerDatum -> InputWithScriptRef -> TxConstraints

Spend the given unspent transaction script output, using a reference script to satisfy the script witnessing requirement.

#mustValidateIn

mustValidateIn :: Warn TxConstraintsDeprecated => POSIXTimeRange -> TxConstraints

mustValidateIn r requires the transaction's time range to be contained in r.

Modules