Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | support@geniusyield.co |
Stability | develop |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class Monad m ⇒ MonadError e (m ∷ Type → Type) | m → e where
- throwError ∷ e → m a
- catchError ∷ m a → (e → m a) → m a
- class Monad m ⇒ MonadRandom (m ∷ Type → Type) where
- getRandomR ∷ Random a ⇒ (a, a) → m a
- getRandom ∷ Random a ⇒ m a
- getRandomRs ∷ Random a ⇒ (a, a) → m [a]
- getRandoms ∷ Random a ⇒ m [a]
- class GYTxQueryMonad m ⇒ GYTxMonad m where
- someUTxO ∷ m GYTxOutRef
- randSeed ∷ m Int
- class MonadError GYTxMonadException m ⇒ GYTxQueryMonad m where
- networkId ∷ m GYNetworkId
- lookupDatum ∷ GYDatumHash → m (Maybe GYDatum)
- utxoAtTxOutRef ∷ GYTxOutRef → m (Maybe GYUTxO)
- utxosAtTxOutRefs ∷ [GYTxOutRef] → m GYUTxOs
- utxosAtAddress ∷ GYAddress → m GYUTxOs
- utxosAtAddresses ∷ [GYAddress] → m GYUTxOs
- utxoRefsAtAddress ∷ GYAddress → m [GYTxOutRef]
- slotConfig ∷ m GYSlotConfig
- currentSlot ∷ m GYSlot
- logMsg ∷ HasCallStack ⇒ GYLogNamespace → GYLogSeverity → String → m ()
- data GYTxSkeleton (v ∷ PlutusVersion) = GYTxSkeleton {
- gytxIns ∷ ![GYTxIn v]
- gytxOuts ∷ ![GYTxOut v]
- gytxRefIns ∷ !(GYTxSkeletonRefIns v)
- gytxMint ∷ !(Map (Some GYMintingPolicy) (Map GYTokenName Integer, GYRedeemer))
- gytxSigs ∷ !(Set GYPubKeyHash)
- gytxInvalidBefore ∷ !(Maybe GYSlot)
- gytxInvalidAfter ∷ !(Maybe GYSlot)
- data GYTxSkeletonRefIns ∷ PlutusVersion → Type where
- gyTxSkeletonRefInsToList ∷ GYTxSkeletonRefIns v → [GYTxOutRef]
- data RandT g (m ∷ Type → Type) a
- lookupDatum' ∷ GYTxQueryMonad m ⇒ GYDatumHash → m GYDatum
- utxoAtTxOutRef' ∷ GYTxQueryMonad m ⇒ GYTxOutRef → m GYUTxO
- slotToBeginTime ∷ GYTxQueryMonad f ⇒ GYSlot → f GYTime
- slotToEndTime ∷ GYTxQueryMonad f ⇒ GYSlot → f GYTime
- enclosingSlotFromTime ∷ GYTxQueryMonad f ⇒ GYTime → f (Maybe GYSlot)
- enclosingSlotFromTime' ∷ GYTxQueryMonad m ⇒ GYTime → m GYSlot
- scriptAddress ∷ GYTxQueryMonad m ⇒ GYValidator v → m GYAddress
- scriptAddress' ∷ GYTxQueryMonad m ⇒ GYValidatorHash → m GYAddress
- addressFromText' ∷ MonadError GYTxMonadException m ⇒ Text → m GYAddress
- addressFromPlutusM ∷ GYTxQueryMonad m ⇒ Address → m (Either PlutusToCardanoError GYAddress)
- addressFromPlutusHushedM ∷ GYTxQueryMonad m ⇒ Address → m (Maybe GYAddress)
- addressFromPlutus' ∷ GYTxQueryMonad m ⇒ Address → m GYAddress
- addressToPubKeyHash' ∷ MonadError GYTxMonadException m ⇒ GYAddress → m GYPubKeyHash
- addressToPubKeyHashIO ∷ GYAddress → IO GYPubKeyHash
- addressToValidatorHash' ∷ MonadError GYTxMonadException m ⇒ GYAddress → m GYValidatorHash
- addressToValidatorHashIO ∷ GYAddress → IO GYValidatorHash
- valueFromPlutus' ∷ MonadError GYTxMonadException m ⇒ Value → m GYValue
- valueFromPlutusIO ∷ Value → IO GYValue
- makeAssetClass' ∷ MonadError GYTxMonadException m ⇒ Text → Text → m GYAssetClass
- makeAssetClassIO ∷ Text → Text → IO GYAssetClass
- assetClassFromPlutus' ∷ MonadError GYTxMonadException m ⇒ AssetClass → m GYAssetClass
- tokenNameFromPlutus' ∷ MonadError GYTxMonadException m ⇒ TokenName → m GYTokenName
- txOutRefFromPlutus' ∷ MonadError GYTxMonadException m ⇒ TxOutRef → m GYTxOutRef
- datumHashFromPlutus' ∷ MonadError GYTxMonadException m ⇒ DatumHash → m GYDatumHash
- pubKeyHashFromPlutus' ∷ MonadError GYTxMonadException m ⇒ PubKeyHash → m GYPubKeyHash
- advanceSlot' ∷ MonadError GYTxMonadException m ⇒ GYSlot → Natural → m GYSlot
- utxosDatums ∷ ∀ m a. (GYTxQueryMonad m, FromData a) ⇒ GYUTxOs → m (Map GYTxOutRef (GYAddress, GYValue, a))
- utxoDatum ∷ (GYTxQueryMonad m, FromData a) ⇒ GYUTxO → m (Either GYQueryDatumError (GYAddress, GYValue, a))
- utxoDatumHushed ∷ (GYTxQueryMonad m, FromData a) ⇒ GYUTxO → m (Maybe (GYAddress, GYValue, a))
- utxoDatum' ∷ (GYTxQueryMonad m, FromData a) ⇒ GYUTxO → m (GYAddress, GYValue, a)
- mustHaveInput ∷ GYTxIn v → GYTxSkeleton v
- mustHaveRefInput ∷ VersionIsGreaterOrEqual v PlutusV2 ⇒ GYTxOutRef → GYTxSkeleton v
- mustHaveOutput ∷ GYTxOut v → GYTxSkeleton v
- mustHaveOptionalOutput ∷ Maybe (GYTxOut v) → GYTxSkeleton v
- mustMint ∷ GYMintingPolicy u → GYRedeemer → GYTokenName → Integer → GYTxSkeleton v
- mustBeSignedBy ∷ GYPubKeyHash → GYTxSkeleton v
- isInvalidBefore ∷ GYSlot → GYTxSkeleton v
- isInvalidAfter ∷ GYSlot → GYTxSkeleton v
- gyLogDebug' ∷ GYTxQueryMonad m ⇒ GYLogNamespace → String → m ()
- gyLogInfo' ∷ GYTxQueryMonad m ⇒ GYLogNamespace → String → m ()
- gyLogWarning' ∷ GYTxQueryMonad m ⇒ GYLogNamespace → String → m ()
- gyLogError' ∷ GYTxQueryMonad m ⇒ GYLogNamespace → String → m ()
- skeletonToRefScriptsORefs ∷ GYTxSkeleton v → [GYTxOutRef]
Documentation
class Monad m ⇒ MonadError e (m ∷ Type → Type) | m → e where #
The strategy of combining computations that can throw exceptions by bypassing bound functions from the point an exception is thrown to the point that it is handled.
Is parameterized over the type of error information and
the monad type constructor.
It is common to use
as the monad type constructor
for an error monad in which error descriptions take the form of strings.
In that case and many other common cases the resulting monad is already defined
as an instance of the Either
StringMonadError
class.
You can also define your own error type and/or use a monad type constructor
other than
or Either
String
.
In these cases you will have to explicitly define instances of the Either
IOError
MonadError
class.
(If you are using the deprecated Control.Monad.Error or
Control.Monad.Trans.Error, you may also have to define an Error
instance.)
throwError ∷ e → m a #
Is used within a monadic computation to begin exception processing.
catchError ∷ m a → (e → m a) → m a #
A handler function to handle previous errors and return to normal execution. A common idiom is:
do { action1; action2; action3 } `catchError` handler
where the action
functions can call throwError
.
Note that handler
and the do-block must have the same return type.
Instances
MonadError () Maybe | Since: mtl-2.2.2 |
Defined in Control.Monad.Error.Class throwError ∷ () → Maybe a # catchError ∷ Maybe a → (() → Maybe a) → Maybe a # | |
MonadError () EvaluationResult | |
Defined in PlutusCore.Evaluation.Result throwError ∷ () → EvaluationResult a # catchError ∷ EvaluationResult a → (() → EvaluationResult a) → EvaluationResult a # | |
MonadError IOException IO | |
Defined in Control.Monad.Error.Class throwError ∷ IOException → IO a # catchError ∷ IO a → (IOException → IO a) → IO a # | |
MonadError ClientError ClientM | |
Defined in Servant.Client.Internal.HttpClient throwError ∷ ClientError → ClientM a # catchError ∷ ClientM a → (ClientError → ClientM a) → ClientM a # | |
MonadError GYTxMonadException GYTxQueryMonadNode # | |
Defined in GeniusYield.TxBuilder.NodeQuery | |
MonadError GYTxMonadException GYTxMonadRun # | |
Defined in GeniusYield.TxBuilder.Run throwError ∷ GYTxMonadException → GYTxMonadRun a # catchError ∷ GYTxMonadRun a → (GYTxMonadException → GYTxMonadRun a) → GYTxMonadRun a # | |
MonadError GYTxMonadException GYTxMonadNode # | |
Defined in GeniusYield.TxBuilder.Node throwError ∷ GYTxMonadException → GYTxMonadNode a # catchError ∷ GYTxMonadNode a → (GYTxMonadException → GYTxMonadNode a) → GYTxMonadNode a # | |
MonadError e m ⇒ MonadError e (MaybeT m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → MaybeT m a # catchError ∷ MaybeT m a → (e → MaybeT m a) → MaybeT m a # | |
MonadError e m ⇒ MonadError e (ListT m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → ListT m a # catchError ∷ ListT m a → (e → ListT m a) → ListT m a # | |
MonadError e (Either e) | |
Defined in Control.Monad.Error.Class throwError ∷ e → Either e a # catchError ∷ Either e a → (e → Either e a) → Either e a # | |
MonadError e m ⇒ MonadError e (NoLoggingT m) | |
Defined in Katip.Monadic throwError ∷ e → NoLoggingT m a # catchError ∷ NoLoggingT m a → (e → NoLoggingT m a) → NoLoggingT m a # | |
MonadError e m ⇒ MonadError e (KatipContextT m) | |
Defined in Katip.Monadic throwError ∷ e → KatipContextT m a # catchError ∷ KatipContextT m a → (e → KatipContextT m a) → KatipContextT m a # | |
MonadError e m ⇒ MonadError e (ResourceT m) | |
Defined in Control.Monad.Trans.Resource.Internal throwError ∷ e → ResourceT m a # catchError ∷ ResourceT m a → (e → ResourceT m a) → ResourceT m a # | |
MonadError e m ⇒ MonadError e (ListT m) | |
Defined in ListT throwError ∷ e → ListT m a # catchError ∷ ListT m a → (e → ListT m a) → ListT m a # | |
MonadError e m ⇒ MonadError e (TreeT m) | |
Defined in Hedgehog.Internal.Tree throwError ∷ e → TreeT m a # catchError ∷ TreeT m a → (e → TreeT m a) → TreeT m a # | |
MonadError e m ⇒ MonadError e (TestT m) | |
Defined in Hedgehog.Internal.Property throwError ∷ e → TestT m a # catchError ∷ TestT m a → (e → TestT m a) → TestT m a # | |
MonadError e m ⇒ MonadError e (PropertyT m) | |
Defined in Hedgehog.Internal.Property throwError ∷ e → PropertyT m a # catchError ∷ PropertyT m a → (e → PropertyT m a) → PropertyT m a # | |
MonadError e m ⇒ MonadError e (GenT m) | |
Defined in Hedgehog.Internal.Gen throwError ∷ e → GenT m a # catchError ∷ GenT m a → (e → GenT m a) → GenT m a # | |
(Functor m, MonadError e m) ⇒ MonadError e (Free m) | |
Defined in Control.Monad.Free throwError ∷ e → Free m a # catchError ∷ Free m a → (e → Free m a) → Free m a # | |
Monad m ⇒ MonadError e (ExceptT e m) | Since: mtl-2.2 |
Defined in Control.Monad.Error.Class throwError ∷ e → ExceptT e m a # catchError ∷ ExceptT e m a → (e → ExceptT e m a) → ExceptT e m a # | |
(Monoid w, MonadError e m) ⇒ MonadError e (WriterT w m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → WriterT w m a # catchError ∷ WriterT w m a → (e → WriterT w m a) → WriterT w m a # | |
(Monoid w, MonadError e m) ⇒ MonadError e (WriterT w m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → WriterT w m a # catchError ∷ WriterT w m a → (e → WriterT w m a) → WriterT w m a # | |
MonadError e m ⇒ MonadError e (StateT s m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → StateT s m a # catchError ∷ StateT s m a → (e → StateT s m a) → StateT s m a # | |
MonadError e m ⇒ MonadError e (StateT s m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → StateT s m a # catchError ∷ StateT s m a → (e → StateT s m a) → StateT s m a # | |
MonadError e m ⇒ MonadError e (ReaderT r m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → ReaderT r m a # catchError ∷ ReaderT r m a → (e → ReaderT r m a) → ReaderT r m a # | |
MonadError e m ⇒ MonadError e (IdentityT m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → IdentityT m a # catchError ∷ IdentityT m a → (e → IdentityT m a) → IdentityT m a # | |
(Monad m, Error e) ⇒ MonadError e (ErrorT e m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → ErrorT e m a # catchError ∷ ErrorT e m a → (e → ErrorT e m a) → ErrorT e m a # | |
(Functor f, MonadError e m) ⇒ MonadError e (FreeT f m) | |
Defined in Control.Monad.Trans.Free throwError ∷ e → FreeT f m a # catchError ∷ FreeT f m a → (e → FreeT f m a) → FreeT f m a # | |
MonadError e m ⇒ MonadError e (RandT g m) | |
Defined in Control.Monad.Trans.Random.Strict throwError ∷ e → RandT g m a # catchError ∷ RandT g m a → (e → RandT g m a) → RandT g m a # | |
MonadError e m ⇒ MonadError e (RandT g m) | |
Defined in Control.Monad.Trans.Random.Lazy throwError ∷ e → RandT g m a # catchError ∷ RandT g m a → (e → RandT g m a) → RandT g m a # | |
MonadError e m ⇒ MonadError e (ConduitT i o m) | |
Defined in Data.Conduit.Internal.Conduit throwError ∷ e → ConduitT i o m a # catchError ∷ ConduitT i o m a → (e → ConduitT i o m a) → ConduitT i o m a # | |
(Monoid w, MonadError e m) ⇒ MonadError e (RWST r w s m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → RWST r w s m a # catchError ∷ RWST r w s m a → (e → RWST r w s m a) → RWST r w s m a # | |
(Monoid w, MonadError e m) ⇒ MonadError e (RWST r w s m) | |
Defined in Control.Monad.Error.Class throwError ∷ e → RWST r w s m a # catchError ∷ RWST r w s m a → (e → RWST r w s m a) → RWST r w s m a # | |
MonadError e m ⇒ MonadError e (Pipe l i o u m) | |
Defined in Data.Conduit.Internal.Pipe throwError ∷ e → Pipe l i o u m a # catchError ∷ Pipe l i o u m a → (e → Pipe l i o u m a) → Pipe l i o u m a # | |
PrettyUni uni fun ⇒ MonadError (CekEvaluationException NamedDeBruijn uni fun) (CekM uni fun s) | |
Defined in UntypedPlutusCore.Evaluation.Machine.Cek.Internal throwError ∷ CekEvaluationException NamedDeBruijn uni fun → CekM uni fun s a # catchError ∷ CekM uni fun s a → (CekEvaluationException NamedDeBruijn uni fun → CekM uni fun s a) → CekM uni fun s a # |
class Monad m ⇒ MonadRandom (m ∷ Type → Type) where #
getRandomR ∷ Random a ⇒ (a, a) → m a #
getRandomRs ∷ Random a ⇒ (a, a) → m [a] #
getRandoms ∷ Random a ⇒ m [a] #
Instances
MonadRandom IO | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → IO a # getRandomRs ∷ Random a ⇒ (a, a) → IO [a] # getRandoms ∷ Random a ⇒ IO [a] # | |
MonadRandom NonRandom | |
Defined in Control.Monad.Random.NonRandom getRandomR ∷ Random a ⇒ (a, a) → NonRandom a # getRandom ∷ Random a ⇒ NonRandom a # getRandomRs ∷ Random a ⇒ (a, a) → NonRandom [a] # getRandoms ∷ Random a ⇒ NonRandom [a] # | |
MonadRandom GYTxMonadRun # | |
Defined in GeniusYield.TxBuilder.Run getRandomR ∷ Random a ⇒ (a, a) → GYTxMonadRun a # getRandom ∷ Random a ⇒ GYTxMonadRun a # getRandomRs ∷ Random a ⇒ (a, a) → GYTxMonadRun [a] # getRandoms ∷ Random a ⇒ GYTxMonadRun [a] # | |
MonadRandom GYTxMonadNode # | |
Defined in GeniusYield.TxBuilder.Node getRandomR ∷ Random a ⇒ (a, a) → GYTxMonadNode a # getRandom ∷ Random a ⇒ GYTxMonadNode a # getRandomRs ∷ Random a ⇒ (a, a) → GYTxMonadNode [a] # getRandoms ∷ Random a ⇒ GYTxMonadNode [a] # | |
MonadRandom m ⇒ MonadRandom (MaybeT m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → MaybeT m a # getRandom ∷ Random a ⇒ MaybeT m a # getRandomRs ∷ Random a ⇒ (a, a) → MaybeT m [a] # getRandoms ∷ Random a ⇒ MaybeT m [a] # | |
MonadRandom m ⇒ MonadRandom (ExceptT e m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → ExceptT e m a # getRandom ∷ Random a ⇒ ExceptT e m a # getRandomRs ∷ Random a ⇒ (a, a) → ExceptT e m [a] # getRandoms ∷ Random a ⇒ ExceptT e m [a] # | |
MonadRandom m ⇒ MonadRandom (IdentityT m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → IdentityT m a # getRandom ∷ Random a ⇒ IdentityT m a # getRandomRs ∷ Random a ⇒ (a, a) → IdentityT m [a] # getRandoms ∷ Random a ⇒ IdentityT m [a] # | |
MonadRandom m ⇒ MonadRandom (ReaderT r m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → ReaderT r m a # getRandom ∷ Random a ⇒ ReaderT r m a # getRandomRs ∷ Random a ⇒ (a, a) → ReaderT r m [a] # getRandoms ∷ Random a ⇒ ReaderT r m [a] # | |
MonadRandom m ⇒ MonadRandom (StateT s m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → StateT s m a # getRandom ∷ Random a ⇒ StateT s m a # getRandomRs ∷ Random a ⇒ (a, a) → StateT s m [a] # getRandoms ∷ Random a ⇒ StateT s m [a] # | |
MonadRandom m ⇒ MonadRandom (StateT s m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → StateT s m a # getRandom ∷ Random a ⇒ StateT s m a # getRandomRs ∷ Random a ⇒ (a, a) → StateT s m [a] # getRandoms ∷ Random a ⇒ StateT s m [a] # | |
(MonadRandom m, Monoid w) ⇒ MonadRandom (WriterT w m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → WriterT w m a # getRandom ∷ Random a ⇒ WriterT w m a # getRandomRs ∷ Random a ⇒ (a, a) → WriterT w m [a] # getRandoms ∷ Random a ⇒ WriterT w m [a] # | |
(MonadRandom m, Monoid w) ⇒ MonadRandom (WriterT w m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → WriterT w m a # getRandom ∷ Random a ⇒ WriterT w m a # getRandomRs ∷ Random a ⇒ (a, a) → WriterT w m [a] # getRandoms ∷ Random a ⇒ WriterT w m [a] # | |
(RandomGen g, Monad m) ⇒ MonadRandom (RandT g m) | |
Defined in Control.Monad.Trans.Random.Lazy getRandomR ∷ Random a ⇒ (a, a) → RandT g m a # getRandom ∷ Random a ⇒ RandT g m a # getRandomRs ∷ Random a ⇒ (a, a) → RandT g m [a] # getRandoms ∷ Random a ⇒ RandT g m [a] # | |
(RandomGen g, Monad m) ⇒ MonadRandom (RandT g m) | |
Defined in Control.Monad.Trans.Random.Strict getRandomR ∷ Random a ⇒ (a, a) → RandT g m a # getRandom ∷ Random a ⇒ RandT g m a # getRandomRs ∷ Random a ⇒ (a, a) → RandT g m [a] # getRandoms ∷ Random a ⇒ RandT g m [a] # | |
MonadRandom m ⇒ MonadRandom (ContT r m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → ContT r m a # getRandom ∷ Random a ⇒ ContT r m a # getRandomRs ∷ Random a ⇒ (a, a) → ContT r m [a] # getRandoms ∷ Random a ⇒ ContT r m [a] # | |
(Monoid w, MonadRandom m) ⇒ MonadRandom (RWST r w s m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → RWST r w s m a # getRandom ∷ Random a ⇒ RWST r w s m a # getRandomRs ∷ Random a ⇒ (a, a) → RWST r w s m [a] # getRandoms ∷ Random a ⇒ RWST r w s m [a] # | |
(Monoid w, MonadRandom m) ⇒ MonadRandom (RWST r w s m) | |
Defined in Control.Monad.Random.Class getRandomR ∷ Random a ⇒ (a, a) → RWST r w s m a # getRandom ∷ Random a ⇒ RWST r w s m a # getRandomRs ∷ Random a ⇒ (a, a) → RWST r w s m [a] # getRandoms ∷ Random a ⇒ RWST r w s m [a] # |
class GYTxQueryMonad m ⇒ GYTxMonad m where #
Class of monads for querying monads as a user.
someUTxO ∷ m GYTxOutRef #
Return some unspend transaction output
Note: may or may not return the same value
A seed to inject non-determinism.
Instances
GYTxMonad GYTxMonadRun # | |
Defined in GeniusYield.TxBuilder.Run | |
GYTxMonad GYTxMonadNode # | |
Defined in GeniusYield.TxBuilder.Node | |
GYTxMonad m ⇒ GYTxMonad (ExceptT GYTxMonadException m) # | |
Defined in GeniusYield.TxBuilder.Class | |
GYTxMonad m ⇒ GYTxMonad (ReaderT g m) # | |
Defined in GeniusYield.TxBuilder.Class | |
GYTxMonad m ⇒ GYTxMonad (RandT g m) # | |
Defined in GeniusYield.TxBuilder.Class |
class MonadError GYTxMonadException m ⇒ GYTxQueryMonad m where #
Class of monads for querying chain data.
networkId, lookupDatum, (utxoAtTxOutRef | utxosAtTxOutRefs), (utxosAtAddress | utxosAtAddresses), slotConfig, currentSlot, logMsg
networkId ∷ m GYNetworkId #
Get the network id
lookupDatum ∷ GYDatumHash → m (Maybe GYDatum) #
Lookup datum by its hash.
utxoAtTxOutRef ∷ GYTxOutRef → m (Maybe GYUTxO) #
Lookup GYUTxO
at GYTxOutRef
.
utxosAtTxOutRefs ∷ [GYTxOutRef] → m GYUTxOs #
Lookup GYUTxOs
at multiple GYTxOutRef
s at once
utxosAtAddress ∷ GYAddress → m GYUTxOs #
utxosAtAddresses ∷ [GYAddress] → m GYUTxOs #
utxoRefsAtAddress ∷ GYAddress → m [GYTxOutRef] #
Lookup the `[GYTxOutRef]`s at a GYAddress
slotConfig ∷ m GYSlotConfig #
Obtain the slot config for the network.
Implementations using era history to create slot config may raise GYEraSummariesToSlotConfigError
.
currentSlot ∷ m GYSlot #
Lookup the current GYSlot
.
logMsg ∷ HasCallStack ⇒ GYLogNamespace → GYLogSeverity → String → m () #
Log a message with specified namespace and severity.
Instances
data GYTxSkeleton (v ∷ PlutusVersion) #
Transaction skeleton
Note: let's add fields as we need them.
The parameter v
indicates the minimum version of scripts allowed
as inputs.
GYTxSkeleton | |
|
Instances
Show (GYTxSkeleton v) # | |
Defined in GeniusYield.TxBuilder.Class showsPrec ∷ Int → GYTxSkeleton v → ShowS # show ∷ GYTxSkeleton v → String # showList ∷ [GYTxSkeleton v] → ShowS # | |
Semigroup (GYTxSkeleton v) # | |
Defined in GeniusYield.TxBuilder.Class (<>) ∷ GYTxSkeleton v → GYTxSkeleton v → GYTxSkeleton v # sconcat ∷ NonEmpty (GYTxSkeleton v) → GYTxSkeleton v # stimes ∷ Integral b ⇒ b → GYTxSkeleton v → GYTxSkeleton v # | |
Monoid (GYTxSkeleton v) # | |
Defined in GeniusYield.TxBuilder.Class mempty ∷ GYTxSkeleton v # mappend ∷ GYTxSkeleton v → GYTxSkeleton v → GYTxSkeleton v # mconcat ∷ [GYTxSkeleton v] → GYTxSkeleton v # |
data GYTxSkeletonRefIns ∷ PlutusVersion → Type where #
GYTxSkeletonRefIns ∷ VersionIsGreaterOrEqual v PlutusV2 ⇒ !(Set GYTxOutRef) → GYTxSkeletonRefIns v | |
GYTxSkeletonNoRefIns ∷ GYTxSkeletonRefIns v |
Instances
Eq (GYTxSkeletonRefIns v) # | |
Defined in GeniusYield.TxBuilder.Class (==) ∷ GYTxSkeletonRefIns v → GYTxSkeletonRefIns v → Bool # (/=) ∷ GYTxSkeletonRefIns v → GYTxSkeletonRefIns v → Bool # | |
Show (GYTxSkeletonRefIns v) # | |
Defined in GeniusYield.TxBuilder.Class showsPrec ∷ Int → GYTxSkeletonRefIns v → ShowS # show ∷ GYTxSkeletonRefIns v → String # showList ∷ [GYTxSkeletonRefIns v] → ShowS # | |
Semigroup (GYTxSkeletonRefIns v) # | |
Defined in GeniusYield.TxBuilder.Class (<>) ∷ GYTxSkeletonRefIns v → GYTxSkeletonRefIns v → GYTxSkeletonRefIns v # sconcat ∷ NonEmpty (GYTxSkeletonRefIns v) → GYTxSkeletonRefIns v # stimes ∷ Integral b ⇒ b → GYTxSkeletonRefIns v → GYTxSkeletonRefIns v # |
data RandT g (m ∷ Type → Type) a #
Instances
lookupDatum' ∷ GYTxQueryMonad m ⇒ GYDatumHash → m GYDatum #
A version of lookupDatum
that raises GYNoDatumForHash
if the datum is not found.
utxoAtTxOutRef' ∷ GYTxQueryMonad m ⇒ GYTxOutRef → m GYUTxO #
A version of utxoAtTxOutRef
that raises GYNoUtxoAtRef
if the utxo is not found.
slotToBeginTime ∷ GYTxQueryMonad f ⇒ GYSlot → f GYTime #
slotToEndTime ∷ GYTxQueryMonad f ⇒ GYSlot → f GYTime #
enclosingSlotFromTime ∷ GYTxQueryMonad f ⇒ GYTime → f (Maybe GYSlot) #
enclosingSlotFromTime' ∷ GYTxQueryMonad m ⇒ GYTime → m GYSlot #
Partial version of enclosingSlotFromTime
.
Raises GYTimeUnderflowException
if given time is before known system start.
scriptAddress ∷ GYTxQueryMonad m ⇒ GYValidator v → m GYAddress #
Calculate script's address.
scriptAddress' ∷ GYTxQueryMonad m ⇒ GYValidatorHash → m GYAddress #
Calculate script's address.
addressFromText' ∷ MonadError GYTxMonadException m ⇒ Text → m GYAddress #
Parse the bech32 representation of an address into GYAddress
in GYTxMonad
.
Throw GYConversionException
if parsing fails.
addressFromPlutusM ∷ GYTxQueryMonad m ⇒ Address → m (Either PlutusToCardanoError GYAddress) #
addressFromPlutusHushedM ∷ GYTxQueryMonad m ⇒ Address → m (Maybe GYAddress) #
hush
ed version of addressFromPlutusM
.
addressFromPlutus' ∷ GYTxQueryMonad m ⇒ Address → m GYAddress #
Convert a Address
to GYAddress
in GYTxMonad
.
Throw GYConversionException
if conversion fails.
addressToPubKeyHash' ∷ MonadError GYTxMonadException m ⇒ GYAddress → m GYPubKeyHash #
Convert GYAddress
to GYPubKeyHash
in GYTxMonad
.
Throw GYConversionException
if address is not key-hash one.
addressToValidatorHash' ∷ MonadError GYTxMonadException m ⇒ GYAddress → m GYValidatorHash #
Convert GYAddress
to GYValidatorHash
in GYTxMonad
.
Throw GYConversionException
if address is not script-hash one.
valueFromPlutus' ∷ MonadError GYTxMonadException m ⇒ Value → m GYValue #
Convert a Value
to GYValue
in GYTxMonad
.
Throw GYConversionException
if conversion fails.
valueFromPlutusIO ∷ Value → IO GYValue #
Convert a Value
to GYValue
in IO
.
Throw GYConversionException
if conversion fails.
makeAssetClass' ∷ MonadError GYTxMonadException m ⇒ Text → Text → m GYAssetClass #
Create a GYAssetClass
from the textual representation of currency symbol and token name in GYTxMonad
.
Throw GYConversionException
if conversion fails.
makeAssetClassIO ∷ Text → Text → IO GYAssetClass #
makeAssetClass'
in the IO monad.
Throw GYConversionException
if conversion fails.
assetClassFromPlutus' ∷ MonadError GYTxMonadException m ⇒ AssetClass → m GYAssetClass #
Convert a AssetClass
to GYAssetClass
in GYTxMonad
.
Throw GYConversionException
if conversion fails.
tokenNameFromPlutus' ∷ MonadError GYTxMonadException m ⇒ TokenName → m GYTokenName #
Convert a TokenName
to GYTokenName
in GYTxMonad
.
Throw GYConversionException
if conversion fails.
txOutRefFromPlutus' ∷ MonadError GYTxMonadException m ⇒ TxOutRef → m GYTxOutRef #
Convert a TxOutRef
to GYTxOutRef
in GYTxMonad
.
Throw GYConversionException
if conversion fails.
datumHashFromPlutus' ∷ MonadError GYTxMonadException m ⇒ DatumHash → m GYDatumHash #
Convert a DatumHash
to GYDatumHash
in GYTxMonad
.
Throw GYConversionException
if conversion fails.
pubKeyHashFromPlutus' ∷ MonadError GYTxMonadException m ⇒ PubKeyHash → m GYPubKeyHash #
Convert a PubKeyHash
to GYPubKeyHash
in GYTxMonad
.
Throw GYConversionException
if conversion fails.
advanceSlot' ∷ MonadError GYTxMonadException m ⇒ GYSlot → Natural → m GYSlot #
Advance GYSlot
forward in GYTxMonad
. If slot value overflows, throw GYSlotOverflowException
.
utxosDatums ∷ ∀ m a. (GYTxQueryMonad m, FromData a) ⇒ GYUTxOs → m (Map GYTxOutRef (GYAddress, GYValue, a)) #
utxoDatum ∷ (GYTxQueryMonad m, FromData a) ⇒ GYUTxO → m (Either GYQueryDatumError (GYAddress, GYValue, a)) #
utxoDatumHushed ∷ (GYTxQueryMonad m, FromData a) ⇒ GYUTxO → m (Maybe (GYAddress, GYValue, a)) #
utxoDatum' ∷ (GYTxQueryMonad m, FromData a) ⇒ GYUTxO → m (GYAddress, GYValue, a) #
Version of utxoDatum
that throws GYTxMonadException
.
mustHaveInput ∷ GYTxIn v → GYTxSkeleton v #
mustHaveOutput ∷ GYTxOut v → GYTxSkeleton v #
mustHaveOptionalOutput ∷ Maybe (GYTxOut v) → GYTxSkeleton v #
mustMint ∷ GYMintingPolicy u → GYRedeemer → GYTokenName → Integer → GYTxSkeleton v #
isInvalidBefore ∷ GYSlot → GYTxSkeleton v #
isInvalidAfter ∷ GYSlot → GYTxSkeleton v #
gyLogDebug' ∷ GYTxQueryMonad m ⇒ GYLogNamespace → String → m () #
gyLogInfo' ∷ GYTxQueryMonad m ⇒ GYLogNamespace → String → m () #
gyLogWarning' ∷ GYTxQueryMonad m ⇒ GYLogNamespace → String → m () #
gyLogError' ∷ GYTxQueryMonad m ⇒ GYLogNamespace → String → m () #
skeletonToRefScriptsORefs ∷ GYTxSkeleton v → [GYTxOutRef] #
Given a skeleton, returns a list of reference to reference script UTxOs which are present as witness.