module Blockfrost.Client.Cardano.Scripts
( listScripts
, listScripts'
, getScript
, getScriptRedeemers
, getScriptRedeemers'
, getScriptDatum
, getScriptJSON
, getScriptCBOR
) where
import Blockfrost.API
import Blockfrost.Client.Types
import Blockfrost.Types
scriptsClient :: Project -> ScriptsAPI (AsClientT BlockfrostClient)
scriptsClient :: Project -> ScriptsAPI (AsClientT BlockfrostClient)
scriptsClient = (((Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash])
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script)
:<|> (ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer])))
:<|> ((DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum)
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON)
:<|> (ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR))))
-> ScriptsAPI (AsClientT BlockfrostClient)
forall (routes :: * -> *) mode.
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant ((((Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash])
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script)
:<|> (ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer])))
:<|> ((DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum)
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON)
:<|> (ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR))))
-> ScriptsAPI (AsClientT BlockfrostClient))
-> (Project
-> ((Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash])
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script)
:<|> (ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer])))
:<|> ((DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum)
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON)
:<|> (ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR))))
-> Project
-> ScriptsAPI (AsClientT BlockfrostClient)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CardanoAPI (AsClientT BlockfrostClient)
-> ((Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash])
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script)
:<|> (ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer])))
:<|> ((DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum)
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON)
:<|> (ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR)))
forall route.
CardanoAPI route
-> route
:- ("scripts"
:> (Tag "Cardano \187 Scripts" :> ToServantApi ScriptsAPI))
_scripts (CardanoAPI (AsClientT BlockfrostClient)
-> ((Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash])
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script)
:<|> (ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer])))
:<|> ((DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum)
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON)
:<|> (ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR))))
-> (Project -> CardanoAPI (AsClientT BlockfrostClient))
-> Project
-> ((Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash])
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script)
:<|> (ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer])))
:<|> ((DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum)
:<|> ((ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON)
:<|> (ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> CardanoAPI (AsClientT BlockfrostClient)
cardanoClient
listScripts_ :: Project -> Paged -> SortOrder -> BlockfrostClient [ScriptHash]
listScripts_ :: Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash]
listScripts_ = ScriptsAPI (AsClientT BlockfrostClient)
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash]
forall route.
ScriptsAPI route
-> route
:- (Summary "Scripts"
:> (Description "List of scripts."
:> (Pagination :> (Sorting :> Get '[JSON] [ScriptHash]))))
_listScripts (ScriptsAPI (AsClientT BlockfrostClient)
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash])
-> (Project -> ScriptsAPI (AsClientT BlockfrostClient))
-> Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT BlockfrostClient)
scriptsClient
listScripts' :: Paged -> SortOrder -> BlockfrostClient [ScriptHash]
listScripts' :: Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash]
listScripts' Paged
pg SortOrder
s = (Project
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash])
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash]
listScripts_ Project
p Paged
pg SortOrder
s)
listScripts :: BlockfrostClient [ScriptHash]
listScripts :: ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash]
listScripts = Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [ScriptHash]
listScripts' Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def
getScript_ :: Project -> ScriptHash -> BlockfrostClient Script
getScript_ :: Project
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script
getScript_ = ScriptsAPI (AsClientT BlockfrostClient)
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) 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 BlockfrostClient)
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script)
-> (Project -> ScriptsAPI (AsClientT BlockfrostClient))
-> Project
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT BlockfrostClient)
scriptsClient
getScript:: ScriptHash -> BlockfrostClient Script
getScript :: ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script
getScript ScriptHash
sh = (Project
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script)
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (Project
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) Script
`getScript_` ScriptHash
sh)
getScriptRedeemers_ :: Project -> ScriptHash -> Paged -> SortOrder -> BlockfrostClient [ScriptRedeemer]
getScriptRedeemers_ :: Project
-> ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer]
getScriptRedeemers_ = ScriptsAPI (AsClientT BlockfrostClient)
-> ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [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 BlockfrostClient)
-> ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer])
-> (Project -> ScriptsAPI (AsClientT BlockfrostClient))
-> Project
-> ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT BlockfrostClient)
scriptsClient
getScriptRedeemers' :: ScriptHash -> Paged -> SortOrder -> BlockfrostClient [ScriptRedeemer]
getScriptRedeemers' :: ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer]
getScriptRedeemers' ScriptHash
sh Paged
pg SortOrder
s = (Project
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer])
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer]
getScriptRedeemers_ Project
p ScriptHash
sh Paged
pg SortOrder
s)
getScriptRedeemers :: ScriptHash -> BlockfrostClient [ScriptRedeemer]
getScriptRedeemers :: ScriptHash
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer]
getScriptRedeemers ScriptHash
sh = ScriptHash
-> Paged
-> SortOrder
-> ExceptT
BlockfrostError (ReaderT ClientConfig IO) [ScriptRedeemer]
getScriptRedeemers' ScriptHash
sh Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def
getScriptDatum_ :: Project -> DatumHash -> BlockfrostClient ScriptDatum
getScriptDatum_ :: Project
-> DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum
getScriptDatum_ = ScriptsAPI (AsClientT BlockfrostClient)
-> DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) 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 BlockfrostClient)
-> DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum)
-> (Project -> ScriptsAPI (AsClientT BlockfrostClient))
-> Project
-> DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT BlockfrostClient)
scriptsClient
getScriptDatum :: DatumHash -> BlockfrostClient ScriptDatum
getScriptDatum :: DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum
getScriptDatum DatumHash
sh = (Project
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum)
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (Project
-> DatumHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptDatum
`getScriptDatum_` DatumHash
sh)
getScriptJSON_ :: Project -> ScriptHash -> BlockfrostClient ScriptJSON
getScriptJSON_ :: Project
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON
getScriptJSON_ = ScriptsAPI (AsClientT BlockfrostClient)
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) 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 BlockfrostClient)
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON)
-> (Project -> ScriptsAPI (AsClientT BlockfrostClient))
-> Project
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT BlockfrostClient)
scriptsClient
getScriptJSON :: ScriptHash -> BlockfrostClient ScriptJSON
getScriptJSON :: ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON
getScriptJSON ScriptHash
sh = (Project
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON)
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (Project
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptJSON
`getScriptJSON_` ScriptHash
sh)
getScriptCBOR_ :: Project -> ScriptHash -> BlockfrostClient ScriptCBOR
getScriptCBOR_ :: Project
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR
getScriptCBOR_ = ScriptsAPI (AsClientT BlockfrostClient)
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) 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 BlockfrostClient)
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR)
-> (Project -> ScriptsAPI (AsClientT BlockfrostClient))
-> Project
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> ScriptsAPI (AsClientT BlockfrostClient)
scriptsClient
getScriptCBOR :: ScriptHash -> BlockfrostClient ScriptCBOR
getScriptCBOR :: ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR
getScriptCBOR ScriptHash
sh = (Project
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR)
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (Project
-> ScriptHash
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) ScriptCBOR
`getScriptCBOR_` ScriptHash
sh)