hydra-node-0.19.0: The Hydra node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.API.HTTPServer

Contents

Synopsis

Documentation

newtype DraftCommitTxResponse tx Source #

Constructors

DraftCommitTxResponse 

Fields

Instances

Instances details
Arbitrary tx => Arbitrary (DraftCommitTxResponse tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

IsTx tx => FromJSON (DraftCommitTxResponse tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

IsTx tx => ToJSON (DraftCommitTxResponse tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

Generic (DraftCommitTxResponse tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

Associated Types

type Rep (DraftCommitTxResponse tx) :: Type -> Type Source #

Show tx => Show (DraftCommitTxResponse tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

type Rep (DraftCommitTxResponse tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

type Rep (DraftCommitTxResponse tx) = D1 ('MetaData "DraftCommitTxResponse" "Hydra.API.HTTPServer" "hydra-node-0.19.0-6Z4E5vp1s1XJuLOmmEVMTw" 'True) (C1 ('MetaCons "DraftCommitTxResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "commitTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 tx)))

data DraftCommitTxRequest tx Source #

Constructors

SimpleCommitRequest 

Fields

FullCommitRequest 

Fields

Instances

Instances details
(Arbitrary tx, Arbitrary (UTxOType tx)) => Arbitrary (DraftCommitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

(FromJSON tx, FromJSON (UTxOType tx)) => FromJSON (DraftCommitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

Methods

parseJSON :: Value -> Parser (DraftCommitTxRequest tx)

parseJSONList :: Value -> Parser [DraftCommitTxRequest tx]

omittedField :: Maybe (DraftCommitTxRequest tx)

(ToJSON tx, ToJSON (UTxOType tx)) => ToJSON (DraftCommitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

Generic (DraftCommitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

Associated Types

type Rep (DraftCommitTxRequest tx) :: Type -> Type Source #

(Show tx, Show (UTxOType tx)) => Show (DraftCommitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

(Eq tx, Eq (UTxOType tx)) => Eq (DraftCommitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

type Rep (DraftCommitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

type Rep (DraftCommitTxRequest tx) = D1 ('MetaData "DraftCommitTxRequest" "Hydra.API.HTTPServer" "hydra-node-0.19.0-6Z4E5vp1s1XJuLOmmEVMTw" 'False) (C1 ('MetaCons "SimpleCommitRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "utxoToCommit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (UTxOType tx))) :+: C1 ('MetaCons "FullCommitRequest" 'PrefixI 'True) (S1 ('MetaSel ('Just "blueprintTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 tx) :*: S1 ('MetaSel ('Just "utxo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (UTxOType tx))))

newtype SubmitTxRequest tx Source #

Constructors

SubmitTxRequest 

Fields

Instances

Instances details
Arbitrary tx => Arbitrary (SubmitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

FromJSON tx => FromJSON (SubmitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

Methods

parseJSON :: Value -> Parser (SubmitTxRequest tx)

parseJSONList :: Value -> Parser [SubmitTxRequest tx]

omittedField :: Maybe (SubmitTxRequest tx)

ToJSON tx => ToJSON (SubmitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

Methods

toJSON :: SubmitTxRequest tx -> Value

toEncoding :: SubmitTxRequest tx -> Encoding

toJSONList :: [SubmitTxRequest tx] -> Value

toEncodingList :: [SubmitTxRequest tx] -> Encoding

omitField :: SubmitTxRequest tx -> Bool

Show tx => Show (SubmitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

Eq tx => Eq (SubmitTxRequest tx) Source # 
Instance details

Defined in Hydra.API.HTTPServer

data TransactionSubmitted Source #

Constructors

TransactionSubmitted 

Instances

Instances details
Arbitrary TransactionSubmitted Source # 
Instance details

Defined in Hydra.API.HTTPServer

FromJSON TransactionSubmitted Source # 
Instance details

Defined in Hydra.API.HTTPServer

ToJSON TransactionSubmitted Source # 
Instance details

Defined in Hydra.API.HTTPServer

Generic TransactionSubmitted Source # 
Instance details

Defined in Hydra.API.HTTPServer

Associated Types

type Rep TransactionSubmitted :: Type -> Type Source #

Show TransactionSubmitted Source # 
Instance details

Defined in Hydra.API.HTTPServer

Eq TransactionSubmitted Source # 
Instance details

Defined in Hydra.API.HTTPServer

type Rep TransactionSubmitted Source # 
Instance details

Defined in Hydra.API.HTTPServer

type Rep TransactionSubmitted = D1 ('MetaData "TransactionSubmitted" "Hydra.API.HTTPServer" "hydra-node-0.19.0-6Z4E5vp1s1XJuLOmmEVMTw" 'False) (C1 ('MetaCons "TransactionSubmitted" 'PrefixI 'False) (U1 :: Type -> Type))

httpApp Source #

Arguments

:: forall tx. IsChainState tx 
=> Tracer IO APIServerLog 
-> Chain tx IO 
-> PParams LedgerEra 
-> IO (Maybe HeadId)

A means to get the HeadId if initializing the Head.

-> IO (Maybe (UTxOType tx))

Get latest confirmed UTxO snapshot.

-> (ClientInput tx -> IO ())

Callback to yield a ClientInput to the main event loop.

-> Application 

Hydra HTTP server

Handlers

handleDraftCommitUtxo Source #

Arguments

:: forall tx. IsChainState tx 
=> Chain tx IO 
-> IO (Maybe HeadId)

A means to get the HeadId if initializing the Head.

-> ByteString

Request body.

-> IO Response 

Handle request to obtain a draft commit tx.

handleSubmitUserTx Source #

Arguments

:: forall tx. FromJSON tx 
=> Chain tx IO 
-> ByteString

Request body.

-> IO Response 

Handle request to submit a cardano transaction.

handleDecommit :: forall tx. FromJSON tx => (ClientInput tx -> IO ()) -> ByteString -> IO Response Source #

badRequest :: IsChainState tx => PostTxError tx -> Response Source #

notFound :: Response Source #

okJSON :: ToJSON a => a -> Response Source #