Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newhoggy/export allpages #2

Merged
merged 2 commits into from
Jun 3, 2024
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
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
Loading