Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion blockfrost-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# 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)
* `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)
Expand Down
2 changes: 1 addition & 1 deletion blockfrost-api/blockfrost-api.cabal
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion blockfrost-client-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# 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)
* `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)
Expand Down
2 changes: 1 addition & 1 deletion blockfrost-client-core/blockfrost-client-core.cabal
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 9 additions & 2 deletions blockfrost-client-core/src/Blockfrost/Client/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)" ->
Expand Down
4 changes: 3 additions & 1 deletion blockfrost-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# 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)
* `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)
Expand Down
6 changes: 3 additions & 3 deletions blockfrost-client/blockfrost-client.cabal
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down