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
- 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 #
BlockfrostError Text | |
BlockfrostBadRequest Text | |
BlockfrostTokenMissing Text | |
BlockfrostNotFound | |
BlockfrostIPBanned | |
BlockfrostUsageLimitReached | |
BlockfrostFatal Text | |
ServantClientError ClientError |
Instances
Eq BlockfrostError | |
Defined in Blockfrost.Client.Core (==) :: BlockfrostError -> BlockfrostError -> Bool # (/=) :: BlockfrostError -> BlockfrostError -> Bool # | |
Show BlockfrostError | |
Defined in Blockfrost.Client.Core showsPrec :: Int -> BlockfrostError -> ShowS # show :: BlockfrostError -> String # showList :: [BlockfrostError] -> ShowS # | |
Monad m => MonadError BlockfrostError (BlockfrostClientT m) Source # | |
Defined in Blockfrost.Client.Types throwError :: BlockfrostError -> BlockfrostClientT m a # catchError :: BlockfrostClientT m a -> (BlockfrostError -> BlockfrostClientT m a) -> BlockfrostClientT m a # |
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 # | |
Generic Project | |
Monad m => MonadReader ClientConfig (BlockfrostClientT m) Source # | |
Defined in Blockfrost.Client.Types ask :: BlockfrostClientT m ClientConfig # local :: (ClientConfig -> ClientConfig) -> BlockfrostClientT m a -> BlockfrostClientT m a # reader :: (ClientConfig -> a) -> BlockfrostClientT m a # | |
type Rep Project | |
Defined in Blockfrost.Auth type Rep Project = D1 ('MetaData "Project" "Blockfrost.Auth" "blockfrost-api-0.3.0.0-FCbWzoquwuxBjDUG0w82hr" '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 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 # toEncodedUrlPiece :: SortOrder -> Builder # toHeader :: SortOrder -> ByteString # toQueryParam :: SortOrder -> Text # | |
FromHttpApiData SortOrder | |
Defined in Blockfrost.Util.Sorting parseUrlPiece :: Text -> Either Text SortOrder # parseHeader :: ByteString -> Either Text SortOrder # |
go :: MonadBlockfrost m => (Project -> m a) -> m a Source #
Helper
data AsClientT (m :: Type -> Type) #
A type that specifies that an API record contains a client implementation.
Instances
GenericMode (AsClientT m) | |
Defined in Servant.Client.Generic | |
type (AsClientT m) :- api | |
Defined in Servant.Client.Generic |
fromServant :: GenericServant routes mode => ToServant routes mode -> routes mode #
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