plutus-contract-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.Contract.Trace.RequestHandler

Synopsis

Documentation

newtype RequestHandler effs req resp Source #

Request handlers that can choose whether to handle an effect (using Alternative). This is useful if req is a sum type.

Constructors

RequestHandler 

Fields

Instances

Instances details
Arrow (RequestHandler effs) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

arr :: (b -> c) -> RequestHandler effs b c Source #

first :: RequestHandler effs b c -> RequestHandler effs (b, d) (c, d) Source #

second :: RequestHandler effs b c -> RequestHandler effs (d, b) (d, c) Source #

(***) :: RequestHandler effs b c -> RequestHandler effs b' c' -> RequestHandler effs (b, b') (c, c') Source #

(&&&) :: RequestHandler effs b c -> RequestHandler effs b c' -> RequestHandler effs b (c, c') Source #

Profunctor (RequestHandler effs) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

dimap :: (a -> b) -> (c -> d) -> RequestHandler effs b c -> RequestHandler effs a d

lmap :: (a -> b) -> RequestHandler effs b c -> RequestHandler effs a c

rmap :: (b -> c) -> RequestHandler effs a b -> RequestHandler effs a c

(#.) :: forall a b c q. Coercible c b => q b c -> RequestHandler effs a b -> RequestHandler effs a c

(.#) :: forall a b c q. Coercible b a => RequestHandler effs b c -> q a b -> RequestHandler effs a c

Category (RequestHandler effs :: Type -> Type -> Type) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

id :: forall (a :: k). RequestHandler effs a a Source #

(.) :: forall (b :: k) (c :: k) (a :: k). RequestHandler effs b c -> RequestHandler effs a b -> RequestHandler effs a c Source #

Functor (RequestHandler effs req) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

fmap :: (a -> b) -> RequestHandler effs req a -> RequestHandler effs req b Source #

(<$) :: a -> RequestHandler effs req b -> RequestHandler effs req a Source #

Semigroup (RequestHandler effs req resp) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

(<>) :: RequestHandler effs req resp -> RequestHandler effs req resp -> RequestHandler effs req resp Source #

sconcat :: NonEmpty (RequestHandler effs req resp) -> RequestHandler effs req resp Source #

stimes :: Integral b => b -> RequestHandler effs req resp -> RequestHandler effs req resp Source #

Monoid (RequestHandler effs req resp) Source # 
Instance details

Defined in Plutus.Contract.Trace.RequestHandler

Methods

mempty :: RequestHandler effs req resp Source #

mappend :: RequestHandler effs req resp -> RequestHandler effs req resp -> RequestHandler effs req resp Source #

mconcat :: [RequestHandler effs req resp] -> RequestHandler effs req resp Source #

data RequestHandlerLogMsg Source #

Instances

Instances details
Eq RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

Show RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

Generic RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

Associated Types

type Rep RequestHandlerLogMsg :: Type -> Type Source #

FromJSON RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

Methods

parseJSON :: Value -> Parser RequestHandlerLogMsg

parseJSONList :: Value -> Parser [RequestHandlerLogMsg]

ToJSON RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

Pretty RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

Methods

pretty :: RequestHandlerLogMsg -> Doc ann

prettyList :: [RequestHandlerLogMsg] -> Doc ann

type Rep RequestHandlerLogMsg Source # 
Instance details

Defined in Wallet.Emulator.LogMessages

type Rep RequestHandlerLogMsg = D1 ('MetaData "RequestHandlerLogMsg" "Wallet.Emulator.LogMessages" "plutus-contract-1.2.0.0-FH8LC9wh7UV4Nmv68NHXrC" 'False) ((C1 ('MetaCons "SlotNoticationTargetVsCurrent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Slot) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Slot)) :+: C1 ('MetaCons "StartWatchingContractAddresses" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "HandleTxFailed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 WalletAPIError)) :+: (C1 ('MetaCons "UtxoAtFailed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address)) :+: C1 ('MetaCons "AdjustingUnbalancedTx" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Lovelace])))))

tryHandler :: forall effs req resp. RequestHandler effs req resp -> [req] -> Eff effs (Maybe resp) Source #

tryHandler' :: forall f effs req resp. (Alternative f, Monad f) => RequestHandler effs req (f resp) -> [req] -> Eff effs (f resp) Source #

wrapHandler :: RequestHandler effs req resp -> RequestHandler effs (Request req) (Response resp) Source #

extract :: Alternative f => Prism' a b -> a -> f b Source #

maybeToHandler :: (req -> Maybe resp) -> RequestHandler effs req resp Source #

generalise :: forall effs req req' resp resp'. (req' -> Maybe req) -> (resp -> resp') -> RequestHandler effs req resp -> RequestHandler effs req' resp' Source #

Generalise a request handler

handlers for common requests

handleAdjustUnbalancedTx :: forall effs. (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member NodeClientEffect effs) => RequestHandler effs UnbalancedTx UnbalancedTx Source #

handleOwnAddresses :: forall a effs. (Member WalletEffect effs, Member (LogObserve (LogMessage Text)) effs) => RequestHandler effs a (NonEmpty CardanoAddress) Source #

handleSlotNotifications :: forall effs. (Member NodeClientEffect effs, Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs) => RequestHandler effs Slot Slot Source #

handleCurrentNodeClientSlot :: forall effs a. (Member NodeClientEffect effs, Member (LogObserve (LogMessage Text)) effs) => RequestHandler effs a Slot Source #

handleCurrentChainIndexSlot :: forall effs a. (Member (LogObserve (LogMessage Text)) effs, Member ChainIndexQueryEffect effs) => RequestHandler effs a Slot Source #

handleTimeNotifications :: forall effs. (Member NodeClientEffect effs, Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs) => RequestHandler effs POSIXTime POSIXTime Source #

handleCurrentTime :: forall effs a. (Member NodeClientEffect effs, Member (LogObserve (LogMessage Text)) effs) => RequestHandler effs a POSIXTime Source #

handleCurrentNodeClientTimeRange :: forall effs a. (Member NodeClientEffect effs, Member (LogObserve (LogMessage Text)) effs) => RequestHandler effs a (POSIXTime, POSIXTime) Source #

handleTimeToSlotConversions :: forall effs. (Member NodeClientEffect effs, Member (LogObserve (LogMessage Text)) effs) => RequestHandler effs POSIXTimeRange SlotRange Source #

handleUnbalancedTransactions :: forall effs. (Member WalletEffect effs, Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs) => RequestHandler effs UnbalancedTx (Either WalletAPIError CardanoTx) Source #

handlePendingTransactions :: forall effs. (Member WalletEffect effs, Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs) => RequestHandler effs CardanoTx (Either WalletAPIError CardanoTx) Source #

handleChainIndexQueries :: forall effs. (Member (LogObserve (LogMessage Text)) effs, Member ChainIndexQueryEffect effs) => RequestHandler effs ChainIndexQuery ChainIndexResponse Source #

handleOwnInstanceIdQueries :: forall effs a. (Member (LogObserve (LogMessage Text)) effs, Member (Reader ContractInstanceId) effs) => RequestHandler effs a ContractInstanceId Source #

handleYieldedUnbalancedTx :: forall effs. (Member WalletEffect effs, Member (LogObserve (LogMessage Text)) effs) => RequestHandler effs UnbalancedTx () Source #

handleGetParams :: forall effs. (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs () Params Source #