module Blockfrost.Client.Cardano.Scripts
( listScripts
, listScripts'
, getScript
, getScriptRedeemers
, getScriptRedeemers'
, getScriptDatum
, getScriptDatumCBOR
, getScriptJSON
, getScriptCBOR
) where
import Blockfrost.API
import Blockfrost.Client.Types
import Blockfrost.Types
scriptsClient :: MonadBlockfrost m => Project -> ScriptsAPI (AsClientT m)
scriptsClient :: forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptsAPI (AsClientT m)
scriptsClient = (((Paged -> SortOrder -> m ScriptHashList)
:<|> ((ScriptHash -> m Script)
:<|> (ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer])))
:<|> (((DatumHash -> m ScriptDatum)
:<|> (DatumHash -> m ScriptDatumCBOR))
:<|> ((ScriptHash -> m ScriptJSON)
:<|> (ScriptHash -> m ScriptCBOR))))
-> ScriptsAPI (AsClientT m)
ToServant ScriptsAPI (AsClientT m) -> ScriptsAPI (AsClientT m)
forall {k} (routes :: k -> *) (mode :: k).
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant ((((Paged -> SortOrder -> m ScriptHashList)
:<|> ((ScriptHash -> m Script)
:<|> (ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer])))
:<|> (((DatumHash -> m ScriptDatum)
:<|> (DatumHash -> m ScriptDatumCBOR))
:<|> ((ScriptHash -> m ScriptJSON)
:<|> (ScriptHash -> m ScriptCBOR))))
-> ScriptsAPI (AsClientT m))
-> (Project
-> ((Paged -> SortOrder -> m ScriptHashList)
:<|> ((ScriptHash -> m Script)
:<|> (ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer])))
:<|> (((DatumHash -> m ScriptDatum)
:<|> (DatumHash -> m ScriptDatumCBOR))
:<|> ((ScriptHash -> m ScriptJSON)
:<|> (ScriptHash -> m ScriptCBOR))))
-> Project
-> ScriptsAPI (AsClientT m)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CardanoAPI (AsClientT m)
-> ((Paged -> SortOrder -> m ScriptHashList)
:<|> ((ScriptHash -> m Script)
:<|> (ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer])))
:<|> (((DatumHash -> m ScriptDatum)
:<|> (DatumHash -> m ScriptDatumCBOR))
:<|> ((ScriptHash -> m ScriptJSON)
:<|> (ScriptHash -> m ScriptCBOR)))
CardanoAPI (AsClientT m)
-> AsClientT m
:- ("scripts"
:> (Tag "Cardano \187 Scripts" :> ToServantApi ScriptsAPI))
forall route.
CardanoAPI route
-> route
:- ("scripts"
:> (Tag "Cardano \187 Scripts" :> ToServantApi ScriptsAPI))
_scripts (CardanoAPI (AsClientT m)
-> ((Paged -> SortOrder -> m ScriptHashList)
:<|> ((ScriptHash -> m Script)
:<|> (ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer])))
:<|> (((DatumHash -> m ScriptDatum)
:<|> (DatumHash -> m ScriptDatumCBOR))
:<|> ((ScriptHash -> m ScriptJSON)
:<|> (ScriptHash -> m ScriptCBOR))))
-> (Project -> CardanoAPI (AsClientT m))
-> Project
-> ((Paged -> SortOrder -> m ScriptHashList)
:<|> ((ScriptHash -> m Script)
:<|> (ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer])))
:<|> (((DatumHash -> m ScriptDatum)
:<|> (DatumHash -> m ScriptDatumCBOR))
:<|> ((ScriptHash -> m ScriptJSON)
:<|> (ScriptHash -> m ScriptCBOR)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> CardanoAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> CardanoAPI (AsClientT m)
cardanoClient
listScripts_ :: MonadBlockfrost m => Project -> Paged -> SortOrder -> m ScriptHashList
listScripts_ :: forall (m :: * -> *).
MonadBlockfrost m =>
Project -> Paged -> SortOrder -> m ScriptHashList
listScripts_ = ScriptsAPI (AsClientT m)
-> AsClientT m
:- (Summary "Scripts"
:> (Description "List of scripts."
:> (Pagination :> (Sorting :> Get '[JSON] ScriptHashList))))
ScriptsAPI (AsClientT m) -> Paged -> SortOrder -> m ScriptHashList
forall route.
ScriptsAPI route
-> route
:- (Summary "Scripts"
:> (Description "List of scripts."
:> (Pagination :> (Sorting :> Get '[JSON] ScriptHashList))))
_listScripts (ScriptsAPI (AsClientT m)
-> Paged -> SortOrder -> m ScriptHashList)
-> (Project -> ScriptsAPI (AsClientT m))
-> Project
-> Paged
-> SortOrder
-> m ScriptHashList
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptsAPI (AsClientT m)
scriptsClient
listScripts' :: MonadBlockfrost m => Paged -> SortOrder -> m ScriptHashList
listScripts' :: forall (m :: * -> *).
MonadBlockfrost m =>
Paged -> SortOrder -> m ScriptHashList
listScripts' Paged
pg SortOrder
s = (Project -> m ScriptHashList) -> m ScriptHashList
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (\Project
p -> Project -> Paged -> SortOrder -> m ScriptHashList
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> Paged -> SortOrder -> m ScriptHashList
listScripts_ Project
p Paged
pg SortOrder
s)
listScripts :: MonadBlockfrost m => m ScriptHashList
listScripts :: forall (m :: * -> *). MonadBlockfrost m => m ScriptHashList
listScripts = Paged -> SortOrder -> m ScriptHashList
forall (m :: * -> *).
MonadBlockfrost m =>
Paged -> SortOrder -> m ScriptHashList
listScripts' Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def
getScript_ :: MonadBlockfrost m => Project -> ScriptHash -> m Script
getScript_ :: forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptHash -> m Script
getScript_ = ScriptsAPI (AsClientT m)
-> AsClientT m
:- (Summary "Specific scripts"
:> (Description "Information about a specific script."
:> (Capture "script_hash" ScriptHash :> Get '[JSON] Script)))
ScriptsAPI (AsClientT m) -> ScriptHash -> m Script
forall route.
ScriptsAPI route
-> route
:- (Summary "Specific scripts"
:> (Description "Information about a specific script."
:> (Capture "script_hash" ScriptHash :> Get '[JSON] Script)))
_getScript (ScriptsAPI (AsClientT m) -> ScriptHash -> m Script)
-> (Project -> ScriptsAPI (AsClientT m))
-> Project
-> ScriptHash
-> m Script
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptsAPI (AsClientT m)
scriptsClient
getScript :: MonadBlockfrost m => ScriptHash -> m Script
getScript :: forall (m :: * -> *). MonadBlockfrost m => ScriptHash -> m Script
getScript ScriptHash
sh = (Project -> m Script) -> m Script
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (Project -> ScriptHash -> m Script
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptHash -> m Script
`getScript_` ScriptHash
sh)
getScriptRedeemers_ :: MonadBlockfrost m => Project -> ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer]
getScriptRedeemers_ :: forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer]
getScriptRedeemers_ = ScriptsAPI (AsClientT m)
-> AsClientT m
:- (Summary "Redeemers of a specific script"
:> (Description "List of redeemers of a specific script."
:> (Capture "script_hash" ScriptHash
:> (Pagination
:> (Sorting :> ("redeemers" :> Get '[JSON] [ScriptRedeemer]))))))
ScriptsAPI (AsClientT m)
-> ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer]
forall route.
ScriptsAPI route
-> route
:- (Summary "Redeemers of a specific script"
:> (Description "List of redeemers of a specific script."
:> (Capture "script_hash" ScriptHash
:> (Pagination
:> (Sorting :> ("redeemers" :> Get '[JSON] [ScriptRedeemer]))))))
_getScriptRedeemers (ScriptsAPI (AsClientT m)
-> ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer])
-> (Project -> ScriptsAPI (AsClientT m))
-> Project
-> ScriptHash
-> Paged
-> SortOrder
-> m [ScriptRedeemer]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptsAPI (AsClientT m)
scriptsClient
getScriptRedeemers' :: MonadBlockfrost m => ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer]
getScriptRedeemers' :: forall (m :: * -> *).
MonadBlockfrost m =>
ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer]
getScriptRedeemers' ScriptHash
sh Paged
pg SortOrder
s = (Project -> m [ScriptRedeemer]) -> m [ScriptRedeemer]
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (\Project
p -> Project -> ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer]
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer]
getScriptRedeemers_ Project
p ScriptHash
sh Paged
pg SortOrder
s)
getScriptRedeemers :: MonadBlockfrost m => ScriptHash -> m [ScriptRedeemer]
getScriptRedeemers :: forall (m :: * -> *).
MonadBlockfrost m =>
ScriptHash -> m [ScriptRedeemer]
getScriptRedeemers ScriptHash
sh = ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer]
forall (m :: * -> *).
MonadBlockfrost m =>
ScriptHash -> Paged -> SortOrder -> m [ScriptRedeemer]
getScriptRedeemers' ScriptHash
sh Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def
getScriptDatum_ :: MonadBlockfrost m => Project -> DatumHash -> m ScriptDatum
getScriptDatum_ :: forall (m :: * -> *).
MonadBlockfrost m =>
Project -> DatumHash -> m ScriptDatum
getScriptDatum_ = ScriptsAPI (AsClientT m)
-> AsClientT m
:- (Summary "Datum value"
:> (Description "Query JSON value of a datum by its hash"
:> ("datum"
:> (Capture "datum_hash" DatumHash :> Get '[JSON] ScriptDatum))))
ScriptsAPI (AsClientT m) -> DatumHash -> m ScriptDatum
forall route.
ScriptsAPI route
-> route
:- (Summary "Datum value"
:> (Description "Query JSON value of a datum by its hash"
:> ("datum"
:> (Capture "datum_hash" DatumHash :> Get '[JSON] ScriptDatum))))
_getScriptDatum (ScriptsAPI (AsClientT m) -> DatumHash -> m ScriptDatum)
-> (Project -> ScriptsAPI (AsClientT m))
-> Project
-> DatumHash
-> m ScriptDatum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptsAPI (AsClientT m)
scriptsClient
getScriptDatum :: MonadBlockfrost m => DatumHash -> m ScriptDatum
getScriptDatum :: forall (m :: * -> *).
MonadBlockfrost m =>
DatumHash -> m ScriptDatum
getScriptDatum DatumHash
sh = (Project -> m ScriptDatum) -> m ScriptDatum
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (Project -> DatumHash -> m ScriptDatum
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> DatumHash -> m ScriptDatum
`getScriptDatum_` DatumHash
sh)
getScriptDatumCBOR_ :: MonadBlockfrost m => Project -> DatumHash -> m ScriptDatumCBOR
getScriptDatumCBOR_ :: forall (m :: * -> *).
MonadBlockfrost m =>
Project -> DatumHash -> m ScriptDatumCBOR
getScriptDatumCBOR_ = ScriptsAPI (AsClientT m)
-> AsClientT m
:- (Summary "Datum CBOR value"
:> (Description "Query CBOR serialised datum by its hash"
:> ("datum"
:> (Capture "datum_hash" DatumHash
:> ("cbor" :> Get '[JSON] ScriptDatumCBOR)))))
ScriptsAPI (AsClientT m) -> DatumHash -> m ScriptDatumCBOR
forall route.
ScriptsAPI route
-> route
:- (Summary "Datum CBOR value"
:> (Description "Query CBOR serialised datum by its hash"
:> ("datum"
:> (Capture "datum_hash" DatumHash
:> ("cbor" :> Get '[JSON] ScriptDatumCBOR)))))
_getScriptDatumCBOR (ScriptsAPI (AsClientT m) -> DatumHash -> m ScriptDatumCBOR)
-> (Project -> ScriptsAPI (AsClientT m))
-> Project
-> DatumHash
-> m ScriptDatumCBOR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptsAPI (AsClientT m)
scriptsClient
getScriptDatumCBOR :: MonadBlockfrost m => DatumHash -> m ScriptDatumCBOR
getScriptDatumCBOR :: forall (m :: * -> *).
MonadBlockfrost m =>
DatumHash -> m ScriptDatumCBOR
getScriptDatumCBOR DatumHash
sh = (Project -> m ScriptDatumCBOR) -> m ScriptDatumCBOR
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (Project -> DatumHash -> m ScriptDatumCBOR
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> DatumHash -> m ScriptDatumCBOR
`getScriptDatumCBOR_` DatumHash
sh)
getScriptJSON_ :: MonadBlockfrost m => Project -> ScriptHash -> m ScriptJSON
getScriptJSON_ :: forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptHash -> m ScriptJSON
getScriptJSON_ = ScriptsAPI (AsClientT m)
-> AsClientT m
:- (Summary "Script JSON"
:> (Description "JSON representation of a `timelock` script"
:> (Capture "script_hash" ScriptHash
:> ("json" :> Get '[JSON] ScriptJSON))))
ScriptsAPI (AsClientT m) -> ScriptHash -> m ScriptJSON
forall route.
ScriptsAPI route
-> route
:- (Summary "Script JSON"
:> (Description "JSON representation of a `timelock` script"
:> (Capture "script_hash" ScriptHash
:> ("json" :> Get '[JSON] ScriptJSON))))
_getScriptJSON (ScriptsAPI (AsClientT m) -> ScriptHash -> m ScriptJSON)
-> (Project -> ScriptsAPI (AsClientT m))
-> Project
-> ScriptHash
-> m ScriptJSON
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptsAPI (AsClientT m)
scriptsClient
getScriptJSON :: MonadBlockfrost m => ScriptHash -> m ScriptJSON
getScriptJSON :: forall (m :: * -> *).
MonadBlockfrost m =>
ScriptHash -> m ScriptJSON
getScriptJSON ScriptHash
sh = (Project -> m ScriptJSON) -> m ScriptJSON
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (Project -> ScriptHash -> m ScriptJSON
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptHash -> m ScriptJSON
`getScriptJSON_` ScriptHash
sh)
getScriptCBOR_ :: MonadBlockfrost m => Project -> ScriptHash -> m ScriptCBOR
getScriptCBOR_ :: forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptHash -> m ScriptCBOR
getScriptCBOR_ = ScriptsAPI (AsClientT m)
-> AsClientT m
:- (Summary "Script CBOR"
:> (Description "CBOR representation of a `plutus` script"
:> (Capture "script_hash" ScriptHash
:> ("cbor" :> Get '[JSON] ScriptCBOR))))
ScriptsAPI (AsClientT m) -> ScriptHash -> m ScriptCBOR
forall route.
ScriptsAPI route
-> route
:- (Summary "Script CBOR"
:> (Description "CBOR representation of a `plutus` script"
:> (Capture "script_hash" ScriptHash
:> ("cbor" :> Get '[JSON] ScriptCBOR))))
_getScriptCBOR (ScriptsAPI (AsClientT m) -> ScriptHash -> m ScriptCBOR)
-> (Project -> ScriptsAPI (AsClientT m))
-> Project
-> ScriptHash
-> m ScriptCBOR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptsAPI (AsClientT m)
scriptsClient
getScriptCBOR :: MonadBlockfrost m => ScriptHash -> m ScriptCBOR
getScriptCBOR :: forall (m :: * -> *).
MonadBlockfrost m =>
ScriptHash -> m ScriptCBOR
getScriptCBOR ScriptHash
sh = (Project -> m ScriptCBOR) -> m ScriptCBOR
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (Project -> ScriptHash -> m ScriptCBOR
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> ScriptHash -> m ScriptCBOR
`getScriptCBOR_` ScriptHash
sh)