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 -> Environment -> PParams LedgerEra -> IO CommitInfo -> IO (Maybe (UTxOType tx)) -> IO [TxIdType tx] -> (ClientInput tx -> IO ()) -> Application
- handleDraftCommitUtxo :: forall tx. IsChainState tx => Environment -> Chain tx IO -> IO CommitInfo -> ByteString -> IO Response
- handleRecoverCommitUtxo :: forall tx. IsChainState tx => (ClientInput tx -> IO ()) -> Text -> 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 | |
-> 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 |
-> 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.
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 #