-- | This module provides the description of a transaction skeleton. We have our
-- own representation of a transaction for many reasons. Here are some of them:
--
-- - our transaction skeletons are typed (datums, validators, outputs...)
--
-- - each transaction skeleton comes with its own set of generation options
--
-- - our transaction skeleton is by default anchored in the latest Cardano era
--
-- - each field in our transaction skeleton comes with a set of helpers and
-- - smart constructor to ease the transaction creation
--
-- - we can have default or automated behavior for the parts of the transactions
-- that are less relevant to testing, such as collaterals or fees
module Cooked.Skeleton
  ( module X,

    -- * Data type
    TxSkel (..),

    -- * Optics
    txSkelLabelsL,
    txSkelOptsL,
    txSkelMintsL,
    txSkelValidityRangeL,
    txSkelProposalsL,
    txSkelSignatoriesL,
    txSkelInputsL,
    txSkelReferenceInputsL,
    txSkelOutputsL,
    txSkelWithdrawalsL,
    txSkelCertificatesL,
    txSkelProposingRedeemedScriptsT,
    txSkelMintingRedeemedScriptsT,
    txSkelCertifyingRedeemedUsersT,
    txSkelWithdrawingRedeemedUsersT,
    txSkelSpendingRedeemersT,
    txSkelRedeemersT,
    txSkelRedeemedScriptsT,
    txSkelRedeemedPeersT,
    txSkelAllocatedPeersT,
    txSkelAllocatedScriptsT,

    -- * Smart constructor
    txSkelTemplate,

    -- * Utilities
    txSkelKnownTxOutRefs,
    txSkelWithdrawnValue,
    txSkelPaidValue,
    txSkelReferenceInputsInRedeemers,
  )
where

import Cooked.Skeleton.Anchor as X
import Cooked.Skeleton.Certificate as X
import Cooked.Skeleton.Datum as X
import Cooked.Skeleton.Label as X
import Cooked.Skeleton.Mint as X
import Cooked.Skeleton.Option as X
import Cooked.Skeleton.Output as X
import Cooked.Skeleton.Proposal as X
import Cooked.Skeleton.Redeemer as X
import Cooked.Skeleton.Signatory as X
import Cooked.Skeleton.User as X
import Cooked.Skeleton.ValidityRange as X
import Cooked.Skeleton.Value as X
import Cooked.Skeleton.Withdrawal as X
import Data.Default
import Data.Map (Map)
import Data.Map qualified as Map
import Data.Set (Set)
import Data.Set qualified as Set
import Data.Typeable
import Ledger.Slot qualified as P.Ledger
import Optics.Core
import Optics.TH
import Plutus.Script.Utils.Value qualified as Script
import PlutusLedgerApi.V3 qualified as Api

-- | A transaction skeleton. This is cooked-validators's variant of transaction
-- bodies, eventually translated to Cardano @TxBody@.
data TxSkel where
  TxSkel ::
    { -- | Labels do not influence the transaction generation at all; they are
      -- pretty-printed whenever cooked-validators prints a transaction, and can
      -- therefore make the output more informative. They can also be used to
      -- select skeletons to be modified during a mockchain run.
      TxSkel -> Set TxSkelLabel
txSkelLabels :: Set TxSkelLabel,
      -- | Some options that control transaction generation.
      TxSkel -> TxSkelOpts
txSkelOpts :: TxSkelOpts,
      -- | Any value minted or burned by the transaction. You'll probably want
      -- to use 'Cooked.Skeleton.Mint.txSkelMintsFromList' to construct this.
      TxSkel -> TxSkelMints
txSkelMints :: TxSkelMints,
      -- | The signatories of the transaction. When auto-balancing is enabled,
      -- this list must contain at least one element, which is always expected
      -- to be case in practice anyway. By default, the first signatory will pay
      -- for fees and balancing. You can change that with
      -- 'Cooked.Skeleton.Option.txSkelOptBalancingPolicy'.
      TxSkel -> [TxSkelSignatory]
txSkelSignatories :: [TxSkelSignatory],
      -- | The validity range of the transaction i.e. the time range in which
      -- the transaction is allowed to be processed successfully.
      TxSkel -> SlotRange
txSkelValidityRange :: P.Ledger.SlotRange,
      -- | To each 'Api.TxOutRef' the transaction should consume, add a redeemer
      -- specifying how to spend it. You must make sure that
      --
      -- - On 'Api.TxOutRef's referencing UTxOs belonging to public keys, use
      --   the 'Cooked.Skeleton.Redeemer.emptyTxSkelRedeemer' smart constructor.
      --
      -- - On 'Api.TxOutRef's referencing UTxOs belonging to scripts, use
      --   the 'Cooked.Skeleton.Redeemer.someTxSkelRedeemer' smart constructor.
      TxSkel -> Map TxOutRef TxSkelRedeemer
txSkelInputs :: Map Api.TxOutRef TxSkelRedeemer,
      -- | All outputs directly referenced by the transaction. Each of them will
      -- be directly translated into a Cardano reference input. Additional
      -- reference inputs can be found within the various redeemers of the
      -- skeleton to host reference scripts. Function
      -- 'txSkelReferenceInputsInRedeemers' collects those all.
      TxSkel -> Set TxOutRef
txSkelReferenceInputs :: Set Api.TxOutRef,
      -- | The outputs of the transaction. These will occur in exactly this
      -- order on the transaction.
      TxSkel -> [TxSkelOut]
txSkelOutputs :: [TxSkelOut],
      -- | Possible proposals issued in this transaction to be voted on and
      -- possible enacted later on.
      TxSkel -> [TxSkelProposal]
txSkelProposals :: [TxSkelProposal],
      -- | Withdrawals performed by the transaction
      TxSkel -> TxSkelWithdrawals
txSkelWithdrawals :: TxSkelWithdrawals,
      -- | Certificates issued by the transaction
      TxSkel -> [TxSkelCertificate]
txSkelCertificates :: [TxSkelCertificate]
    } ->
    TxSkel
  deriving (Int -> TxSkel -> ShowS
[TxSkel] -> ShowS
TxSkel -> String
(Int -> TxSkel -> ShowS)
-> (TxSkel -> String) -> ([TxSkel] -> ShowS) -> Show TxSkel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TxSkel -> ShowS
showsPrec :: Int -> TxSkel -> ShowS
$cshow :: TxSkel -> String
show :: TxSkel -> String
$cshowList :: [TxSkel] -> ShowS
showList :: [TxSkel] -> ShowS
Show, TxSkel -> TxSkel -> Bool
(TxSkel -> TxSkel -> Bool)
-> (TxSkel -> TxSkel -> Bool) -> Eq TxSkel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TxSkel -> TxSkel -> Bool
== :: TxSkel -> TxSkel -> Bool
$c/= :: TxSkel -> TxSkel -> Bool
/= :: TxSkel -> TxSkel -> Bool
Eq)

-- | Focuses on the labels of a 'TxSkel'
makeLensesFor [("txSkelLabels", "txSkelLabelsL")] ''TxSkel

-- | Focuses on the options of a 'TxSkel'
makeLensesFor [("txSkelOpts", "txSkelOptsL")] ''TxSkel

-- | Focuses on the minted value of a 'TxSkel'
makeLensesFor [("txSkelMints", "txSkelMintsL")] ''TxSkel

-- | Focuses on the validity range of a 'TxSkel'
makeLensesFor [("txSkelValidityRange", "txSkelValidityRangeL")] ''TxSkel

-- | Focuses on the proposals of a 'TxSkel'
makeLensesFor [("txSkelProposals", "txSkelProposalsL")] ''TxSkel

-- | Focuses on the signatories of a 'TxSkel'
makeLensesFor [("txSkelSignatories", "txSkelSignatoriesL")] ''TxSkel

-- | Focuses on the inputs of a 'TxSkel'
makeLensesFor [("txSkelInputs", "txSkelInputsL")] ''TxSkel

-- | Focuses on the reference inputs of a 'TxSkel'
makeLensesFor [("txSkelReferenceInputs", "txSkelReferenceInputsL")] ''TxSkel

-- | Focuses on the outputs of a 'TxSkel'
makeLensesFor [("txSkelOutputs", "txSkelOutputsL")] ''TxSkel

-- | Focuses on the withdrawals of a 'TxSkel'
makeLensesFor [("txSkelWithdrawals", "txSkelWithdrawalsL")] ''TxSkel

-- | Focuses on the certificates of a 'TxSkel'
makeLensesFor [("txSkelCertificates", "txSkelCertificatesL")] ''TxSkel

-- | Returns all the redeemed scripts involved in proposals in this 'TxSkel'
txSkelProposingRedeemedScriptsT :: Traversal' TxSkel (User IsScript Redemption)
txSkelProposingRedeemedScriptsT :: Traversal' TxSkel (User 'IsScript 'Redemption)
txSkelProposingRedeemedScriptsT =
  Lens' TxSkel [TxSkelProposal]
txSkelProposalsL
    Lens' TxSkel [TxSkelProposal]
-> Optic
     A_Traversal
     '[]
     [TxSkelProposal]
     [TxSkelProposal]
     TxSkelProposal
     TxSkelProposal
-> Optic
     A_Traversal '[] TxSkel TxSkel TxSkelProposal TxSkelProposal
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Traversal
  '[]
  [TxSkelProposal]
  [TxSkelProposal]
  TxSkelProposal
  TxSkelProposal
forall (t :: * -> *) a b.
Traversable t =>
Traversal (t a) (t b) a b
traversed
    Optic A_Traversal '[] TxSkel TxSkel TxSkelProposal TxSkelProposal
-> Optic
     An_AffineTraversal
     '[]
     TxSkelProposal
     TxSkelProposal
     (Maybe (User 'IsScript 'Redemption))
     (Maybe (User 'IsScript 'Redemption))
-> Optic
     A_Traversal
     '[]
     TxSkel
     TxSkel
     (Maybe (User 'IsScript 'Redemption))
     (Maybe (User 'IsScript 'Redemption))
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  An_AffineTraversal
  '[]
  TxSkelProposal
  TxSkelProposal
  (Maybe (User 'IsScript 'Redemption))
  (Maybe (User 'IsScript 'Redemption))
forall (kind :: UserKind).
Typeable kind =>
AffineTraversal' TxSkelProposal (Maybe (User kind 'Redemption))
txSkelProposalMConstitutionAT
    Optic
  A_Traversal
  '[]
  TxSkel
  TxSkel
  (Maybe (User 'IsScript 'Redemption))
  (Maybe (User 'IsScript 'Redemption))
-> Optic
     A_Prism
     '[]
     (Maybe (User 'IsScript 'Redemption))
     (Maybe (User 'IsScript 'Redemption))
     (User 'IsScript 'Redemption)
     (User 'IsScript 'Redemption)
-> Traversal' TxSkel (User 'IsScript 'Redemption)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Prism
  '[]
  (Maybe (User 'IsScript 'Redemption))
  (Maybe (User 'IsScript 'Redemption))
  (User 'IsScript 'Redemption)
  (User 'IsScript 'Redemption)
forall a b. Prism (Maybe a) (Maybe b) a b
_Just

-- | Returns all the redeemed scripts involved in minting in this 'TxSkel'
txSkelMintingRedeemedScriptsT :: Traversal' TxSkel (User IsScript Redemption)
txSkelMintingRedeemedScriptsT :: Traversal' TxSkel (User 'IsScript 'Redemption)
txSkelMintingRedeemedScriptsT =
  Lens' TxSkel TxSkelMints
txSkelMintsL
    Lens' TxSkel TxSkelMints
-> Optic An_Iso '[] TxSkelMints TxSkelMints [Mint] [Mint]
-> Optic A_Lens '[] TxSkel TxSkel [Mint] [Mint]
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic An_Iso '[] TxSkelMints TxSkelMints [Mint] [Mint]
txSkelMintsListI
    Optic A_Lens '[] TxSkel TxSkel [Mint] [Mint]
-> Optic A_Traversal '[] [Mint] [Mint] Mint Mint
-> Optic A_Traversal '[] TxSkel TxSkel Mint Mint
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic A_Traversal '[] [Mint] [Mint] Mint Mint
forall (t :: * -> *) a b.
Traversable t =>
Traversal (t a) (t b) a b
traversed
    Optic A_Traversal '[] TxSkel TxSkel Mint Mint
-> Optic
     A_Lens
     '[]
     Mint
     Mint
     (User 'IsScript 'Redemption)
     (User 'IsScript 'Redemption)
-> Traversal' TxSkel (User 'IsScript 'Redemption)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Lens
  '[]
  Mint
  Mint
  (User 'IsScript 'Redemption)
  (User 'IsScript 'Redemption)
mintRedeemedScriptL

-- | Returns all the redeemed users involved in certificates in this 'TxSkel'
txSkelCertifyingRedeemedUsersT ::
  forall user.
  (Typeable user) =>
  Traversal' TxSkel (User user Redemption)
txSkelCertifyingRedeemedUsersT :: forall (user :: UserKind).
Typeable user =>
Traversal' TxSkel (User user 'Redemption)
txSkelCertifyingRedeemedUsersT =
  Lens' TxSkel [TxSkelCertificate]
txSkelCertificatesL
    Lens' TxSkel [TxSkelCertificate]
-> Optic
     A_Traversal
     '[]
     [TxSkelCertificate]
     [TxSkelCertificate]
     TxSkelCertificate
     TxSkelCertificate
-> Optic
     A_Traversal '[] TxSkel TxSkel TxSkelCertificate TxSkelCertificate
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Traversal
  '[]
  [TxSkelCertificate]
  [TxSkelCertificate]
  TxSkelCertificate
  TxSkelCertificate
forall (t :: * -> *) a b.
Traversable t =>
Traversal (t a) (t b) a b
traversed
    Optic
  A_Traversal '[] TxSkel TxSkel TxSkelCertificate TxSkelCertificate
-> Optic
     An_AffineTraversal
     '[]
     TxSkelCertificate
     TxSkelCertificate
     (User user 'Redemption)
     (User user 'Redemption)
-> Optic
     A_Traversal
     '[]
     TxSkel
     TxSkel
     (User user 'Redemption)
     (User user 'Redemption)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% forall (user :: UserKind).
Typeable user =>
AffineTraversal' TxSkelCertificate (User user 'Redemption)
txSkelCertificateOwnerAT @user

-- | Returns all the redeemed users involved in withdrawals in this 'TxSkel'
txSkelWithdrawingRedeemedUsersT :: Traversal' TxSkel (User IsEither Redemption)
txSkelWithdrawingRedeemedUsersT :: Traversal' TxSkel (User 'IsEither 'Redemption)
txSkelWithdrawingRedeemedUsersT =
  Lens' TxSkel TxSkelWithdrawals
txSkelWithdrawalsL
    Lens' TxSkel TxSkelWithdrawals
-> Optic
     An_Iso
     '[]
     TxSkelWithdrawals
     TxSkelWithdrawals
     [Withdrawal]
     [Withdrawal]
-> Optic A_Lens '[] TxSkel TxSkel [Withdrawal] [Withdrawal]
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  An_Iso
  '[]
  TxSkelWithdrawals
  TxSkelWithdrawals
  [Withdrawal]
  [Withdrawal]
txSkelWithdrawalsListI
    Optic A_Lens '[] TxSkel TxSkel [Withdrawal] [Withdrawal]
-> Optic
     A_Traversal '[] [Withdrawal] [Withdrawal] Withdrawal Withdrawal
-> Optic A_Traversal '[] TxSkel TxSkel Withdrawal Withdrawal
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Traversal '[] [Withdrawal] [Withdrawal] Withdrawal Withdrawal
forall (t :: * -> *) a b.
Traversable t =>
Traversal (t a) (t b) a b
traversed
    Optic A_Traversal '[] TxSkel TxSkel Withdrawal Withdrawal
-> Optic
     A_Lens
     '[]
     Withdrawal
     Withdrawal
     (User 'IsEither 'Redemption)
     (User 'IsEither 'Redemption)
-> Traversal' TxSkel (User 'IsEither 'Redemption)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Lens
  '[]
  Withdrawal
  Withdrawal
  (User 'IsEither 'Redemption)
  (User 'IsEither 'Redemption)
withdrawalUserL

-- | A traversal focusing every script redeemed directly within a 'TxSkel',
-- that is in the minting, proposing, withdrawing and certifying positions. The
-- spending position is excluded, as the scripts spent there are not stored in
-- the skeleton but fetched from the index based on the inputs' references.
txSkelRedeemedScriptsT :: Traversal' TxSkel (User IsScript Redemption)
txSkelRedeemedScriptsT :: Traversal' TxSkel (User 'IsScript 'Redemption)
txSkelRedeemedScriptsT =
  Traversal' TxSkel (User 'IsScript 'Redemption)
txSkelMintingRedeemedScriptsT
    Traversal' TxSkel (User 'IsScript 'Redemption)
-> Traversal' TxSkel (User 'IsScript 'Redemption)
-> Traversal' TxSkel (User 'IsScript 'Redemption)
forall k l (is :: IxList) s a (js :: IxList).
(Is k A_Traversal, Is l A_Traversal) =>
Optic' k is s a -> Optic' l js s a -> Traversal' s a
`adjoin` Traversal' TxSkel (User 'IsScript 'Redemption)
txSkelProposingRedeemedScriptsT
    Traversal' TxSkel (User 'IsScript 'Redemption)
-> Traversal' TxSkel (User 'IsScript 'Redemption)
-> Traversal' TxSkel (User 'IsScript 'Redemption)
forall k l (is :: IxList) s a (js :: IxList).
(Is k A_Traversal, Is l A_Traversal) =>
Optic' k is s a -> Optic' l js s a -> Traversal' s a
`adjoin` (Traversal' TxSkel (User 'IsEither 'Redemption)
txSkelWithdrawingRedeemedUsersT Traversal' TxSkel (User 'IsEither 'Redemption)
-> Optic
     A_Prism
     '[]
     (User 'IsEither 'Redemption)
     (User 'IsEither 'Redemption)
     (User 'IsScript 'Redemption)
     (User 'IsScript 'Redemption)
-> Traversal' TxSkel (User 'IsScript 'Redemption)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Prism
  '[]
  (User 'IsEither 'Redemption)
  (User 'IsEither 'Redemption)
  (User 'IsScript 'Redemption)
  (User 'IsScript 'Redemption)
forall (mode :: UserMode).
Prism' (User 'IsEither mode) (User 'IsScript mode)
userEitherScriptP)
    Traversal' TxSkel (User 'IsScript 'Redemption)
-> Traversal' TxSkel (User 'IsScript 'Redemption)
-> Traversal' TxSkel (User 'IsScript 'Redemption)
forall k l (is :: IxList) s a (js :: IxList).
(Is k A_Traversal, Is l A_Traversal) =>
Optic' k is s a -> Optic' l js s a -> Traversal' s a
`adjoin` (Traversal' TxSkel (User 'IsEither 'Redemption)
forall (user :: UserKind).
Typeable user =>
Traversal' TxSkel (User user 'Redemption)
txSkelCertifyingRedeemedUsersT Traversal' TxSkel (User 'IsEither 'Redemption)
-> Optic
     A_Prism
     '[]
     (User 'IsEither 'Redemption)
     (User 'IsEither 'Redemption)
     (User 'IsScript 'Redemption)
     (User 'IsScript 'Redemption)
-> Traversal' TxSkel (User 'IsScript 'Redemption)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Prism
  '[]
  (User 'IsEither 'Redemption)
  (User 'IsEither 'Redemption)
  (User 'IsScript 'Redemption)
  (User 'IsScript 'Redemption)
forall (mode :: UserMode).
Prism' (User 'IsEither mode) (User 'IsScript mode)
userEitherScriptP)

-- | A traversal focusing every pubkey used in redemption mode.
txSkelRedeemedPeersT :: Traversal' TxSkel (User IsPubKey Redemption)
txSkelRedeemedPeersT :: Traversal' TxSkel (User 'IsPubKey 'Redemption)
txSkelRedeemedPeersT =
  (Traversal' TxSkel (User 'IsEither 'Redemption)
txSkelWithdrawingRedeemedUsersT Traversal' TxSkel (User 'IsEither 'Redemption)
-> Optic
     A_Prism
     '[]
     (User 'IsEither 'Redemption)
     (User 'IsEither 'Redemption)
     (User 'IsPubKey 'Redemption)
     (User 'IsPubKey 'Redemption)
-> Traversal' TxSkel (User 'IsPubKey 'Redemption)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Prism
  '[]
  (User 'IsEither 'Redemption)
  (User 'IsEither 'Redemption)
  (User 'IsPubKey 'Redemption)
  (User 'IsPubKey 'Redemption)
forall (mode :: UserMode).
Prism' (User 'IsEither mode) (User 'IsPubKey mode)
userEitherPubKeyP)
    Traversal' TxSkel (User 'IsPubKey 'Redemption)
-> Traversal' TxSkel (User 'IsPubKey 'Redemption)
-> Traversal' TxSkel (User 'IsPubKey 'Redemption)
forall k l (is :: IxList) s a (js :: IxList).
(Is k A_Traversal, Is l A_Traversal) =>
Optic' k is s a -> Optic' l js s a -> Traversal' s a
`adjoin` (Traversal' TxSkel (User 'IsEither 'Redemption)
forall (user :: UserKind).
Typeable user =>
Traversal' TxSkel (User user 'Redemption)
txSkelCertifyingRedeemedUsersT Traversal' TxSkel (User 'IsEither 'Redemption)
-> Optic
     A_Prism
     '[]
     (User 'IsEither 'Redemption)
     (User 'IsEither 'Redemption)
     (User 'IsPubKey 'Redemption)
     (User 'IsPubKey 'Redemption)
-> Traversal' TxSkel (User 'IsPubKey 'Redemption)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Prism
  '[]
  (User 'IsEither 'Redemption)
  (User 'IsEither 'Redemption)
  (User 'IsPubKey 'Redemption)
  (User 'IsPubKey 'Redemption)
forall (mode :: UserMode).
Prism' (User 'IsEither mode) (User 'IsPubKey mode)
userEitherPubKeyP)
    Traversal' TxSkel (User 'IsPubKey 'Redemption)
-> Traversal' TxSkel (User 'IsPubKey 'Redemption)
-> Traversal' TxSkel (User 'IsPubKey 'Redemption)
forall k l (is :: IxList) s a (js :: IxList).
(Is k A_Traversal, Is l A_Traversal) =>
Optic' k is s a -> Optic' l js s a -> Traversal' s a
`adjoin` Traversal' TxSkel (User 'IsPubKey 'Redemption)
forall (user :: UserKind).
Typeable user =>
Traversal' TxSkel (User user 'Redemption)
txSkelCertifyingRedeemedUsersT

-- | A traversal focusing every pubkey used in allocation mode.
txSkelAllocatedPeersT :: Traversal' TxSkel (User IsPubKey Allocation)
txSkelAllocatedPeersT :: Traversal' TxSkel (User 'IsPubKey 'Allocation)
txSkelAllocatedPeersT =
  (Lens' TxSkel [TxSkelOut]
txSkelOutputsL Lens' TxSkel [TxSkelOut]
-> Optic
     A_Traversal '[] [TxSkelOut] [TxSkelOut] TxSkelOut TxSkelOut
-> Optic A_Traversal '[] TxSkel TxSkel TxSkelOut TxSkelOut
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic A_Traversal '[] [TxSkelOut] [TxSkelOut] TxSkelOut TxSkelOut
forall (t :: * -> *) a b.
Traversable t =>
Traversal (t a) (t b) a b
traversed Optic A_Traversal '[] TxSkel TxSkel TxSkelOut TxSkelOut
-> Optic
     A_Lens
     '[]
     TxSkelOut
     TxSkelOut
     (User 'IsEither 'Allocation)
     (User 'IsEither 'Allocation)
-> Optic
     A_Traversal
     '[]
     TxSkel
     TxSkel
     (User 'IsEither 'Allocation)
     (User 'IsEither 'Allocation)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Lens
  '[]
  TxSkelOut
  TxSkelOut
  (User 'IsEither 'Allocation)
  (User 'IsEither 'Allocation)
txSkelOutOwnerL Optic
  A_Traversal
  '[]
  TxSkel
  TxSkel
  (User 'IsEither 'Allocation)
  (User 'IsEither 'Allocation)
-> Optic
     A_Prism
     '[]
     (User 'IsEither 'Allocation)
     (User 'IsEither 'Allocation)
     (User 'IsPubKey 'Allocation)
     (User 'IsPubKey 'Allocation)
-> Traversal' TxSkel (User 'IsPubKey 'Allocation)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Prism
  '[]
  (User 'IsEither 'Allocation)
  (User 'IsEither 'Allocation)
  (User 'IsPubKey 'Allocation)
  (User 'IsPubKey 'Allocation)
forall (mode :: UserMode).
Prism' (User 'IsEither mode) (User 'IsPubKey mode)
userEitherPubKeyP)
    Traversal' TxSkel (User 'IsPubKey 'Allocation)
-> Traversal' TxSkel (User 'IsPubKey 'Allocation)
-> Traversal' TxSkel (User 'IsPubKey 'Allocation)
forall k l (is :: IxList) s a (js :: IxList).
(Is k A_Traversal, Is l A_Traversal) =>
Optic' k is s a -> Optic' l js s a -> Traversal' s a
`adjoin` (Lens' TxSkel [TxSkelSignatory]
txSkelSignatoriesL Lens' TxSkel [TxSkelSignatory]
-> Optic
     A_Traversal
     '[]
     [TxSkelSignatory]
     [TxSkelSignatory]
     TxSkelSignatory
     TxSkelSignatory
-> Optic
     A_Traversal '[] TxSkel TxSkel TxSkelSignatory TxSkelSignatory
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Traversal
  '[]
  [TxSkelSignatory]
  [TxSkelSignatory]
  TxSkelSignatory
  TxSkelSignatory
forall (t :: * -> *) a b.
Traversable t =>
Traversal (t a) (t b) a b
traversed Optic A_Traversal '[] TxSkel TxSkel TxSkelSignatory TxSkelSignatory
-> Optic
     A_Lens '[] TxSkelSignatory TxSkelSignatory PubKeyHash PubKeyHash
-> Optic A_Traversal '[] TxSkel TxSkel PubKeyHash PubKeyHash
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Lens '[] TxSkelSignatory TxSkelSignatory PubKeyHash PubKeyHash
txSkelSignatoryPubKeyHashL Optic A_Traversal '[] TxSkel TxSkel PubKeyHash PubKeyHash
-> Optic
     An_Iso
     '[]
     PubKeyHash
     PubKeyHash
     (User 'IsPubKey 'Allocation)
     (User 'IsPubKey 'Allocation)
-> Traversal' TxSkel (User 'IsPubKey 'Allocation)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  An_Iso
  '[]
  (User 'IsPubKey 'Allocation)
  (User 'IsPubKey 'Allocation)
  PubKeyHash
  PubKeyHash
-> Optic
     (ReversedOptic An_Iso)
     '[]
     PubKeyHash
     PubKeyHash
     (User 'IsPubKey 'Allocation)
     (User 'IsPubKey 'Allocation)
forall (is :: IxList) s t a b.
AcceptsEmptyIndices "re" is =>
Optic An_Iso is s t a b -> Optic (ReversedOptic An_Iso) is b a t s
forall k (is :: IxList) s t a b.
(ReversibleOptic k, AcceptsEmptyIndices "re" is) =>
Optic k is s t a b -> Optic (ReversedOptic k) is b a t s
re Optic
  An_Iso
  '[]
  (User 'IsPubKey 'Allocation)
  (User 'IsPubKey 'Allocation)
  PubKeyHash
  PubKeyHash
forall (mode :: UserMode). Iso' (User 'IsPubKey mode) PubKeyHash
userPubKeyHashI)

-- | A traversal focusing every script used in allocation mode.
txSkelAllocatedScriptsT :: Traversal' TxSkel (User IsScript Allocation)
txSkelAllocatedScriptsT :: Traversal' TxSkel (User 'IsScript 'Allocation)
txSkelAllocatedScriptsT = Lens' TxSkel [TxSkelOut]
txSkelOutputsL Lens' TxSkel [TxSkelOut]
-> Optic
     A_Traversal '[] [TxSkelOut] [TxSkelOut] TxSkelOut TxSkelOut
-> Optic A_Traversal '[] TxSkel TxSkel TxSkelOut TxSkelOut
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic A_Traversal '[] [TxSkelOut] [TxSkelOut] TxSkelOut TxSkelOut
forall (t :: * -> *) a b.
Traversable t =>
Traversal (t a) (t b) a b
traversed Optic A_Traversal '[] TxSkel TxSkel TxSkelOut TxSkelOut
-> Optic
     A_Lens
     '[]
     TxSkelOut
     TxSkelOut
     (User 'IsEither 'Allocation)
     (User 'IsEither 'Allocation)
-> Optic
     A_Traversal
     '[]
     TxSkel
     TxSkel
     (User 'IsEither 'Allocation)
     (User 'IsEither 'Allocation)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Lens
  '[]
  TxSkelOut
  TxSkelOut
  (User 'IsEither 'Allocation)
  (User 'IsEither 'Allocation)
txSkelOutOwnerL Optic
  A_Traversal
  '[]
  TxSkel
  TxSkel
  (User 'IsEither 'Allocation)
  (User 'IsEither 'Allocation)
-> Optic
     A_Prism
     '[]
     (User 'IsEither 'Allocation)
     (User 'IsEither 'Allocation)
     (User 'IsScript 'Allocation)
     (User 'IsScript 'Allocation)
-> Traversal' TxSkel (User 'IsScript 'Allocation)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Prism
  '[]
  (User 'IsEither 'Allocation)
  (User 'IsEither 'Allocation)
  (User 'IsScript 'Allocation)
  (User 'IsScript 'Allocation)
forall (mode :: UserMode).
Prism' (User 'IsEither mode) (User 'IsScript mode)
userEitherScriptP

-- | A traversal focusing every redeemer involved with the spending purpose in
-- the given 'TxSkel'.
txSkelSpendingRedeemersT :: Traversal' TxSkel TxSkelRedeemer
txSkelSpendingRedeemersT :: Traversal' TxSkel TxSkelRedeemer
txSkelSpendingRedeemersT =
  Lens' TxSkel (Map TxOutRef TxSkelRedeemer)
txSkelInputsL
    Lens' TxSkel (Map TxOutRef TxSkelRedeemer)
-> Optic
     An_Iso
     '[]
     (Map TxOutRef TxSkelRedeemer)
     (Map TxOutRef TxSkelRedeemer)
     [(TxOutRef, TxSkelRedeemer)]
     [(TxOutRef, TxSkelRedeemer)]
-> Optic
     A_Lens
     '[]
     TxSkel
     TxSkel
     [(TxOutRef, TxSkelRedeemer)]
     [(TxOutRef, TxSkelRedeemer)]
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% (Map TxOutRef TxSkelRedeemer -> [(TxOutRef, TxSkelRedeemer)])
-> ([(TxOutRef, TxSkelRedeemer)] -> Map TxOutRef TxSkelRedeemer)
-> Optic
     An_Iso
     '[]
     (Map TxOutRef TxSkelRedeemer)
     (Map TxOutRef TxSkelRedeemer)
     [(TxOutRef, TxSkelRedeemer)]
     [(TxOutRef, TxSkelRedeemer)]
forall s a b t. (s -> a) -> (b -> t) -> Iso s t a b
iso Map TxOutRef TxSkelRedeemer -> [(TxOutRef, TxSkelRedeemer)]
forall k a. Map k a -> [(k, a)]
Map.toList [(TxOutRef, TxSkelRedeemer)] -> Map TxOutRef TxSkelRedeemer
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
    Optic
  A_Lens
  '[]
  TxSkel
  TxSkel
  [(TxOutRef, TxSkelRedeemer)]
  [(TxOutRef, TxSkelRedeemer)]
-> Optic
     A_Traversal
     '[]
     [(TxOutRef, TxSkelRedeemer)]
     [(TxOutRef, TxSkelRedeemer)]
     (TxOutRef, TxSkelRedeemer)
     (TxOutRef, TxSkelRedeemer)
-> Optic
     A_Traversal
     '[]
     TxSkel
     TxSkel
     (TxOutRef, TxSkelRedeemer)
     (TxOutRef, TxSkelRedeemer)
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Traversal
  '[]
  [(TxOutRef, TxSkelRedeemer)]
  [(TxOutRef, TxSkelRedeemer)]
  (TxOutRef, TxSkelRedeemer)
  (TxOutRef, TxSkelRedeemer)
forall (t :: * -> *) a b.
Traversable t =>
Traversal (t a) (t b) a b
traversed
    Optic
  A_Traversal
  '[]
  TxSkel
  TxSkel
  (TxOutRef, TxSkelRedeemer)
  (TxOutRef, TxSkelRedeemer)
-> Optic
     A_Lens
     '[]
     (TxOutRef, TxSkelRedeemer)
     (TxOutRef, TxSkelRedeemer)
     TxSkelRedeemer
     TxSkelRedeemer
-> Traversal' TxSkel TxSkelRedeemer
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Lens
  '[]
  (TxOutRef, TxSkelRedeemer)
  (TxOutRef, TxSkelRedeemer)
  TxSkelRedeemer
  TxSkelRedeemer
forall s t a b. Field2 s t a b => Lens s t a b
_2

-- | A traversal focusing every 'TxSkelRedeemer' of a 'TxSkel', in all five
-- positions (spending, minting, proposing, withdrawing and certifying).
txSkelRedeemersT :: Traversal' TxSkel TxSkelRedeemer
txSkelRedeemersT :: Traversal' TxSkel TxSkelRedeemer
txSkelRedeemersT =
  Traversal' TxSkel TxSkelRedeemer
txSkelSpendingRedeemersT
    Traversal' TxSkel TxSkelRedeemer
-> Traversal' TxSkel TxSkelRedeemer
-> Traversal' TxSkel TxSkelRedeemer
forall k l (is :: IxList) s a (js :: IxList).
(Is k A_Traversal, Is l A_Traversal) =>
Optic' k is s a -> Optic' l js s a -> Traversal' s a
`adjoin` (Traversal' TxSkel (User 'IsScript 'Redemption)
txSkelRedeemedScriptsT Traversal' TxSkel (User 'IsScript 'Redemption)
-> Optic
     A_Lens
     '[]
     (User 'IsScript 'Redemption)
     (User 'IsScript 'Redemption)
     TxSkelRedeemer
     TxSkelRedeemer
-> Traversal' TxSkel TxSkelRedeemer
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  A_Lens
  '[]
  (User 'IsScript 'Redemption)
  (User 'IsScript 'Redemption)
  TxSkelRedeemer
  TxSkelRedeemer
userRedeemerL)

-- | A convenience template of an empty transaction skeleton.
txSkelTemplate :: TxSkel
txSkelTemplate :: TxSkel
txSkelTemplate =
  TxSkel
    { txSkelLabels :: Set TxSkelLabel
txSkelLabels = Set TxSkelLabel
forall a. Monoid a => a
mempty,
      txSkelOpts :: TxSkelOpts
txSkelOpts = TxSkelOpts
forall a. Default a => a
def,
      txSkelMints :: TxSkelMints
txSkelMints = TxSkelMints
forall a. Monoid a => a
mempty,
      txSkelValidityRange :: SlotRange
txSkelValidityRange = SlotRange
forall a. Interval a
Api.always,
      txSkelSignatories :: [TxSkelSignatory]
txSkelSignatories = [TxSkelSignatory]
forall a. Monoid a => a
mempty,
      txSkelInputs :: Map TxOutRef TxSkelRedeemer
txSkelInputs = Map TxOutRef TxSkelRedeemer
forall a. Monoid a => a
mempty,
      txSkelReferenceInputs :: Set TxOutRef
txSkelReferenceInputs = Set TxOutRef
forall a. Monoid a => a
mempty,
      txSkelOutputs :: [TxSkelOut]
txSkelOutputs = [TxSkelOut]
forall a. Monoid a => a
mempty,
      txSkelProposals :: [TxSkelProposal]
txSkelProposals = [TxSkelProposal]
forall a. Monoid a => a
mempty,
      txSkelWithdrawals :: TxSkelWithdrawals
txSkelWithdrawals = TxSkelWithdrawals
forall a. Monoid a => a
mempty,
      txSkelCertificates :: [TxSkelCertificate]
txSkelCertificates = [TxSkelCertificate]
forall a. Monoid a => a
mempty
    }

-- | All 'Api.TxOutRef's in reference inputs from redeemers
txSkelReferenceInputsInRedeemers :: TxSkel -> Set Api.TxOutRef
txSkelReferenceInputsInRedeemers :: TxSkel -> Set TxOutRef
txSkelReferenceInputsInRedeemers =
  [TxOutRef] -> Set TxOutRef
forall a. Ord a => [a] -> Set a
Set.fromList ([TxOutRef] -> Set TxOutRef)
-> (TxSkel -> [TxOutRef]) -> TxSkel -> Set TxOutRef
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Optic' A_Traversal '[] TxSkel TxOutRef -> TxSkel -> [TxOutRef]
forall k (is :: IxList) s a.
Is k A_Fold =>
Optic' k is s a -> s -> [a]
toListOf (Traversal' TxSkel TxSkelRedeemer
txSkelRedeemersT Traversal' TxSkel TxSkelRedeemer
-> Optic
     An_AffineTraversal
     '[]
     TxSkelRedeemer
     TxSkelRedeemer
     TxOutRef
     TxOutRef
-> Optic' A_Traversal '[] TxSkel TxOutRef
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic
  An_AffineTraversal
  '[]
  TxSkelRedeemer
  TxSkelRedeemer
  TxOutRef
  TxOutRef
txSkelRedeemerReferenceInputAT)

-- | All 'Api.TxOutRef's known by a given transaction skeleton. This includes
-- 'Api.TxOutRef's used as inputs of the skeleton and 'Api.TxOutRef's used as reference
-- inputs of the skeleton. This does not include additional possible
-- 'Api.TxOutRef's used for balancing and additional 'Api.TxOutRef's used as collateral
-- inputs, as they are not part of the skeleton.
txSkelKnownTxOutRefs :: TxSkel -> Set Api.TxOutRef
txSkelKnownTxOutRefs :: TxSkel -> Set TxOutRef
txSkelKnownTxOutRefs skel :: TxSkel
skel@TxSkel {[TxSkelSignatory]
[TxSkelProposal]
[TxSkelCertificate]
[TxSkelOut]
Set TxOutRef
Set TxSkelLabel
Map TxOutRef TxSkelRedeemer
SlotRange
TxSkelOpts
TxSkelWithdrawals
TxSkelMints
txSkelLabels :: TxSkel -> Set TxSkelLabel
txSkelOpts :: TxSkel -> TxSkelOpts
txSkelMints :: TxSkel -> TxSkelMints
txSkelSignatories :: TxSkel -> [TxSkelSignatory]
txSkelValidityRange :: TxSkel -> SlotRange
txSkelInputs :: TxSkel -> Map TxOutRef TxSkelRedeemer
txSkelReferenceInputs :: TxSkel -> Set TxOutRef
txSkelOutputs :: TxSkel -> [TxSkelOut]
txSkelProposals :: TxSkel -> [TxSkelProposal]
txSkelWithdrawals :: TxSkel -> TxSkelWithdrawals
txSkelCertificates :: TxSkel -> [TxSkelCertificate]
txSkelLabels :: Set TxSkelLabel
txSkelOpts :: TxSkelOpts
txSkelMints :: TxSkelMints
txSkelSignatories :: [TxSkelSignatory]
txSkelValidityRange :: SlotRange
txSkelInputs :: Map TxOutRef TxSkelRedeemer
txSkelReferenceInputs :: Set TxOutRef
txSkelOutputs :: [TxSkelOut]
txSkelProposals :: [TxSkelProposal]
txSkelWithdrawals :: TxSkelWithdrawals
txSkelCertificates :: [TxSkelCertificate]
..} =
  TxSkel -> Set TxOutRef
txSkelReferenceInputsInRedeemers TxSkel
skel
    Set TxOutRef -> Set TxOutRef -> Set TxOutRef
forall a. Semigroup a => a -> a -> a
<> Map TxOutRef TxSkelRedeemer -> Set TxOutRef
forall k a. Map k a -> Set k
Map.keysSet Map TxOutRef TxSkelRedeemer
txSkelInputs
    Set TxOutRef -> Set TxOutRef -> Set TxOutRef
forall a. Semigroup a => a -> a -> a
<> Set TxOutRef
txSkelReferenceInputs

-- | Returns the total value withdrawn in this 'TxSkel'
txSkelWithdrawnValue :: TxSkel -> Api.Value
txSkelWithdrawnValue :: TxSkel -> Value
txSkelWithdrawnValue = TxSkelWithdrawals -> Value
forall a. ToValue a => a -> Value
Script.toValue (TxSkelWithdrawals -> Value)
-> (TxSkel -> TxSkelWithdrawals) -> TxSkel -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TxSkel -> TxSkelWithdrawals
txSkelWithdrawals

-- | Returns the full value contained in the skeleton outputs
txSkelPaidValue :: TxSkel -> Api.Value
txSkelPaidValue :: TxSkel -> Value
txSkelPaidValue =
  Optic' A_Fold '[] TxSkel Value -> TxSkel -> Value
forall k a (is :: IxList) s.
(Is k A_Fold, Monoid a) =>
Optic' k is s a -> s -> a
foldOf (Optic' A_Fold '[] TxSkel Value -> TxSkel -> Value)
-> Optic' A_Fold '[] TxSkel Value -> TxSkel -> Value
forall a b. (a -> b) -> a -> b
$
    Lens' TxSkel [TxSkelOut]
txSkelOutputsL
      Lens' TxSkel [TxSkelOut]
-> Optic A_Fold '[] [TxSkelOut] [TxSkelOut] TxSkelOut TxSkelOut
-> Optic A_Fold '[] TxSkel TxSkel TxSkelOut TxSkelOut
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic A_Fold '[] [TxSkelOut] [TxSkelOut] TxSkelOut TxSkelOut
forall (f :: * -> *) a. Foldable f => Fold (f a) a
folded
      Optic A_Fold '[] TxSkel TxSkel TxSkelOut TxSkelOut
-> Optic A_Lens '[] TxSkelOut TxSkelOut Value Value
-> Optic' A_Fold '[] TxSkel Value
forall k l m (is :: IxList) (js :: IxList) (ks :: IxList) s t u v a
       b.
(JoinKinds k l m, AppendIndices is js ks) =>
Optic k is s t u v -> Optic l js u v a b -> Optic m ks s t a b
% Optic A_Lens '[] TxSkelOut TxSkelOut Value Value
txSkelOutValueL