| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Singular.Registry.LedgerProvider
Description
Capabilities supply raw Conway facts and generic reconstruction material. They neither interpret registry commands nor assert verification or snapshot binding. One acquisition identifies all reads used to prepare a transaction.
Synopsis
- data LedgerProvider w (m :: Type -> Type) = LedgerProvider {
- acquire :: forall a. Acquisition -> (Session w m -> m a) -> m (Either AcquireFailure a)
- submitTx :: Network -> SignedTx -> m SubmitResult
- data Session w (m :: Type -> Type) = Session {
- sessionNetwork :: Network
- sessionId :: SessionId
- sessionBinding :: SessionBinding
- sessionTracer :: Tracer m ReadEvent
- sessionEvaluated :: Evaluation -> m ()
- outputs :: OutputQuery -> m (Either ReadFailure (Evidenced w Outputs))
- protocolParameters :: m (Either ReadFailure (Evidenced w (PParams ConwayEra)))
- tipObservation :: m (Either ReadFailure (Evidenced w TipObservation))
- networkTime :: m (Either ReadFailure (Evidenced w NetworkTime))
- scriptRegistered :: ScriptHash -> m (Either ReadFailure (Evidenced w Bool))
- mintRecord :: Asset -> m (Either ReadFailure (Evidenced w (Maybe MintRecord)))
- history :: Asset -> HistoryRange -> m (Either HistoryFailure (HistoryStream m))
- newtype Network = Network Word32
- data ChainPoint
- data Acquisition
- data AcquireFailure
- data ReadFailure
- = ReleasedSession SessionId
- | MissingOutput TxIn
- | ConflictingOutput TxIn
- | BackendReadFailure Text
- | NetworkTimeRefusal NetworkTimeFailure
- data SubmitResult
- = SubmitAccepted TxId
- | SubmitRefused Text
- | SubmitFailed Text
- | SubmitWrongNetwork Network Network
- data OutputQuery
- = AtAddress Addr
- | HoldingAsset Asset
- | AtTxIn TxIn
- | CarryingReferenceScript ScriptHash
- | AnyOf (NonEmpty OutputQuery)
- | AllOf (NonEmpty OutputQuery)
- data MintRecord = MintRecord {
- mintTransaction :: TxId
- mintSpentInputs :: [TxIn]
- mintSupply :: Integer
- type Outputs = [(TxIn, TxOut ConwayEra)]
- type Asset = (PolicyID, AssetName)
- data TipObservation = TipObservation {
- observedSlot :: SlotNo
- observedHash :: ByteString
- observedHeight :: Word64
- observedBlockTime :: Word64
- data HistoryRange = HistoryRange {
- fromHeight :: Maybe Word64
- throughHeight :: Maybe Word64
- data HistoryFailure
- = HistoryReadFailure ReadFailure
- | HistoryDependencyCycle (NonEmpty TxId)
- | MissingInBlockParent TxId TxId
- | DuplicateSpend TxIn
- | HistoryMaterialMismatch TxId Text
- | HistoryOrderMismatch Word64 Word64
- data HistoricalTransaction = HistoricalTransaction {
- historicalId :: TxId
- historicalCbor :: ByteString
- historicalTx :: ConwayTx
- spentOutputs :: Outputs
- referenceOutputs :: Outputs
- createdOutputs :: Outputs
- scriptValid :: Bool
- data HistoryBlock = HistoryBlock {
- blockHeight :: Word64
- blockTransactions :: NonEmpty HistoricalTransaction
- newtype HistoryStream (m :: Type -> Type) = HistoryStream {
- nextBlock :: m (Either HistoryFailure (Maybe (HistoryBlock, HistoryStream m)))
Documentation
data LedgerProvider w (m :: Type -> Type) Source #
Reading and signed submission in the caller's monad and witness domain.
Constructors
| LedgerProvider | |
Fields
| |
data Session w (m :: Type -> Type) Source #
Facts consumed within one acquired scope and its named network.
Constructors
| Session | |
Fields
| |
Explicit network magic; no process-global network choice.
Constructors
| Network Word32 |
Instances
| Show Network Source # | |
Defined in Singular.Registry.LedgerProvider | |
| Eq Network Source # | |
Defined in Singular.Registry.LedgerProvider | |
| Ord Network Source # | |
Defined in Singular.Registry.LedgerProvider | |
data ChainPoint Source #
A requested chain point. It does not establish a binding by observation.
Instances
| Show ChainPoint Source # | |
Defined in Singular.Registry.LedgerProvider Methods showsPrec :: Int -> ChainPoint -> ShowS Source # show :: ChainPoint -> String Source # showList :: [ChainPoint] -> ShowS Source # | |
| Eq ChainPoint Source # | |
Defined in Singular.Registry.LedgerProvider Methods (==) :: ChainPoint -> ChainPoint -> Bool Source # (/=) :: ChainPoint -> ChainPoint -> Bool Source # | |
data Acquisition Source #
Acquisition always names its network.
Constructors
| Latest Network | |
| AtPoint Network ChainPoint |
Instances
| Show Acquisition Source # | |
Defined in Singular.Registry.LedgerProvider Methods showsPrec :: Int -> Acquisition -> ShowS Source # show :: Acquisition -> String Source # showList :: [Acquisition] -> ShowS Source # | |
| Eq Acquisition Source # | |
Defined in Singular.Registry.LedgerProvider Methods (==) :: Acquisition -> Acquisition -> Bool Source # (/=) :: Acquisition -> Acquisition -> Bool Source # | |
data AcquireFailure Source #
Named acquisition refusal, distinct from an empty query result.
Constructors
| WrongNetwork Network Network | |
| PointNotSupported ChainPoint | |
| AcquisitionReadFailure ReadFailure |
Instances
| Exception AcquireFailure Source # | |
Defined in Singular.Registry.LedgerProvider Methods toException :: AcquireFailure -> SomeException Source # fromException :: SomeException -> Maybe AcquireFailure Source # displayException :: AcquireFailure -> String Source # backtraceDesired :: AcquireFailure -> Bool Source # | |
| Show AcquireFailure Source # | |
Defined in Singular.Registry.LedgerProvider Methods showsPrec :: Int -> AcquireFailure -> ShowS Source # show :: AcquireFailure -> String Source # showList :: [AcquireFailure] -> ShowS Source # | |
| Eq AcquireFailure Source # | |
Defined in Singular.Registry.LedgerProvider Methods (==) :: AcquireFailure -> AcquireFailure -> Bool Source # (/=) :: AcquireFailure -> AcquireFailure -> Bool Source # | |
data ReadFailure Source #
Read refusals retain the missing/conflicting identity or backend reason.
Constructors
| ReleasedSession SessionId | |
| MissingOutput TxIn | |
| ConflictingOutput TxIn | |
| BackendReadFailure Text | |
| NetworkTimeRefusal NetworkTimeFailure |
Instances
| Exception ReadFailure Source # | |
Defined in Singular.Registry.LedgerProvider Methods toException :: ReadFailure -> SomeException Source # fromException :: SomeException -> Maybe ReadFailure Source # displayException :: ReadFailure -> String Source # backtraceDesired :: ReadFailure -> Bool Source # | |
| Show ReadFailure Source # | |
Defined in Singular.Registry.LedgerProvider Methods showsPrec :: Int -> ReadFailure -> ShowS Source # show :: ReadFailure -> String Source # showList :: [ReadFailure] -> ShowS Source # | |
| Eq ReadFailure Source # | |
Defined in Singular.Registry.LedgerProvider Methods (==) :: ReadFailure -> ReadFailure -> Bool Source # (/=) :: ReadFailure -> ReadFailure -> Bool Source # | |
data SubmitResult Source #
Signed submission's actual backend outcome.
Constructors
| SubmitAccepted TxId | |
| SubmitRefused Text | |
| SubmitFailed Text | |
| SubmitWrongNetwork Network Network |
Instances
| Show SubmitResult Source # | |
Defined in Singular.Registry.LedgerProvider Methods showsPrec :: Int -> SubmitResult -> ShowS Source # show :: SubmitResult -> String Source # showList :: [SubmitResult] -> ShowS Source # | |
| Eq SubmitResult Source # | |
Defined in Singular.Registry.LedgerProvider Methods (==) :: SubmitResult -> SubmitResult -> Bool Source # (/=) :: SubmitResult -> SubmitResult -> Bool Source # | |
data OutputQuery Source #
Nonempty composed queries; an absent exact reference refuses by name.
Constructors
| AtAddress Addr | |
| HoldingAsset Asset | |
| AtTxIn TxIn | |
| CarryingReferenceScript ScriptHash | Live outputs carrying this reference script. An empty answer means not found by this provider, never not on chain; a consumer checks each candidate's script itself. |
| AnyOf (NonEmpty OutputQuery) | |
| AllOf (NonEmpty OutputQuery) |
Instances
| Show OutputQuery Source # | |
Defined in Singular.Registry.LedgerProvider Methods showsPrec :: Int -> OutputQuery -> ShowS Source # show :: OutputQuery -> String Source # showList :: [OutputQuery] -> ShowS Source # | |
| Eq OutputQuery Source # | |
Defined in Singular.Registry.LedgerProvider Methods (==) :: OutputQuery -> OutputQuery -> Bool Source # (/=) :: OutputQuery -> OutputQuery -> Bool Source # | |
data MintRecord Source #
How an asset came to be: the transaction that minted it, every input that transaction spent, and the asset's current total supply.
Constructors
| MintRecord | |
Fields
| |
Instances
| Show MintRecord Source # | |
Defined in Singular.Registry.LedgerProvider Methods showsPrec :: Int -> MintRecord -> ShowS Source # show :: MintRecord -> String Source # showList :: [MintRecord] -> ShowS Source # | |
| Eq MintRecord Source # | |
Defined in Singular.Registry.LedgerProvider Methods (==) :: MintRecord -> MintRecord -> Bool Source # (/=) :: MintRecord -> MintRecord -> Bool Source # | |
data TipObservation Source #
Latest observed block facts, with raw POSIX seconds independent of slots.
Constructors
| TipObservation | |
Fields
| |
Instances
| Show TipObservation Source # | |
Defined in Singular.Registry.LedgerProvider Methods showsPrec :: Int -> TipObservation -> ShowS Source # show :: TipObservation -> String Source # showList :: [TipObservation] -> ShowS Source # | |
| Eq TipObservation Source # | |
Defined in Singular.Registry.LedgerProvider Methods (==) :: TipObservation -> TipObservation -> Bool Source # (/=) :: TipObservation -> TipObservation -> Bool Source # | |
data HistoryRange Source #
Inclusive block-height bounds; absent bounds leave that side open.
Constructors
| HistoryRange | |
Fields
| |
Instances
| Show HistoryRange Source # | |
Defined in Singular.Registry.LedgerProvider Methods showsPrec :: Int -> HistoryRange -> ShowS Source # show :: HistoryRange -> String Source # showList :: [HistoryRange] -> ShowS Source # | |
| Eq HistoryRange Source # | |
Defined in Singular.Registry.LedgerProvider Methods (==) :: HistoryRange -> HistoryRange -> Bool Source # (/=) :: HistoryRange -> HistoryRange -> Bool Source # | |
data HistoryFailure Source #
History refuses incomplete or inconsistent reconstruction material.
Constructors
| HistoryReadFailure ReadFailure | |
| HistoryDependencyCycle (NonEmpty TxId) | |
| MissingInBlockParent TxId TxId | |
| DuplicateSpend TxIn | |
| HistoryMaterialMismatch TxId Text | |
| HistoryOrderMismatch Word64 Word64 |
Instances
| Exception HistoryFailure Source # | |
Defined in Singular.Registry.LedgerProvider Methods toException :: HistoryFailure -> SomeException Source # fromException :: SomeException -> Maybe HistoryFailure Source # displayException :: HistoryFailure -> String Source # backtraceDesired :: HistoryFailure -> Bool Source # | |
| Show HistoryFailure Source # | |
Defined in Singular.Registry.LedgerProvider Methods showsPrec :: Int -> HistoryFailure -> ShowS Source # show :: HistoryFailure -> String Source # showList :: [HistoryFailure] -> ShowS Source # | |
| Eq HistoryFailure Source # | |
Defined in Singular.Registry.LedgerProvider Methods (==) :: HistoryFailure -> HistoryFailure -> Bool Source # (/=) :: HistoryFailure -> HistoryFailure -> Bool Source # | |
data HistoricalTransaction Source #
Complete CBOR plus resolved inputs, references and outputs, with validity. These are reconstruction material, without an evidence verdict.
Constructors
| HistoricalTransaction | |
Fields
| |
data HistoryBlock Source #
One complete block, in creator-before-spender order within its height.
Constructors
| HistoryBlock | |
Fields
| |
newtype HistoryStream (m :: Type -> Type) Source #
Deferred complete-block consumption; never joins the entire history first.
Constructors
| HistoryStream | |
Fields
| |