Skip to content

Commit

Permalink
Merge pull request #2 from haskell-works/newhoggy/export-allpages
Browse files Browse the repository at this point in the history
Newhoggy/export allpages
  • Loading branch information
newhoggy authored Jun 3, 2024
2 parents 981b70f + e9ee5a5 commit 32bc76e
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 140 deletions.
8 changes: 4 additions & 4 deletions polysemy-blockfrost.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ source-repository head
type: git
location: https://github.com/haskell-works/polysemy-blockfrost

common base { build-depends: base >= 4.18 && < 5 }
common base { build-depends: base >= 4.14 && < 5 }

common blockfrost-api { build-depends: blockfrost-api < 0.11 }
common blockfrost-client { build-depends: blockfrost-client < 0.9 }
Expand All @@ -29,7 +29,7 @@ common polysemy-plugin { build-depends: polysemy-plugin
common tasty { build-depends: tasty < 1.6 }
common text { build-depends: text < 3 }

common polysemy-blockfrost { build-depends: polysemy-blockfrost }
common polysemy-blockfrost { build-depends: polysemy-blockfrost }

common project-config
import: polysemy,
Expand All @@ -56,12 +56,12 @@ library
Polysemy.Blockfrost.Client
Polysemy.Blockfrost.Effect.Blockfrost
hs-source-dirs: src
default-language: GHC2021
default-language: Haskell2010

test-suite polysemy-blockfrost-test
import: base, project-config,
tasty,
default-language: GHC2021
default-language: Haskell2010
type: exitcode-stdio-1.0
build-tool-depends: tasty-discover:tasty-discover
hs-source-dirs: test
Expand Down
6 changes: 6 additions & 0 deletions src/Polysemy/Blockfrost.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module Polysemy.Blockfrost
getAddressUtxos,
getAddressUtxosAsset',
getAddressUtxosAsset,
getAddressTransactions',
getAddressTransactions,

-- * Client.Cardano.Assets
Expand Down Expand Up @@ -166,6 +167,11 @@ module Polysemy.Blockfrost
getTxMetadataByLabelCBOR',
getTxMetadataByLabelCBOR,

-- * Pagination
allPages,

) where

import Polysemy.Blockfrost.Api

import Blockfrost.Client (allPages)
6 changes: 5 additions & 1 deletion src/Polysemy/Blockfrost/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ module Polysemy.Blockfrost.Api
getAddressUtxos ,
getAddressUtxosAsset' ,
getAddressUtxosAsset ,
getAddressTransactions' ,
getAddressTransactions ,

-- Client.Cardano.Assets
Expand Down Expand Up @@ -252,7 +253,7 @@ import Control.Monad
import Data.Either
import Data.Maybe
import Data.Text
import GHC.Integer
import Prelude (Integer)

import Blockfrost.Client (AccountDelegation (..),
AccountHistory (..),
Expand All @@ -278,6 +279,7 @@ import Blockfrost.Client (AccountDelegation (..),
AssetTransaction (..),
Block (..),
BlockHash (..),
BlockIndex (..),
BlockfrostError (..),
CBORString (..),
DatumHash (..),
Expand Down Expand Up @@ -395,6 +397,7 @@ getAddressUtxos' :: Member Blockfrost r => Member (Error Bloc
getAddressUtxos :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [AddressUtxo]
getAddressUtxosAsset' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> AssetId-> Paged -> SortOrder -> Sem r [AddressUtxo]
getAddressUtxosAsset :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> AssetId -> Sem r [AddressUtxo]
getAddressTransactions' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Maybe BlockIndex -> Maybe BlockIndex -> Sem r [AddressTransaction]
getAddressTransactions :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [AddressTransaction]

-- Client.Cardano.Assets
Expand Down Expand Up @@ -559,6 +562,7 @@ getAddressUtxos a = fromEither =<< BF.getAddressUtxos
getAddressUtxosAsset' a b c d = fromEither =<< BF.getAddressUtxosAsset' a b c d
getAddressUtxosAsset a b = fromEither =<< BF.getAddressUtxosAsset a b
getAddressTransactions a = fromEither =<< BF.getAddressTransactions a
getAddressTransactions' a b c d e = fromEither =<< BF.getAddressTransactions' a b c d e

-- Client.Cardano.Assets
getAssets' a b = fromEither =<< BF.getAssets' a b
Expand Down
Loading

0 comments on commit 32bc76e

Please sign in to comment.