diff --git a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Blockchain.purs b/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Blockchain.purs index 96ec5218a6..f456723d2c 100644 --- a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Blockchain.purs +++ b/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Blockchain.purs @@ -17,7 +17,7 @@ import Data.Maybe (Maybe(..)) import Data.Newtype (class Newtype, unwrap) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Type.Proxy (Proxy(Proxy)) import Data.Argonaut.Decode.Aeson as D import Data.Argonaut.Encode.Aeson as E diff --git a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Constraints/OffChain.purs b/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Constraints/OffChain.purs index b45d5a3440..23f7bcdb14 100644 --- a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Constraints/OffChain.purs +++ b/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Constraints/OffChain.purs @@ -20,7 +20,7 @@ import Data.Set (Set) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) import Ledger.Address (PaymentPubKeyHash) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Ledger.Typed.Tx (ConnectionError) import Plutus.V1.Ledger.Interval (Interval) import Plutus.V1.Ledger.Scripts (DatumHash) diff --git a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Index/Internal.purs b/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Index/Internal.purs index 4066e91cbe..ea7789f5ae 100644 --- a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Index/Internal.purs +++ b/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Index/Internal.purs @@ -23,7 +23,7 @@ import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) import Ledger.Crypto (PubKey, Signature) import Ledger.Slot (Slot) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Plutus.V1.Ledger.Crypto (PubKeyHash) import Plutus.V1.Ledger.Scripts (DatumHash, ScriptError, Validator) import Plutus.V1.Ledger.Tx (RedeemerPtr, TxIn, TxOut, TxOutRef) diff --git a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx.purs b/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx.purs index 03d4d34b19..7549daa3ad 100644 --- a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx.purs +++ b/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx.purs @@ -15,13 +15,14 @@ import Data.Lens (Iso', Lens', Prism', iso, prism') import Data.Lens.Iso.Newtype (_Newtype) import Data.Lens.Record (prop) import Data.Maybe (Maybe(..)) -import Data.Newtype (unwrap) +import Data.Newtype (class Newtype, unwrap) import Data.RawJson (RawJson) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Plutus.V1.Ledger.Address (Address) import Plutus.V1.Ledger.Scripts (DatumHash, Validator) +import Plutus.V1.Ledger.Tx (TxOut) import Plutus.V1.Ledger.Value (Value) import Type.Proxy (Proxy(Proxy)) import Data.Argonaut.Decode.Aeson as D @@ -139,3 +140,40 @@ _ScriptChainIndexTxOut :: Prism' ChainIndexTxOut { _ciTxOutAddress :: Address, _ _ScriptChainIndexTxOut = prism' ScriptChainIndexTxOut case _ of (ScriptChainIndexTxOut a) -> Just a _ -> Nothing + +-------------------------------------------------------------------------------- + +newtype TxOutTx = TxOutTx + { txOutTxTx :: Tx + , txOutTxOut :: TxOut + } + +derive instance Eq TxOutTx + +instance Show TxOutTx where + show a = genericShow a + +instance EncodeJson TxOutTx where + encodeJson = defer \_ -> E.encode $ unwrap >$< + ( E.record + { txOutTxTx: E.value :: _ Tx + , txOutTxOut: E.value :: _ TxOut + } + ) + +instance DecodeJson TxOutTx where + decodeJson = defer \_ -> D.decode $ + ( TxOutTx <$> D.record "TxOutTx" + { txOutTxTx: D.value :: _ Tx + , txOutTxOut: D.value :: _ TxOut + } + ) + +derive instance Generic TxOutTx _ + +derive instance Newtype TxOutTx _ + +-------------------------------------------------------------------------------- + +_TxOutTx :: Iso' TxOutTx { txOutTxTx :: Tx, txOutTxOut :: TxOut } +_TxOutTx = _Newtype diff --git a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx/CardanoAPI.purs b/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx/CardanoAPI.purs index bc899bdd97..302495fd78 100644 --- a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx/CardanoAPI.purs +++ b/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx/CardanoAPI.purs @@ -20,7 +20,6 @@ import Data.Maybe (Maybe(..)) import Data.Newtype (unwrap) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) -import Plutus.V1.Ledger.Tx (ScriptTag) import Type.Proxy (Proxy(Proxy)) import Data.Argonaut.Decode.Aeson as D import Data.Argonaut.Encode.Aeson as E @@ -66,10 +65,10 @@ data ToCardanoError | OutputHasZeroAda | StakingPointersNotSupported | SimpleScriptsNotSupportedToCardano - | MissingTxInType - | MissingMintingPolicyRedeemer + | MissingInputValidator + | MissingDatum | MissingMintingPolicy - | ScriptPurposeNotSupported ScriptTag + | MissingStakeValidator | Tag String ToCardanoError derive instance Eq ToCardanoError @@ -86,10 +85,10 @@ instance EncodeJson ToCardanoError where OutputHasZeroAda -> encodeJson { tag: "OutputHasZeroAda", contents: jsonNull } StakingPointersNotSupported -> encodeJson { tag: "StakingPointersNotSupported", contents: jsonNull } SimpleScriptsNotSupportedToCardano -> encodeJson { tag: "SimpleScriptsNotSupportedToCardano", contents: jsonNull } - MissingTxInType -> encodeJson { tag: "MissingTxInType", contents: jsonNull } - MissingMintingPolicyRedeemer -> encodeJson { tag: "MissingMintingPolicyRedeemer", contents: jsonNull } + MissingInputValidator -> encodeJson { tag: "MissingInputValidator", contents: jsonNull } + MissingDatum -> encodeJson { tag: "MissingDatum", contents: jsonNull } MissingMintingPolicy -> encodeJson { tag: "MissingMintingPolicy", contents: jsonNull } - ScriptPurposeNotSupported a -> E.encodeTagged "ScriptPurposeNotSupported" a E.value + MissingStakeValidator -> encodeJson { tag: "MissingStakeValidator", contents: jsonNull } Tag a b -> E.encodeTagged "Tag" (a /\ b) (E.tuple (E.value >/\< E.value)) instance DecodeJson ToCardanoError where @@ -103,10 +102,10 @@ instance DecodeJson ToCardanoError where , "OutputHasZeroAda" /\ pure OutputHasZeroAda , "StakingPointersNotSupported" /\ pure StakingPointersNotSupported , "SimpleScriptsNotSupportedToCardano" /\ pure SimpleScriptsNotSupportedToCardano - , "MissingTxInType" /\ pure MissingTxInType - , "MissingMintingPolicyRedeemer" /\ pure MissingMintingPolicyRedeemer + , "MissingInputValidator" /\ pure MissingInputValidator + , "MissingDatum" /\ pure MissingDatum , "MissingMintingPolicy" /\ pure MissingMintingPolicy - , "ScriptPurposeNotSupported" /\ D.content (ScriptPurposeNotSupported <$> D.value) + , "MissingStakeValidator" /\ pure MissingStakeValidator , "Tag" /\ D.content (D.tuple $ Tag D.value D.value) ] @@ -149,14 +148,14 @@ _SimpleScriptsNotSupportedToCardano = prism' (const SimpleScriptsNotSupportedToC SimpleScriptsNotSupportedToCardano -> Just unit _ -> Nothing -_MissingTxInType :: Prism' ToCardanoError Unit -_MissingTxInType = prism' (const MissingTxInType) case _ of - MissingTxInType -> Just unit +_MissingInputValidator :: Prism' ToCardanoError Unit +_MissingInputValidator = prism' (const MissingInputValidator) case _ of + MissingInputValidator -> Just unit _ -> Nothing -_MissingMintingPolicyRedeemer :: Prism' ToCardanoError Unit -_MissingMintingPolicyRedeemer = prism' (const MissingMintingPolicyRedeemer) case _ of - MissingMintingPolicyRedeemer -> Just unit +_MissingDatum :: Prism' ToCardanoError Unit +_MissingDatum = prism' (const MissingDatum) case _ of + MissingDatum -> Just unit _ -> Nothing _MissingMintingPolicy :: Prism' ToCardanoError Unit @@ -164,9 +163,9 @@ _MissingMintingPolicy = prism' (const MissingMintingPolicy) case _ of MissingMintingPolicy -> Just unit _ -> Nothing -_ScriptPurposeNotSupported :: Prism' ToCardanoError ScriptTag -_ScriptPurposeNotSupported = prism' ScriptPurposeNotSupported case _ of - (ScriptPurposeNotSupported a) -> Just a +_MissingStakeValidator :: Prism' ToCardanoError Unit +_MissingStakeValidator = prism' (const MissingStakeValidator) case _ of + MissingStakeValidator -> Just unit _ -> Nothing _Tag :: Prism' ToCardanoError { a :: String, b :: ToCardanoError } diff --git a/plutus-pab-executables/demo/pab-nami/client/generated/Plutus/PAB/Webserver/Types.purs b/plutus-pab-executables/demo/pab-nami/client/generated/Plutus/PAB/Webserver/Types.purs index 76d0971d7f..9151fd5cf7 100644 --- a/plutus-pab-executables/demo/pab-nami/client/generated/Plutus/PAB/Webserver/Types.purs +++ b/plutus-pab-executables/demo/pab-nami/client/generated/Plutus/PAB/Webserver/Types.purs @@ -23,7 +23,7 @@ import Data.Tuple (Tuple) import Data.Tuple.Nested ((/\)) import Ledger.Index.Internal (UtxoIndex) import Ledger.Slot (Slot) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Playground.Types (FunctionSchema) import Plutus.Contract.Effects (ActiveEndpoint, PABReq) import Plutus.PAB.Events.ContractInstanceState (PartiallyDecodedResponse) diff --git a/plutus-pab-executables/demo/pab-nami/client/generated/Wallet/Rollup/Types.purs b/plutus-pab-executables/demo/pab-nami/client/generated/Wallet/Rollup/Types.purs index a9f55ca5ca..11388320be 100644 --- a/plutus-pab-executables/demo/pab-nami/client/generated/Wallet/Rollup/Types.purs +++ b/plutus-pab-executables/demo/pab-nami/client/generated/Wallet/Rollup/Types.purs @@ -20,7 +20,7 @@ import Data.Newtype (class Newtype, unwrap) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) import Ledger.Address (PaymentPubKeyHash) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Plutus.V1.Ledger.Tx (TxId, TxIn, TxOut) import Plutus.V1.Ledger.Value (Value) import Type.Proxy (Proxy(Proxy)) diff --git a/plutus-playground-client/generated/Ledger/Blockchain.purs b/plutus-playground-client/generated/Ledger/Blockchain.purs index 96ec5218a6..f456723d2c 100644 --- a/plutus-playground-client/generated/Ledger/Blockchain.purs +++ b/plutus-playground-client/generated/Ledger/Blockchain.purs @@ -17,7 +17,7 @@ import Data.Maybe (Maybe(..)) import Data.Newtype (class Newtype, unwrap) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Type.Proxy (Proxy(Proxy)) import Data.Argonaut.Decode.Aeson as D import Data.Argonaut.Encode.Aeson as E diff --git a/plutus-playground-client/generated/Ledger/Constraints/OffChain.purs b/plutus-playground-client/generated/Ledger/Constraints/OffChain.purs index b45d5a3440..23f7bcdb14 100644 --- a/plutus-playground-client/generated/Ledger/Constraints/OffChain.purs +++ b/plutus-playground-client/generated/Ledger/Constraints/OffChain.purs @@ -20,7 +20,7 @@ import Data.Set (Set) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) import Ledger.Address (PaymentPubKeyHash) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Ledger.Typed.Tx (ConnectionError) import Plutus.V1.Ledger.Interval (Interval) import Plutus.V1.Ledger.Scripts (DatumHash) diff --git a/plutus-playground-client/generated/Ledger/Index/Internal.purs b/plutus-playground-client/generated/Ledger/Index/Internal.purs index 4066e91cbe..ea7789f5ae 100644 --- a/plutus-playground-client/generated/Ledger/Index/Internal.purs +++ b/plutus-playground-client/generated/Ledger/Index/Internal.purs @@ -23,7 +23,7 @@ import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) import Ledger.Crypto (PubKey, Signature) import Ledger.Slot (Slot) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Plutus.V1.Ledger.Crypto (PubKeyHash) import Plutus.V1.Ledger.Scripts (DatumHash, ScriptError, Validator) import Plutus.V1.Ledger.Tx (RedeemerPtr, TxIn, TxOut, TxOutRef) diff --git a/plutus-playground-client/generated/Ledger/Tx.purs b/plutus-playground-client/generated/Ledger/Tx.purs index 03d4d34b19..7549daa3ad 100644 --- a/plutus-playground-client/generated/Ledger/Tx.purs +++ b/plutus-playground-client/generated/Ledger/Tx.purs @@ -15,13 +15,14 @@ import Data.Lens (Iso', Lens', Prism', iso, prism') import Data.Lens.Iso.Newtype (_Newtype) import Data.Lens.Record (prop) import Data.Maybe (Maybe(..)) -import Data.Newtype (unwrap) +import Data.Newtype (class Newtype, unwrap) import Data.RawJson (RawJson) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Plutus.V1.Ledger.Address (Address) import Plutus.V1.Ledger.Scripts (DatumHash, Validator) +import Plutus.V1.Ledger.Tx (TxOut) import Plutus.V1.Ledger.Value (Value) import Type.Proxy (Proxy(Proxy)) import Data.Argonaut.Decode.Aeson as D @@ -139,3 +140,40 @@ _ScriptChainIndexTxOut :: Prism' ChainIndexTxOut { _ciTxOutAddress :: Address, _ _ScriptChainIndexTxOut = prism' ScriptChainIndexTxOut case _ of (ScriptChainIndexTxOut a) -> Just a _ -> Nothing + +-------------------------------------------------------------------------------- + +newtype TxOutTx = TxOutTx + { txOutTxTx :: Tx + , txOutTxOut :: TxOut + } + +derive instance Eq TxOutTx + +instance Show TxOutTx where + show a = genericShow a + +instance EncodeJson TxOutTx where + encodeJson = defer \_ -> E.encode $ unwrap >$< + ( E.record + { txOutTxTx: E.value :: _ Tx + , txOutTxOut: E.value :: _ TxOut + } + ) + +instance DecodeJson TxOutTx where + decodeJson = defer \_ -> D.decode $ + ( TxOutTx <$> D.record "TxOutTx" + { txOutTxTx: D.value :: _ Tx + , txOutTxOut: D.value :: _ TxOut + } + ) + +derive instance Generic TxOutTx _ + +derive instance Newtype TxOutTx _ + +-------------------------------------------------------------------------------- + +_TxOutTx :: Iso' TxOutTx { txOutTxTx :: Tx, txOutTxOut :: TxOut } +_TxOutTx = _Newtype diff --git a/plutus-playground-client/generated/Ledger/Tx/CardanoAPI.purs b/plutus-playground-client/generated/Ledger/Tx/CardanoAPI.purs index bc899bdd97..302495fd78 100644 --- a/plutus-playground-client/generated/Ledger/Tx/CardanoAPI.purs +++ b/plutus-playground-client/generated/Ledger/Tx/CardanoAPI.purs @@ -20,7 +20,6 @@ import Data.Maybe (Maybe(..)) import Data.Newtype (unwrap) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) -import Plutus.V1.Ledger.Tx (ScriptTag) import Type.Proxy (Proxy(Proxy)) import Data.Argonaut.Decode.Aeson as D import Data.Argonaut.Encode.Aeson as E @@ -66,10 +65,10 @@ data ToCardanoError | OutputHasZeroAda | StakingPointersNotSupported | SimpleScriptsNotSupportedToCardano - | MissingTxInType - | MissingMintingPolicyRedeemer + | MissingInputValidator + | MissingDatum | MissingMintingPolicy - | ScriptPurposeNotSupported ScriptTag + | MissingStakeValidator | Tag String ToCardanoError derive instance Eq ToCardanoError @@ -86,10 +85,10 @@ instance EncodeJson ToCardanoError where OutputHasZeroAda -> encodeJson { tag: "OutputHasZeroAda", contents: jsonNull } StakingPointersNotSupported -> encodeJson { tag: "StakingPointersNotSupported", contents: jsonNull } SimpleScriptsNotSupportedToCardano -> encodeJson { tag: "SimpleScriptsNotSupportedToCardano", contents: jsonNull } - MissingTxInType -> encodeJson { tag: "MissingTxInType", contents: jsonNull } - MissingMintingPolicyRedeemer -> encodeJson { tag: "MissingMintingPolicyRedeemer", contents: jsonNull } + MissingInputValidator -> encodeJson { tag: "MissingInputValidator", contents: jsonNull } + MissingDatum -> encodeJson { tag: "MissingDatum", contents: jsonNull } MissingMintingPolicy -> encodeJson { tag: "MissingMintingPolicy", contents: jsonNull } - ScriptPurposeNotSupported a -> E.encodeTagged "ScriptPurposeNotSupported" a E.value + MissingStakeValidator -> encodeJson { tag: "MissingStakeValidator", contents: jsonNull } Tag a b -> E.encodeTagged "Tag" (a /\ b) (E.tuple (E.value >/\< E.value)) instance DecodeJson ToCardanoError where @@ -103,10 +102,10 @@ instance DecodeJson ToCardanoError where , "OutputHasZeroAda" /\ pure OutputHasZeroAda , "StakingPointersNotSupported" /\ pure StakingPointersNotSupported , "SimpleScriptsNotSupportedToCardano" /\ pure SimpleScriptsNotSupportedToCardano - , "MissingTxInType" /\ pure MissingTxInType - , "MissingMintingPolicyRedeemer" /\ pure MissingMintingPolicyRedeemer + , "MissingInputValidator" /\ pure MissingInputValidator + , "MissingDatum" /\ pure MissingDatum , "MissingMintingPolicy" /\ pure MissingMintingPolicy - , "ScriptPurposeNotSupported" /\ D.content (ScriptPurposeNotSupported <$> D.value) + , "MissingStakeValidator" /\ pure MissingStakeValidator , "Tag" /\ D.content (D.tuple $ Tag D.value D.value) ] @@ -149,14 +148,14 @@ _SimpleScriptsNotSupportedToCardano = prism' (const SimpleScriptsNotSupportedToC SimpleScriptsNotSupportedToCardano -> Just unit _ -> Nothing -_MissingTxInType :: Prism' ToCardanoError Unit -_MissingTxInType = prism' (const MissingTxInType) case _ of - MissingTxInType -> Just unit +_MissingInputValidator :: Prism' ToCardanoError Unit +_MissingInputValidator = prism' (const MissingInputValidator) case _ of + MissingInputValidator -> Just unit _ -> Nothing -_MissingMintingPolicyRedeemer :: Prism' ToCardanoError Unit -_MissingMintingPolicyRedeemer = prism' (const MissingMintingPolicyRedeemer) case _ of - MissingMintingPolicyRedeemer -> Just unit +_MissingDatum :: Prism' ToCardanoError Unit +_MissingDatum = prism' (const MissingDatum) case _ of + MissingDatum -> Just unit _ -> Nothing _MissingMintingPolicy :: Prism' ToCardanoError Unit @@ -164,9 +163,9 @@ _MissingMintingPolicy = prism' (const MissingMintingPolicy) case _ of MissingMintingPolicy -> Just unit _ -> Nothing -_ScriptPurposeNotSupported :: Prism' ToCardanoError ScriptTag -_ScriptPurposeNotSupported = prism' ScriptPurposeNotSupported case _ of - (ScriptPurposeNotSupported a) -> Just a +_MissingStakeValidator :: Prism' ToCardanoError Unit +_MissingStakeValidator = prism' (const MissingStakeValidator) case _ of + MissingStakeValidator -> Just unit _ -> Nothing _Tag :: Prism' ToCardanoError { a :: String, b :: ToCardanoError } diff --git a/plutus-playground-client/generated/Ledger/Tx/Internal.purs b/plutus-playground-client/generated/Ledger/Tx/Internal.purs deleted file mode 100644 index 80cd005238..0000000000 --- a/plutus-playground-client/generated/Ledger/Tx/Internal.purs +++ /dev/null @@ -1,127 +0,0 @@ --- File auto generated by purescript-bridge! -- -module Ledger.Tx.Internal where - -import Prelude - -import Control.Lazy (defer) -import Data.Argonaut (encodeJson, jsonNull) -import Data.Argonaut.Decode (class DecodeJson) -import Data.Argonaut.Decode.Aeson ((), (), ()) -import Data.Argonaut.Encode (class EncodeJson) -import Data.Argonaut.Encode.Aeson ((>$<), (>/\<)) -import Data.Generic.Rep (class Generic) -import Data.Lens (Iso', Lens', Prism', iso, prism') -import Data.Lens.Iso.Newtype (_Newtype) -import Data.Lens.Record (prop) -import Data.Map (Map) -import Data.Maybe (Maybe(..)) -import Data.Newtype (class Newtype, unwrap) -import Data.Set (Set) -import Data.Show.Generic (genericShow) -import Data.Tuple.Nested ((/\)) -import Ledger.Crypto (PubKey, Signature) -import Ledger.Slot (Slot) -import Plutus.V1.Ledger.Interval (Interval) -import Plutus.V1.Ledger.Scripts (DatumHash, MintingPolicy) -import Plutus.V1.Ledger.Tx (RedeemerPtr, TxIn, TxOut) -import Plutus.V1.Ledger.Value (Value) -import Type.Proxy (Proxy(Proxy)) -import Data.Argonaut.Decode.Aeson as D -import Data.Argonaut.Encode.Aeson as E -import Data.Map as Map - -newtype Tx = Tx - { txInputs :: Set TxIn - , txCollateral :: Set TxIn - , txOutputs :: Array TxOut - , txMint :: Value - , txFee :: Value - , txValidRange :: Interval Slot - , txMintScripts :: Set MintingPolicy - , txSignatures :: Map PubKey Signature - , txRedeemers :: Map RedeemerPtr String - , txData :: Map DatumHash String - } - -derive instance Eq Tx - -instance Show Tx where - show a = genericShow a - -instance EncodeJson Tx where - encodeJson = defer \_ -> E.encode $ unwrap >$< - ( E.record - { txInputs: E.value :: _ (Set TxIn) - , txCollateral: E.value :: _ (Set TxIn) - , txOutputs: E.value :: _ (Array TxOut) - , txMint: E.value :: _ Value - , txFee: E.value :: _ Value - , txValidRange: E.value :: _ (Interval Slot) - , txMintScripts: E.value :: _ (Set MintingPolicy) - , txSignatures: (E.dictionary E.value E.value) :: _ (Map PubKey Signature) - , txRedeemers: (E.dictionary E.value E.value) :: _ (Map RedeemerPtr String) - , txData: (E.dictionary E.value E.value) :: _ (Map DatumHash String) - } - ) - -instance DecodeJson Tx where - decodeJson = defer \_ -> D.decode $ - ( Tx <$> D.record "Tx" - { txInputs: D.value :: _ (Set TxIn) - , txCollateral: D.value :: _ (Set TxIn) - , txOutputs: D.value :: _ (Array TxOut) - , txMint: D.value :: _ Value - , txFee: D.value :: _ Value - , txValidRange: D.value :: _ (Interval Slot) - , txMintScripts: D.value :: _ (Set MintingPolicy) - , txSignatures: (D.dictionary D.value D.value) :: _ (Map PubKey Signature) - , txRedeemers: (D.dictionary D.value D.value) :: _ (Map RedeemerPtr String) - , txData: (D.dictionary D.value D.value) :: _ (Map DatumHash String) - } - ) - -derive instance Generic Tx _ - -derive instance Newtype Tx _ - --------------------------------------------------------------------------------- - -_Tx :: Iso' Tx { txInputs :: Set TxIn, txCollateral :: Set TxIn, txOutputs :: Array TxOut, txMint :: Value, txFee :: Value, txValidRange :: Interval Slot, txMintScripts :: Set MintingPolicy, txSignatures :: Map PubKey Signature, txRedeemers :: Map RedeemerPtr String, txData :: Map DatumHash String } -_Tx = _Newtype - --------------------------------------------------------------------------------- - -newtype TxOutTx = TxOutTx - { txOutTxTx :: Tx - , txOutTxOut :: TxOut - } - -derive instance Eq TxOutTx - -instance Show TxOutTx where - show a = genericShow a - -instance EncodeJson TxOutTx where - encodeJson = defer \_ -> E.encode $ unwrap >$< - ( E.record - { txOutTxTx: E.value :: _ Tx - , txOutTxOut: E.value :: _ TxOut - } - ) - -instance DecodeJson TxOutTx where - decodeJson = defer \_ -> D.decode $ - ( TxOutTx <$> D.record "TxOutTx" - { txOutTxTx: D.value :: _ Tx - , txOutTxOut: D.value :: _ TxOut - } - ) - -derive instance Generic TxOutTx _ - -derive instance Newtype TxOutTx _ - --------------------------------------------------------------------------------- - -_TxOutTx :: Iso' TxOutTx { txOutTxTx :: Tx, txOutTxOut :: TxOut } -_TxOutTx = _Newtype diff --git a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx/Internal.purs b/plutus-playground-client/generated/Ledger/Tx/Types/Tx.purs similarity index 53% rename from plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx/Internal.purs rename to plutus-playground-client/generated/Ledger/Tx/Types/Tx.purs index 80cd005238..67348b2c50 100644 --- a/plutus-pab-executables/demo/pab-nami/client/generated/Ledger/Tx/Internal.purs +++ b/plutus-playground-client/generated/Ledger/Tx/Types/Tx.purs @@ -1,5 +1,5 @@ -- File auto generated by purescript-bridge! -- -module Ledger.Tx.Internal where +module Ledger.Tx.Types.Tx where import Prelude @@ -16,14 +16,16 @@ import Data.Lens.Record (prop) import Data.Map (Map) import Data.Maybe (Maybe(..)) import Data.Newtype (class Newtype, unwrap) -import Data.Set (Set) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) import Ledger.Crypto (PubKey, Signature) import Ledger.Slot (Slot) +import Ledger.Tx.Types.Certificate (Certificate) +import Ledger.Tx.Types.TxInput (TxInput) +import Ledger.Tx.Types.Withdrawal (Withdrawal) import Plutus.V1.Ledger.Interval (Interval) -import Plutus.V1.Ledger.Scripts (DatumHash, MintingPolicy) -import Plutus.V1.Ledger.Tx (RedeemerPtr, TxIn, TxOut) +import Plutus.V1.Ledger.Scripts (DatumHash) +import Plutus.V1.Ledger.Tx (TxOut) import Plutus.V1.Ledger.Value (Value) import Type.Proxy (Proxy(Proxy)) import Data.Argonaut.Decode.Aeson as D @@ -31,16 +33,19 @@ import Data.Argonaut.Encode.Aeson as E import Data.Map as Map newtype Tx = Tx - { txInputs :: Set TxIn - , txCollateral :: Set TxIn + { txInputs :: Array TxInput + , txCollateral :: Array TxInput , txOutputs :: Array TxOut , txMint :: Value , txFee :: Value , txValidRange :: Interval Slot - , txMintScripts :: Set MintingPolicy + , txMintingScripts :: Map String String + , txWithdrawals :: Array Withdrawal + , txCertificates :: Array Certificate , txSignatures :: Map PubKey Signature - , txRedeemers :: Map RedeemerPtr String + , txScripts :: Map String String , txData :: Map DatumHash String + , txMetadata :: Maybe String } derive instance Eq Tx @@ -51,32 +56,38 @@ instance Show Tx where instance EncodeJson Tx where encodeJson = defer \_ -> E.encode $ unwrap >$< ( E.record - { txInputs: E.value :: _ (Set TxIn) - , txCollateral: E.value :: _ (Set TxIn) + { txInputs: E.value :: _ (Array TxInput) + , txCollateral: E.value :: _ (Array TxInput) , txOutputs: E.value :: _ (Array TxOut) , txMint: E.value :: _ Value , txFee: E.value :: _ Value , txValidRange: E.value :: _ (Interval Slot) - , txMintScripts: E.value :: _ (Set MintingPolicy) + , txMintingScripts: (E.dictionary E.value E.value) :: _ (Map String String) + , txWithdrawals: E.value :: _ (Array Withdrawal) + , txCertificates: E.value :: _ (Array Certificate) , txSignatures: (E.dictionary E.value E.value) :: _ (Map PubKey Signature) - , txRedeemers: (E.dictionary E.value E.value) :: _ (Map RedeemerPtr String) + , txScripts: (E.dictionary E.value E.value) :: _ (Map String String) , txData: (E.dictionary E.value E.value) :: _ (Map DatumHash String) + , txMetadata: (E.maybe E.value) :: _ (Maybe String) } ) instance DecodeJson Tx where decodeJson = defer \_ -> D.decode $ ( Tx <$> D.record "Tx" - { txInputs: D.value :: _ (Set TxIn) - , txCollateral: D.value :: _ (Set TxIn) + { txInputs: D.value :: _ (Array TxInput) + , txCollateral: D.value :: _ (Array TxInput) , txOutputs: D.value :: _ (Array TxOut) , txMint: D.value :: _ Value , txFee: D.value :: _ Value , txValidRange: D.value :: _ (Interval Slot) - , txMintScripts: D.value :: _ (Set MintingPolicy) + , txMintingScripts: (D.dictionary D.value D.value) :: _ (Map String String) + , txWithdrawals: D.value :: _ (Array Withdrawal) + , txCertificates: D.value :: _ (Array Certificate) , txSignatures: (D.dictionary D.value D.value) :: _ (Map PubKey Signature) - , txRedeemers: (D.dictionary D.value D.value) :: _ (Map RedeemerPtr String) + , txScripts: (D.dictionary D.value D.value) :: _ (Map String String) , txData: (D.dictionary D.value D.value) :: _ (Map DatumHash String) + , txMetadata: (D.maybe D.value) :: _ (Maybe String) } ) @@ -86,42 +97,5 @@ derive instance Newtype Tx _ -------------------------------------------------------------------------------- -_Tx :: Iso' Tx { txInputs :: Set TxIn, txCollateral :: Set TxIn, txOutputs :: Array TxOut, txMint :: Value, txFee :: Value, txValidRange :: Interval Slot, txMintScripts :: Set MintingPolicy, txSignatures :: Map PubKey Signature, txRedeemers :: Map RedeemerPtr String, txData :: Map DatumHash String } +_Tx :: Iso' Tx { txInputs :: Array TxInput, txCollateral :: Array TxInput, txOutputs :: Array TxOut, txMint :: Value, txFee :: Value, txValidRange :: Interval Slot, txMintingScripts :: Map String String, txWithdrawals :: Array Withdrawal, txCertificates :: Array Certificate, txSignatures :: Map PubKey Signature, txScripts :: Map String String, txData :: Map DatumHash String, txMetadata :: Maybe String } _Tx = _Newtype - --------------------------------------------------------------------------------- - -newtype TxOutTx = TxOutTx - { txOutTxTx :: Tx - , txOutTxOut :: TxOut - } - -derive instance Eq TxOutTx - -instance Show TxOutTx where - show a = genericShow a - -instance EncodeJson TxOutTx where - encodeJson = defer \_ -> E.encode $ unwrap >$< - ( E.record - { txOutTxTx: E.value :: _ Tx - , txOutTxOut: E.value :: _ TxOut - } - ) - -instance DecodeJson TxOutTx where - decodeJson = defer \_ -> D.decode $ - ( TxOutTx <$> D.record "TxOutTx" - { txOutTxTx: D.value :: _ Tx - , txOutTxOut: D.value :: _ TxOut - } - ) - -derive instance Generic TxOutTx _ - -derive instance Newtype TxOutTx _ - --------------------------------------------------------------------------------- - -_TxOutTx :: Iso' TxOutTx { txOutTxTx :: Tx, txOutTxOut :: TxOut } -_TxOutTx = _Newtype diff --git a/plutus-playground-client/generated/Wallet/Rollup/Types.purs b/plutus-playground-client/generated/Wallet/Rollup/Types.purs index 890be6ca81..835139303d 100644 --- a/plutus-playground-client/generated/Wallet/Rollup/Types.purs +++ b/plutus-playground-client/generated/Wallet/Rollup/Types.purs @@ -20,7 +20,7 @@ import Data.Newtype (class Newtype, unwrap) import Data.Show.Generic (genericShow) import Data.Tuple.Nested ((/\)) import Ledger.Address (PaymentPubKeyHash) -import Ledger.Tx.Internal (Tx) +import Ledger.Tx.Types.Tx (Tx) import Plutus.V1.Ledger.Tx (TxId, TxIn, TxOut) import Plutus.V1.Ledger.Value (Value) import Type.Proxy (Proxy(Proxy)) diff --git a/plutus-playground-client/generated/evaluation_response0.json b/plutus-playground-client/generated/evaluation_response0.json index 09d2800653..ab0acb5b86 100644 --- a/plutus-playground-client/generated/evaluation_response0.json +++ b/plutus-playground-client/generated/evaluation_response0.json @@ -13,12 +13,14 @@ }, { "contents": { + "txCertificates": [], "txCollateral": [], "txData": [], "txFee": { "getValue": [] }, "txInputs": [], + "txMetadata": null, "txMint": { "getValue": [ [ @@ -36,7 +38,7 @@ ] ] }, - "txMintScripts": [], + "txMintingScripts": [], "txOutputs": [ { "txOutAddress": { @@ -619,7 +621,7 @@ } } ], - "txRedeemers": [], + "txScripts": [], "txSignatures": [], "txValidRange": { "ivFrom": [ @@ -634,7 +636,8 @@ }, true ] - } + }, + "txWithdrawals": [] }, "tag": "EmulatorTx" }, @@ -846,12 +849,14 @@ "txIndex": 0 }, "tx": { + "txCertificates": [], "txCollateral": [], "txData": [], "txFee": { "getValue": [] }, "txInputs": [], + "txMetadata": null, "txMint": { "getValue": [ [ @@ -869,7 +874,7 @@ ] ] }, - "txMintScripts": [], + "txMintingScripts": [], "txOutputs": [ { "txOutAddress": { @@ -1452,7 +1457,7 @@ } } ], - "txRedeemers": [], + "txScripts": [], "txSignatures": [], "txValidRange": { "ivFrom": [ @@ -1467,7 +1472,8 @@ }, true ] - } + }, + "txWithdrawals": [] }, "txId": { "getTxId": "0312c21da481701ccdc534cdc3d080111f688e5ba147eb5d74865fb180be287a"