| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cooked.Skeleton.Option
Contents
Description
This modules provides a variety of options associated with a
TxSkel. These options mostly revolves around customizing
the default behavior of cooked-validators's transaction generation mechanism.
Synopsis
- type UserConstraints pkh = (ToPubKeyHash pkh, Show pkh, Eq pkh, Typeable pkh)
- data BalanceOutputPolicy
- data FeePolicy
- data BalancingPolicy where
- BalanceWithFirstSignatory :: BalancingPolicy
- BalanceWith :: UserConstraints pkh => pkh -> BalancingPolicy
- DoNotBalance :: BalancingPolicy
- data BalancingUtxos
- data CollateralUtxos where
- CollateralUtxosFromBalancingUser :: CollateralUtxos
- CollateralUtxosFromUser :: UserConstraints pkh => pkh -> CollateralUtxos
- CollateralUtxosFromSet :: UserConstraints pkh => Set TxOutRef -> pkh -> CollateralUtxos
- data TxSkelOpts = TxSkelOpts {
- txSkelOptAutoSlotIncrease :: Bool
- txSkelOptModTx :: Tx ConwayEra -> Tx ConwayEra
- txSkelOptBalancingPolicy :: BalancingPolicy
- txSkelOptFeePolicy :: FeePolicy
- txSkelOptBalanceOutputPolicy :: BalanceOutputPolicy
- txSkelOptBalancingUtxos :: BalancingUtxos
- txSkelOptModParams :: Params -> Params
- txSkelOptCollateralUtxos :: CollateralUtxos
- txSkelOptModTxL :: Lens' TxSkelOpts (Tx ConwayEra -> Tx ConwayEra)
- txSkelOptAutoSlotIncreaseL :: Lens' TxSkelOpts Bool
- txSkelOptBalancingPolicyL :: Lens' TxSkelOpts BalancingPolicy
- txSkelOptBalanceOutputPolicyL :: Lens' TxSkelOpts BalanceOutputPolicy
- txSkelOptFeePolicyL :: Lens' TxSkelOpts FeePolicy
- txSkelOptBalancingUtxosL :: Lens' TxSkelOpts BalancingUtxos
- txSkelOptModParamsL :: Lens' TxSkelOpts (Params -> Params)
- txSkelOptCollateralUtxosL :: Lens' TxSkelOpts CollateralUtxos
- txSkelOptAddModTx :: (Tx ConwayEra -> Tx ConwayEra) -> TxSkelOpts -> TxSkelOpts
- txSkelOptAddModParams :: (Params -> Params) -> TxSkelOpts -> TxSkelOpts
Data types
type UserConstraints pkh = (ToPubKeyHash pkh, Show pkh, Eq pkh, Typeable pkh) Source #
Set of constraints that need to be satisfied by users in options
data BalanceOutputPolicy Source #
Whether to adjust a potentially existing output to the balancing user with the change during transaction balancing.
Constructors
| AdjustExistingOutput | Try to adjust an existing public key output with the change. If no suitable output can be found, create a new change output. |
| DontAdjustExistingOutput | Do not change the existing outputs, always create a new change output. |
Instances
What fee policy to use in the transaction.
Constructors
| AutoFeeComputation | Use automatic fee computation. If balancing is activated, an optimal fee will be computed based on the transaction and existing utxos in the balancing user. Otherwise, the maximum transaction fee will be applied. |
| ManualFee Integer | Provide a fee to the transaction. If the autobalancing is activated, it will be attempted around this fee, which might lead to failure if it is too low, otherwise, this fee will be given to transaction generation. |
Instances
| Show FeePolicy Source # | |
| Default FeePolicy Source # | |
Defined in Cooked.Skeleton.Option | |
| Eq FeePolicy Source # | |
| Ord FeePolicy Source # | |
data BalancingPolicy where Source #
Whether to balance the transaction or not, and which user to use to provide outputs for balancing.
Constructors
| BalanceWithFirstSignatory :: BalancingPolicy | Balance with the first signatory of the list of signatories |
| BalanceWith :: UserConstraints pkh => pkh -> BalancingPolicy | Balance using a given user |
| DoNotBalance :: BalancingPolicy | Do not perform balancing at all |
Instances
| Show BalancingPolicy Source # | |
Defined in Cooked.Skeleton.Option Methods showsPrec :: Int -> BalancingPolicy -> ShowS # show :: BalancingPolicy -> String # showList :: [BalancingPolicy] -> ShowS # | |
| Default BalancingPolicy Source # | |
Defined in Cooked.Skeleton.Option Methods def :: BalancingPolicy # | |
| Eq BalancingPolicy Source # | |
Defined in Cooked.Skeleton.Option Methods (==) :: BalancingPolicy -> BalancingPolicy -> Bool # (/=) :: BalancingPolicy -> BalancingPolicy -> Bool # | |
data BalancingUtxos Source #
Which UTxOs to use when balancing. Note that utxos that are already known
by the skeleton being balanced (in the sense of
txSkelKnownTxOutRefs, i.e. inputs and reference inputs)
will be filtered out during balancing.
Constructors
| BalancingUtxosFromBalancingUser | Use all UTxOs containing only a Value (no datum, no staking credential, and no reference script) belonging to the balancing user. |
| BalancingUtxosFromSet (Set TxOutRef) | Use the provided UTxOs. UTxOs belonging to scripts will be filtered out |
Instances
| Show BalancingUtxos Source # | |
Defined in Cooked.Skeleton.Option Methods showsPrec :: Int -> BalancingUtxos -> ShowS # show :: BalancingUtxos -> String # showList :: [BalancingUtxos] -> ShowS # | |
| Default BalancingUtxos Source # | |
Defined in Cooked.Skeleton.Option Methods def :: BalancingUtxos # | |
| Eq BalancingUtxos Source # | |
Defined in Cooked.Skeleton.Option Methods (==) :: BalancingUtxos -> BalancingUtxos -> Bool # (/=) :: BalancingUtxos -> BalancingUtxos -> Bool # | |
| Ord BalancingUtxos Source # | |
Defined in Cooked.Skeleton.Option Methods compare :: BalancingUtxos -> BalancingUtxos -> Ordering # (<) :: BalancingUtxos -> BalancingUtxos -> Bool # (<=) :: BalancingUtxos -> BalancingUtxos -> Bool # (>) :: BalancingUtxos -> BalancingUtxos -> Bool # (>=) :: BalancingUtxos -> BalancingUtxos -> Bool # max :: BalancingUtxos -> BalancingUtxos -> BalancingUtxos # min :: BalancingUtxos -> BalancingUtxos -> BalancingUtxos # | |
data CollateralUtxos where Source #
Describe which UTxOs to use as collaterals
Constructors
| CollateralUtxosFromBalancingUser :: CollateralUtxos | Rely on automated computation with only-value UTxOs from the balancing user. Return collaterals will be sent to this user. |
| CollateralUtxosFromUser :: UserConstraints pkh => pkh -> CollateralUtxos | Rely on automated computation with only-value UTxOs from a given user. Return collaterals will be sent to this user. |
| CollateralUtxosFromSet :: UserConstraints pkh => Set TxOutRef -> pkh -> CollateralUtxos | Manually provide a set of candidate UTxOs to be used as collaterals alongside a user to send return collaterals back to. |
Instances
| Show CollateralUtxos Source # | |
Defined in Cooked.Skeleton.Option Methods showsPrec :: Int -> CollateralUtxos -> ShowS # show :: CollateralUtxos -> String # showList :: [CollateralUtxos] -> ShowS # | |
| Default CollateralUtxos Source # | |
Defined in Cooked.Skeleton.Option Methods def :: CollateralUtxos # | |
| Eq CollateralUtxos Source # | |
Defined in Cooked.Skeleton.Option Methods (==) :: CollateralUtxos -> CollateralUtxos -> Bool # (/=) :: CollateralUtxos -> CollateralUtxos -> Bool # | |
data TxSkelOpts Source #
Set of options to modify the behavior of generating and validating some transaction.
Constructors
| TxSkelOpts | |
Fields
| |
Instances
Optics
txSkelOptModTxL :: Lens' TxSkelOpts (Tx ConwayEra -> Tx ConwayEra) Source #
A lens to get or set the Cardano transaction modifications option
txSkelOptAutoSlotIncreaseL :: Lens' TxSkelOpts Bool Source #
A lens to get or set the automatic slot increase option
txSkelOptBalancingPolicyL :: Lens' TxSkelOpts BalancingPolicy Source #
A lens to get or set the balancing policy option
txSkelOptBalanceOutputPolicyL :: Lens' TxSkelOpts BalanceOutputPolicy Source #
A lens to get or set the handling of balancing outputs option
txSkelOptFeePolicyL :: Lens' TxSkelOpts FeePolicy Source #
A lens to get or set the fee policy option
txSkelOptBalancingUtxosL :: Lens' TxSkelOpts BalancingUtxos Source #
A lens to get or set the balancing utxos option
txSkelOptModParamsL :: Lens' TxSkelOpts (Params -> Params) Source #
A lens to get or set the changes to protocol parameters option
txSkelOptCollateralUtxosL :: Lens' TxSkelOpts CollateralUtxos Source #
A lens to get or set the collateral utxos option
Utilities
txSkelOptAddModTx :: (Tx ConwayEra -> Tx ConwayEra) -> TxSkelOpts -> TxSkelOpts Source #
Appends a transaction modification to the given TxSkelOpts
txSkelOptAddModParams :: (Params -> Params) -> TxSkelOpts -> TxSkelOpts Source #
Appends a parameters modification to the given TxSkelOpts