plutus-chain-index-core-1.2.0.0
Safe Haskell None
Language Haskell2010

Plutus.ChainIndex.Tx

Contents

Description

The chain index' version of a transaction

Synopsis

Documentation

data ChainIndexTx Source #

Constructors

ChainIndexTx

Fields

Instances

Instances details
Eq ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToSchema ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.Types

Serialise ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.Types

HasDbType ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

HasDbType ( TxId , ChainIndexTx ) Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

type Rep ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.Types

type DbType ChainIndexTx Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

type DbType ( TxId , ChainIndexTx ) Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

data ChainIndexTxOutputs Source #

List of outputs of a transaction. There is only an optional collateral output if the transaction is invalid.

Constructors

InvalidTx ( Maybe ChainIndexTxOut )

The transaction is invalid so there is maybe a collateral output.

ValidTx [ ChainIndexTxOut ]

Instances

Instances details
Eq ChainIndexTxOutputs Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show ChainIndexTxOutputs Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic ChainIndexTxOutputs Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON ChainIndexTxOutputs Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON ChainIndexTxOutputs Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToSchema ChainIndexTxOutputs Source #
Instance details

Defined in Plutus.ChainIndex.Types

Serialise ChainIndexTxOutputs Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep ChainIndexTxOutputs Source #
Instance details

Defined in Plutus.ChainIndex.Types

data ChainIndexTxOut Source #

Constructors

ChainIndexTxOut

Fields

Instances

Instances details
Eq ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToSchema ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.Types

Serialise ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.Types

HasDbType ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

type Rep ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.Types

type DbType ChainIndexTxOut Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

data ReferenceScript Source #

Instances

Instances details
Eq ReferenceScript Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show ReferenceScript Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic ReferenceScript Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON ReferenceScript Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON ReferenceScript Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToSchema ReferenceScript Source #
Instance details

Defined in Plutus.ChainIndex.Types

Serialise ReferenceScript Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep ReferenceScript Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep ReferenceScript = D1 (' MetaData "ReferenceScript" "Plutus.ChainIndex.Types" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' False ) ( C1 (' MetaCons "ReferenceScriptNone" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "ReferenceScriptInAnyLang" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedStrict ) ( Rec0 ScriptInAnyLang )))

data Address Source #

Address with two kinds of credentials, normal and staking.

Instances

Instances details
Eq Address
Instance details

Defined in Plutus.V1.Ledger.Address

Ord Address
Instance details

Defined in Plutus.V1.Ledger.Address

Show Address
Instance details

Defined in Plutus.V1.Ledger.Address

Generic Address
Instance details

Defined in Plutus.V1.Ledger.Address

NFData Address
Instance details

Defined in Plutus.V1.Ledger.Address

Pretty Address
Instance details

Defined in Plutus.V1.Ledger.Address

UnsafeFromData Address
Instance details

Defined in Plutus.V1.Ledger.Address

FromData Address
Instance details

Defined in Plutus.V1.Ledger.Address

ToData Address
Instance details

Defined in Plutus.V1.Ledger.Address

Eq Address
Instance details

Defined in Plutus.V1.Ledger.Address

Lift DefaultUni Address
Instance details

Defined in Plutus.V1.Ledger.Address

Typeable DefaultUni Address
Instance details

Defined in Plutus.V1.Ledger.Address

type Rep Address
Instance details

Defined in Plutus.V1.Ledger.Address

type Rep Address = D1 (' MetaData "Address" "Plutus.V1.Ledger.Address" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" ' False ) ( C1 (' MetaCons "Address" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "addressCredential") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Credential ) :*: S1 (' MetaSel (' Just "addressStakingCredential") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Maybe StakingCredential ))))

data OutputDatum Source #

The datum attached to an output: either nothing; a datum hash; or the datum itself (an "inline datum").

Instances

Instances details
Eq OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

Show OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

Generic OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

NFData OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

ToSchema OutputDatum Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

UnsafeFromData OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

FromData OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

ToData OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

Eq OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

Lift DefaultUni OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

Typeable DefaultUni OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

type Rep OutputDatum
Instance details

Defined in Plutus.V2.Ledger.Tx

newtype Value Source #

A cryptocurrency value. This is a map from CurrencySymbol s to a quantity of that currency.

Operations on currencies are usually implemented pointwise . That is, we apply the operation to the quantities for each currency in turn. So when we add two Value s the resulting Value has, for each currency, the sum of the quantities of that particular currency in the argument Value . The effect of this is that the currencies in the Value are "independent", and are operated on separately.

Whenever we need to get the quantity of a currency in a Value where there is no explicit quantity of that currency in the Value , then the quantity is taken to be zero.

See note [Currencies] for more details.

Instances

Instances details
Eq Value
Instance details

Defined in Plutus.V1.Ledger.Value

Data Value
Instance details

Defined in Plutus.V1.Ledger.Value

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Value -> c Value Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c Value Source #

toConstr :: Value -> Constr Source #

dataTypeOf :: Value -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c Value ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c Value ) Source #

gmapT :: ( forall b. Data b => b -> b) -> Value -> Value Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Value -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Value -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> Value -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> Value -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Value -> m Value Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Value -> m Value Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Value -> m Value Source #

Show Value
Instance details

Defined in Plutus.V1.Ledger.Value

Generic Value
Instance details

Defined in Plutus.V1.Ledger.Value

Semigroup Value
Instance details

Defined in Plutus.V1.Ledger.Value

Monoid Value
Instance details

Defined in Plutus.V1.Ledger.Value

NFData Value
Instance details

Defined in Plutus.V1.Ledger.Value

ToSchema Value Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty Value
Instance details

Defined in Plutus.V1.Ledger.Value

UnsafeFromData Value
Instance details

Defined in Plutus.V1.Ledger.Value

FromData Value
Instance details

Defined in Plutus.V1.Ledger.Value

ToData Value
Instance details

Defined in Plutus.V1.Ledger.Value

JoinSemiLattice Value
Instance details

Defined in Plutus.V1.Ledger.Value

MeetSemiLattice Value
Instance details

Defined in Plutus.V1.Ledger.Value

AdditiveSemigroup Value
Instance details

Defined in Plutus.V1.Ledger.Value

AdditiveMonoid Value
Instance details

Defined in Plutus.V1.Ledger.Value

AdditiveGroup Value
Instance details

Defined in Plutus.V1.Ledger.Value

Monoid Value
Instance details

Defined in Plutus.V1.Ledger.Value

Group Value
Instance details

Defined in Plutus.V1.Ledger.Value

Semigroup Value
Instance details

Defined in Plutus.V1.Ledger.Value

Eq Value
Instance details

Defined in Plutus.V1.Ledger.Value

Module Integer Value
Instance details

Defined in Plutus.V1.Ledger.Value

Lift DefaultUni Value
Instance details

Defined in Plutus.V1.Ledger.Value

Typeable DefaultUni Value
Instance details

Defined in Plutus.V1.Ledger.Value

type Rep Value
Instance details

Defined in Plutus.V1.Ledger.Value

type Rep Value = D1 (' MetaData "Value" "Plutus.V1.Ledger.Value" "plutus-ledger-api-1.0.0.1-GlUFhIIE0LJGuJDDdHh5lQ" ' True ) ( C1 (' MetaCons "Value" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getValue") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Map CurrencySymbol ( Map TokenName Integer )))))

fromOnChainTx :: OnChainTx -> ChainIndexTx Source #

Convert a OnChainTx to a ChainIndexTx . An invalid OnChainTx will not produce any ChainIndexTx outputs and the collateral inputs of the OnChainTx will be the inputs of the ChainIndexTx .

Cardano api transactions store validity internally. Our emulated blockchain stores validity outside of the transactions, so we need to make sure these match up.

txOutRefs :: ChainIndexTx -> [ TxOutRef ] Source #

Get tx output references from tx.

txOutsWithRef :: ChainIndexTx -> [( ChainIndexTxOut , TxOutRef )] Source #

Get tx output references and tx outputs from tx.

txOutRefMapForAddr :: CardanoAddress -> ChainIndexTx -> Map TxOutRef ( ChainIndexTxOut , ChainIndexTx ) Source #

Get Map of tx outputs from tx for a specific address.

Lenses