convex-base-0.2.0.0: Base classes and types for working with cardano-api transactions
Safe HaskellSafe-Inferred
LanguageHaskell2010

Convex.Class

Description

Typeclass for blockchain operations

Synopsis

Documentation

class Monad m ⇒ MonadBlockchain m where Source #

Send transactions and resolve tx inputs.

Methods

sendTx Source #

Arguments

Tx BabbageEra 
→ m TxId

Submit a transaction to the network

utxoByTxIn Source #

Arguments

Set TxIn 
→ m (UTxO BabbageEra)

Resolve tx inputs

queryProtocolParameters Source #

Arguments

∷ m (BundledProtocolParameters BabbageEra)

Get the protocol parameters

queryStakePools Source #

Arguments

∷ m (Set PoolId)

Get the stake pools

querySystemStart ∷ m SystemStart Source #

queryEraHistory ∷ m (EraHistory CardanoMode) Source #

querySlotNo Source #

Arguments

∷ m (SlotNo, SlotLength, UTCTime)

returns the current slot number, slot length and begin utc time for slot. Slot 0 is returned when at genesis.

networkId Source #

Arguments

∷ m NetworkId

Get the network id

Instances

Instances details
MonadBlockchain m ⇒ MonadBlockchain (ResultT m) Source # 
Instance details

Defined in Convex.Class

(MonadLog m, MonadIO m) ⇒ MonadBlockchain (MonadBlockchainCardanoNodeT e m) Source # 
Instance details

Defined in Convex.Class

MonadBlockchain m ⇒ MonadBlockchain (ExceptT e m) Source # 
Instance details

Defined in Convex.Class

MonadBlockchain m ⇒ MonadBlockchain (ReaderT e m) Source # 
Instance details

Defined in Convex.Class

MonadBlockchain m ⇒ MonadBlockchain (StateT e m) Source # 
Instance details

Defined in Convex.Class

MonadBlockchain m ⇒ MonadBlockchain (StateT e m) Source # 
Instance details

Defined in Convex.Class

class MonadBlockchain m ⇒ MonadMockchain m where Source #

Modify the mockchain internals

Methods

modifySlot ∷ (SlotNo → (SlotNo, a)) → m a Source #

modifyUtxo ∷ (UTxO ERA → (UTxO ERA, a)) → m a Source #

resolveDatumHashHash ScriptData → m (Maybe ScriptData) Source #

Look up the datum of a script hash, taking into account all datums that were part of transactions submitted with sendTx.

Instances

Instances details
MonadMockchain m ⇒ MonadMockchain (ResultT m) Source # 
Instance details

Defined in Convex.Class

MonadMockchain m ⇒ MonadMockchain (ExceptT e m) Source # 
Instance details

Defined in Convex.Class

Methods

modifySlot ∷ (SlotNo → (SlotNo, a)) → ExceptT e m a Source #

modifyUtxo ∷ (UTxO ERA → (UTxO ERA, a)) → ExceptT e m a Source #

resolveDatumHashHash ScriptDataExceptT e m (Maybe ScriptData) Source #

MonadMockchain m ⇒ MonadMockchain (ReaderT e m) Source # 
Instance details

Defined in Convex.Class

Methods

modifySlot ∷ (SlotNo → (SlotNo, a)) → ReaderT e m a Source #

modifyUtxo ∷ (UTxO ERA → (UTxO ERA, a)) → ReaderT e m a Source #

resolveDatumHashHash ScriptDataReaderT e m (Maybe ScriptData) Source #

MonadMockchain m ⇒ MonadMockchain (StateT e m) Source # 
Instance details

Defined in Convex.Class

Methods

modifySlot ∷ (SlotNo → (SlotNo, a)) → StateT e m a Source #

modifyUtxo ∷ (UTxO ERA → (UTxO ERA, a)) → StateT e m a Source #

resolveDatumHashHash ScriptDataStateT e m (Maybe ScriptData) Source #

MonadMockchain m ⇒ MonadMockchain (StateT e m) Source # 
Instance details

Defined in Convex.Class

Methods

modifySlot ∷ (SlotNo → (SlotNo, a)) → StateT e m a Source #

modifyUtxo ∷ (UTxO ERA → (UTxO ERA, a)) → StateT e m a Source #

resolveDatumHashHash ScriptDataStateT e m (Maybe ScriptData) Source #

data MonadBlockchainError e Source #

Instances

Instances details
Functor MonadBlockchainError Source # 
Instance details

Defined in Convex.Class

FromJSON e ⇒ FromJSON (MonadBlockchainError e) Source # 
Instance details

Defined in Convex.Class

ToJSON e ⇒ ToJSON (MonadBlockchainError e) Source # 
Instance details

Defined in Convex.Class

Generic (MonadBlockchainError e) Source # 
Instance details

Defined in Convex.Class

Associated Types

type Rep (MonadBlockchainError e) ∷ TypeType Source #

Show e ⇒ Show (MonadBlockchainError e) Source # 
Instance details

Defined in Convex.Class

Eq e ⇒ Eq (MonadBlockchainError e) Source # 
Instance details

Defined in Convex.Class

type Rep (MonadBlockchainError e) Source # 
Instance details

Defined in Convex.Class

type Rep (MonadBlockchainError e) = D1 ('MetaData "MonadBlockchainError" "Convex.Class" "convex-base-0.2.0.0-inplace" 'False) (C1 ('MetaCons "MonadBlockchainError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 e)) :+: (C1 ('MetaCons "ProtocolConversionError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "FailWith" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

getSlotMonadMockchain m ⇒ m SlotNo Source #

Get the current slot number

setSlotMonadMockchain m ⇒ SlotNo → m () Source #

Get the current slot number

setPOSIXTime ∷ (MonadFail m, MonadMockchain m) ⇒ POSIXTime → m () Source #

Set the slot number to the slot that contains the given POSIX time.

nextSlotMonadMockchain m ⇒ m () Source #

Increase the slot number by 1.

setTimeToValidRangeMonadMockchain m ⇒ (TxValidityLowerBound BabbageEra, TxValidityUpperBound BabbageEra) → m () Source #

Change the clock so that the current slot time is within the given validity range. This MAY move the clock backwards!

getUtxoMonadMockchain m ⇒ m (UTxO ERA) Source #

Get the UTxO set |

setUtxoMonadMockchain m ⇒ UTxO ERA → m () Source #

Set the UTxO set |

Implementation

newtype MonadBlockchainCardanoNodeT e m a Source #

MonadBlockchain implementation that connects to a cardano node

Instances

Instances details
MonadError e m ⇒ MonadError e (MonadBlockchainCardanoNodeT e m) Source # 
Instance details

Defined in Convex.Class

MonadTrans (MonadBlockchainCardanoNodeT e) Source # 
Instance details

Defined in Convex.Class

Methods

liftMonad m ⇒ m a → MonadBlockchainCardanoNodeT e m a Source #

MonadLog m ⇒ MonadFail (MonadBlockchainCardanoNodeT e m) Source # 
Instance details

Defined in Convex.Class

MonadIO m ⇒ MonadIO (MonadBlockchainCardanoNodeT e m) Source # 
Instance details

Defined in Convex.Class

Monad m ⇒ Applicative (MonadBlockchainCardanoNodeT e m) Source # 
Instance details

Defined in Convex.Class

Functor m ⇒ Functor (MonadBlockchainCardanoNodeT e m) Source # 
Instance details

Defined in Convex.Class

Monad m ⇒ Monad (MonadBlockchainCardanoNodeT e m) Source # 
Instance details

Defined in Convex.Class

(MonadLog m, MonadIO m) ⇒ MonadBlockchain (MonadBlockchainCardanoNodeT e m) Source # 
Instance details

Defined in Convex.Class

MonadLog m ⇒ MonadLog (MonadBlockchainCardanoNodeT e m) Source # 
Instance details

Defined in Convex.Class