Safe Haskell | None |
---|---|
Language | Haskell2010 |
Client Types
Synopsis
- type BlockfrostClient = BlockfrostClientT IO
- data BlockfrostError
- type ClientConfig = ( ClientEnv , Project )
- runBlockfrost :: Project -> BlockfrostClientT IO a -> IO ( Either BlockfrostError a)
- apiClient :: MonadBlockfrost m => BlockfrostAPI ( AsClientT m)
- api0Client :: MonadBlockfrost m => Project -> BlockfrostV0API ( AsClientT m)
- commonClient :: MonadBlockfrost m => Project -> CommonAPI ( AsClientT m)
- cardanoClient :: MonadBlockfrost m => Project -> CardanoAPI ( AsClientT m)
- ipfsClient :: MonadBlockfrost m => Project -> IPFSAPI ( AsClientT m)
- nutLinkClient :: MonadBlockfrost m => Project -> NutLinkAPI ( AsClientT m)
-
data
Project
=
Project
{
- projectEnv :: Env
- projectId :: Text
-
data
Paged
=
Paged
{
- countPerPage :: Int
- pageNumber :: Int
-
data
SortOrder
- = Ascending
- | Descending
- go :: MonadBlockfrost m => ( Project -> m a) -> m a
- data AsClientT (m :: Type -> Type )
- fromServant :: GenericServant routes mode => ToServant routes mode -> routes mode
- tryError :: MonadError e m => m a -> m ( Either e a)
- def :: Default a => a
- newtype BlockfrostClientT m a = BlockfrostClientT { }
-
class
MonadIO
m =>
MonadBlockfrost
m
where
- liftBlockfrostClient :: ClientM a -> m a
- getConf :: m ClientConfig
- runBlockfrostClientT :: MonadIO m => Project -> BlockfrostClientT m a -> m ( Either BlockfrostError a)
- newClientConfig :: MonadIO m => m ClientConfig
Documentation
type BlockfrostClient = BlockfrostClientT IO Source #
data BlockfrostError Source #
BlockfrostError Text | |
BlockfrostBadRequest Text | |
BlockfrostTokenMissing Text | |
BlockfrostNotFound | |
BlockfrostIPBanned | |
BlockfrostUsageLimitReached | |
BlockfrostFatal Text | |
ServantClientError ClientError |
Instances
Eq BlockfrostError | |
Defined in Blockfrost.Client.Core (==) :: BlockfrostError -> BlockfrostError -> Bool Source # (/=) :: BlockfrostError -> BlockfrostError -> Bool Source # |
|
Show BlockfrostError | |
Defined in Blockfrost.Client.Core |
|
Monad m => MonadError BlockfrostError ( BlockfrostClientT m) Source # | |
Defined in Blockfrost.Client.Types throwError :: BlockfrostError -> BlockfrostClientT m a Source # catchError :: BlockfrostClientT m a -> ( BlockfrostError -> BlockfrostClientT m a) -> BlockfrostClientT m a Source # |
type ClientConfig = ( ClientEnv , Project ) Source #
runBlockfrost :: Project -> BlockfrostClientT IO a -> IO ( Either BlockfrostError a) Source #
Run
BlockfrostClientT
monad in
IO
, using provided
Project
apiClient :: MonadBlockfrost m => BlockfrostAPI ( AsClientT m) Source #
api0Client :: MonadBlockfrost m => Project -> BlockfrostV0API ( AsClientT m) Source #
commonClient :: MonadBlockfrost m => Project -> CommonAPI ( AsClientT m) Source #
cardanoClient :: MonadBlockfrost m => Project -> CardanoAPI ( AsClientT m) Source #
ipfsClient :: MonadBlockfrost m => Project -> IPFSAPI ( AsClientT m) Source #
nutLinkClient :: MonadBlockfrost m => Project -> NutLinkAPI ( AsClientT m) Source #
Project | |
|
Instances
Eq Project | |
Show Project | |
IsString Project | |
Defined in Blockfrost.Auth fromString :: String -> Project Source # |
|
Generic Project | |
Monad m => MonadReader ClientConfig ( BlockfrostClientT m) Source # | |
Defined in Blockfrost.Client.Types ask :: BlockfrostClientT m ClientConfig Source # local :: ( ClientConfig -> ClientConfig ) -> BlockfrostClientT m a -> BlockfrostClientT m a Source # reader :: ( ClientConfig -> a) -> BlockfrostClientT m a Source # |
|
type Rep Project | |
Defined in Blockfrost.Auth
type
Rep
Project
=
D1
('
MetaData
"Project" "Blockfrost.Auth" "blockfrost-api-0.4.0.1-A9W5au7R2kOUA8M8hTMe9" '
False
) (
C1
('
MetaCons
"Project" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"projectEnv") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
Env
)
:*:
S1
('
MetaSel
('
Just
"projectId") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
Text
)))
|
Pagination parameters
Paged | |
|
Instances
Eq Paged | |
Ord Paged | |
Defined in Blockfrost.Util.Pagination |
|
Show Paged | |
Default Paged | |
Defined in Blockfrost.Util.Pagination |
Instances
Eq SortOrder | |
Ord SortOrder | |
Defined in Blockfrost.Util.Sorting |
|
Show SortOrder | |
Default SortOrder | |
Defined in Blockfrost.Util.Sorting |
|
ToHttpApiData SortOrder | |
Defined in Blockfrost.Util.Sorting toUrlPiece :: SortOrder -> Text Source # toEncodedUrlPiece :: SortOrder -> Builder Source # toHeader :: SortOrder -> ByteString Source # toQueryParam :: SortOrder -> Text Source # |
|
FromHttpApiData SortOrder | |
Defined in Blockfrost.Util.Sorting |
go :: MonadBlockfrost m => ( Project -> m a) -> m a Source #
Helper
data AsClientT (m :: Type -> Type ) Source #
A type that specifies that an API record contains a client implementation.
Instances
GenericMode ( AsClientT m) | |
Defined in Servant.Client.Core.HasClient |
|
type ( AsClientT m) :- api | |
Defined in Servant.Client.Core.HasClient |
fromServant :: GenericServant routes mode => ToServant routes mode -> routes mode Source #
Inverse of
toServant
.
This can be used to turn
generated
values such as client functions into records.
You may need to provide a type signature for the output type (your record type).
tryError :: MonadError e m => m a -> m ( Either e a) Source #
MonadError
analogue to the
try
function.
newtype BlockfrostClientT m a Source #
Instances
class MonadIO m => MonadBlockfrost m where Source #
liftBlockfrostClient :: ClientM a -> m a Source #
getConf :: m ClientConfig Source #
Instances
MonadBlockfrost IO Source # | |
Defined in Blockfrost.Client.Types liftBlockfrostClient :: ClientM a -> IO a Source # getConf :: IO ClientConfig Source # |
|
MonadBlockfrost ClientM Source # | |
Defined in Blockfrost.Client.Types liftBlockfrostClient :: ClientM a -> ClientM a Source # |
|
MonadIO m => MonadBlockfrost ( BlockfrostClientT m) Source # | |
Defined in Blockfrost.Client.Types liftBlockfrostClient :: ClientM a -> BlockfrostClientT m a Source # |
runBlockfrostClientT :: MonadIO m => Project -> BlockfrostClientT m a -> m ( Either BlockfrostError a) Source #
Run
BlockfrostClientT
, using provided
Project
newClientConfig :: MonadIO m => m ClientConfig Source #
Build default
ClientConfig
using BLOCKFROST_TOKEN_PATH environment variable