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 -> 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 #
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 | |
-> 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 #
:: 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.
:: 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 #