From 09404752346b6bb30a24854a145ef8c2a58c5e20 Mon Sep 17 00:00:00 2001 From: sorki Date: Mon, 1 Dec 2025 16:59:12 +0100 Subject: [PATCH 1/4] client-core: extend BlockfrostNotFound with path that failed to resolve `BlockfrostNotFound` constructor of `BlockfrostError` is now `BlockfrostNotFound Text` Closes #80 --- blockfrost-api/CHANGELOG.md | 2 ++ blockfrost-client-core/CHANGELOG.md | 2 ++ blockfrost-client-core/src/Blockfrost/Client/Core.hs | 11 +++++++++-- blockfrost-client/CHANGELOG.md | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/blockfrost-api/CHANGELOG.md b/blockfrost-api/CHANGELOG.md index 8f3c320..983684d 100644 --- a/blockfrost-api/CHANGELOG.md +++ b/blockfrost-api/CHANGELOG.md @@ -2,6 +2,8 @@ * 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) * Drop `Sanchonet` `Env` [#79](https://github.com/blockfrost/blockfrost-haskell/pull/79) # Version [0.13.0.0](https://github.com/blockfrost/blockfrost-haskell/compare/api-0.12.2.0...api-0.13.0.0) (2025-06-03) diff --git a/blockfrost-client-core/CHANGELOG.md b/blockfrost-client-core/CHANGELOG.md index aa34da3..39f31e5 100644 --- a/blockfrost-client-core/CHANGELOG.md +++ b/blockfrost-client-core/CHANGELOG.md @@ -2,6 +2,8 @@ * 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) * Drop `Sanchonet` `Env` [#79](https://github.com/blockfrost/blockfrost-haskell/pull/79) # Version [0.6.0.1](https://github.com/blockfrost/blockfrost-haskell/compare/v0.6.0.0...client-core-0.6.0.1) (2024-01-16) diff --git a/blockfrost-client-core/src/Blockfrost/Client/Core.hs b/blockfrost-client-core/src/Blockfrost/Client/Core.hs index 1069e0e..4c047ab 100644 --- a/blockfrost-client-core/src/Blockfrost/Client/Core.hs +++ b/blockfrost-client-core/src/Blockfrost/Client/Core.hs @@ -34,11 +34,14 @@ import Blockfrost.Types.ApiError import Data.Aeson (eitherDecode) import Data.Default (Default (def)) import Data.Text (Text) +import qualified Data.ByteString.Char8 +import qualified Data.Text import qualified Data.Text.IO import qualified Network.HTTP.Client import qualified Network.HTTP.Client.TLS import Network.HTTP.Types import Servant.Client +import Servant.Client.Core.Request import Servant.Multipart.API import Servant.Multipart.Client () import qualified System.Environment @@ -96,7 +99,7 @@ data BlockfrostError = BlockfrostError Text | BlockfrostBadRequest Text -- 400 | BlockfrostTokenMissing Text -- 403 - | BlockfrostNotFound -- 404 + | BlockfrostNotFound Text -- 404 | BlockfrostIPBanned -- 418 | BlockfrostMempoolFullOrPinQueueFull -- 425 | BlockfrostUsageLimitReached -- 429 @@ -106,13 +109,17 @@ data BlockfrostError = fromServantClientError :: ClientError -> BlockfrostError fromServantClientError e = case e of - FailureResponse _bUrl (Response s _ _ body) + FailureResponse req (Response s _ _ body) | s == status400 -> BlockfrostBadRequest (withMessage body) | s == status403 -> BlockfrostTokenMissing (withMessage body) | s == status404 -> BlockfrostNotFound + . Data.Text.pack + . Data.ByteString.Char8.unpack + . snd + $ requestPath req | s == status418 -> BlockfrostIPBanned | s == mkStatus 425 "Mempool Full (TXs) or Pin Queue Full (IPFS)" -> diff --git a/blockfrost-client/CHANGELOG.md b/blockfrost-client/CHANGELOG.md index d17cd55..be46ae7 100644 --- a/blockfrost-client/CHANGELOG.md +++ b/blockfrost-client/CHANGELOG.md @@ -2,6 +2,8 @@ * 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) * 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) From 49beaebd8dc688547e0c20ac71dd82fb43c15720 Mon Sep 17 00:00:00 2001 From: sorki Date: Mon, 1 Dec 2025 17:02:08 +0100 Subject: [PATCH 2/4] client-core: Release 0.7.0.0 --- blockfrost-client-core/CHANGELOG.md | 2 +- blockfrost-client-core/blockfrost-client-core.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blockfrost-client-core/CHANGELOG.md b/blockfrost-client-core/CHANGELOG.md index 39f31e5..7174252 100644 --- a/blockfrost-client-core/CHANGELOG.md +++ b/blockfrost-client-core/CHANGELOG.md @@ -1,4 +1,4 @@ -# Version [next](https://github.com/blockfrost/blockfrost-haskell/compare/client-core-0.6.0.1...master) (2025-MM-DD) +# Version [0.7.0.0](https://github.com/blockfrost/blockfrost-haskell/compare/client-core-0.6.0.1...client-core-0.7.0.0) (2025-12-02) * Changes * Add `CustomURL` to `Env`, to allow arbitrary Blockfrost instance [#79](https://github.com/blockfrost/blockfrost-haskell/pull/79) diff --git a/blockfrost-client-core/blockfrost-client-core.cabal b/blockfrost-client-core/blockfrost-client-core.cabal index 67769a6..cd345a9 100644 --- a/blockfrost-client-core/blockfrost-client-core.cabal +++ b/blockfrost-client-core/blockfrost-client-core.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: blockfrost-client-core -version: 0.6.0.1 +version: 0.7.0.0 synopsis: blockfrost.io common client definitions / instances description: HasClient for our auth homepage: https://github.com/blockfrost/blockfrost-haskell From df89a26bef1d1f7857ed10d49eeb69eac61988eb Mon Sep 17 00:00:00 2001 From: sorki Date: Mon, 1 Dec 2025 17:04:27 +0100 Subject: [PATCH 3/4] api: Release 0.14.0.0 --- blockfrost-api/CHANGELOG.md | 2 +- blockfrost-api/blockfrost-api.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blockfrost-api/CHANGELOG.md b/blockfrost-api/CHANGELOG.md index 983684d..84a54a0 100644 --- a/blockfrost-api/CHANGELOG.md +++ b/blockfrost-api/CHANGELOG.md @@ -1,4 +1,4 @@ -# Version [next](https://github.com/blockfrost/blockfrost-haskell/compare/api-0.13.0.0...master) (2025-MM-DD) +# Version [0.14.0.0](https://github.com/blockfrost/blockfrost-haskell/compare/api-0.13.0.0...api-0.14.0.0) (2025-12-02) * Changes * Add `CustomURL` to `Env`, to allow arbitrary Blockfrost instance [#79](https://github.com/blockfrost/blockfrost-haskell/pull/79) diff --git a/blockfrost-api/blockfrost-api.cabal b/blockfrost-api/blockfrost-api.cabal index 12a7263..b07e67a 100644 --- a/blockfrost-api/blockfrost-api.cabal +++ b/blockfrost-api/blockfrost-api.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: blockfrost-api -version: 0.13.0.0 +version: 0.14.0.0 synopsis: API definitions for blockfrost.io description: Core types and Servant API description homepage: https://github.com/blockfrost/blockfrost-haskell From e241a09f4e46ee7c39f5eef1868a2094d3f0fb89 Mon Sep 17 00:00:00 2001 From: sorki Date: Mon, 1 Dec 2025 17:06:18 +0100 Subject: [PATCH 4/4] client: Release 0.11.0.0 --- blockfrost-client/CHANGELOG.md | 2 +- blockfrost-client/blockfrost-client.cabal | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/blockfrost-client/CHANGELOG.md b/blockfrost-client/CHANGELOG.md index be46ae7..8979616 100644 --- a/blockfrost-client/CHANGELOG.md +++ b/blockfrost-client/CHANGELOG.md @@ -1,4 +1,4 @@ -# Version [next](https://github.com/blockfrost/blockfrost-haskell/compare/client-0.10.0.0...master) (2025-MM-DD) +# 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) diff --git a/blockfrost-client/blockfrost-client.cabal b/blockfrost-client/blockfrost-client.cabal index c4b7ff7..20d8fc3 100644 --- a/blockfrost-client/blockfrost-client.cabal +++ b/blockfrost-client/blockfrost-client.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: blockfrost-client -version: 0.10.0.0 +version: 0.11.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,8 +69,8 @@ library , Blockfrost.Client.IPFS , Blockfrost.Client.NutLink build-depends: base >= 4.7 && < 5 - , blockfrost-api >= 0.13 - , blockfrost-client-core ^>= 0.6 + , blockfrost-api >= 0.14 + , blockfrost-client-core ^>= 0.7 , bytestring , directory , data-default