hydra-node-0.20.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.20.0-5pXAEiXeWsXH8K4KfwlMxW" '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.20.0-5pXAEiXeWsXH8K4KfwlMxW" '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.20.0-5pXAEiXeWsXH8K4KfwlMxW" 'False) (C1 ('MetaCons "TransactionSubmitted" 'PrefixI 'False) (U1 :: Type -> Type))

httpApp Source #

Arguments

:: forall tx. IsChainState tx 
=> Tracer IO APIServerLog 
-> Chain tx IO 
-> Environment 
-> PParams LedgerEra 
-> IO CommitInfo

A means to get commit info.

-> IO (Maybe (UTxOType tx))

Get latest confirmed UTxO snapshot.

-> IO [TxIdType tx]

Get the pending commits (deposits)

-> (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 
=> Environment 
-> Chain tx IO 
-> IO CommitInfo

A means to get commit info.

-> ByteString

Request body.

-> IO Response 

Handle request to obtain a draft commit tx.

handleRecoverCommitUtxo :: forall tx. IsChainState tx => (ClientInput tx -> IO ()) -> Text -> ByteString -> IO Response Source #

Handle request to recover a pending deposit.

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 #