marlowe-runtime-0.0.5: Runtime system for running Marlowe financial contracts on the Cardano Computation Layer
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Marlowe.Runtime.Indexer.Types

Synopsis

Documentation

data MarloweBlock Source #

Constructors

MarloweBlock 

Instances

Instances details
Generic MarloweBlock Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Associated Types

type Rep MarloweBlock :: Type -> Type Source #

Show MarloweBlock Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Eq MarloweBlock Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

type Rep MarloweBlock Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

type Rep MarloweBlock = D1 ('MetaData "MarloweBlock" "Language.Marlowe.Runtime.Indexer.Types" "marlowe-runtime-0.0.5-JktrJhpUQi4IpTDTYokofB-indexer" 'False) (C1 ('MetaCons "MarloweBlock" 'PrefixI 'True) (S1 ('MetaSel ('Just "blockHeader") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BlockHeader) :*: S1 ('MetaSel ('Just "transactions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NonEmpty MarloweTransaction))))

data MarloweTransaction Source #

Instances

Instances details
Generic MarloweTransaction Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Associated Types

type Rep MarloweTransaction :: Type -> Type Source #

Show MarloweTransaction Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Eq MarloweTransaction Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

type Rep MarloweTransaction Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

type Rep MarloweTransaction = D1 ('MetaData "MarloweTransaction" "Language.Marlowe.Runtime.Indexer.Types" "marlowe-runtime-0.0.5-JktrJhpUQi4IpTDTYokofB-indexer" 'False) ((C1 ('MetaCons "CreateTransaction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 MarloweCreateTransaction)) :+: C1 ('MetaCons "ApplyInputsTransaction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 MarloweApplyInputsTransaction))) :+: (C1 ('MetaCons "WithdrawTransaction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 MarloweWithdrawTransaction)) :+: (C1 ('MetaCons "InvalidCreateTransaction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ContractId) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExtractCreationError)) :+: C1 ('MetaCons "InvalidApplyInputsTransaction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TxId) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Set TxOutRef)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExtractMarloweTransactionError))))))

data MarloweCreateTransaction Source #

Constructors

MarloweCreateTransaction 

Fields

data MarloweWithdrawTransaction Source #

Constructors

MarloweWithdrawTransaction 

Fields

Instances

Instances details
Generic MarloweWithdrawTransaction Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Associated Types

type Rep MarloweWithdrawTransaction :: Type -> Type Source #

Show MarloweWithdrawTransaction Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Eq MarloweWithdrawTransaction Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

type Rep MarloweWithdrawTransaction Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

type Rep MarloweWithdrawTransaction = D1 ('MetaData "MarloweWithdrawTransaction" "Language.Marlowe.Runtime.Indexer.Types" "marlowe-runtime-0.0.5-JktrJhpUQi4IpTDTYokofB-indexer" 'False) (C1 ('MetaCons "MarloweWithdrawTransaction" 'PrefixI 'True) (S1 ('MetaSel ('Just "consumedPayouts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map ContractId (Set TxOutRef))) :*: S1 ('MetaSel ('Just "consumingTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TxId)))

data MarloweUTxO Source #

The global Marlowe UTxO set

Constructors

MarloweUTxO 

Fields

Instances

Instances details
ToJSON MarloweUTxO Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Methods

toJSON :: MarloweUTxO -> Value

toEncoding :: MarloweUTxO -> Encoding

toJSONList :: [MarloweUTxO] -> Value

toEncodingList :: [MarloweUTxO] -> Encoding

Generic MarloweUTxO Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Associated Types

type Rep MarloweUTxO :: Type -> Type Source #

Show MarloweUTxO Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Eq MarloweUTxO Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

type Rep MarloweUTxO Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

type Rep MarloweUTxO = D1 ('MetaData "MarloweUTxO" "Language.Marlowe.Runtime.Indexer.Types" "marlowe-runtime-0.0.5-JktrJhpUQi4IpTDTYokofB-indexer" 'False) (C1 ('MetaCons "MarloweUTxO" 'PrefixI 'True) (S1 ('MetaSel ('Just "unspentContractOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map ContractId UnspentContractOutput)) :*: S1 ('MetaSel ('Just "unspentPayoutOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map ContractId (Set TxOutRef)))))

data UnspentContractOutput Source #

Information about an unspent contract transaction output.

Constructors

UnspentContractOutput 

Fields

Instances

Instances details
ToJSON UnspentContractOutput Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Generic UnspentContractOutput Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Associated Types

type Rep UnspentContractOutput :: Type -> Type Source #

Show UnspentContractOutput Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

Eq UnspentContractOutput Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

type Rep UnspentContractOutput Source # 
Instance details

Defined in Language.Marlowe.Runtime.Indexer.Types

type Rep UnspentContractOutput = D1 ('MetaData "UnspentContractOutput" "Language.Marlowe.Runtime.Indexer.Types" "marlowe-runtime-0.0.5-JktrJhpUQi4IpTDTYokofB-indexer" 'False) (C1 ('MetaCons "UnspentContractOutput" 'PrefixI 'True) ((S1 ('MetaSel ('Just "marloweVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SomeMarloweVersion) :*: S1 ('MetaSel ('Just "txOutRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TxOutRef)) :*: (S1 ('MetaSel ('Just "marloweAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Address) :*: S1 ('MetaSel ('Just "payoutValidatorHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ScriptHash))))

extractMarloweBlock Source #

Arguments

:: SystemStart 
-> EraHistory CardanoMode 
-> Set ScriptHash

All known Marlowe script hashes.

-> BlockHeader

The BlockHeader of the block.

-> Set Transaction

The set of transactions in the block.

-> MarloweUTxO

The current MarloweUTxO

-> Maybe (MarloweUTxO, MarloweBlock) 

retrySilentUntilAllSilent :: (Witherable t, MonadWriter [w] m) => t a -> (a -> m ()) -> m () Source #

extractCreateTx Source #

Arguments

:: Set ScriptHash

All known Marlowe script hashes.

-> Transaction 
-> WriterT [MarloweTransaction] (State MarloweUTxO) () 

Extracts a MarloweCreateTransaction from a Chain transaction. A single transaction can create multiple Marlowe contracts, and this function returns a map of outputs that it failed to extract as well as the map of contracts it successfully extracted.

extractContractId Source #

Arguments

:: Set ScriptHash

All known Marlowe script hashes.

-> TxOutRef

The txOutRef of the transaction output.

-> TransactionOutput

The transaction output.

-> Maybe ContractId 

Extracts a ContractId from a transaction output if it is a Marlowe contract output.

extractApplyInputsTx Source #

Arguments

:: SystemStart 
-> EraHistory CardanoMode 
-> BlockHeader 
-> Transaction

The transaction to extract an apply inputs tx from.

-> WriterT [MarloweTransaction] (State MarloweUTxO) () 

Extracts an apply inputs transaction from a chain transaction. Returns nothing if the transaction does not apply an input to any unspent contract output.

extractWithdrawTx :: Transaction -> WriterT [MarloweTransaction] (State MarloweUTxO) () Source #

Extracts a withdraw transaction from a chain transaction. Returns nothing if the transaction does not withdraw contract payouts. Removes payouts from the Marlowe UTxO.

hoistMaybe :: Applicative m => Maybe a -> MaybeT m a Source #