Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Hydra.API.HTTPServer
Contents
Synopsis
- newtype DraftCommitTxResponse tx = DraftCommitTxResponse {
- commitTx :: tx
- data DraftCommitTxRequest tx
- = SimpleCommitRequest {
- utxoToCommit :: UTxOType tx
- | FullCommitRequest {
- blueprintTx :: tx
- utxo :: UTxOType tx
- = SimpleCommitRequest {
- newtype SubmitTxRequest tx = SubmitTxRequest {
- txToSubmit :: tx
- data TransactionSubmitted = TransactionSubmitted
- httpApp :: forall tx. IsChainState tx => Tracer IO APIServerLog -> Chain tx IO -> PParams LedgerEra -> IO (Maybe HeadId) -> IO (Maybe (UTxOType tx)) -> (ClientInput tx -> IO ()) -> Application
- handleDraftCommitUtxo :: forall tx. IsChainState tx => Chain tx IO -> IO (Maybe HeadId) -> ByteString -> IO Response
- handleSubmitUserTx :: forall tx. FromJSON tx => Chain tx IO -> ByteString -> IO Response
- handleDecommit :: forall tx. FromJSON tx => (ClientInput tx -> IO ()) -> ByteString -> IO Response
- badRequest :: IsChainState tx => PostTxError tx -> Response
- notFound :: Response
- okJSON :: ToJSON a => a -> Response
Documentation
newtype DraftCommitTxResponse tx Source #
Constructors
DraftCommitTxResponse | |
Fields
|
Instances
data DraftCommitTxRequest tx Source #
Constructors
SimpleCommitRequest | |
Fields
| |
FullCommitRequest | |
Fields
|
Instances
newtype SubmitTxRequest tx Source #
Constructors
SubmitTxRequest | |
Fields
|
Instances
Arbitrary tx => Arbitrary (SubmitTxRequest tx) Source # | |
Defined in Hydra.API.HTTPServer | |
FromJSON tx => FromJSON (SubmitTxRequest tx) Source # | |
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 # | |
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 # | |
Defined in Hydra.API.HTTPServer | |
Eq tx => Eq (SubmitTxRequest tx) Source # | |
Defined in Hydra.API.HTTPServer Methods (==) :: SubmitTxRequest tx -> SubmitTxRequest tx -> Bool Source # (/=) :: SubmitTxRequest tx -> SubmitTxRequest tx -> Bool Source # |
data TransactionSubmitted Source #
Constructors
TransactionSubmitted |
Instances
Arguments
:: forall tx. IsChainState tx | |
=> Tracer IO APIServerLog | |
-> Chain tx IO | |
-> PParams LedgerEra | |
-> IO (Maybe HeadId) | A means to get the |
-> IO (Maybe (UTxOType tx)) | Get latest confirmed UTxO snapshot. |
-> (ClientInput tx -> IO ()) | Callback to yield a |
-> Application |
Hydra HTTP server
Handlers
handleDraftCommitUtxo Source #
Arguments
:: forall tx. IsChainState tx | |
=> Chain tx IO | |
-> IO (Maybe HeadId) | A means to get the |
-> ByteString | Request body. |
-> IO Response |
Handle request to obtain a draft commit tx.
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 #