Skip to content

Commit

Permalink
Feat 30: V1 Endpoints support - turbo submit endpoint + version set t…
Browse files Browse the repository at this point in the history
…o 1.0.0
  • Loading branch information
sourabhxyz committed Jul 14, 2023
1 parent 8db3672 commit 8180f26
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion maestro-sdk.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: maestro-sdk
version: 0.1.0.0
version: 1.0.0
synopsis: Maestro Blockchain Indexer SDK
description: Maestro provides blockchain indexers, APIs and event management systems for the Cardano blockchain.
license: Apache-2.0
Expand Down
6 changes: 5 additions & 1 deletion src/Maestro/API/V1/TxManager.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ import Maestro.Types.V1
import Servant.API
import Servant.API.Generic

newtype TxManagerAPI route = TxManagerAPI
data TxManagerAPI route = TxManagerAPI
{ _monitoredTxSubmit ::
route
:- ReqBody' '[Required] '[CBORStream] BS.ByteString
:> PostAccepted '[JSON] T.Text
, _monitoredTurboTxSubmit ::
route
:- ReqBody' '[Required] '[CBORStream] BS.ByteString
:> PostAccepted '[JSON] T.Text
}
deriving (Generic)
10 changes: 10 additions & 0 deletions src/Maestro/Client/V1/TxManager.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Maestro.Client.V1.TxManager
( submitAndMonitorTx
, turboSubmitAndMonitorTx
)
where

Expand All @@ -23,3 +24,12 @@ submitAndMonitorTx ::
BS.ByteString ->
IO Text
submitAndMonitorTx = _monitoredTxSubmit . txClient

-- | Submit a signed and serialized transaction to the network. A transaction submited with this endpoint will be [turbo submitted & monitored by Maestro](https://docs.gomaestro.org/docs/API%20reference/Transaction%20Manager/tx-manager-turbo-submit).
turboSubmitAndMonitorTx ::
-- | The Maestro Environment.
MaestroEnv 'V1 ->
-- | CBOR encoded Transaction.
BS.ByteString ->
IO Text
turboSubmitAndMonitorTx = _monitoredTurboTxSubmit . txClient

0 comments on commit 8180f26

Please sign in to comment.