plutus-ledger-0.1.0.0: Wallet API
Safe HaskellNone
LanguageHaskell2010

Ledger.Tx.CardanoAPI

Description

Interface to the transaction types from 'cardano-api'

Synopsis

Documentation

data SomeCardanoApiTx where Source #

Cardano tx from any era.

Constructors

SomeTx :: IsCardanoEra era => Tx era -> EraInMode era CardanoMode -> SomeCardanoApiTx 

Instances

Instances details
Eq SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Show SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

ToJSON SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

FromJSON SomeCardanoApiTx Source #

Converting SomeCardanoApiTx to JSON.

If the "tx" field is from an unknown era, the JSON parser will print an error at runtime while parsing.

Instance details

Defined in Ledger.Tx.CardanoAPI

ToSchema SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Serialise SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Pretty SomeCardanoApiTx Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

fromTxScriptValidity :: TxScriptValidity era -> Bool Source #

Given a 'C.TxScriptValidity era', if the era supports scripts, return a True or False depending on script validity. If the era does not support scripts, always return True.

scriptDataFromCardanoTxBody :: TxBody era -> (Map DatumHash Datum, Map RedeemerHash Redeemer) Source #

Given a 'C.TxBody from a 'C.Tx era', return the datums and redeemers along with their hashes.

plutusScriptsFromTxBody :: TxBody era -> Map ScriptHash Script Source #

Extract plutus scripts from a Cardano API tx body.

Note that Plutus scripts are only supported in Alonzo era and onwards.

toCardanoTxBody Source #

Arguments

:: [PaymentPubKeyHash]

Required signers of the transaction

-> Maybe ProtocolParameters

Protocol parameters to use. Building Plutus transactions will fail if this is Nothing

-> NetworkId

Network ID

-> Tx 
-> Either ToCardanoError (TxBody AlonzoEra) 

toCardanoTxBodyContent Source #

Arguments

:: [PaymentPubKeyHash]

Required signers of the transaction

-> Maybe ProtocolParameters

Protocol parameters to use. Building Plutus transactions will fail if this is Nothing

-> NetworkId

Network ID

-> Tx 
-> Either ToCardanoError (TxBodyContent BuildTx AlonzoEra) 

data ToCardanoError Source #

Instances

Instances details
Eq ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Show ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Generic ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Associated Types

type Rep ToCardanoError :: Type -> Type Source #

ToJSON ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

FromJSON ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Pretty ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

type Rep ToCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

type Rep ToCardanoError = D1 ('MetaData "ToCardanoError" "Ledger.Tx.CardanoAPI" "plutus-ledger-0.1.0.0-BAhdPNOPbMF52ZvZJtxBkz" 'False) (((C1 ('MetaCons "TxBodyError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: (C1 ('MetaCons "DeserialisationError" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InvalidValidityRange" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ValueNotPureAda" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "OutputHasZeroAda" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "StakingPointersNotSupported" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "SimpleScriptsNotSupportedToCardano" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MissingTxInType" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MissingMintingPolicyRedeemer" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "MissingMintingPolicy" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ScriptPurposeNotSupported" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ScriptTag)) :+: C1 ('MetaCons "Tag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ToCardanoError))))))

data FromCardanoError Source #

Instances

Instances details
Eq FromCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Show FromCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Generic FromCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Associated Types

type Rep FromCardanoError :: Type -> Type Source #

ToJSON FromCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

FromJSON FromCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

Pretty FromCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

ToObject FromCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

type Rep FromCardanoError Source # 
Instance details

Defined in Ledger.Tx.CardanoAPI

type Rep FromCardanoError = D1 ('MetaData "FromCardanoError" "Ledger.Tx.CardanoAPI" "plutus-ledger-0.1.0.0-BAhdPNOPbMF52ZvZJtxBkz" 'False) (C1 ('MetaCons "SimpleScriptsNotSupported" 'PrefixI 'False) (U1 :: Type -> Type))

Orphan instances

Typeable era => ToSchema (Tx era) Source # 
Instance details

(Typeable era, Typeable mode) => ToSchema (EraInMode era mode) Source # 
Instance details