Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data TxOutRef = TxOutRef {
- txOutRefId :: TxId
- txOutRefIdx :: Integer
- inScripts :: TxIn -> Maybe (Validator, Redeemer, Datum)
- isPayToScriptOut :: TxOut -> Bool
- isPubKeyOut :: TxOut -> Bool
- pubKeyHashTxOut :: Value -> PubKeyHash -> TxOut
- pubKeyTxIns :: Fold (Set TxIn) TxIn
- scriptTxIns :: Fold (Set TxIn) TxIn
- data RedeemerPtr = RedeemerPtr ScriptTag Integer
- type Redeemers = Map RedeemerPtr Redeemer
- data ScriptTag
- data Language
- data Versioned script = Versioned {
- unversioned :: script
- version :: Language
- type ReferenceScript = ReferenceScript BabbageEra
- type MintingWitnessesMap = Map MintingPolicyHash (Redeemer, Maybe (Versioned TxOutRef))
- type ScriptsMap = Map ScriptHash (Versioned Script)
- newtype TxOut = TxOut {
- getTxOut :: TxOut CtxTx BabbageEra
- data Certificate = Certificate {}
- data Withdrawal = Withdrawal {}
- cardanoTxOutValue :: TxOut ctx era -> Value
- txOutValue :: TxOut -> Value
- outValue :: Lens TxOut TxOut Value (TxOutValue BabbageEra)
- outValue' :: Lens' TxOut (TxOutValue BabbageEra)
- toSizedTxOut :: TxOut -> Sized (TxOut StandardBabbage)
- toCtxUTxOTxOut :: TxOut -> TxOut CtxUTxO BabbageEra
- txOutDatumHash :: TxOut -> Maybe DatumHash
- txOutDatum :: forall d. FromData d => TxOut -> Maybe d
- cardanoTxOutDatumHash :: TxOutDatum CtxUTxO BabbageEra -> Maybe (Hash ScriptData)
- txOutPubKey :: TxOut -> Maybe PubKeyHash
- txOutAddress :: TxOut -> CardanoAddress
- outAddress :: Lens' TxOut (AddressInEra BabbageEra)
- outDatumHash :: Lens TxOut TxOut (Maybe DatumHash) (TxOutDatum CtxTx BabbageEra)
- txOutReferenceScript :: TxOut -> ReferenceScript
- outReferenceScript :: Lens' TxOut ReferenceScript
- lookupScript :: ScriptsMap -> ScriptHash -> Maybe (Versioned Script)
- lookupValidator :: ScriptsMap -> ValidatorHash -> Maybe (Versioned Validator)
- lookupMintingPolicy :: ScriptsMap -> MintingPolicyHash -> Maybe (Versioned MintingPolicy)
- lookupStakeValidator :: ScriptsMap -> StakeValidatorHash -> Maybe (Versioned StakeValidator)
- emptyTxBodyContent :: TxBodyContent BuildTx BabbageEra
- newtype TxId = TxId (Hash StandardCrypto EraIndependentTxBody)
- data TxIn = TxIn TxId TxIx
- newtype TxIx = TxIx Word
- data DecoratedTxOut
- = PublicKeyDecoratedTxOut { }
- | ScriptDecoratedTxOut {
- _decoratedTxOutValidatorHash :: ValidatorHash
- _decoratedTxOutStakingCredential :: Maybe StakingCredential
- _decoratedTxOutValue :: Value
- _decoratedTxOutScriptDatum :: (DatumHash, DatumFromQuery)
- _decoratedTxOutReferenceScript :: Maybe (Versioned Script)
- _decoratedTxOutValidator :: Maybe (Versioned Validator)
- toTxOut :: NetworkId -> DecoratedTxOut -> Either ToCardanoError TxOut
- toTxInfoTxOut :: DecoratedTxOut -> TxOut
- toDecoratedTxOut :: TxOut -> Maybe DecoratedTxOut
- decoratedTxOutPubKeyHash :: Traversal' DecoratedTxOut PubKeyHash
- decoratedTxOutAddress :: Getter DecoratedTxOut Address
- decoratedTxOutDatum :: Traversal' DecoratedTxOut (DatumHash, DatumFromQuery)
- decoratedTxOutValue :: Lens' DecoratedTxOut Value
- decoratedTxOutPubKeyDatum :: Traversal' DecoratedTxOut (Maybe (DatumHash, DatumFromQuery))
- decoratedTxOutScriptDatum :: Traversal' DecoratedTxOut (DatumHash, DatumFromQuery)
- decoratedTxOutStakingCredential :: Lens' DecoratedTxOut (Maybe StakingCredential)
- decoratedTxOutReferenceScript :: Lens' DecoratedTxOut (Maybe (Versioned Script))
- decoratedTxOutValidatorHash :: Traversal' DecoratedTxOut ValidatorHash
- decoratedTxOutValidator :: Traversal' DecoratedTxOut (Maybe (Versioned Validator))
- _PublicKeyDecoratedTxOut :: Prism' DecoratedTxOut (PubKeyHash, Maybe StakingCredential, Value, Maybe (DatumHash, DatumFromQuery), Maybe (Versioned Script))
- _ScriptDecoratedTxOut :: Prism' DecoratedTxOut (ValidatorHash, Maybe StakingCredential, Value, (DatumHash, DatumFromQuery), Maybe (Versioned Script), Maybe (Versioned Validator))
- _decoratedTxOutAddress :: DecoratedTxOut -> Address
- mkDecoratedTxOut :: CardanoAddress -> Value -> Maybe (DatumHash, DatumFromQuery) -> Maybe (Versioned Script) -> Maybe DecoratedTxOut
- mkPubkeyDecoratedTxOut :: CardanoAddress -> Value -> Maybe (DatumHash, DatumFromQuery) -> Maybe (Versioned Script) -> Maybe DecoratedTxOut
- mkScriptDecoratedTxOut :: CardanoAddress -> Value -> (DatumHash, DatumFromQuery) -> Maybe (Versioned Script) -> Maybe (Versioned Validator) -> Maybe DecoratedTxOut
- data DatumFromQuery
- datumInDatumFromQuery :: Traversal' DatumFromQuery Datum
- getCardanoTxId :: CardanoTx -> TxId
- getCardanoTxInputs :: CardanoTx -> [TxIn]
- getCardanoTxCollateralInputs :: CardanoTx -> [TxIn]
- getCardanoTxOutRefs :: CardanoTx -> [(TxOut, TxIn)]
- getCardanoTxOutputs :: CardanoTx -> [TxOut]
- getCardanoTxRedeemers :: CardanoTx -> Redeemers
- getCardanoTxSpentOutputs :: CardanoTx -> Set TxIn
- getCardanoTxProducedOutputs :: CardanoTx -> Map TxIn TxOut
- getCardanoTxReturnCollateral :: CardanoTx -> Maybe TxOut
- getCardanoTxProducedReturnCollateral :: CardanoTx -> Map TxIn TxOut
- getCardanoTxTotalCollateral :: CardanoTx -> Maybe Lovelace
- getCardanoTxFee :: CardanoTx -> Lovelace
- getCardanoTxMint :: CardanoTx -> Value
- getCardanoTxValidityRange :: CardanoTx -> SlotRange
- getCardanoTxData :: CardanoTx -> Map DatumHash Datum
- data CardanoTx where
- CardanoTx :: IsCardanoEra era => Tx era -> EraInMode era CardanoMode -> CardanoTx
- pattern CardanoEmulatorEraTx :: Tx BabbageEra -> CardanoTx
- data ToCardanoError
- = TxBodyError String
- | DeserialisationError
- | InvalidValidityRange
- | ValueNotPureAda
- | OutputHasZeroAda
- | StakingPointersNotSupported
- | SimpleScriptsNotSupportedToCardano
- | MissingInputValidator
- | MissingDatum
- | MissingMintingPolicy
- | ScriptPurposeNotSupported ScriptTag
- | MissingMintingPolicyRedeemer
- | MissingStakeValidator
- | UnsupportedPlutusVersion Language
- | Tag String ToCardanoError
- addCardanoTxSignature :: PrivateKey -> CardanoTx -> CardanoTx
- getTxBodyContentInputs :: TxBodyContent ctx era -> [TxIn]
- getTxBodyContentCollateralInputs :: TxBodyContent ctx era -> [TxIn]
- getTxBodyContentReturnCollateral :: TxBodyContent ctx BabbageEra -> Maybe TxOut
- getTxBodyContentMint :: TxBodyContent ctx era -> Value
- txBodyContentIns :: Lens' (TxBodyContent BuildTx BabbageEra) [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra))]
- txBodyContentCollateralIns :: Lens' (TxBodyContent BuildTx BabbageEra) [TxIn]
- txBodyContentOuts :: Lens' (TxBodyContent ctx BabbageEra) [TxOut]
- decoratedTxOutPlutusValue :: DecoratedTxOut -> Value
- fromDecoratedIndex :: NetworkId -> Map TxOutRef DecoratedTxOut -> Either ToCardanoError UtxoIndex
Documentation
TxOutRef | |
|
Instances
isPayToScriptOut :: TxOut -> Bool #
isPubKeyOut :: TxOut -> Bool #
pubKeyHashTxOut :: Value -> PubKeyHash -> TxOut #
pubKeyTxIns :: Fold (Set TxIn) TxIn #
scriptTxIns :: Fold (Set TxIn) TxIn #
data RedeemerPtr #
Instances
type Redeemers = Map RedeemerPtr Redeemer #
Instances
Instances
Versioned | |
|
Instances
Functor Versioned | |
Eq script => Eq (Versioned script) | |
Ord script => Ord (Versioned script) | |
Defined in Plutus.Script.Utils.Scripts compare :: Versioned script -> Versioned script -> Ordering Source # (<) :: Versioned script -> Versioned script -> Bool Source # (<=) :: Versioned script -> Versioned script -> Bool Source # (>) :: Versioned script -> Versioned script -> Bool Source # (>=) :: Versioned script -> Versioned script -> Bool Source # max :: Versioned script -> Versioned script -> Versioned script Source # min :: Versioned script -> Versioned script -> Versioned script Source # | |
Show script => Show (Versioned script) | |
Generic (Versioned script) | |
Serialise script => Serialise (Versioned script) | |
Defined in Plutus.Script.Utils.Scripts encode :: Versioned script -> Encoding decode :: Decoder s (Versioned script) encodeList :: [Versioned script] -> Encoding decodeList :: Decoder s [Versioned script] | |
FromJSON script => FromJSON (Versioned script) | |
Defined in Plutus.Script.Utils.Scripts parseJSON :: Value -> Parser (Versioned script) parseJSONList :: Value -> Parser [Versioned script] | |
ToJSON script => ToJSON (Versioned script) | |
Defined in Plutus.Script.Utils.Scripts toJSON :: Versioned script -> Value toEncoding :: Versioned script -> Encoding toJSONList :: [Versioned script] -> Value toEncodingList :: [Versioned script] -> Encoding | |
Pretty script => Pretty (Versioned script) | |
Defined in Plutus.Script.Utils.Scripts | |
type Rep (Versioned script) | |
Defined in Plutus.Script.Utils.Scripts type Rep (Versioned script) = D1 ('MetaData "Versioned" "Plutus.Script.Utils.Scripts" "plutus-script-utils-1.2.0.0-5TpLCy32WGLK5IaOxcwe9j" 'False) (C1 ('MetaCons "Versioned" 'PrefixI 'True) (S1 ('MetaSel ('Just "unversioned") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 script) :*: S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Language))) |
type ReferenceScript = ReferenceScript BabbageEra Source #
type MintingWitnessesMap = Map MintingPolicyHash (Redeemer, Maybe (Versioned TxOutRef)) Source #
type ScriptsMap = Map ScriptHash (Versioned Script) Source #
Instances
Eq TxOut Source # | |
Show TxOut Source # | |
Generic TxOut Source # | |
Serialise TxOut Source # | |
Defined in Ledger.Tx.Internal encodeList :: [TxOut] -> Encoding decodeList :: Decoder s [TxOut] | |
FromJSON TxOut Source # | |
Defined in Ledger.Tx.Internal parseJSON :: Value -> Parser TxOut parseJSONList :: Value -> Parser [TxOut] | |
ToJSON TxOut Source # | |
Defined in Ledger.Tx.Internal | |
Pretty TxOut Source # | |
Defined in Ledger.Tx.Internal | |
FromCBOR TxOut Source # | |
ToCBOR TxOut Source # | |
Defined in Ledger.Tx.Internal encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy TxOut -> Size encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [TxOut] -> Size | |
type Rep TxOut Source # | |
Defined in Ledger.Tx.Internal |
data Certificate Source #
Certificate | |
|
Instances
data Withdrawal Source #
Stake withdrawal, if applicable the script should be included in txScripts.
Withdrawal | |
|
Instances
cardanoTxOutValue :: TxOut ctx era -> Value Source #
txOutValue :: TxOut -> Value Source #
toSizedTxOut :: TxOut -> Sized (TxOut StandardBabbage) Source #
toCtxUTxOTxOut :: TxOut -> TxOut CtxUTxO BabbageEra Source #
txOutDatumHash :: TxOut -> Maybe DatumHash Source #
Get a hash from the stored TxOutDatum (either directly or by hashing the inlined datum)
txOutDatum :: forall d. FromData d => TxOut -> Maybe d Source #
cardanoTxOutDatumHash :: TxOutDatum CtxUTxO BabbageEra -> Maybe (Hash ScriptData) Source #
txOutPubKey :: TxOut -> Maybe PubKeyHash Source #
txOutAddress :: TxOut -> CardanoAddress Source #
outAddress :: Lens' TxOut (AddressInEra BabbageEra) Source #
outReferenceScript :: Lens' TxOut ReferenceScript Source #
lookupScript :: ScriptsMap -> ScriptHash -> Maybe (Versioned Script) Source #
lookupValidator :: ScriptsMap -> ValidatorHash -> Maybe (Versioned Validator) Source #
lookupStakeValidator :: ScriptsMap -> StakeValidatorHash -> Maybe (Versioned StakeValidator) Source #
emptyTxBodyContent :: TxBodyContent BuildTx BabbageEra Source #
TxId (Hash StandardCrypto EraIndependentTxBody) |
Instances
Eq TxId | |
Ord TxId | |
Show TxId | |
IsString TxId | |
Defined in Cardano.Api.TxIn fromString :: String -> TxId Source # | |
Generic TxId Source # | |
Serialise TxId | |
Defined in Ledger.Tx.Orphans encodeList :: [TxId] -> Encoding decodeList :: Decoder s [TxId] | |
FromJSON TxId | |
Defined in Cardano.Api.TxIn parseJSON :: Value -> Parser TxId parseJSONList :: Value -> Parser [TxId] | |
FromJSONKey TxId | |
Defined in Cardano.Api.TxIn fromJSONKey :: FromJSONKeyFunction TxId fromJSONKeyList :: FromJSONKeyFunction [TxId] | |
ToJSON TxId | |
Defined in Cardano.Api.TxIn | |
ToJSONKey TxId | |
Defined in Cardano.Api.TxIn toJSONKey :: ToJSONKeyFunction TxId toJSONKeyList :: ToJSONKeyFunction [TxId] | |
Pretty TxId Source # | |
Defined in Ledger.Tx.Orphans | |
HasTypeProxy TxId | |
SerialiseAsRawBytes TxId | |
Defined in Cardano.Api.TxIn serialiseToRawBytes :: TxId -> ByteString deserialiseFromRawBytes :: AsType TxId -> ByteString -> Maybe TxId | |
type Rep TxId Source # | |
Defined in Ledger.Tx.Orphans | |
data AsType TxId | |
Defined in Cardano.Api.TxIn |
Instances
Instances
Enum TxIx | |
Eq TxIx | |
Ord TxIx | |
Show TxIx | |
Generic TxIx Source # | |
Serialise TxIx | |
Defined in Ledger.Tx.Orphans encodeList :: [TxIx] -> Encoding decodeList :: Decoder s [TxIx] | |
FromJSON TxIx | |
Defined in Cardano.Api.TxIn parseJSON :: Value -> Parser TxIx parseJSONList :: Value -> Parser [TxIx] | |
ToJSON TxIx | |
Defined in Cardano.Api.TxIn | |
type Rep TxIx Source # | |
Defined in Ledger.Tx.Orphans |
DecoratedTxOut
data DecoratedTxOut Source #
Offchain view of a transaction output.
PublicKeyDecoratedTxOut | |
| |
ScriptDecoratedTxOut | |
|
Instances
toTxOut :: NetworkId -> DecoratedTxOut -> Either ToCardanoError TxOut Source #
toTxInfoTxOut :: DecoratedTxOut -> TxOut Source #
Converts a transaction output from the chain index to the plutus-ledger-api transaction output.
Note that DecoratedTxOut
supports features such inline datums and
reference scripts which are not supported by V1 TxOut. Converting from
DecoratedTxOut
to TxOut
and back is therefore lossy.
Lenses and Prisms
decoratedTxOutPubKeyHash :: Traversal' DecoratedTxOut PubKeyHash Source #
decoratedTxOutAddress :: Getter DecoratedTxOut Address Source #
decoratedTxOutDatum :: Traversal' DecoratedTxOut (DatumHash, DatumFromQuery) Source #
decoratedTxOutValue :: Lens' DecoratedTxOut Value Source #
decoratedTxOutPubKeyDatum :: Traversal' DecoratedTxOut (Maybe (DatumHash, DatumFromQuery)) Source #
decoratedTxOutScriptDatum :: Traversal' DecoratedTxOut (DatumHash, DatumFromQuery) Source #
decoratedTxOutReferenceScript :: Lens' DecoratedTxOut (Maybe (Versioned Script)) Source #
decoratedTxOutValidatorHash :: Traversal' DecoratedTxOut ValidatorHash Source #
decoratedTxOutValidator :: Traversal' DecoratedTxOut (Maybe (Versioned Validator)) Source #
_PublicKeyDecoratedTxOut :: Prism' DecoratedTxOut (PubKeyHash, Maybe StakingCredential, Value, Maybe (DatumHash, DatumFromQuery), Maybe (Versioned Script)) Source #
_ScriptDecoratedTxOut :: Prism' DecoratedTxOut (ValidatorHash, Maybe StakingCredential, Value, (DatumHash, DatumFromQuery), Maybe (Versioned Script), Maybe (Versioned Validator)) Source #
smart Constructors
mkDecoratedTxOut :: CardanoAddress -> Value -> Maybe (DatumHash, DatumFromQuery) -> Maybe (Versioned Script) -> Maybe DecoratedTxOut Source #
mkPubkeyDecoratedTxOut :: CardanoAddress -> Value -> Maybe (DatumHash, DatumFromQuery) -> Maybe (Versioned Script) -> Maybe DecoratedTxOut Source #
mkScriptDecoratedTxOut :: CardanoAddress -> Value -> (DatumHash, DatumFromQuery) -> Maybe (Versioned Script) -> Maybe (Versioned Validator) -> Maybe DecoratedTxOut Source #
DatumFromQuery
data DatumFromQuery Source #
A datum in a transaction output that comes from a chain index query.
Instances
datumInDatumFromQuery :: Traversal' DatumFromQuery Datum Source #
Transactions
getCardanoTxId :: CardanoTx -> TxId Source #
getCardanoTxInputs :: CardanoTx -> [TxIn] Source #
getCardanoTxCollateralInputs :: CardanoTx -> [TxIn] Source #
getCardanoTxOutputs :: CardanoTx -> [TxOut] Source #
getCardanoTxSpentOutputs :: CardanoTx -> Set TxIn Source #
getCardanoTxFee :: CardanoTx -> Lovelace Source #
getCardanoTxMint :: CardanoTx -> Value Source #
Cardano tx from any era.
pattern CardanoEmulatorEraTx :: Tx BabbageEra -> CardanoTx |
Instances
Eq CardanoTx Source # | |
Show CardanoTx Source # | |
Serialise CardanoTx Source # | |
Defined in Ledger.Tx.CardanoAPI.Internal encode :: CardanoTx -> Encoding encodeList :: [CardanoTx] -> Encoding decodeList :: Decoder s [CardanoTx] | |
FromJSON CardanoTx Source # | Converting If the "tx" field is from an unknown era, the JSON parser will print an error at runtime while parsing. |
Defined in Ledger.Tx.CardanoAPI.Internal parseJSON :: Value -> Parser CardanoTx parseJSONList :: Value -> Parser [CardanoTx] | |
ToJSON CardanoTx Source # | |
Defined in Ledger.Tx.CardanoAPI.Internal toEncoding :: CardanoTx -> Encoding toJSONList :: [CardanoTx] -> Value toEncodingList :: [CardanoTx] -> Encoding | |
Pretty CardanoTx Source # | |
data ToCardanoError Source #
Instances
addCardanoTxSignature :: PrivateKey -> CardanoTx -> CardanoTx Source #
TxBodyContent functions
getTxBodyContentInputs :: TxBodyContent ctx era -> [TxIn] Source #
getTxBodyContentCollateralInputs :: TxBodyContent ctx era -> [TxIn] Source #
getTxBodyContentReturnCollateral :: TxBodyContent ctx BabbageEra -> Maybe TxOut Source #
getTxBodyContentMint :: TxBodyContent ctx era -> Value Source #
txBodyContentIns :: Lens' (TxBodyContent BuildTx BabbageEra) [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn BabbageEra))] Source #
txBodyContentCollateralIns :: Lens' (TxBodyContent BuildTx BabbageEra) [TxIn] Source #
txBodyContentOuts :: Lens' (TxBodyContent ctx BabbageEra) [TxOut] Source #
Utility
decoratedTxOutPlutusValue :: DecoratedTxOut -> Value Source #
fromDecoratedIndex :: NetworkId -> Map TxOutRef DecoratedTxOut -> Either ToCardanoError UtxoIndex Source #
Orphan instances
Pretty CardanoTx Source # | |
Pretty CardanoBuildTx Source # | |
pretty :: CardanoBuildTx -> Doc ann # prettyList :: [CardanoBuildTx] -> Doc ann # |