From ad5f9311fe80239f82811ec6a3832a1a3e83db0a Mon Sep 17 00:00:00 2001 From: John Ky Date: Sun, 12 May 2024 23:03:38 +1000 Subject: [PATCH] Initial project --- .github/workflows/haskell.yml | 179 ++++++ .gitignore | 25 + CHANGELOG.md | 5 + LICENSE | 30 + README.md | 1 - polysemy-blockfrost.cabal | 76 +++ src/Polysemy/Blockfrost.hs | 171 ++++++ src/Polysemy/Blockfrost/Api.hs | 587 +++++++++++++++++++ src/Polysemy/Blockfrost/Client.hs | 9 + src/Polysemy/Blockfrost/Effect/Blockfrost.hs | 377 ++++++++++++ test/Main.hs | 1 + 11 files changed, 1460 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/haskell.yml create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 polysemy-blockfrost.cabal create mode 100644 src/Polysemy/Blockfrost.hs create mode 100644 src/Polysemy/Blockfrost/Api.hs create mode 100644 src/Polysemy/Blockfrost/Client.hs create mode 100644 src/Polysemy/Blockfrost/Effect/Blockfrost.hs create mode 100644 test/Main.hs diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml new file mode 100644 index 0000000..2327332 --- /dev/null +++ b/.github/workflows/haskell.yml @@ -0,0 +1,179 @@ +name: Binaries + +defaults: + run: + shell: bash + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + ghc: ["9.6.5", "9.8.2"] + os: [ubuntu-latest, macOS-latest] + exclude: + - os: windows-latest + ghc: "9.8.2" + + env: + # Modify this value to "invalidate" the cabal cache. + CABAL_CACHE_VERSION: "2024-05-10" + + steps: + - uses: actions/checkout@v2 + + - uses: haskell-actions/setup@v2 + id: setup-haskell + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: '3.10.3.0' + + - name: Set some window specific things + if: matrix.os == 'windows-latest' + run: echo 'EXE_EXT=.exe' >> $GITHUB_ENV + + - name: Configure project + run: | + cabal configure --enable-tests --enable-benchmarks --write-ghc-environment-files=ghc8.4.4+ + cabal build all --enable-tests --enable-benchmarks --dry-run + + - name: Cabal cache over S3 + uses: action-works/cabal-cache-s3@v1 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + with: + region: us-west-2 + dist-dir: dist-newstyle + store-path: ${{ steps.setup-haskell.outputs.cabal-store }} + threads: 16 + archive-uri: ${{ secrets.BINARY_CACHE_URI }}/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}/${{ matrix.cabal }}/${{ matrix.ghc }} + skip: "${{ secrets.BINARY_CACHE_URI == '' }}" + + - name: Cabal cache over HTTPS + uses: action-works/cabal-cache-s3@v1 + with: + dist-dir: dist-newstyle + store-path: ${{ steps.setup-haskell.outputs.cabal-store }} + threads: 16 + archive-uri: https://cache.haskellworks.io/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}/${{ matrix.cabal }}/${{ matrix.ghc }} + skip: "${{ secrets.BINARY_CACHE_URI != '' }}" + + - name: Build + run: cabal build all --enable-tests --enable-benchmarks + + - name: Test + run: cabal test all --enable-tests --enable-benchmarks + + check: + needs: build + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.tag.outputs.tag }} + + steps: + - uses: actions/checkout@v2 + + - name: Check if cabal project is sane + run: | + PROJECT_DIR=$PWD + mkdir -p $PROJECT_DIR/build/sdist + for i in $(git ls-files | grep '\.cabal'); do + cd $PROJECT_DIR && cd `dirname $i` + cabal check + done + + - name: Tag new version + id: tag + if: ${{ github.ref == 'refs/heads/main' }} + env: + server: http://hackage.haskell.org + username: ${{ secrets.HACKAGE_USER }} + password: ${{ secrets.HACKAGE_PASS }} + run: | + package_version="$(cat *.cabal | grep '^version:' | cut -d : -f 2 | xargs)" + + echo "Package version is v$package_version" + + git fetch --unshallow origin + + if git tag "v$package_version"; then + echo "Tagging with new version "v$package_version"" + + if git push origin "v$package_version"; then + echo "Tagged with new version "v$package_version"" + + echo "::set-output name=tag::v$package_version" + fi + fi + + release: + needs: [build, check] + runs-on: ubuntu-latest + if: ${{ needs.check.outputs.tag != '' }} + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + + steps: + - uses: actions/checkout@v2 + + - name: Create source distribution + run: | + PROJECT_DIR=$PWD + mkdir -p $PROJECT_DIR/build/sdist + for i in $(git ls-files | grep '\.cabal'); do + cd $PROJECT_DIR && cd `dirname $i` + cabal v2-sdist -o $PROJECT_DIR/build/sdist + done; + + - name: Publish to hackage + env: + server: http://hackage.haskell.org + username: ${{ secrets.HACKAGE_USER }} + password: ${{ secrets.HACKAGE_PASS }} + candidate: false + run: | + package_version="$(cat *.cabal | grep '^version:' | cut -d : -f 2 | xargs)" + + for PACKAGE_TARBALL in $(find ./build/sdist/ -name "*.tar.gz"); do + PACKAGE_NAME=$(basename ${PACKAGE_TARBALL%.*.*}) + + if ${{ env.candidate }}; then + TARGET_URL="${{ env.server }}/packages/candidates"; + DOCS_URL="${{ env.server }}/package/$PACKAGE_NAME/candidate/docs" + else + TARGET_URL="${{ env.server }}/packages/upload"; + DOCS_URL="${{ env.server }}/package/$PACKAGE_NAME/docs" + fi + + HACKAGE_STATUS=$(curl --silent --head -w %{http_code} -XGET --anyauth --user "${{ env.username }}:${{ env.password }}" ${{ env.server }}/package/$PACKAGE_NAME -o /dev/null) + + if [ "$HACKAGE_STATUS" = "404" ]; then + echo "Uploading $PACKAGE_NAME to $TARGET_URL" + + curl -X POST -f --user "${{ env.username }}:${{ env.password }}" $TARGET_URL -F "package=@$PACKAGE_TARBALL" + echo "Uploaded $PACKAGE_NAME" + else + echo "Package $PACKAGE_NAME" already exists on Hackage. + fi + done + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: Undocumented + draft: true + prerelease: false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..446145e --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +dist +dist-* +cabal-dev +*.o +*.hi +*.chi +*.chs.h +*.dyn_o +*.dyn_hi +.hpc +.hsenv +.cabal-sandbox/ +cabal.sandbox.config +*.prof +*.aux +*.hp +*.eventlog +.stack-work/ +cabal.project.local +cabal.project.local~ +.HTF/ +.ghc.environment.* + +.vscode/ipch +/hie.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..bd8b266 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for polysemy-blockfrost + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..417ab2f --- /dev/null +++ b/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2024, John Ky + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of John Ky nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 915ac6c..2d96d8c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ # polysemy-blockfrost -# polysemy-blockfrost diff --git a/polysemy-blockfrost.cabal b/polysemy-blockfrost.cabal new file mode 100644 index 0000000..cf1c031 --- /dev/null +++ b/polysemy-blockfrost.cabal @@ -0,0 +1,76 @@ +cabal-version: 3.4 + + +name: polysymey-blockfrost +version: 0.1.0.0 +synopsis: Polysemy wrapper around the Blockfrost client +description: Polysemy wrapper around the Blockfrost client. +license: Apache-2.0 +license-file: LICENSE +author: John Ky +maintainer: newhoggy@gmail.com +copyright: 2024 John Ky +category: Development +build-type: Simple +extra-doc-files: CHANGELOG.md +extra-source-files: README.md + +source-repository head + type: git + location: https://github.com/haskell-works/polysymey-blockfrost + +common base { build-depends: base >= 4.18.2.1 && < 5 } + +common blockfrost-api { build-depends: blockfrost-api < 0.11 } +common blockfrost-client { build-depends: blockfrost-client < 0.9 } +common bytestring { build-depends: bytestring < 0.13 } +common contravariant { build-depends: contravariant < 1.6 } +common filepath { build-depends: filepath < 1.6 } +common ghc-prim { build-depends: ghc-prim < 0.12 } +common hedgehog { build-depends: hedgehog < 1.5 } +common polysemy { build-depends: polysemy < 2 } +common polysemy-log { build-depends: polysemy-log < 0.11 } +common polysemy-plugin { build-depends: polysemy-plugin < 0.5 } +common polysemy-time { build-depends: polysemy-time < 0.7 } +common tasty { build-depends: tasty < 1.6 } +common tasty-hedgehog { build-depends: tasty-hedgehog < 1.5 } +common text { build-depends: text < 3 } + +common polysymey-blockfrost { build-depends: polysymey-blockfrost } + +common project-config + import: polysemy, + polysemy-plugin, + default-extensions: BlockArguments + DataKinds + FlexibleContexts + FlexibleInstances + LambdaCase + NoImplicitPrelude + OverloadedStrings + TypeApplications + ghc-options: -Wall + -fplugin=Polysemy.Plugin + +library + import: base, project-config, + blockfrost-api, + blockfrost-client, + polysemy, + text, + exposed-modules: Polysemy.Blockfrost + Polysemy.Blockfrost.Api + Polysemy.Blockfrost.Client + Polysemy.Blockfrost.Effect.Blockfrost + hs-source-dirs: src + default-language: GHC2021 + +test-suite polysymey-blockfrost-test + import: base, project-config, + tasty, + default-language: GHC2021 + type: exitcode-stdio-1.0 + build-tool-depends: tasty-discover:tasty-discover + hs-source-dirs: test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-T diff --git a/src/Polysemy/Blockfrost.hs b/src/Polysemy/Blockfrost.hs new file mode 100644 index 0000000..a126173 --- /dev/null +++ b/src/Polysemy/Blockfrost.hs @@ -0,0 +1,171 @@ +module Polysemy.Blockfrost + ( Blockfrost, + BlockfrostError, + Project, + runBlockfrost, + + -- * Client + getRoot, + getHealth, + getClock, + getMetrics, + getMetricsEndpoints, + + -- * Client.NutLink + nutlinkListAddress, + nutlinkListAddressTickers', + nutlinkListAddressTickers, + nutlinkAddressTickers', + nutlinkAddressTickers, + nutlinkTickers', + nutlinkTickers, + + -- * Client.IPFS + ipfsGateway, + ipfsPin, + ipfsListPins', + ipfsListPins, + ipfsGetPin, + ipfsRemovePin, + + -- * Client.Cardano.Blocks + getLatestBlock, + getLatestBlockTxs', + getLatestBlockTxs, + getBlock, + getBlockSlot, + getBlockEpochSlot, + getNextBlocks', + getNextBlocks, + getPreviousBlocks', + getPreviousBlocks, + getBlockTxs', + getBlockTxs, + getBlockAffectedAddresses', + getBlockAffectedAddresses, + + -- * Client.Cardano.Network + getNetworkInfo, + getNetworkEras, + + -- * Client.Cardano.Addresses + getAddressInfo, + getAddressInfoExtended, + getAddressDetails, + getAddressUtxos', + getAddressUtxos, + getAddressUtxosAsset', + getAddressUtxosAsset, + getAddressTransactions, + + -- * Client.Cardano.Assets + getAssets', + getAssets, + getAssetDetails, + getAssetHistory', + getAssetHistory, + getAssetTransactions', + getAssetTransactions, + getAssetAddresses', + getAssetAddresses, + getAssetsByPolicy', + getAssetsByPolicy, + + -- * Client.Cardano.Scripts + listScripts', + listScripts, + getScript, + getScriptRedeemers', + getScriptRedeemers, + getScriptDatum, + getScriptDatumCBOR, + getScriptJSON, + getScriptCBOR, + + -- * Client.Cardano.Epochs + getLatestEpoch, + getLatestEpochProtocolParams, + getEpoch, + getNextEpochs', + getNextEpochs, + getPreviousEpochs', + getPreviousEpochs, + getEpochStake', + getEpochStake, + getEpochStakeByPool', + getEpochStakeByPool, + getEpochBlocks', + getEpochBlocks, + getEpochBlocksByPool', + getEpochBlocksByPool, + getEpochProtocolParams, + + -- * Client.Cardano.Transactions + getTx, + getTxUtxos, + getTxRedeemers, + getTxStakes, + getTxDelegations, + getTxWithdrawals, + getTxMirs, + getTxPoolUpdates, + getTxPoolRetiring, + getTxMetadataJSON, + getTxMetadataCBOR, + submitTx, + + -- * Client.Cardano.Ledger + getLedgerGenesis, + + -- * Client.Cardano.Accounts + getAccount, + getAccountRewards', + getAccountRewards, + getAccountHistory', + getAccountHistory, + getAccountDelegations', + getAccountDelegations, + getAccountRegistrations', + getAccountRegistrations, + getAccountWithdrawals', + getAccountWithdrawals, + getAccountMirs', + getAccountMirs, + getAccountAssociatedAddresses', + getAccountAssociatedAddresses, + getAccountAssociatedAddressesTotal, + getAccountAssociatedAssets', + getAccountAssociatedAssets, + + -- * Client.Cardano.Pools + listPools', + listPools, + listPoolsExtended', + listPoolsExtended, + listRetiredPools', + listRetiredPools, + listRetiringPools', + listRetiringPools, + getPool, + getPoolHistory', + getPoolHistory, + getPoolMetadata, + getPoolRelays, + getPoolDelegators', + getPoolDelegators, + getPoolBlocks', + getPoolBlocks, + getPoolUpdates', + getPoolUpdates, + + -- * Client.Cardano.Metadata + getTxMetadataLabels', + getTxMetadataLabels, + getTxMetadataByLabelJSON', + getTxMetadataByLabelJSON, + getTxMetadataByLabelCBOR', + getTxMetadataByLabelCBOR, + + ) where + +import Polysemy.Blockfrost.Api diff --git a/src/Polysemy/Blockfrost/Api.hs b/src/Polysemy/Blockfrost/Api.hs new file mode 100644 index 0000000..c6fd189 --- /dev/null +++ b/src/Polysemy/Blockfrost/Api.hs @@ -0,0 +1,587 @@ +{-# LANGUAGE FlexibleContexts #-} + +module Polysemy.Blockfrost.Api + ( Blockfrost, + BlockfrostError, + Project, + runBlockfrost, + + -- Client + getRoot , + getHealth , + getClock , + getMetrics , + getMetricsEndpoints , + + -- Client.NutLink + nutlinkListAddress , + nutlinkListAddressTickers' , + nutlinkListAddressTickers , + nutlinkAddressTickers' , + nutlinkAddressTickers , + nutlinkTickers' , + nutlinkTickers , + + -- Client.IPFS + ipfsGateway , + ipfsPin , + ipfsListPins' , + ipfsListPins , + ipfsGetPin , + ipfsRemovePin , + + -- Client.Cardano.Blocks + getLatestBlock , + getLatestBlockTxs' , + getLatestBlockTxs , + getBlock , + getBlockSlot , + getBlockEpochSlot , + getNextBlocks' , + getNextBlocks , + getPreviousBlocks' , + getPreviousBlocks , + getBlockTxs' , + getBlockTxs , + getBlockAffectedAddresses' , + getBlockAffectedAddresses , + + -- Client.Cardano.Network + getNetworkInfo , + getNetworkEras , + + -- Client.Cardano.Addresses + getAddressInfo , + getAddressInfoExtended , + getAddressDetails , + getAddressUtxos' , + getAddressUtxos , + getAddressUtxosAsset' , + getAddressUtxosAsset , + getAddressTransactions , + + -- Client.Cardano.Assets + getAssets' , + getAssets , + getAssetDetails , + getAssetHistory' , + getAssetHistory , + getAssetTransactions' , + getAssetTransactions , + getAssetAddresses' , + getAssetAddresses , + getAssetsByPolicy' , + getAssetsByPolicy , + + -- Client.Cardano.Scripts + listScripts' , + listScripts , + getScript , + getScriptRedeemers' , + getScriptRedeemers , + getScriptDatum , + getScriptDatumCBOR , + getScriptJSON , + getScriptCBOR , + + -- Client.Cardano.Epochs + getLatestEpoch , + getLatestEpochProtocolParams , + getEpoch , + getNextEpochs' , + getNextEpochs , + getPreviousEpochs' , + getPreviousEpochs , + getEpochStake' , + getEpochStake , + getEpochStakeByPool' , + getEpochStakeByPool , + getEpochBlocks' , + getEpochBlocks , + getEpochBlocksByPool' , + getEpochBlocksByPool , + getEpochProtocolParams , + + -- Client.Cardano.Transactions + getTx , + getTxUtxos , + getTxRedeemers , + getTxStakes , + getTxDelegations , + getTxWithdrawals , + getTxMirs , + getTxPoolUpdates , + getTxPoolRetiring , + getTxMetadataJSON , + getTxMetadataCBOR , + submitTx , + + -- Client.Cardano.Ledger + getLedgerGenesis , + + -- Client.Cardano.Accounts + getAccount , + getAccountRewards' , + getAccountRewards , + getAccountHistory' , + getAccountHistory , + getAccountDelegations' , + getAccountDelegations , + getAccountRegistrations' , + getAccountRegistrations , + getAccountWithdrawals' , + getAccountWithdrawals , + getAccountMirs' , + getAccountMirs , + getAccountAssociatedAddresses' , + getAccountAssociatedAddresses , + getAccountAssociatedAddressesTotal , + getAccountAssociatedAssets' , + getAccountAssociatedAssets , + + -- Client.Cardano.Pools + listPools' , + listPools , + listPoolsExtended' , + listPoolsExtended , + listRetiredPools' , + listRetiredPools , + listRetiringPools' , + listRetiringPools , + getPool , + getPoolHistory' , + getPoolHistory , + getPoolMetadata , + getPoolRelays , + getPoolDelegators' , + getPoolDelegators , + getPoolBlocks' , + getPoolBlocks , + getPoolUpdates' , + getPoolUpdates , + + -- Client.Cardano.Metadata + getTxMetadataLabels' , + getTxMetadataLabels , + getTxMetadataByLabelJSON' , + getTxMetadataByLabelJSON , + getTxMetadataByLabelCBOR' , + getTxMetadataByLabelCBOR , + + ) where + +import Control.Monad +import Data.Either +import Data.Maybe +import Data.Text +import GHC.Integer + +import Blockfrost.Client (AccountDelegation, + AccountHistory, + AccountInfo, + AccountMir, + AccountRegistration, + AccountReward, + AccountWithdrawal, + Address, + AddressAssociated, + AddressAssociatedTotal, + AddressDetails, + AddressInfo, + AddressInfoExtended, + AddressTransaction, + AddressUtxo, + Amount, + AssetAddress, + AssetDetails, + AssetHistory, + AssetId, + AssetInfo, + AssetTransaction, + Block, + BlockHash, + BlockfrostError, + CBORString, + DatumHash, + Epoch, + EpochInfo, + Genesis, + Healthy, + IPFSData, + IPFSPin, + IPFSPinChange, + Metric, Network, + NetworkEraSummary, + NutlinkAddress, + NutlinkAddressTicker, + NutlinkTicker, + Paged, PolicyId, + Pool, + PoolDelegator, + PoolEpoch, + PoolHistory, + PoolId, + PoolInfo, + PoolMetadata, + PoolRelay, + PoolStakeDistribution, + PoolUpdate, + Project, + ProtocolParams, + Script, + ScriptCBOR, + ScriptDatum, + ScriptDatumCBOR, + ScriptHash, + ScriptHashList, + ScriptJSON, + ScriptRedeemer, + ServerTime, + Slot, SortOrder, + StakeDistribution, + Transaction, + TransactionDelegation, + TransactionMetaCBOR, + TransactionMetaJSON, + TransactionMir, + TransactionPoolRetiring, + TransactionPoolUpdate, + TransactionRedeemer, + TransactionStake, + TransactionUtxos, + TransactionWithdrawal, + TxHash, TxMeta, + TxMetaCBOR, + TxMetaJSON, + URLVersion) +import Polysemy.Blockfrost.Effect.Blockfrost (Blockfrost, + runBlockfrost) +import qualified Polysemy.Blockfrost.Effect.Blockfrost as BF +import Polysemy +import Polysemy.Error + + +-- Client +getRoot :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r URLVersion +getHealth :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r Healthy +getClock :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r ServerTime +getMetrics :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [Metric] +getMetricsEndpoints :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [(Text, Metric)] + +-- Client.NutLink +nutlinkListAddress :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r NutlinkAddress +nutlinkListAddressTickers' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Sem r [NutlinkAddressTicker] +nutlinkListAddressTickers :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [NutlinkAddressTicker] +nutlinkAddressTickers' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Text -> Paged -> SortOrder -> Sem r [NutlinkTicker] +nutlinkAddressTickers :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Text -> Sem r [NutlinkTicker] +nutlinkTickers' :: Member Blockfrost r => Member (Error BlockfrostError) r => Text -> Paged -> SortOrder -> Sem r [(Address, NutlinkTicker)] +nutlinkTickers :: Member Blockfrost r => Member (Error BlockfrostError) r => Text -> Sem r [(Address, NutlinkTicker)] + +-- Client.IPFS +ipfsGateway :: Member Blockfrost r => Member (Error BlockfrostError) r => Text -> Sem r IPFSData +ipfsPin :: Member Blockfrost r => Member (Error BlockfrostError) r => Text -> Sem r IPFSPinChange +ipfsListPins' :: Member Blockfrost r => Member (Error BlockfrostError) r => Paged -> SortOrder -> Sem r [IPFSPin] +ipfsListPins :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [IPFSPin] +ipfsGetPin :: Member Blockfrost r => Member (Error BlockfrostError) r => Text -> Sem r IPFSPin +ipfsRemovePin :: Member Blockfrost r => Member (Error BlockfrostError) r => Text -> Sem r IPFSPinChange + +-- Client.Cardano.Blocks +getLatestBlock :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r Block +getLatestBlockTxs' :: Member Blockfrost r => Member (Error BlockfrostError) r => Paged -> SortOrder -> Sem r [TxHash] +getLatestBlockTxs :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [TxHash] +getBlock :: Member Blockfrost r => Member (Error BlockfrostError) r => Either Integer BlockHash -> Sem r Block +getBlockSlot :: Member Blockfrost r => Member (Error BlockfrostError) r => Slot -> Sem r Block +getBlockEpochSlot :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Slot -> Sem r Block +getNextBlocks' :: Member Blockfrost r => Member (Error BlockfrostError) r => Either Integer BlockHash -> Paged -> Sem r [Block] +getNextBlocks :: Member Blockfrost r => Member (Error BlockfrostError) r => Either Integer BlockHash -> Sem r [Block] +getPreviousBlocks' :: Member Blockfrost r => Member (Error BlockfrostError) r => Either Integer BlockHash -> Paged -> Sem r [Block] +getPreviousBlocks :: Member Blockfrost r => Member (Error BlockfrostError) r => Either Integer BlockHash -> Sem r [Block] +getBlockTxs' :: Member Blockfrost r => Member (Error BlockfrostError) r => Either Integer BlockHash -> Paged -> SortOrder -> Sem r [TxHash] +getBlockTxs :: Member Blockfrost r => Member (Error BlockfrostError) r => Either Integer BlockHash -> Sem r [TxHash] +getBlockAffectedAddresses' :: Member Blockfrost r => Member (Error BlockfrostError) r => Either Integer BlockHash -> Paged -> Sem r [(Address, [TxHash])] +getBlockAffectedAddresses :: Member Blockfrost r => Member (Error BlockfrostError) r => Either Integer BlockHash -> Sem r [(Address, [TxHash])] + +-- Client.Cardano.Network +getNetworkInfo :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r Network +getNetworkEras :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [NetworkEraSummary] + +-- Client.Cardano.Addresses +getAddressInfo :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r AddressInfo +getAddressInfoExtended :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r AddressInfoExtended +getAddressDetails :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r AddressDetails +getAddressUtxos' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Sem r [AddressUtxo] +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 -> Sem r [AddressTransaction] + +-- Client.Cardano.Assets +getAssets' :: Member Blockfrost r => Member (Error BlockfrostError) r => Paged -> SortOrder -> Sem r [AssetInfo] +getAssets :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [AssetInfo] +getAssetDetails :: Member Blockfrost r => Member (Error BlockfrostError) r => AssetId -> Sem r AssetDetails +getAssetHistory' :: Member Blockfrost r => Member (Error BlockfrostError) r => AssetId -> Paged -> SortOrder -> Sem r [AssetHistory] +getAssetHistory :: Member Blockfrost r => Member (Error BlockfrostError) r => AssetId -> Sem r [AssetHistory] +getAssetTransactions' :: Member Blockfrost r => Member (Error BlockfrostError) r => AssetId -> Paged -> SortOrder -> Sem r [AssetTransaction] +getAssetTransactions :: Member Blockfrost r => Member (Error BlockfrostError) r => AssetId -> Sem r [AssetTransaction] +getAssetAddresses' :: Member Blockfrost r => Member (Error BlockfrostError) r => AssetId -> Paged -> SortOrder -> Sem r [AssetAddress] +getAssetAddresses :: Member Blockfrost r => Member (Error BlockfrostError) r => AssetId -> Sem r [AssetAddress] +getAssetsByPolicy' :: Member Blockfrost r => Member (Error BlockfrostError) r => PolicyId -> Paged -> SortOrder -> Sem r [AssetInfo] +getAssetsByPolicy :: Member Blockfrost r => Member (Error BlockfrostError) r => PolicyId -> Sem r [AssetInfo] + +-- Client.Cardano.Scripts +listScripts' :: Member Blockfrost r => Member (Error BlockfrostError) r => Paged -> SortOrder -> Sem r ScriptHashList +listScripts :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r ScriptHashList +getScript :: Member Blockfrost r => Member (Error BlockfrostError) r => ScriptHash -> Sem r Script +getScriptRedeemers' :: Member Blockfrost r => Member (Error BlockfrostError) r => ScriptHash -> Paged -> SortOrder -> Sem r [ScriptRedeemer] +getScriptRedeemers :: Member Blockfrost r => Member (Error BlockfrostError) r => ScriptHash -> Sem r [ScriptRedeemer] +getScriptDatum :: Member Blockfrost r => Member (Error BlockfrostError) r => DatumHash -> Sem r ScriptDatum +getScriptDatumCBOR :: Member Blockfrost r => Member (Error BlockfrostError) r => DatumHash -> Sem r ScriptDatumCBOR +getScriptJSON :: Member Blockfrost r => Member (Error BlockfrostError) r => ScriptHash -> Sem r ScriptJSON +getScriptCBOR :: Member Blockfrost r => Member (Error BlockfrostError) r => ScriptHash -> Sem r ScriptCBOR + +-- Client.Cardano.Epochs +getLatestEpoch :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r EpochInfo +getLatestEpochProtocolParams :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r ProtocolParams +getEpoch :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Sem r EpochInfo +getNextEpochs' :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Paged -> Sem r [EpochInfo] +getNextEpochs :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Sem r [EpochInfo] +getPreviousEpochs' :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Paged -> Sem r [EpochInfo] +getPreviousEpochs :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Sem r [EpochInfo] +getEpochStake' :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Paged -> Sem r [StakeDistribution] +getEpochStake :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Sem r [StakeDistribution] +getEpochStakeByPool' :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> PoolId -> Paged -> Sem r [PoolStakeDistribution] +getEpochStakeByPool :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> PoolId -> Sem r [PoolStakeDistribution] +getEpochBlocks' :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Paged -> SortOrder -> Sem r [BlockHash] +getEpochBlocks :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Sem r [BlockHash] +getEpochBlocksByPool' :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> PoolId -> Paged -> SortOrder -> Sem r [BlockHash] +getEpochBlocksByPool :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> PoolId -> Sem r [BlockHash] +getEpochProtocolParams :: Member Blockfrost r => Member (Error BlockfrostError) r => Epoch -> Sem r ProtocolParams + +-- Client.Cardano.Transactions +getTx :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r Transaction +getTxUtxos :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r TransactionUtxos +getTxRedeemers :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r [TransactionRedeemer] +getTxStakes :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r [TransactionStake] +getTxDelegations :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r [TransactionDelegation] +getTxWithdrawals :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r [TransactionWithdrawal] +getTxMirs :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r [TransactionMir] +getTxPoolUpdates :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r [TransactionPoolUpdate] +getTxPoolRetiring :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r [TransactionPoolRetiring] +getTxMetadataJSON :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r [TransactionMetaJSON] +getTxMetadataCBOR :: Member Blockfrost r => Member (Error BlockfrostError) r => TxHash -> Sem r [TransactionMetaCBOR] +submitTx :: Member Blockfrost r => Member (Error BlockfrostError) r => CBORString -> Sem r TxHash + +-- Client.Cardano.Ledger +getLedgerGenesis :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r Genesis + +-- Client.Cardano.Accounts +getAccount :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r AccountInfo +getAccountRewards' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Sem r [AccountReward] +getAccountRewards :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [AccountReward] +getAccountHistory' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Sem r [AccountHistory] +getAccountHistory :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [AccountHistory] +getAccountDelegations' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Sem r [AccountDelegation] +getAccountDelegations :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [AccountDelegation] +getAccountRegistrations' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Sem r [AccountRegistration] +getAccountRegistrations :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [AccountRegistration] +getAccountWithdrawals' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Sem r [AccountWithdrawal] +getAccountWithdrawals :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [AccountWithdrawal] +getAccountMirs' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Sem r [AccountMir] +getAccountMirs :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [AccountMir] +getAccountAssociatedAddresses' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Sem r [AddressAssociated] +getAccountAssociatedAddresses :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [AddressAssociated] +getAccountAssociatedAddressesTotal :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r AddressAssociatedTotal +getAccountAssociatedAssets' :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Paged -> SortOrder -> Sem r [Amount] +getAccountAssociatedAssets :: Member Blockfrost r => Member (Error BlockfrostError) r => Address -> Sem r [Amount] + +-- Client.Cardano.Pools +listPools' :: Member Blockfrost r => Member (Error BlockfrostError) r => Paged -> SortOrder -> Sem r [PoolId] +listPools :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [PoolId] +listPoolsExtended' :: Member Blockfrost r => Member (Error BlockfrostError) r => Paged -> SortOrder -> Sem r [Pool] +listPoolsExtended :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [Pool] +listRetiredPools' :: Member Blockfrost r => Member (Error BlockfrostError) r => Paged -> SortOrder -> Sem r [PoolEpoch] +listRetiredPools :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [PoolEpoch] +listRetiringPools' :: Member Blockfrost r => Member (Error BlockfrostError) r => Paged -> SortOrder -> Sem r [PoolEpoch] +listRetiringPools :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [PoolEpoch] +getPool :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Sem r PoolInfo +getPoolHistory' :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Paged -> SortOrder -> Sem r [PoolHistory] +getPoolHistory :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Sem r [PoolHistory] +getPoolMetadata :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Sem r (Maybe PoolMetadata) +getPoolRelays :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Sem r [PoolRelay] +getPoolDelegators' :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Paged -> SortOrder -> Sem r [PoolDelegator] +getPoolDelegators :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Sem r [PoolDelegator] +getPoolBlocks' :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Paged -> SortOrder -> Sem r [BlockHash] +getPoolBlocks :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Sem r [BlockHash] +getPoolUpdates' :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Paged -> SortOrder -> Sem r [PoolUpdate] +getPoolUpdates :: Member Blockfrost r => Member (Error BlockfrostError) r => PoolId -> Sem r [PoolUpdate] + +-- Client.Cardano.Metadata +getTxMetadataLabels' :: Member Blockfrost r => Member (Error BlockfrostError) r => Paged -> SortOrder -> Sem r [TxMeta] +getTxMetadataLabels :: Member Blockfrost r => Member (Error BlockfrostError) r => Sem r [TxMeta] +getTxMetadataByLabelJSON' :: Member Blockfrost r => Member (Error BlockfrostError) r => Text -> Paged -> SortOrder -> Sem r [TxMetaJSON] +getTxMetadataByLabelJSON :: Member Blockfrost r => Member (Error BlockfrostError) r => Text -> Sem r [TxMetaJSON] +getTxMetadataByLabelCBOR' :: Member Blockfrost r => Member (Error BlockfrostError) r => Text -> Paged -> SortOrder -> Sem r [TxMetaCBOR] +getTxMetadataByLabelCBOR :: Member Blockfrost r => Member (Error BlockfrostError) r => Text -> Sem r [TxMetaCBOR] + + +-- Client +getRoot = fromEither =<< BF.getRoot +getHealth = fromEither =<< BF.getHealth +getClock = fromEither =<< BF.getClock +getMetrics = fromEither =<< BF.getMetrics +getMetricsEndpoints = fromEither =<< BF.getMetricsEndpoints + +-- Client.NutLink +nutlinkListAddress a = fromEither =<< BF.nutlinkListAddress a +nutlinkListAddressTickers' a b c = fromEither =<< BF.nutlinkListAddressTickers' a b c +nutlinkListAddressTickers a = fromEither =<< BF.nutlinkListAddressTickers a +nutlinkAddressTickers' a b c d = fromEither =<< BF.nutlinkAddressTickers' a b c d +nutlinkAddressTickers a b = fromEither =<< BF.nutlinkAddressTickers a b +nutlinkTickers' a b c = fromEither =<< BF.nutlinkTickers' a b c +nutlinkTickers a = fromEither =<< BF.nutlinkTickers a + +-- -- Client.IPFS +ipfsGateway a = fromEither =<< BF.ipfsGateway a +ipfsPin a = fromEither =<< BF.ipfsPin a +ipfsListPins' a b = fromEither =<< BF.ipfsListPins' a b +ipfsListPins = fromEither =<< BF.ipfsListPins +ipfsGetPin a = fromEither =<< BF.ipfsGetPin a +ipfsRemovePin a = fromEither =<< BF.ipfsRemovePin a + +-- Client.Cardano.Blocks +getLatestBlock = fromEither =<< BF.getLatestBlock +getLatestBlockTxs' a b = fromEither =<< BF.getLatestBlockTxs' a b +getLatestBlockTxs = fromEither =<< BF.getLatestBlockTxs +getBlock a = fromEither =<< BF.getBlock a +getBlockSlot a = fromEither =<< BF.getBlockSlot a +getBlockEpochSlot a b = fromEither =<< BF.getBlockEpochSlot a b +getNextBlocks' a b = fromEither =<< BF.getNextBlocks' a b +getNextBlocks a = fromEither =<< BF.getNextBlocks a +getPreviousBlocks' a b = fromEither =<< BF.getPreviousBlocks' a b +getPreviousBlocks a = fromEither =<< BF.getPreviousBlocks a +getBlockTxs' a b c = fromEither =<< BF.getBlockTxs' a b c +getBlockTxs a = fromEither =<< BF.getBlockTxs a +getBlockAffectedAddresses' a b = fromEither =<< BF.getBlockAffectedAddresses' a b +getBlockAffectedAddresses a = fromEither =<< BF.getBlockAffectedAddresses a + +-- -- Client.Cardano.Network +getNetworkInfo = fromEither =<< BF.getNetworkInfo +getNetworkEras = fromEither =<< BF.getNetworkEras + +-- Client.Cardano.Addresses +getAddressInfo a = fromEither =<< BF.getAddressInfo a +getAddressInfoExtended a = fromEither =<< BF.getAddressInfoExtended a +getAddressDetails a = fromEither =<< BF.getAddressDetails a +getAddressUtxos' a b c = fromEither =<< BF.getAddressUtxos' a b c +getAddressUtxos a = fromEither =<< BF.getAddressUtxos a +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 + +-- Client.Cardano.Assets +getAssets' a b = fromEither =<< BF.getAssets' a b +getAssets = fromEither =<< BF.getAssets +getAssetDetails a = fromEither =<< BF.getAssetDetails a +getAssetHistory' a b c = fromEither =<< BF.getAssetHistory' a b c +getAssetHistory a = fromEither =<< BF.getAssetHistory a +getAssetTransactions' a b c = fromEither =<< BF.getAssetTransactions' a b c +getAssetTransactions a = fromEither =<< BF.getAssetTransactions a +getAssetAddresses' a b c = fromEither =<< BF.getAssetAddresses' a b c +getAssetAddresses a = fromEither =<< BF.getAssetAddresses a +getAssetsByPolicy' a b c = fromEither =<< BF.getAssetsByPolicy' a b c +getAssetsByPolicy a = fromEither =<< BF.getAssetsByPolicy a + +-- Client.Cardano.Scripts +listScripts' a b = fromEither =<< BF.listScripts' a b +listScripts = fromEither =<< BF.listScripts +getScript a = fromEither =<< BF.getScript a +getScriptRedeemers' a b c = fromEither =<< BF.getScriptRedeemers' a b c +getScriptRedeemers a = fromEither =<< BF.getScriptRedeemers a +getScriptDatum a = fromEither =<< BF.getScriptDatum a +getScriptDatumCBOR a = fromEither =<< BF.getScriptDatumCBOR a +getScriptJSON a = fromEither =<< BF.getScriptJSON a +getScriptCBOR a = fromEither =<< BF.getScriptCBOR a + +-- Client.Cardano.Epochs +getLatestEpoch = fromEither =<< BF.getLatestEpoch +getLatestEpochProtocolParams = fromEither =<< BF.getLatestEpochProtocolParams +getEpoch a = fromEither =<< BF.getEpoch a +getNextEpochs' a b = fromEither =<< BF.getNextEpochs' a b +getNextEpochs a = fromEither =<< BF.getNextEpochs a +getPreviousEpochs' a b = fromEither =<< BF.getPreviousEpochs' a b +getPreviousEpochs a = fromEither =<< BF.getPreviousEpochs a +getEpochStake' a b = fromEither =<< BF.getEpochStake' a b +getEpochStake a = fromEither =<< BF.getEpochStake a +getEpochStakeByPool' a b c = fromEither =<< BF.getEpochStakeByPool' a b c +getEpochStakeByPool a b = fromEither =<< BF.getEpochStakeByPool a b +getEpochBlocks' a b c = fromEither =<< BF.getEpochBlocks' a b c +getEpochBlocks a = fromEither =<< BF.getEpochBlocks a +getEpochBlocksByPool' a b c d = fromEither =<< BF.getEpochBlocksByPool' a b c d +getEpochBlocksByPool a b = fromEither =<< BF.getEpochBlocksByPool a b +getEpochProtocolParams a = fromEither =<< BF.getEpochProtocolParams a + +-- Client.Cardano.Transactions +getTx a = fromEither =<< BF.getTx a +getTxUtxos a = fromEither =<< BF.getTxUtxos a +getTxRedeemers a = fromEither =<< BF.getTxRedeemers a +getTxStakes a = fromEither =<< BF.getTxStakes a +getTxDelegations a = fromEither =<< BF.getTxDelegations a +getTxWithdrawals a = fromEither =<< BF.getTxWithdrawals a +getTxMirs a = fromEither =<< BF.getTxMirs a +getTxPoolUpdates a = fromEither =<< BF.getTxPoolUpdates a +getTxPoolRetiring a = fromEither =<< BF.getTxPoolRetiring a +getTxMetadataJSON a = fromEither =<< BF.getTxMetadataJSON a +getTxMetadataCBOR a = fromEither =<< BF.getTxMetadataCBOR a +submitTx a = fromEither =<< BF.submitTx a + +-- Client.Cardano.Ledger +getLedgerGenesis = fromEither =<< BF.getLedgerGenesis + +-- Client.Cardano.Accounts +getAccount a = fromEither =<< BF.getAccount a +getAccountRewards' a b c = fromEither =<< BF.getAccountRewards' a b c +getAccountRewards a = fromEither =<< BF.getAccountRewards a +getAccountHistory' a b c = fromEither =<< BF.getAccountHistory' a b c +getAccountHistory a = fromEither =<< BF.getAccountHistory a +getAccountDelegations' a b c = fromEither =<< BF.getAccountDelegations' a b c +getAccountDelegations a = fromEither =<< BF.getAccountDelegations a +getAccountRegistrations' a b c = fromEither =<< BF.getAccountRegistrations' a b c +getAccountRegistrations a = fromEither =<< BF.getAccountRegistrations a +getAccountWithdrawals' a b c = fromEither =<< BF.getAccountWithdrawals' a b c +getAccountWithdrawals a = fromEither =<< BF.getAccountWithdrawals a +getAccountMirs' a b c = fromEither =<< BF.getAccountMirs' a b c +getAccountMirs a = fromEither =<< BF.getAccountMirs a +getAccountAssociatedAddresses' a b c = fromEither =<< BF.getAccountAssociatedAddresses' a b c +getAccountAssociatedAddresses a = fromEither =<< BF.getAccountAssociatedAddresses a +getAccountAssociatedAddressesTotal a = fromEither =<< BF.getAccountAssociatedAddressesTotal a +getAccountAssociatedAssets' a b c = fromEither =<< BF.getAccountAssociatedAssets' a b c +getAccountAssociatedAssets a = fromEither =<< BF.getAccountAssociatedAssets a + +-- Client.Cardano.Pools +listPools' a b = fromEither =<< BF.listPools' a b +listPools = fromEither =<< BF.listPools +listPoolsExtended' a b = fromEither =<< BF.listPoolsExtended' a b +listPoolsExtended = fromEither =<< BF.listPoolsExtended +listRetiredPools' a b = fromEither =<< BF.listRetiredPools' a b +listRetiredPools = fromEither =<< BF.listRetiredPools +listRetiringPools' a b = fromEither =<< BF.listRetiringPools' a b +listRetiringPools = fromEither =<< BF.listRetiringPools +getPool a = fromEither =<< BF.getPool a +getPoolHistory' a b c = fromEither =<< BF.getPoolHistory' a b c +getPoolHistory a = fromEither =<< BF.getPoolHistory a +getPoolMetadata a = fromEither =<< BF.getPoolMetadata a +getPoolRelays a = fromEither =<< BF.getPoolRelays a +getPoolDelegators' a b c = fromEither =<< BF.getPoolDelegators' a b c +getPoolDelegators a = fromEither =<< BF.getPoolDelegators a +getPoolBlocks' a b c = fromEither =<< BF.getPoolBlocks' a b c +getPoolBlocks a = fromEither =<< BF.getPoolBlocks a +getPoolUpdates' a b c = fromEither =<< BF.getPoolUpdates' a b c +getPoolUpdates a = fromEither =<< BF.getPoolUpdates a + +-- Client.Cardano.Metadata +getTxMetadataLabels' a b = fromEither =<< BF.getTxMetadataLabels' a b +getTxMetadataLabels = fromEither =<< BF.getTxMetadataLabels +getTxMetadataByLabelJSON' a b c = fromEither =<< BF.getTxMetadataByLabelJSON' a b c +getTxMetadataByLabelJSON a = fromEither =<< BF.getTxMetadataByLabelJSON a +getTxMetadataByLabelCBOR' a b c = fromEither =<< BF.getTxMetadataByLabelCBOR' a b c +getTxMetadataByLabelCBOR a = fromEither =<< BF.getTxMetadataByLabelCBOR a diff --git a/src/Polysemy/Blockfrost/Client.hs b/src/Polysemy/Blockfrost/Client.hs new file mode 100644 index 0000000..b329b30 --- /dev/null +++ b/src/Polysemy/Blockfrost/Client.hs @@ -0,0 +1,9 @@ +module Polysemy.Blockfrost.Client + ( getRoot, + getHealth, + getClock, + getMetrics, + getMetricsEndpoints, + ) where + +import Polysemy.Blockfrost.Api diff --git a/src/Polysemy/Blockfrost/Effect/Blockfrost.hs b/src/Polysemy/Blockfrost/Effect/Blockfrost.hs new file mode 100644 index 0000000..0f38b7d --- /dev/null +++ b/src/Polysemy/Blockfrost/Effect/Blockfrost.hs @@ -0,0 +1,377 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE UnicodeSyntax #-} + +{- HLINT ignore "Redundant $" -} + +module Polysemy.Blockfrost.Effect.Blockfrost where + +import Data.Either +import Data.Function (($)) +import Data.Maybe +import Data.Text (Text) +import GHC.Integer +import System.IO (IO) + +import Blockfrost.Client (BlockfrostError, Project) +import qualified Blockfrost.Client as BF +import Blockfrost.Types +import Blockfrost.Util.Pagination +import Blockfrost.Util.Sorting +import Polysemy +import Polysemy.Reader + +data Blockfrost m a where + + -- Client + GetRoot :: Blockfrost m (Either BlockfrostError URLVersion) + GetHealth :: Blockfrost m (Either BlockfrostError Healthy) + GetClock :: Blockfrost m (Either BlockfrostError ServerTime) + GetMetrics :: Blockfrost m (Either BlockfrostError [Metric]) + GetMetricsEndpoints :: Blockfrost m (Either BlockfrostError [(Text, Metric)]) + + -- Client.NutLink + NutlinkListAddress :: Address -> Blockfrost m (Either BlockfrostError NutlinkAddress) + NutlinkListAddressTickers' :: Address -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [NutlinkAddressTicker]) + NutlinkListAddressTickers :: Address -> Blockfrost m (Either BlockfrostError [NutlinkAddressTicker]) + NutlinkAddressTickers' :: Address -> Text -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [NutlinkTicker]) + NutlinkAddressTickers :: Address -> Text -> Blockfrost m (Either BlockfrostError [NutlinkTicker]) + NutlinkTickers' :: Text -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [(Address, NutlinkTicker)]) + NutlinkTickers :: Text -> Blockfrost m (Either BlockfrostError [(Address, NutlinkTicker)]) + + -- Client.IPFS + IpfsGateway :: Text -> Blockfrost m (Either BlockfrostError IPFSData) + IpfsPin :: Text -> Blockfrost m (Either BlockfrostError IPFSPinChange) + IpfsListPins' :: Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [IPFSPin]) + IpfsListPins :: Blockfrost m (Either BlockfrostError [IPFSPin]) + IpfsGetPin :: Text -> Blockfrost m (Either BlockfrostError IPFSPin) + IpfsRemovePin :: Text -> Blockfrost m (Either BlockfrostError IPFSPinChange) + + -- Client.Cardano.Blocks + GetLatestBlock :: Blockfrost m (Either BlockfrostError Block) + GetLatestBlockTxs' :: Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [TxHash]) + GetLatestBlockTxs :: Blockfrost m (Either BlockfrostError [TxHash]) + GetBlock :: Either Integer BlockHash -> Blockfrost m (Either BlockfrostError Block) + GetBlockSlot :: Slot -> Blockfrost m (Either BlockfrostError Block) + GetBlockEpochSlot :: Epoch -> Slot -> Blockfrost m (Either BlockfrostError Block) + GetNextBlocks' :: Either Integer BlockHash -> Paged -> Blockfrost m (Either BlockfrostError [Block]) + GetNextBlocks :: Either Integer BlockHash -> Blockfrost m (Either BlockfrostError [Block]) + GetPreviousBlocks' :: Either Integer BlockHash -> Paged -> Blockfrost m (Either BlockfrostError [Block]) + GetPreviousBlocks :: Either Integer BlockHash -> Blockfrost m (Either BlockfrostError [Block]) + GetBlockTxs' :: Either Integer BlockHash -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [TxHash]) + GetBlockTxs :: Either Integer BlockHash -> Blockfrost m (Either BlockfrostError [TxHash]) + GetBlockAffectedAddresses' :: Either Integer BlockHash -> Paged -> Blockfrost m (Either BlockfrostError [(Address, [TxHash])]) + GetBlockAffectedAddresses :: Either Integer BlockHash -> Blockfrost m (Either BlockfrostError [(Address, [TxHash])]) + + -- Client.Cardano.Network + GetNetworkInfo :: Blockfrost m (Either BlockfrostError Network) + GetNetworkEras :: Blockfrost m (Either BlockfrostError [NetworkEraSummary]) + + -- Client.Cardano.Addresses + GetAddressInfo :: Address -> Blockfrost m (Either BlockfrostError AddressInfo) + GetAddressInfoExtended :: Address -> Blockfrost m (Either BlockfrostError AddressInfoExtended) + GetAddressDetails :: Address -> Blockfrost m (Either BlockfrostError AddressDetails) + GetAddressUtxos' :: Address -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AddressUtxo]) + GetAddressUtxos :: Address -> Blockfrost m (Either BlockfrostError [AddressUtxo]) + GetAddressUtxosAsset' :: Address -> AssetId-> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AddressUtxo]) + GetAddressUtxosAsset :: Address -> AssetId -> Blockfrost m (Either BlockfrostError [AddressUtxo]) + GetAddressTransactions :: Address -> Blockfrost m (Either BlockfrostError [AddressTransaction]) + + -- Client.Cardano.Assets + GetAssets' :: Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AssetInfo]) + GetAssets :: Blockfrost m (Either BlockfrostError [AssetInfo]) + GetAssetDetails :: AssetId -> Blockfrost m (Either BlockfrostError AssetDetails) + GetAssetHistory' :: AssetId -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AssetHistory]) + GetAssetHistory :: AssetId -> Blockfrost m (Either BlockfrostError [AssetHistory]) + GetAssetTransactions' :: AssetId -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AssetTransaction]) + GetAssetTransactions :: AssetId -> Blockfrost m (Either BlockfrostError [AssetTransaction]) + GetAssetAddresses' :: AssetId -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AssetAddress]) + GetAssetAddresses :: AssetId -> Blockfrost m (Either BlockfrostError [AssetAddress]) + GetAssetsByPolicy' :: PolicyId -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AssetInfo]) + GetAssetsByPolicy :: PolicyId -> Blockfrost m (Either BlockfrostError [AssetInfo]) + + -- Client.Cardano.Scripts + ListScripts' :: Paged -> SortOrder -> Blockfrost m (Either BlockfrostError ScriptHashList) + ListScripts :: Blockfrost m (Either BlockfrostError ScriptHashList) + GetScript :: ScriptHash -> Blockfrost m (Either BlockfrostError Script) + GetScriptRedeemers' :: ScriptHash -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [ScriptRedeemer]) + GetScriptRedeemers :: ScriptHash -> Blockfrost m (Either BlockfrostError [ScriptRedeemer]) + GetScriptDatum :: DatumHash -> Blockfrost m (Either BlockfrostError ScriptDatum) + GetScriptDatumCBOR :: DatumHash -> Blockfrost m (Either BlockfrostError ScriptDatumCBOR) + GetScriptJSON :: ScriptHash -> Blockfrost m (Either BlockfrostError ScriptJSON) + GetScriptCBOR :: ScriptHash -> Blockfrost m (Either BlockfrostError ScriptCBOR) + + -- Client.Cardano.Epochs + GetLatestEpoch :: Blockfrost m (Either BlockfrostError EpochInfo) + GetLatestEpochProtocolParams :: Blockfrost m (Either BlockfrostError ProtocolParams) + GetEpoch :: Epoch -> Blockfrost m (Either BlockfrostError EpochInfo) + GetNextEpochs' :: Epoch -> Paged -> Blockfrost m (Either BlockfrostError [EpochInfo]) + GetNextEpochs :: Epoch -> Blockfrost m (Either BlockfrostError [EpochInfo]) + GetPreviousEpochs' :: Epoch -> Paged -> Blockfrost m (Either BlockfrostError [EpochInfo]) + GetPreviousEpochs :: Epoch -> Blockfrost m (Either BlockfrostError [EpochInfo]) + GetEpochStake' :: Epoch -> Paged -> Blockfrost m (Either BlockfrostError [StakeDistribution]) + GetEpochStake :: Epoch -> Blockfrost m (Either BlockfrostError [StakeDistribution]) + GetEpochStakeByPool' :: Epoch -> PoolId -> Paged -> Blockfrost m (Either BlockfrostError [PoolStakeDistribution]) + GetEpochStakeByPool :: Epoch -> PoolId -> Blockfrost m (Either BlockfrostError [PoolStakeDistribution]) + GetEpochBlocks' :: Epoch -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [BlockHash]) + GetEpochBlocks :: Epoch -> Blockfrost m (Either BlockfrostError [BlockHash]) + GetEpochBlocksByPool' :: Epoch -> PoolId -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [BlockHash]) + GetEpochBlocksByPool :: Epoch -> PoolId -> Blockfrost m (Either BlockfrostError [BlockHash]) + GetEpochProtocolParams :: Epoch -> Blockfrost m (Either BlockfrostError ProtocolParams) + + -- Client.Cardano.Transactions + GetTx :: TxHash -> Blockfrost m (Either BlockfrostError Transaction) + GetTxUtxos :: TxHash -> Blockfrost m (Either BlockfrostError TransactionUtxos) + GetTxRedeemers :: TxHash -> Blockfrost m (Either BlockfrostError [TransactionRedeemer]) + GetTxStakes :: TxHash -> Blockfrost m (Either BlockfrostError [TransactionStake]) + GetTxDelegations :: TxHash -> Blockfrost m (Either BlockfrostError [TransactionDelegation]) + GetTxWithdrawals :: TxHash -> Blockfrost m (Either BlockfrostError [TransactionWithdrawal]) + GetTxMirs :: TxHash -> Blockfrost m (Either BlockfrostError [TransactionMir]) + GetTxPoolUpdates :: TxHash -> Blockfrost m (Either BlockfrostError [TransactionPoolUpdate]) + GetTxPoolRetiring :: TxHash -> Blockfrost m (Either BlockfrostError [TransactionPoolRetiring]) + GetTxMetadataJSON :: TxHash -> Blockfrost m (Either BlockfrostError [TransactionMetaJSON]) + GetTxMetadataCBOR :: TxHash -> Blockfrost m (Either BlockfrostError [TransactionMetaCBOR]) + SubmitTx :: CBORString -> Blockfrost m (Either BlockfrostError TxHash) + + -- Client.Cardano.Ledger + GetLedgerGenesis :: Blockfrost m (Either BlockfrostError Genesis) + + -- Client.Cardano.Accounts + GetAccount :: Address -> Blockfrost m (Either BlockfrostError AccountInfo) + GetAccountRewards' :: Address -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AccountReward]) + GetAccountRewards :: Address -> Blockfrost m (Either BlockfrostError [AccountReward]) + GetAccountHistory' :: Address -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AccountHistory]) + GetAccountHistory :: Address -> Blockfrost m (Either BlockfrostError [AccountHistory]) + GetAccountDelegations' :: Address -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AccountDelegation]) + GetAccountDelegations :: Address -> Blockfrost m (Either BlockfrostError [AccountDelegation]) + GetAccountRegistrations' :: Address -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AccountRegistration]) + GetAccountRegistrations :: Address -> Blockfrost m (Either BlockfrostError [AccountRegistration]) + GetAccountWithdrawals' :: Address -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AccountWithdrawal]) + GetAccountWithdrawals :: Address -> Blockfrost m (Either BlockfrostError [AccountWithdrawal]) + GetAccountMirs' :: Address -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AccountMir]) + GetAccountMirs :: Address -> Blockfrost m (Either BlockfrostError [AccountMir]) + GetAccountAssociatedAddresses' :: Address -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [AddressAssociated]) + GetAccountAssociatedAddresses :: Address -> Blockfrost m (Either BlockfrostError [AddressAssociated]) + GetAccountAssociatedAddressesTotal :: Address -> Blockfrost m (Either BlockfrostError AddressAssociatedTotal) + GetAccountAssociatedAssets' :: Address -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [Amount]) + GetAccountAssociatedAssets :: Address -> Blockfrost m (Either BlockfrostError [Amount]) + + -- Client.Cardano.Pools + ListPools' :: Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [PoolId]) + ListPools :: Blockfrost m (Either BlockfrostError [PoolId]) + ListPoolsExtended' :: Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [Pool]) + ListPoolsExtended :: Blockfrost m (Either BlockfrostError [Pool]) + ListRetiredPools' :: Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [PoolEpoch]) + ListRetiredPools :: Blockfrost m (Either BlockfrostError [PoolEpoch]) + ListRetiringPools' :: Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [PoolEpoch]) + ListRetiringPools :: Blockfrost m (Either BlockfrostError [PoolEpoch]) + GetPool :: PoolId -> Blockfrost m (Either BlockfrostError PoolInfo) + GetPoolHistory' :: PoolId -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [PoolHistory]) + GetPoolHistory :: PoolId -> Blockfrost m (Either BlockfrostError [PoolHistory]) + GetPoolMetadata :: PoolId -> Blockfrost m (Either BlockfrostError (Maybe PoolMetadata)) + GetPoolRelays :: PoolId -> Blockfrost m (Either BlockfrostError [PoolRelay]) + GetPoolDelegators' :: PoolId -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [PoolDelegator]) + GetPoolDelegators :: PoolId -> Blockfrost m (Either BlockfrostError [PoolDelegator]) + GetPoolBlocks' :: PoolId -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [BlockHash]) + GetPoolBlocks :: PoolId -> Blockfrost m (Either BlockfrostError [BlockHash]) + GetPoolUpdates' :: PoolId -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [PoolUpdate]) + GetPoolUpdates :: PoolId -> Blockfrost m (Either BlockfrostError [PoolUpdate]) + + -- Client.Cardano.Metadata + GetTxMetadataLabels' :: Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [TxMeta]) + GetTxMetadataLabels :: Blockfrost m (Either BlockfrostError [TxMeta]) + GetTxMetadataByLabelJSON' :: Text -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [TxMetaJSON]) + GetTxMetadataByLabelJSON :: Text -> Blockfrost m (Either BlockfrostError [TxMetaJSON]) + GetTxMetadataByLabelCBOR' :: Text -> Paged -> SortOrder -> Blockfrost m (Either BlockfrostError [TxMetaCBOR]) + GetTxMetadataByLabelCBOR :: Text -> Blockfrost m (Either BlockfrostError [TxMetaCBOR]) + +makeSem ''Blockfrost + +callBlockfrost :: () + => Member (Reader Project) r + => Member (Embed IO) r + => BF.BlockfrostClientT IO b + -> Sem r (Either BlockfrostError b) +callBlockfrost f = do + project <- ask @Project + embed (BF.runBlockfrost project f) + +runBlockfrost :: () + => Member (Embed IO) r + => Member (Reader Project) r + => Sem (Blockfrost ': r) a + -> Sem r a +runBlockfrost = + interpret $ \case + -- Client + GetRoot -> callBlockfrost $ BF.getRoot + GetHealth -> callBlockfrost $ BF.getHealth + GetClock -> callBlockfrost $ BF.getClock + GetMetrics -> callBlockfrost $ BF.getMetrics + GetMetricsEndpoints -> callBlockfrost $ BF.getMetricsEndpoints + + -- Client.NutLink + NutlinkListAddress a -> callBlockfrost $ BF.nutlinkListAddress a + NutlinkListAddressTickers' a b c -> callBlockfrost $ BF.nutlinkListAddressTickers' a b c + NutlinkListAddressTickers a -> callBlockfrost $ BF.nutlinkListAddressTickers a + NutlinkAddressTickers' a b c d -> callBlockfrost $ BF.nutlinkAddressTickers' a b c d + NutlinkAddressTickers a b -> callBlockfrost $ BF.nutlinkAddressTickers a b + NutlinkTickers' a b c -> callBlockfrost $ BF.nutlinkTickers' a b c + NutlinkTickers a -> callBlockfrost $ BF.nutlinkTickers a + + -- -- Client.IPFS + IpfsGateway a -> callBlockfrost $ BF.ipfsGateway a + IpfsPin a -> callBlockfrost $ BF.ipfsPin a + IpfsListPins' a b -> callBlockfrost $ BF.ipfsListPins' a b + IpfsListPins -> callBlockfrost $ BF.ipfsListPins + IpfsGetPin a -> callBlockfrost $ BF.ipfsGetPin a + IpfsRemovePin a -> callBlockfrost $ BF.ipfsRemovePin a + + -- Client.Cardano.Blocks + GetLatestBlock -> callBlockfrost $ BF.getLatestBlock + GetLatestBlockTxs' a b -> callBlockfrost $ BF.getLatestBlockTxs' a b + GetLatestBlockTxs -> callBlockfrost $ BF.getLatestBlockTxs + GetBlock a -> callBlockfrost $ BF.getBlock a + GetBlockSlot a -> callBlockfrost $ BF.getBlockSlot a + GetBlockEpochSlot a b -> callBlockfrost $ BF.getBlockEpochSlot a b + GetNextBlocks' a b -> callBlockfrost $ BF.getNextBlocks' a b + GetNextBlocks a -> callBlockfrost $ BF.getNextBlocks a + GetPreviousBlocks' a b -> callBlockfrost $ BF.getPreviousBlocks' a b + GetPreviousBlocks a -> callBlockfrost $ BF.getPreviousBlocks a + GetBlockTxs' a b c -> callBlockfrost $ BF.getBlockTxs' a b c + GetBlockTxs a -> callBlockfrost $ BF.getBlockTxs a + GetBlockAffectedAddresses' a b -> callBlockfrost $ BF.getBlockAffectedAddresses' a b + GetBlockAffectedAddresses a -> callBlockfrost $ BF.getBlockAffectedAddresses a + + -- -- Client.Cardano.Network + GetNetworkInfo -> callBlockfrost $ BF.getNetworkInfo + GetNetworkEras -> callBlockfrost $ BF.getNetworkEras + + -- Client.Cardano.Addresses + GetAddressInfo a -> callBlockfrost $ BF.getAddressInfo a + GetAddressInfoExtended a -> callBlockfrost $ BF.getAddressInfoExtended a + GetAddressDetails a -> callBlockfrost $ BF.getAddressDetails a + GetAddressUtxos' a b c -> callBlockfrost $ BF.getAddressUtxos' a b c + GetAddressUtxos a -> callBlockfrost $ BF.getAddressUtxos a + GetAddressUtxosAsset' a b c d -> callBlockfrost $ BF.getAddressUtxosAsset' a b c d + GetAddressUtxosAsset a b -> callBlockfrost $ BF.getAddressUtxosAsset a b + GetAddressTransactions a -> callBlockfrost $ BF.getAddressTransactions a + + -- Client.Cardano.Assets + GetAssets' a b -> callBlockfrost $ BF.getAssets' a b + GetAssets -> callBlockfrost $ BF.getAssets + GetAssetDetails a -> callBlockfrost $ BF.getAssetDetails a + GetAssetHistory' a b c -> callBlockfrost $ BF.getAssetHistory' a b c + GetAssetHistory a -> callBlockfrost $ BF.getAssetHistory a + GetAssetTransactions' a b c -> callBlockfrost $ BF.getAssetTransactions' a b c + GetAssetTransactions a -> callBlockfrost $ BF.getAssetTransactions a + GetAssetAddresses' a b c -> callBlockfrost $ BF.getAssetAddresses' a b c + GetAssetAddresses a -> callBlockfrost $ BF.getAssetAddresses a + GetAssetsByPolicy' a b c -> callBlockfrost $ BF.getAssetsByPolicy' a b c + GetAssetsByPolicy a -> callBlockfrost $ BF.getAssetsByPolicy a + + -- Client.Cardano.Scripts + ListScripts' a b -> callBlockfrost $ BF.listScripts' a b + ListScripts -> callBlockfrost $ BF.listScripts + GetScript a -> callBlockfrost $ BF.getScript a + GetScriptRedeemers' a b c -> callBlockfrost $ BF.getScriptRedeemers' a b c + GetScriptRedeemers a -> callBlockfrost $ BF.getScriptRedeemers a + GetScriptDatum a -> callBlockfrost $ BF.getScriptDatum a + GetScriptDatumCBOR a -> callBlockfrost $ BF.getScriptDatumCBOR a + GetScriptJSON a -> callBlockfrost $ BF.getScriptJSON a + GetScriptCBOR a -> callBlockfrost $ BF.getScriptCBOR a + + -- Client.Cardano.Epochs + GetLatestEpoch -> callBlockfrost $ BF.getLatestEpoch + GetLatestEpochProtocolParams -> callBlockfrost $ BF.getLatestEpochProtocolParams + GetEpoch a -> callBlockfrost $ BF.getEpoch a + GetNextEpochs' a b -> callBlockfrost $ BF.getNextEpochs' a b + GetNextEpochs a -> callBlockfrost $ BF.getNextEpochs a + GetPreviousEpochs' a b -> callBlockfrost $ BF.getPreviousEpochs' a b + GetPreviousEpochs a -> callBlockfrost $ BF.getPreviousEpochs a + GetEpochStake' a b -> callBlockfrost $ BF.getEpochStake' a b + GetEpochStake a -> callBlockfrost $ BF.getEpochStake a + GetEpochStakeByPool' a b c -> callBlockfrost $ BF.getEpochStakeByPool' a b c + GetEpochStakeByPool a b -> callBlockfrost $ BF.getEpochStakeByPool a b + GetEpochBlocks' a b c -> callBlockfrost $ BF.getEpochBlocks' a b c + GetEpochBlocks a -> callBlockfrost $ BF.getEpochBlocks a + GetEpochBlocksByPool' a b c d -> callBlockfrost $ BF.getEpochBlocksByPool' a b c d + GetEpochBlocksByPool a b -> callBlockfrost $ BF.getEpochBlocksByPool a b + GetEpochProtocolParams a -> callBlockfrost $ BF.getEpochProtocolParams a + + -- Client.Cardano.Transactions + GetTx a -> callBlockfrost $ BF.getTx a + GetTxUtxos a -> callBlockfrost $ BF.getTxUtxos a + GetTxRedeemers a -> callBlockfrost $ BF.getTxRedeemers a + GetTxStakes a -> callBlockfrost $ BF.getTxStakes a + GetTxDelegations a -> callBlockfrost $ BF.getTxDelegations a + GetTxWithdrawals a -> callBlockfrost $ BF.getTxWithdrawals a + GetTxMirs a -> callBlockfrost $ BF.getTxMirs a + GetTxPoolUpdates a -> callBlockfrost $ BF.getTxPoolUpdates a + GetTxPoolRetiring a -> callBlockfrost $ BF.getTxPoolRetiring a + GetTxMetadataJSON a -> callBlockfrost $ BF.getTxMetadataJSON a + GetTxMetadataCBOR a -> callBlockfrost $ BF.getTxMetadataCBOR a + SubmitTx a -> callBlockfrost $ BF.submitTx a + + -- Client.Cardano.Ledger + GetLedgerGenesis -> callBlockfrost $ BF.getLedgerGenesis + + -- Client.Cardano.Accounts + GetAccount a -> callBlockfrost $ BF.getAccount a + GetAccountRewards' a b c -> callBlockfrost $ BF.getAccountRewards' a b c + GetAccountRewards a -> callBlockfrost $ BF.getAccountRewards a + GetAccountHistory' a b c -> callBlockfrost $ BF.getAccountHistory' a b c + GetAccountHistory a -> callBlockfrost $ BF.getAccountHistory a + GetAccountDelegations' a b c -> callBlockfrost $ BF.getAccountDelegations' a b c + GetAccountDelegations a -> callBlockfrost $ BF.getAccountDelegations a + GetAccountRegistrations' a b c -> callBlockfrost $ BF.getAccountRegistrations' a b c + GetAccountRegistrations a -> callBlockfrost $ BF.getAccountRegistrations a + GetAccountWithdrawals' a b c -> callBlockfrost $ BF.getAccountWithdrawals' a b c + GetAccountWithdrawals a -> callBlockfrost $ BF.getAccountWithdrawals a + GetAccountMirs' a b c -> callBlockfrost $ BF.getAccountMirs' a b c + GetAccountMirs a -> callBlockfrost $ BF.getAccountMirs a + GetAccountAssociatedAddresses' a b c -> callBlockfrost $ BF.getAccountAssociatedAddresses' a b c + GetAccountAssociatedAddresses a -> callBlockfrost $ BF.getAccountAssociatedAddresses a + GetAccountAssociatedAddressesTotal a -> callBlockfrost $ BF.getAccountAssociatedAddressesTotal a + GetAccountAssociatedAssets' a b c -> callBlockfrost $ BF.getAccountAssociatedAssets' a b c + GetAccountAssociatedAssets a -> callBlockfrost $ BF.getAccountAssociatedAssets a + + -- Client.Cardano.Pools + ListPools' a b -> callBlockfrost $ BF.listPools' a b + ListPools -> callBlockfrost $ BF.listPools + ListPoolsExtended' a b -> callBlockfrost $ BF.listPoolsExtended' a b + ListPoolsExtended -> callBlockfrost $ BF.listPoolsExtended + ListRetiredPools' a b -> callBlockfrost $ BF.listRetiredPools' a b + ListRetiredPools -> callBlockfrost $ BF.listRetiredPools + ListRetiringPools' a b -> callBlockfrost $ BF.listRetiringPools' a b + ListRetiringPools -> callBlockfrost $ BF.listRetiringPools + GetPool a -> callBlockfrost $ BF.getPool a + GetPoolHistory' a b c -> callBlockfrost $ BF.getPoolHistory' a b c + GetPoolHistory a -> callBlockfrost $ BF.getPoolHistory a + GetPoolMetadata a -> callBlockfrost $ BF.getPoolMetadata a + GetPoolRelays a -> callBlockfrost $ BF.getPoolRelays a + GetPoolDelegators' a b c -> callBlockfrost $ BF.getPoolDelegators' a b c + GetPoolDelegators a -> callBlockfrost $ BF.getPoolDelegators a + GetPoolBlocks' a b c -> callBlockfrost $ BF.getPoolBlocks' a b c + GetPoolBlocks a -> callBlockfrost $ BF.getPoolBlocks a + GetPoolUpdates' a b c -> callBlockfrost $ BF.getPoolUpdates' a b c + GetPoolUpdates a -> callBlockfrost $ BF.getPoolUpdates a + + -- Client.Cardano.Metadata + GetTxMetadataLabels' a b -> callBlockfrost $ BF.getTxMetadataLabels' a b + GetTxMetadataLabels -> callBlockfrost $ BF.getTxMetadataLabels + GetTxMetadataByLabelJSON' a b c -> callBlockfrost $ BF.getTxMetadataByLabelJSON' a b c + GetTxMetadataByLabelJSON a -> callBlockfrost $ BF.getTxMetadataByLabelJSON a + GetTxMetadataByLabelCBOR' a b c -> callBlockfrost $ BF.getTxMetadataByLabelCBOR' a b c + GetTxMetadataByLabelCBOR a -> callBlockfrost $ BF.getTxMetadataByLabelCBOR a diff --git a/test/Main.hs b/test/Main.hs new file mode 100644 index 0000000..70c55f5 --- /dev/null +++ b/test/Main.hs @@ -0,0 +1 @@ +{-# OPTIONS_GHC -F -pgmF tasty-discover #-}