packages feed

blockfrost-client 0.11.0.0 → 0.12.0.0

raw patch · 5 files changed

+70/−18 lines, 5 filesdep ~blockfrost-apiPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: blockfrost-api

API changes (from Hackage documentation)

+ Blockfrost.Client: getMempoolTransactions' :: MonadBlockfrost m => Paged -> SortOrder -> m [TxHashObject]
+ Blockfrost.Client: getMempoolTransactionsByAddress' :: MonadBlockfrost m => Address -> Paged -> SortOrder -> m [TxHashObject]
+ Blockfrost.Client.Cardano.Mempool: getMempoolTransactions' :: MonadBlockfrost m => Paged -> SortOrder -> m [TxHashObject]
+ Blockfrost.Client.Cardano.Mempool: getMempoolTransactionsByAddress' :: MonadBlockfrost m => Address -> Paged -> SortOrder -> m [TxHashObject]
- Blockfrost.Client: getMempoolTransaction :: MonadBlockfrost m => Project -> TxHash -> m MempoolTransaction
+ Blockfrost.Client: getMempoolTransaction :: MonadBlockfrost m => TxHash -> m MempoolTransaction
- Blockfrost.Client: getMempoolTransactions :: MonadBlockfrost m => Project -> Paged -> SortOrder -> m [TxHashObject]
+ Blockfrost.Client: getMempoolTransactions :: MonadBlockfrost m => m [TxHashObject]
- Blockfrost.Client: getMempoolTransactionsByAddress :: MonadBlockfrost m => Project -> Address -> Paged -> SortOrder -> m [TxHashObject]
+ Blockfrost.Client: getMempoolTransactionsByAddress :: MonadBlockfrost m => Address -> m [TxHashObject]
- Blockfrost.Client.Cardano.Mempool: getMempoolTransaction :: MonadBlockfrost m => Project -> TxHash -> m MempoolTransaction
+ Blockfrost.Client.Cardano.Mempool: getMempoolTransaction :: MonadBlockfrost m => TxHash -> m MempoolTransaction
- Blockfrost.Client.Cardano.Mempool: getMempoolTransactions :: MonadBlockfrost m => Project -> Paged -> SortOrder -> m [TxHashObject]
+ Blockfrost.Client.Cardano.Mempool: getMempoolTransactions :: MonadBlockfrost m => m [TxHashObject]
- Blockfrost.Client.Cardano.Mempool: getMempoolTransactionsByAddress :: MonadBlockfrost m => Project -> Address -> Paged -> SortOrder -> m [TxHashObject]
+ Blockfrost.Client.Cardano.Mempool: getMempoolTransactionsByAddress :: MonadBlockfrost m => Address -> m [TxHashObject]

Files

CHANGELOG.md view
@@ -1,9 +1,20 @@+# Version [0.12.0.0](https://github.com/blockfrost/blockfrost-haskell/compare/client-0.11.0.0...client-0.12.0.0) (2026-02-02)++* Changes+  * Fix `MempoolUTxOInput` `address` field from `Text` to `Maybe Text` [#83](https://github.com/blockfrost/blockfrost-haskell/issues/83) [#84](https://github.com/blockfrost/blockfrost-haskell/pull/84)+  * Mempool API functions adjusted to not require passing in `Project` [#85](https://github.com/blockfrost/blockfrost-haskell/pull/85)+    * Previous `getMempoolTransactions prj def def` is now simply `getMempoolTransactions` and a principled+      variant `getMempoolTransactions'` is provided accepting page and sort order parameters+      (for example `allPages $ \p -> getMempoolTransactions' p def`).+    * Similar for `getMempoolTransactionsByAddress`.+    * `getMempoolTransaction` now simply doesn't require passing `Project`+ # Version [0.11.0.0](https://github.com/blockfrost/blockfrost-haskell/compare/client-0.10.0.0...client-0.11.0.0) (2025-12-02)  * Changes   * Add `CustomURL` to `Env`, to allow arbitrary Blockfrost instance [#79](https://github.com/blockfrost/blockfrost-haskell/pull/79)   * `BlockfrostNotFound` constructor of `BlockfrostError` is now `BlockfrostNotFound Text`-    containing path that resulted in 404 error [#80](https://github.com/blockfrost/blockfrost-haskell/pull/80)+    containing path that resulted in 404 error [#81](https://github.com/blockfrost/blockfrost-haskell/pull/81)   * Drop `Sanchonet` `Env` [#79](https://github.com/blockfrost/blockfrost-haskell/pull/79)  # Version [0.10.0.0](https://github.com/blockfrost/blockfrost-haskell/compare/client-0.9.2.0...client-0.10.0.0) (2025-06-03)
blockfrost-client.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.2 name:                blockfrost-client-version:             0.11.0.0+version:             0.12.0.0 synopsis:            blockfrost.io basic client description:         Simple Blockfrost clients for use with transformers or mtl homepage:            https://github.com/blockfrost/blockfrost-haskell@@ -69,7 +69,7 @@                       , Blockfrost.Client.IPFS                       , Blockfrost.Client.NutLink    build-depends:       base                     >= 4.7 && < 5-                      , blockfrost-api           >= 0.14+                      , blockfrost-api           >= 0.15                       , blockfrost-client-core   ^>= 0.7                       , bytestring                       , directory
example/Main.hs view
@@ -17,18 +17,19 @@     (ers :: Either BlockfrostError [AccountReward]) <-       tryError $ getAccountRewards "gonnaFail" +    -- variant accepting @Paged@ and @SortOrder@ arguments+    -- getAccountRewards' "gonnaFail" (page 10) desc+     allMempoolTxs <--      getMempoolTransactions prj def def+      allPages $ \p -> getMempoolTransactions' p def      if null allMempoolTxs     then return $ (latestBlocks, ers, allMempoolTxs, Nothing)     else do let lastTxInMempool = TxHash . unTxHashObject $ last allMempoolTxs-            lastMempoolTx <- getMempoolTransaction prj lastTxInMempool+            lastMempoolTx <- getMempoolTransaction lastTxInMempool              return (latestBlocks, ers, allMempoolTxs, Just lastMempoolTx)  -  -- variant accepting @Paged@ and @SortOrder@ arguments-  -- getAccountRewards' "gonnaFail" (page 10) desc   case res of     Left e -> print e     Right ((latestBlocks, ers, allMempoolTxs, lastMempoolTx)) -> do @@ -51,7 +52,12 @@           case _inputs mempoolTx of             [] -> print "No mempool transaction inputs found" -- Should be impossible             (inp:_) -> do-              let address = Address $ _address inp-              mempoolTxByAddress <- runBlockfrost prj $ getMempoolTransactionsByAddress prj address def def-              print "Mempool transactions by address:"-              print mempoolTxByAddress+              case _address inp of+                Nothing -> print "Input has no address"+                Just addr -> do+                  mempoolTxByAddress <-+                    runBlockfrost prj+                      $ getMempoolTransactionsByAddress+                          (Address addr)+                  print "Mempool transactions by address:"+                  print mempoolTxByAddress
src/Blockfrost/Client.hs view
@@ -122,8 +122,10 @@   , getTxMetadataByLabelCBOR'     -- Cardano - Mempool   , getMempoolTransactions+  , getMempoolTransactions'   , getMempoolTransaction   , getMempoolTransactionsByAddress+  , getMempoolTransactionsByAddress'     -- Cardano - Network   , getNetworkInfo   , getNetworkEras
src/Blockfrost/Client/Cardano/Mempool.hs view
@@ -2,8 +2,10 @@  module Blockfrost.Client.Cardano.Mempool   ( getMempoolTransactions-  , getMempoolTransaction +  , getMempoolTransactions'+  , getMempoolTransaction   , getMempoolTransactionsByAddress+  , getMempoolTransactionsByAddress'   ) where  import Blockfrost.API@@ -13,12 +15,43 @@ mempoolClient :: MonadBlockfrost m => Project -> MempoolAPI (AsClientT m) mempoolClient = fromServant . _mempool . cardanoClient -getMempoolTransactions :: MonadBlockfrost m => Project -> Paged -> SortOrder -> m [TxHashObject]-getMempoolTransactions = _mempoolTransactions . mempoolClient +getMempoolTransactions_ :: MonadBlockfrost m => Project -> Paged -> SortOrder -> m [TxHashObject]+getMempoolTransactions_ = _mempoolTransactions . mempoolClient -getMempoolTransaction :: MonadBlockfrost m => Project -> TxHash -> m MempoolTransaction-getMempoolTransaction = _specificTransaction . mempoolClient  +-- | Get a list of transactions currently in Blockfrost.io mempool+-- Allows custom paging and ordering using 'Paged' and 'SortOrder'.+getMempoolTransactions' :: MonadBlockfrost m => Paged -> SortOrder -> m [TxHashObject]+getMempoolTransactions' pg s = go (\p -> getMempoolTransactions_ p pg s) -getMempoolTransactionsByAddress :: MonadBlockfrost m => Project -> Address -> Paged -> SortOrder -> m [TxHashObject]-getMempoolTransactionsByAddress = _specificAddress . mempoolClient +-- | Get a list of transactions currently in Blockfrost.io mempool+--+-- Queries 100 entries. To query all entries use 'Blockfrost.Client.Core.allPages'+-- with principled variant of this function (suffixed with @'@)+-- that accepts 'Paged' argument.+getMempoolTransactions :: MonadBlockfrost m => m [TxHashObject]+getMempoolTransactions = getMempoolTransactions' def def +getMempoolTransaction_ :: MonadBlockfrost m => Project -> TxHash -> m MempoolTransaction+getMempoolTransaction_ = _specificTransaction . mempoolClient++-- | Get details about a specific @MempoolTransaction@+getMempoolTransaction :: MonadBlockfrost m => TxHash -> m MempoolTransaction+getMempoolTransaction t = go (`getMempoolTransaction_` t)++getMempoolTransactionsByAddress_ :: MonadBlockfrost m => Project -> Address -> Paged -> SortOrder -> m [TxHashObject]+getMempoolTransactionsByAddress_ = _specificAddress . mempoolClient++-- | Get a list of transactions currently in Blockfrost.io mempool+-- where at least one of the transaction inputs or outputs belongs to the address.+-- Allows custom paging and ordering using 'Paged' and 'SortOrder'.+getMempoolTransactionsByAddress' :: MonadBlockfrost m => Address -> Paged -> SortOrder -> m [TxHashObject]+getMempoolTransactionsByAddress' addr pg s = go (\p -> getMempoolTransactionsByAddress_ p addr pg s)++-- | Get a list of transactions currently in Blockfrost.io mempool+-- where at least one of the transaction inputs or outputs belongs to the address.+--+-- Queries 100 entries. To query all entries use 'Blockfrost.Client.Core.allPages'+-- with principled variant of this function (suffixed with @'@)+-- that accepts 'Paged' argument.+getMempoolTransactionsByAddress :: MonadBlockfrost m => Address -> m [TxHashObject]+getMempoolTransactionsByAddress addr = go (\p -> getMempoolTransactionsByAddress_ p addr def def)