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

Plutus.ChainIndex.Emulator

Synopsis

Documentation

newtype BlockId #

Instances

Instances details
Eq BlockId
Instance details

Defined in Ledger.Blockchain

Ord BlockId
Instance details

Defined in Ledger.Blockchain

Show BlockId
Instance details

Defined in Ledger.Blockchain

Generic BlockId
Instance details

Defined in Ledger.Blockchain

ToJSON BlockId
Instance details

Defined in Ledger.Blockchain

FromJSON BlockId
Instance details

Defined in Ledger.Blockchain

ToSchema BlockId Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty BlockId
Instance details

Defined in Ledger.Blockchain

HasDbType BlockId Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

Associated Types

type DbType BlockId Source #

type Rep BlockId
Instance details

Defined in Ledger.Blockchain

type Rep BlockId = D1 (' MetaData "BlockId" "Ledger.Blockchain" "plutus-ledger-1.2.0.0-5ZNFySGahCv2fMTEPkrA76" ' True ) ( C1 (' MetaCons "BlockId" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getBlockId") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ByteString )))
type DbType BlockId 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 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 Tip Source #

The tip of the chain index.

Constructors

TipAtGenesis
Tip

Fields

Instances

Instances details
Eq Tip Source #
Instance details

Defined in Plutus.ChainIndex.Types

Ord Tip Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show Tip Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic Tip Source #
Instance details

Defined in Plutus.ChainIndex.Types

Associated Types

type Rep Tip :: Type -> Type Source #

Semigroup Tip Source #

This mirrors the previously defined Tip which used the Last monoid definition.

Instance details

Defined in Plutus.ChainIndex.Types

Monoid Tip Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON Tip Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON Tip Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToSchema Tip Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty Tip Source #
Instance details

Defined in Plutus.ChainIndex.Types

HasDbType Tip Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

Associated Types

type DbType Tip Source #

type Rep Tip Source #
Instance details

Defined in Plutus.ChainIndex.Types

type DbType Tip Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

newtype BlockNumber Source #

Instances

Instances details
Enum BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

Eq BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

Integral BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

Num BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

Ord BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

Real BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToSchema BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

HasDbType BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

type Rep BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep BlockNumber = D1 (' MetaData "BlockNumber" "Plutus.ChainIndex.Types" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' True ) ( C1 (' MetaCons "BlockNumber" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unBlockNumber") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word64 )))
type DbType BlockNumber Source #
Instance details

Defined in Plutus.ChainIndex.DbSchema

blockId :: Block -> BlockId Source #

Compute a hash of the block's contents.

data Point Source #

When performing a rollback the chain sync protocol does not provide a block number where to resume from.

Constructors

PointAtGenesis
Point

Fields

Instances

Instances details
Eq Point Source #
Instance details

Defined in Plutus.ChainIndex.Types

Ord Point Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show Point Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic Point Source #
Instance details

Defined in Plutus.ChainIndex.Types

Semigroup Point Source #
Instance details

Defined in Plutus.ChainIndex.Types

Monoid Point Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON Point Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON Point Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty Point Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep Point Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep Point = D1 (' MetaData "Point" "Plutus.ChainIndex.Types" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' False ) ( C1 (' MetaCons "PointAtGenesis" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "Point" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "pointSlot") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedStrict ) ( Rec0 Slot) :*: S1 (' MetaSel (' Just "pointBlockId") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedStrict ) ( Rec0 BlockId )))

data TxOutBalance Source #

The effect of a transaction (or a number of them) on the tx output set.

Constructors

TxOutBalance

Fields

Instances

Instances details
Eq TxOutBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show TxOutBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic TxOutBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

Semigroup TxOutBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

Monoid TxOutBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON TxOutBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON TxOutBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep TxOutBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep TxOutBalance = D1 (' MetaData "TxOutBalance" "Plutus.ChainIndex.Types" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' False ) ( C1 (' MetaCons "TxOutBalance" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "_tobUnspentOutputs") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedStrict ) ( Rec0 ( Set TxOutRef )) :*: S1 (' MetaSel (' Just "_tobSpentOutputs") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedStrict ) ( Rec0 ( Map TxOutRef TxId ))))

data TxConfirmedState Source #

Instances

Instances details
Eq TxConfirmedState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show TxConfirmedState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic TxConfirmedState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Semigroup TxConfirmedState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Monoid TxConfirmedState Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep TxConfirmedState Source #
Instance details

Defined in Plutus.ChainIndex.Types

data TxIdState Source #

Constructors

TxIdState

Fields

Instances

Instances details
Eq TxIdState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show TxIdState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic TxIdState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Semigroup TxIdState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Monoid TxIdState Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep TxIdState Source #
Instance details

Defined in Plutus.ChainIndex.Types

data Diagnostics Source #

Instances

Instances details
Eq Diagnostics Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show Diagnostics Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic Diagnostics Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON Diagnostics Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON Diagnostics Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToSchema Diagnostics Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep Diagnostics Source #
Instance details

Defined in Plutus.ChainIndex.Types

data TxOutState Source #

Instances

Instances details
Eq TxOutState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Ord TxOutState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show TxOutState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic TxOutState Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON TxOutState Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON TxOutState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty TxOutState Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep TxOutState Source #
Instance details

Defined in Plutus.ChainIndex.Types

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

data RollbackState a Source #

The rollback state of a Cardano transaction

Constructors

Unknown

The transaction is not on the chain. That's all we can say.

TentativelyConfirmed Depth TxValidity a

The transaction is on the chain, n blocks deep. It can still be rolled back.

Committed TxValidity a

The transaction is on the chain. It cannot be rolled back anymore.

Instances

Instances details
Functor RollbackState Source #
Instance details

Defined in Plutus.ChainIndex.Types

Eq a => Eq ( RollbackState a) Source #
Instance details

Defined in Plutus.ChainIndex.Types

Ord a => Ord ( RollbackState a) Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show a => Show ( RollbackState a) Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic ( RollbackState a) Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON a => ToJSON ( RollbackState a) Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON a => FromJSON ( RollbackState a) Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show a => Pretty ( RollbackState a) Source #
Instance details

Defined in Plutus.ChainIndex.Types

MeetSemiLattice a => MeetSemiLattice ( RollbackState a) Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep ( RollbackState a) Source #
Instance details

Defined in Plutus.ChainIndex.Types

type TxStatus = RollbackState () Source #

The status of a Cardano transaction

newtype Depth Source #

How many blocks deep the tx is on the chain

Constructors

Depth

Instances

Instances details
Enum Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

Eq Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

Integral Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

Num Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

Ord Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

Real Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

MeetSemiLattice Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep Depth Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep Depth = D1 (' MetaData "Depth" "Plutus.ChainIndex.Types" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' True ) ( C1 (' MetaCons "Depth" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unDepth") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Int )))

data TxValidity Source #

Validity of a transaction that has been added to the ledger

Instances

Instances details
Eq TxValidity Source #
Instance details

Defined in Plutus.ChainIndex.Types

Ord TxValidity Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show TxValidity Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic TxValidity Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON TxValidity Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON TxValidity Source #
Instance details

Defined in Plutus.ChainIndex.Types

Pretty TxValidity Source #
Instance details

Defined in Plutus.ChainIndex.Types

MeetSemiLattice TxValidity Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep TxValidity Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep TxValidity = D1 (' MetaData "TxValidity" "Plutus.ChainIndex.Types" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' False ) ( C1 (' MetaCons "TxValid" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: ( C1 (' MetaCons "TxInvalid" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "UnknownValidity" ' PrefixI ' False ) ( U1 :: Type -> Type )))

liftTxOutStatus :: TxOutStatus -> TxStatus Source #

Converts a TxOutStatus to a TxStatus . Possible since a transaction output belongs to a transaction.

Note, however, that we can't convert a TxStatus to a TxOutStatus .

data TxUtxoBalance Source #

The effect of a transaction (or a number of them) on the utxo set.

Constructors

TxUtxoBalance

Fields

Instances

Instances details
Eq TxUtxoBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

Show TxUtxoBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

Generic TxUtxoBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

Semigroup TxUtxoBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

Monoid TxUtxoBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

ToJSON TxUtxoBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

FromJSON TxUtxoBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

Serialise TxUtxoBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep TxUtxoBalance Source #
Instance details

Defined in Plutus.ChainIndex.Types

type Rep TxUtxoBalance = D1 (' MetaData "TxUtxoBalance" "Plutus.ChainIndex.Types" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' False ) ( C1 (' MetaCons "TxUtxoBalance" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "_tubUnspentOutputs") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedStrict ) ( Rec0 ( Set TxOutRef )) :*: S1 (' MetaSel (' Just "_tubUnmatchedSpentInputs") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedStrict ) ( Rec0 ( Set TxOutRef ))))

newtype TxProcessOption Source #

User-customizable options to process a transaction. See #73 for more motivations.

Constructors

TxProcessOption

Fields

  • tpoStoreTx :: Bool

    Should the chain index store this transaction or not. If not, only handle the UTXOs. This, for example, allows applications to skip unwanted pre-Alonzo transactions.

data RollbackFailed Source #

Reason why the rollback operation failed

Constructors

RollbackNoTip

Rollback failed because the utxo index had no tip (not synchronised)

TipMismatch

Unable to roll back to expectedTip because the tip at that position was different

OldPointNotFound Point

Unable to find the old tip

Instances

Instances details
Eq RollbackFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Ord RollbackFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Show RollbackFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Generic RollbackFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

ToJSON RollbackFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

FromJSON RollbackFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Pretty RollbackFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

type Rep RollbackFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

data InsertUtxoFailed Source #

UTXO state could not be inserted into the chain index

Constructors

DuplicateBlock Tip

Insertion failed as there was already a block with the given number

InsertUtxoNoTip

The _usTip field of the argument was 'Last Nothing'

Instances

Instances details
Eq InsertUtxoFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Ord InsertUtxoFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Show InsertUtxoFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Generic InsertUtxoFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

ToJSON InsertUtxoFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

FromJSON InsertUtxoFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Pretty InsertUtxoFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

type Rep InsertUtxoFailed Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

type Rep InsertUtxoFailed = D1 (' MetaData "InsertUtxoFailed" "Plutus.ChainIndex.ChainIndexError" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' False ) ( C1 (' MetaCons "DuplicateBlock" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Tip )) :+: C1 (' MetaCons "InsertUtxoNoTip" ' PrefixI ' False ) ( U1 :: Type -> Type ))

data ChainIndexError Source #

Constructors

InsertionFailed InsertUtxoFailed
RollbackFailed RollbackFailed
ResumeNotSupported
QueryFailedNoTip

Query failed because the chain index does not have a tip (not synchronised with node)

BeamEffectError BeamError
ToCardanoError ToCardanoError

Instances

Instances details
Eq ChainIndexError Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Show ChainIndexError Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Generic ChainIndexError Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

ToJSON ChainIndexError Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

FromJSON ChainIndexError Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

Pretty ChainIndexError Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

type Rep ChainIndexError Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexError

data CredentialMap Source #

Set of transaction output references for each address.

Instances

Instances details
Eq CredentialMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Show CredentialMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Generic CredentialMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Semigroup CredentialMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Monoid CredentialMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Ixed CredentialMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

At CredentialMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

type Rep CredentialMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

type Rep CredentialMap = D1 (' MetaData "CredentialMap" "Plutus.ChainIndex.Emulator.DiskState" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' True ) ( C1 (' MetaCons "CredentialMap" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "_unCredentialMap") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Map Credential ( Set TxOutRef )))))
type Index CredentialMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

type IxValue CredentialMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

data AssetClassMap Source #

Set of transaction output references for each asset class.

Instances

Instances details
Eq AssetClassMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Show AssetClassMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Generic AssetClassMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Semigroup AssetClassMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Monoid AssetClassMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Ixed AssetClassMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

At AssetClassMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

type Rep AssetClassMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

type Rep AssetClassMap = D1 (' MetaData "AssetClassMap" "Plutus.ChainIndex.Emulator.DiskState" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' True ) ( C1 (' MetaCons "AssetClassMap" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "_unAssetClassMap") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Map AssetId ( Set TxOutRef )))))
type Index AssetClassMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

type IxValue AssetClassMap Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

data DiskState Source #

Data that we keep on disk. (This type is used for testing only - we need other structures for the disk-backed storage)

Instances

Instances details
Eq DiskState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Show DiskState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Generic DiskState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Semigroup DiskState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

Monoid DiskState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

type Rep DiskState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.DiskState

data ChainIndexQueryEffect r where Source #

Constructors

DatumFromHash :: DatumHash -> ChainIndexQueryEffect ( Maybe Datum )

Get the datum from a datum hash (if available)

ValidatorFromHash :: ValidatorHash -> ChainIndexQueryEffect ( Maybe (Versioned Validator ))

Get the validator from a validator hash (if available)

MintingPolicyFromHash :: MintingPolicyHash -> ChainIndexQueryEffect ( Maybe (Versioned MintingPolicy ))

Get the monetary policy from an MPS hash (if available)

RedeemerFromHash :: RedeemerHash -> ChainIndexQueryEffect ( Maybe Redeemer )

Get the redeemer from a redeemer hash (if available)

StakeValidatorFromHash :: StakeValidatorHash -> ChainIndexQueryEffect ( Maybe (Versioned StakeValidator ))

Get the stake validator from a stake validator hash (if available)

UnspentTxOutFromRef :: TxOutRef -> ChainIndexQueryEffect ( Maybe DecoratedTxOut)

Get the TxOut from a TxOutRef (if available)

TxOutFromRef :: TxOutRef -> ChainIndexQueryEffect ( Maybe DecoratedTxOut)

Get the TxOut from a TxOutRef (if available)

TxFromTxId :: TxId -> ChainIndexQueryEffect ( Maybe ChainIndexTx )

Get the transaction for a tx ID

UtxoSetMembership :: TxOutRef -> ChainIndexQueryEffect IsUtxoResponse

Whether a tx output is part of the UTXO set

UtxoSetAtAddress :: PageQuery TxOutRef -> Credential -> ChainIndexQueryEffect UtxosResponse

Unspent outputs located at addresses with the given credential.

UnspentTxOutSetAtAddress :: PageQuery TxOutRef -> Credential -> ChainIndexQueryEffect ( QueryResponse [( TxOutRef , DecoratedTxOut)])

Get the unspent txouts located at an address This is to avoid multiple queries from chain-index when using utxosAt

DatumsAtAddress :: PageQuery TxOutRef -> Credential -> ChainIndexQueryEffect ( QueryResponse [ Datum ])

get the datums located at addresses with the given credential.

UtxoSetWithCurrency :: PageQuery TxOutRef -> AssetClass -> ChainIndexQueryEffect UtxosResponse

Unspent outputs containing a specific currency ( AssetClass ).

Note that requesting unspent outputs containing Ada should not return anything, as this request will always return all unspent outputs.

TxsFromTxIds :: [ TxId ] -> ChainIndexQueryEffect [ ChainIndexTx ]

Get the transactions for a list of tx IDs.

TxoSetAtAddress :: PageQuery TxOutRef -> Credential -> ChainIndexQueryEffect TxosResponse

Outputs located at addresses with the given credential.

GetTip :: ChainIndexQueryEffect Tip

Get the tip of the chain index

data ChainIndexControlEffect r where Source #

Constructors

AppendBlocks :: [ ChainSyncBlock ] -> ChainIndexControlEffect ()

Add new blocks to the chain index.

Rollback :: Point -> ChainIndexControlEffect ()

Roll back to a previous state (previous tip)

ResumeSync :: Point -> ChainIndexControlEffect ()

Resume syncing from a certain point

CollectGarbage :: ChainIndexControlEffect ()

Delete all data that is not covered by current UTxOs.

GetDiagnostics :: ChainIndexControlEffect Diagnostics

data InsertUtxoPosition Source #

Outcome of inserting a UtxoState into the utxo index

Constructors

InsertAtEnd

The utxo state was added to the end. Returns the new index

InsertBeforeEnd

The utxo state was added somewhere before the end. Returns the new index and the tip

Instances

Instances details
Eq InsertUtxoPosition Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

Ord InsertUtxoPosition Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

Show InsertUtxoPosition Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

Generic InsertUtxoPosition Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

ToJSON InsertUtxoPosition Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

FromJSON InsertUtxoPosition Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

Pretty InsertUtxoPosition Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

type Rep InsertUtxoPosition Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

type Rep InsertUtxoPosition = D1 (' MetaData "InsertUtxoPosition" "Plutus.ChainIndex.ChainIndexLog" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' False ) ( C1 (' MetaCons "InsertAtEnd" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "InsertBeforeEnd" ' PrefixI ' False ) ( U1 :: Type -> Type ))

data ChainIndexLog Source #

Instances

Instances details
Eq ChainIndexLog Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

Show ChainIndexLog Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

Generic ChainIndexLog Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

ToJSON ChainIndexLog Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

FromJSON ChainIndexLog Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

Pretty ChainIndexLog Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

ToObject ChainIndexLog Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

type Rep ChainIndexLog Source #
Instance details

Defined in Plutus.ChainIndex.ChainIndexLog

type Rep ChainIndexLog = D1 (' MetaData "ChainIndexLog" "Plutus.ChainIndex.ChainIndexLog" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' False ) ((( C1 (' MetaCons "InsertionSuccess" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Tip ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 InsertUtxoPosition )) :+: C1 (' MetaCons "ConversionFailed" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 FromCardanoError))) :+: ( C1 (' MetaCons "RollbackSuccess" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Tip )) :+: C1 (' MetaCons "Err" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChainIndexError )))) :+: (( C1 (' MetaCons "TxNotFound" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 TxId )) :+: C1 (' MetaCons "TxOutNotFound" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 TxOutRef ))) :+: ( C1 (' MetaCons "TipIsGenesis" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: ( C1 (' MetaCons "NoDatumScriptAddr" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChainIndexTxOut )) :+: C1 (' MetaCons "BeamLogItem" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 BeamLog ))))))

data ChainIndexEmulatorState Source #

Instances

Instances details
Eq ChainIndexEmulatorState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.Handlers

Show ChainIndexEmulatorState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.Handlers

Generic ChainIndexEmulatorState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.Handlers

Semigroup ChainIndexEmulatorState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.Handlers

Monoid ChainIndexEmulatorState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.Handlers

type Rep ChainIndexEmulatorState Source #
Instance details

Defined in Plutus.ChainIndex.Emulator.Handlers

type Rep ChainIndexEmulatorState = D1 (' MetaData "ChainIndexEmulatorState" "Plutus.ChainIndex.Emulator.Handlers" "plutus-chain-index-core-1.2.0.0-vEgAIGWZqMIuVHBPih2W5" ' False ) ( C1 (' MetaCons "ChainIndexEmulatorState" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "_diskState") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 DiskState ) :*: S1 (' MetaSel (' Just "_utxoIndex") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( UtxoIndex TxUtxoBalance ))))

serveChainIndexQueryServer Source #

Arguments

:: Int

Port

-> TVar ChainIndexEmulatorState

Chain index state (TODO: When the disk state is stored in a DB, replace this with DB connection info)

-> IO ()