Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
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 #
Instances
data DraftCommitTxRequest tx Source #
SimpleCommitRequest | |
| |
FullCommitRequest | |
|
Instances
newtype SubmitTxRequest tx Source #
SubmitTxRequest | |
|
Instances
Arbitrary tx => Arbitrary (SubmitTxRequest tx) Source # | |
Defined in Hydra.API.HTTPServer arbitrary :: Gen (SubmitTxRequest tx) shrink :: SubmitTxRequest tx -> [SubmitTxRequest tx] | |
FromJSON tx => FromJSON (SubmitTxRequest tx) Source # | |
Defined in Hydra.API.HTTPServer 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 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 (==) :: SubmitTxRequest tx -> SubmitTxRequest tx -> Bool Source # (/=) :: SubmitTxRequest tx -> SubmitTxRequest tx -> Bool Source # |
data TransactionSubmitted Source #
Instances
Arbitrary TransactionSubmitted Source # | |
Defined in Hydra.API.HTTPServer | |
FromJSON TransactionSubmitted Source # | |
Defined in Hydra.API.HTTPServer parseJSON :: Value -> Parser TransactionSubmitted parseJSONList :: Value -> Parser [TransactionSubmitted] | |
ToJSON TransactionSubmitted Source # | |
Defined in Hydra.API.HTTPServer toJSON :: TransactionSubmitted -> Value toEncoding :: TransactionSubmitted -> Encoding toJSONList :: [TransactionSubmitted] -> Value toEncodingList :: [TransactionSubmitted] -> Encoding | |
Generic TransactionSubmitted Source # | |
Defined in Hydra.API.HTTPServer | |
Show TransactionSubmitted Source # | |
Defined in Hydra.API.HTTPServer | |
Eq TransactionSubmitted Source # | |
Defined in Hydra.API.HTTPServer (==) :: TransactionSubmitted -> TransactionSubmitted -> Bool Source # (/=) :: TransactionSubmitted -> TransactionSubmitted -> Bool Source # | |
type Rep TransactionSubmitted Source # | |
:: 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 #
:: 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.
:: 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 #