cabal-version:       2.2
name:                blockfrost-client
version:             0.7.1.1
synopsis:            blockfrost.io basic client
description:         Simple Blockfrost clients for use with transformers or mtl
homepage:            https://github.com/blockfrost/blockfrost-haskell
license:             Apache-2.0
license-file:        LICENSE
author:              blockfrost.io
maintainer:          srk@48.io
copyright:           2021 blockfrost.io
category:            Cardano
build-type:          Simple


extra-source-files:
    CHANGELOG.md
    LICENSE
    README.md

flag BuildFast
     Default: True
     Description: Turn off optimizations

flag Examples
     Default: False
     Manual: True
     Description: Build examples

flag Production
     Default: False
     Manual: True
     Description: Production build

common libstuff
  default-language:    Haskell2010
  ghc-options:         -Wall -Wunused-packages
                       -fno-specialize
                       -- ^ this helps quite a lot
                       -- with memory usage
                       -- https://github.com/haskell-servant/servant/issues/986
                       -- but -O0 is even better
  if flag(BuildFast)
    ghc-options: -O0
  if flag(Production)
    ghc-options: -Werror

library
   import:              libstuff
   hs-source-dirs:      src
   exposed-modules:     Blockfrost.Client
                      , Blockfrost.Client.Types
                      , Blockfrost.Client.Cardano.Accounts
                      , Blockfrost.Client.Cardano.Addresses
                      , Blockfrost.Client.Cardano.Assets
                      , Blockfrost.Client.Cardano.Blocks
                      , Blockfrost.Client.Cardano.Epochs
                      , Blockfrost.Client.Cardano.Ledger
                      , Blockfrost.Client.Cardano.Metadata
                      , Blockfrost.Client.Cardano.Network
                      , Blockfrost.Client.Cardano.Pools
                      , Blockfrost.Client.Cardano.Scripts
                      , Blockfrost.Client.Cardano.Transactions
                      , Blockfrost.Client.IPFS
                      , Blockfrost.Client.NutLink
   build-depends:       base                     >= 4.7 && < 5
                      , blockfrost-api           >= 0.7.1
                      , blockfrost-client-core   ^>= 0.6
                      , bytestring
                      , directory
                      , data-default
                      , filepath
                      , text
                      , mtl
                      , servant                  >= 0.18 && < 0.20
                      , servant-client
                      , servant-client-core

executable blockfrost-client-example
  if !flag(Examples)
    buildable: False
  hs-source-dirs:      example
  main-is:             Main.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , blockfrost-client
  default-language:    Haskell2010

test-suite blockfrost-client-tests
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Spec.hs
  other-modules:       SampleSpec
  build-depends:       base >= 4.7 && < 5
                     , blockfrost-client
                     , hspec
                     , tasty
                     , tasty-hspec
                     , tasty-hunit
  build-tool-depends:
    tasty-discover:tasty-discover
  default-language:    Haskell2010

source-repository head
  type:     git
  location: https://github.com/blockfrost/blockfrost-haskell