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

newtype TxConstraints

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

Constructors

Instances

#mustBeSignedBy

mustBeSignedBy :: PaymentPubKeyHash -> TxConstraints

Require the transaction to be signed by the public key.

#mustDelegateStakeNativeScript

#mustDelegateStakePlutusScript

#mustDelegateStakePubKey

#mustDeregisterStakeNativeScript

#mustDeregisterStakePlutusScript

#mustIncludeDatum

mustIncludeDatum :: PlutusData -> TxConstraints

Require the transaction to include a datum.

#mustMintCurrency

mustMintCurrency :: ScriptHash -> AssetName -> Int -> TxConstraints

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

#mustMintCurrencyUsingNativeScript

#mustMintCurrencyUsingScriptRef

mustMintCurrencyUsingScriptRef :: 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 :: ScriptHash -> RedeemerDatum -> AssetName -> Int -> TxConstraints

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

#mustMintCurrencyWithRedeemerUsingScriptRef

mustMintCurrencyWithRedeemerUsingScriptRef :: 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 :: Mint -> TxConstraints

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

#mustMintValueWithRedeemer

mustMintValueWithRedeemer :: forall (i :: Type) (o :: Type). RedeemerDatum -> Mint -> TxConstraints

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

#mustNotBeValid

mustNotBeValid :: 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.

#mustPayToNativeScript

#mustPayToNativeScriptAddress

#mustPayToPubKey

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

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

#mustPayToPubKeyAddress

mustPayToPubKeyAddress :: PaymentPubKeyHash -> StakePubKeyHash -> Value -> TxConstraints

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

#mustPayToPubKeyAddressWithDatum

mustPayToPubKeyAddressWithDatum :: PaymentPubKeyHash -> StakePubKeyHash -> PlutusData -> DatumPresence -> Value -> TxConstraints

Lock the value and datum with a public key address.

#mustPayToPubKeyAddressWithDatumAndScriptRef

mustPayToPubKeyAddressWithDatumAndScriptRef :: PaymentPubKeyHash -> StakePubKeyHash -> PlutusData -> DatumPresence -> ScriptRef -> Value -> TxConstraints

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

#mustPayToPubKeyAddressWithScriptRef

mustPayToPubKeyAddressWithScriptRef :: PaymentPubKeyHash -> StakePubKeyHash -> ScriptRef -> Value -> TxConstraints

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

#mustPayToPubKeyWithDatum

mustPayToPubKeyWithDatum :: 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 :: PaymentPubKeyHash -> ScriptRef -> Value -> TxConstraints

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

#mustPayToScript

mustPayToScript :: 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 :: forall (i :: Type) (o :: Type). 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 :: 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 :: Value -> TxConstraints

Requirement to produce outputs with at least the given value

#mustReferenceOutput

mustReferenceOutput :: TransactionInput -> TxConstraints

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

#mustRegisterStakeScript

#mustRetirePool

mustRetirePool :: forall (i :: Type) (o :: Type). PoolPubKeyHash -> Epoch -> TxConstraints

#mustSatisfyAnyOf

mustSatisfyAnyOf :: forall (f :: Type -> Type) (i :: Type) (o :: Type). Foldable f => 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 :: Value -> TxConstraints

Requirement to spend inputs with at least the given value

#mustSpendPubKeyOutput

mustSpendPubKeyOutput :: TransactionInput -> TxConstraints

Spend the given unspent transaction public key output.

#mustSpendScriptOutput

mustSpendScriptOutput :: TransactionInput -> RedeemerDatum -> TxConstraints

Spend the given unspent transaction script output.

#mustSpendScriptOutputUsingScriptRef

mustSpendScriptOutputUsingScriptRef :: TransactionInput -> RedeemerDatum -> InputWithScriptRef -> TxConstraints

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

#mustValidateIn

mustValidateIn :: POSIXTimeRange -> TxConstraints

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

#mustWithdrawStakeNativeScript

#mustWithdrawStakePlutusScript

Modules