mafoc-0.0.0.1
Safe HaskellSafe-Inferred
LanguageHaskell2010

Mafoc.Upstream

Synopsis

Additions to cardano-api

type SlotNoBhh = (SlotNo, Hash BlockHeader) #

getSecurityParamAndNetworkId :: FilePath -> IO (SecurityParam, NetworkId) #

getNetworkId :: FilePath -> IO NetworkId #

tipDistance :: BlockInMode mode -> ChainTip -> Natural #

Query node

queryCurrentEra :: LocalNodeConnectInfo CardanoMode -> IO AnyCardanoEra #

Query the current era of the local node's current state.

querySecurityParamEra :: LocalNodeConnectInfo CardanoMode -> ShelleyBasedEra era -> IO SecurityParam #

Query security param from the local node given a Shelley based era.

querySecurityParam :: LocalNodeConnectInfo CardanoMode -> IO SecurityParam #

Block accessors

blockChainPoint :: BlockInMode mode -> ChainPoint #

Create a ChainPoint from BlockInMode

blockNo :: BlockInMode mode -> BlockNo #

blockSlotNoBhh :: BlockInMode mode -> SlotNoBhh #

blockSlotNo :: BlockInMode mode -> SlotNo #

chainPointSlotNo :: ChainPoint -> SlotNo #

txoAddressAny :: TxOut ctx era -> AddressAny #

toAddressAny :: AddressInEra era -> AddressAny #

Labels

TxId

ChainPoint

BlockNo

SlotNo

Block header hash

Streaming

streamPassReturn :: Monad m => Stream (Of a) m r -> (a -> Stream (Of a) m r -> Stream (Of b) m r) -> Stream (Of b) m r #

loopM :: (MonadTrans t1, Monad m, Monad (t1 m)) => Stream (Of t2) m b -> (t2 -> t1 m a) -> t1 m b #

Consume a stream source in a loop and run effect f on it.

foldYield :: Monad m => (st -> a -> m (st, b)) -> st -> Stream (Of a) m r -> Stream (Of b) m r #

Fold a stream of a's, yield a stream of bs, while keeping a state of @st".

Base

Send traces to stdout

defaultConfigStderr :: IO Configuration #

defaultConfigStderrSeverity :: Severity -> IO Configuration #

Newtypes for file paths

newtype NodeFolder #

Not sure if anyone actually wants these upstreamed

Constructors

NodeFolder FilePath 

Instances

Instances details
IsString NodeFolder # 
Instance details

Defined in Mafoc.Upstream

Show NodeFolder # 
Instance details

Defined in Mafoc.Upstream

IsLabel "nodeConfig" (NodeFolder -> NodeConfig) # 
Instance details

Defined in Mafoc.Upstream

newtype NodeConfig #

Constructors

NodeConfig FilePath 

Instances

Instances details
IsString NodeConfig # 
Instance details

Defined in Mafoc.Upstream

Show NodeConfig # 
Instance details

Defined in Mafoc.Upstream

IsLabel "getNetworkId" (LocalChainsyncConfig NodeConfig -> IO NetworkId) # 
Instance details

Defined in Mafoc.Core

IsLabel "getNetworkId" (LocalChainsyncConfig_ -> IO NetworkId) # 
Instance details

Defined in Mafoc.Core

Methods

fromLabel :: LocalChainsyncConfig_ -> IO NetworkId #

IsLabel "getNetworkId" (NodeInfo NodeConfig -> IO NetworkId) # 
Instance details

Defined in Mafoc.Core

Methods

fromLabel :: NodeInfo NodeConfig -> IO NetworkId #

IsLabel "getNetworkId" (NodeConfig -> IO NetworkId) # 
Instance details

Defined in Mafoc.Upstream

Methods

fromLabel :: NodeConfig -> IO NetworkId #

IsLabel "nodeConfig" (LocalChainsyncConfig NodeConfig -> NodeConfig) # 
Instance details

Defined in Mafoc.Core

IsLabel "nodeConfig" (NodeInfo NodeConfig -> NodeConfig) # 
Instance details

Defined in Mafoc.Core

IsLabel "nodeConfig" (NodeFolder -> NodeConfig) # 
Instance details

Defined in Mafoc.Upstream

newtype SocketPath #

Constructors

SocketPath FilePath 

Instances

Instances details
IsString SocketPath # 
Instance details

Defined in Mafoc.Upstream

Show SocketPath # 
Instance details

Defined in Mafoc.Upstream

IsLabel "socketPath" (LocalChainsyncConfig a -> SocketPath) # 
Instance details

Defined in Mafoc.Core

IsLabel "socketPath" (NodeInfo a -> SocketPath) # 
Instance details

Defined in Mafoc.Core

Hard-coded chainpoints

data LedgerEra #

Constructors

Byron 
Shelley 
Allegra 
Mary 
Alonzo 
Babbage 

Instances

Instances details
ToJSON LedgerEra # 
Instance details

Defined in Mafoc.Upstream

Methods

toJSON :: LedgerEra -> Value

toEncoding :: LedgerEra -> Encoding

toJSONList :: [LedgerEra] -> Value

toEncodingList :: [LedgerEra] -> Encoding

Bounded LedgerEra # 
Instance details

Defined in Mafoc.Upstream

Enum LedgerEra # 
Instance details

Defined in Mafoc.Upstream

Generic LedgerEra # 
Instance details

Defined in Mafoc.Upstream

Associated Types

type Rep LedgerEra :: Type -> Type #

Show LedgerEra # 
Instance details

Defined in Mafoc.Upstream

Eq LedgerEra # 
Instance details

Defined in Mafoc.Upstream

Ord LedgerEra # 
Instance details

Defined in Mafoc.Upstream

type Rep LedgerEra # 
Instance details

Defined in Mafoc.Upstream

type Rep LedgerEra = D1 ('MetaData "LedgerEra" "Mafoc.Upstream" "mafoc-0.0.0.1-inplace" 'False) ((C1 ('MetaCons "Byron" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Shelley" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Allegra" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Mary" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Alonzo" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Babbage" 'PrefixI 'False) (U1 :: Type -> Type))))

slotEra :: SlotNo -> LedgerEra #

newtype TxIndexInBlock #

Constructors

TxIndexInBlock Word64 

Instances

Instances details
FromJSON TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

Methods

parseJSON :: Value -> Parser TxIndexInBlock

parseJSONList :: Value -> Parser [TxIndexInBlock]

ToJSON TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

Methods

toJSON :: TxIndexInBlock -> Value

toEncoding :: TxIndexInBlock -> Encoding

toJSONList :: [TxIndexInBlock] -> Value

toEncodingList :: [TxIndexInBlock] -> Encoding

Enum TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

Num TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

Show TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

FromCBOR TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

Methods

fromCBOR :: Decoder s TxIndexInBlock

label :: Proxy TxIndexInBlock -> Text

ToCBOR TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

Methods

toCBOR :: TxIndexInBlock -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy TxIndexInBlock -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [TxIndexInBlock] -> Size

Eq TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

Ord TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

FromField TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

Methods

fromField :: FieldParser TxIndexInBlock

ToField TxIndexInBlock # 
Instance details

Defined in Mafoc.Upstream

Methods

toField :: TxIndexInBlock -> SQLData

Datum

allDatums :: Tx era -> [(Hash ScriptData, ScriptData)] #

Datums from script data

plutusDatums :: [Tx era] -> [(Hash ScriptData, ScriptData)] #

Get a map of datum hash to datum from a list of transactions.

txPlutusDatums :: Tx era -> [(Hash ScriptData, ScriptData)] #

txAlonzoDatums :: Tx era -> [(DataHash (EraCrypto (ShelleyLedgerEra era)), Data (ShelleyLedgerEra era))] #

alonzoTxBodyDatums :: TxBody era -> Map (DataHash (EraCrypto (ShelleyLedgerEra era))) (Data (ShelleyLedgerEra era)) #

datumFromAlonzo :: Data ledgerera -> (Hash ScriptData, ScriptData) #

From TxOut

getFilteredTxOutDatumsFromTxs :: Maybe (Address ShelleyAddr -> Bool) -> [Tx era] -> Map (Hash ScriptData) ScriptData #

getFilteredAddressDatumsFromTxs :: Maybe (Address ShelleyAddr -> Bool) -> [Tx era] -> [(AddressAny, Either (Hash ScriptData) (Hash ScriptData, ScriptData))] #

txAddressDatums :: Tx era -> [(AddressAny, Either (Hash ScriptData) (Hash ScriptData, ScriptData))] #

txDatums :: Tx era -> [Either (Hash ScriptData) (Hash ScriptData, ScriptData)] #

maybeDatum :: TxOut CtxTx era -> Maybe (Either (Hash ScriptData) (Hash ScriptData, ScriptData)) #

Orphan instances

Exception AcquiringFailure # 
Instance details

Methods

toException :: AcquiringFailure -> SomeException #

fromException :: SomeException -> Maybe AcquiringFailure #

displayException :: AcquiringFailure -> String #

Exception EraMismatch # 
Instance details

Methods

toException :: EraMismatch -> SomeException #

fromException :: SomeException -> Maybe EraMismatch #

displayException :: EraMismatch -> String #

Ord ChainTip # 
Instance details

Methods

compare :: ChainTip -> ChainTip -> Ordering #

(<) :: ChainTip -> ChainTip -> Bool #

(<=) :: ChainTip -> ChainTip -> Bool #

(>) :: ChainTip -> ChainTip -> Bool #

(>=) :: ChainTip -> ChainTip -> Bool #

max :: ChainTip -> ChainTip -> ChainTip #

min :: ChainTip -> ChainTip -> ChainTip #

IsLabel "blockHeaderHash" (Block era -> Hash BlockHeader) # 
Instance details

Methods

fromLabel :: Block era -> Hash BlockHeader #

IsLabel "blockHeaderHash" (BlockHeader -> Hash BlockHeader) # 
Instance details

Methods

fromLabel :: BlockHeader -> Hash BlockHeader #

IsLabel "blockHeaderHash" (BlockInMode era -> Hash BlockHeader) # 
Instance details

Methods

fromLabel :: BlockInMode era -> Hash BlockHeader #

IsLabel "blockNo" (Block era -> BlockNo) # 
Instance details

Methods

fromLabel :: Block era -> BlockNo #

IsLabel "blockNo" (BlockHeader -> BlockNo) # 
Instance details

Methods

fromLabel :: BlockHeader -> BlockNo #

IsLabel "blockNo" (BlockInMode mode -> BlockNo) # 
Instance details

Methods

fromLabel :: BlockInMode mode -> BlockNo #

IsLabel "calculateTxId" (Tx era -> TxId) # 
Instance details

Methods

fromLabel :: Tx era -> TxId #

IsLabel "calculateTxId" (TxBody era -> TxId) #

We say calculate because transaction body is actually hashed.

Instance details

Methods

fromLabel :: TxBody era -> TxId #

IsLabel "chainPoint" (Block era -> ChainPoint) # 
Instance details

Methods

fromLabel :: Block era -> ChainPoint #

IsLabel "chainPoint" (BlockHeader -> ChainPoint) # 
Instance details

Methods

fromLabel :: BlockHeader -> ChainPoint #

IsLabel "chainPoint" (BlockInMode era -> ChainPoint) # 
Instance details

Methods

fromLabel :: BlockInMode era -> ChainPoint #

IsLabel "chainPoint" (SlotNoBhh -> ChainPoint) # 
Instance details

Methods

fromLabel :: SlotNoBhh -> ChainPoint #

IsLabel "slotNo" (Either SlotNo ChainPoint -> SlotNo) # 
Instance details

Methods

fromLabel :: Either SlotNo ChainPoint -> SlotNo #

IsLabel "slotNo" (Block era -> SlotNo) # 
Instance details

Methods

fromLabel :: Block era -> SlotNo #

IsLabel "slotNo" (BlockHeader -> SlotNo) # 
Instance details

Methods

fromLabel :: BlockHeader -> SlotNo #

IsLabel "slotNo" (BlockInMode era -> SlotNo) # 
Instance details

Methods

fromLabel :: BlockInMode era -> SlotNo #

IsLabel "slotNo" (ChainPoint -> SlotNo) # 
Instance details

Methods

fromLabel :: ChainPoint -> SlotNo #

IsLabel "slotNo" (ChainTip -> SlotNo) # 
Instance details

Methods

fromLabel :: ChainTip -> SlotNo #

IsLabel "slotNo" (SlotNoBhh -> SlotNo) # 
Instance details

Methods

fromLabel :: SlotNoBhh -> SlotNo #

IsLabel "slotNoBhh" (Block era -> SlotNoBhh) # 
Instance details

Methods

fromLabel :: Block era -> SlotNoBhh #

IsLabel "slotNoBhh" (BlockHeader -> SlotNoBhh) # 
Instance details

Methods

fromLabel :: BlockHeader -> SlotNoBhh #

IsLabel "slotNoBhh" (BlockInMode era -> SlotNoBhh) # 
Instance details

Methods

fromLabel :: BlockInMode era -> SlotNoBhh #