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

Feat: Client functions to get transactions at an address / payment credential... #48

Merged
merged 19 commits into from
Apr 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b381567
Feat: Client functions to get transactions at an address / payment cr…
sourabhxyz Feb 12, 2024
7783843
feat: Also parse error strings which are not enclosed in quotes
sourabhxyz Feb 20, 2024
f2d58ff
feat: :sparkles: add \`assets\` endpoint to get for native asset info…
sourabhxyz Feb 28, 2024
a20a033
feat: add `timestamp` field when fetching prices
sourabhxyz Mar 3, 2024
7877265
feat: add all the query parameters for the OHLC endpoint
sourabhxyz Mar 3, 2024
9d0d219
feat: adds newer `Show` instance and derives more classes for `Resolu…
sourabhxyz Mar 4, 2024
62af37a
feat: use `Natural` as type for `ohlcCandleInfoCount`
sourabhxyz Mar 4, 2024
cd42401
feat: hide api key in case of `ConnectionError`
sourabhxyz Mar 10, 2024
dc95858
feat: add `FromHttpApiData` instance of `Dex`
sourabhxyz Mar 10, 2024
0bd82fa
feat: add `Enum`, `Bounded` instance of `Dex`
sourabhxyz Mar 10, 2024
bd92193
feat: add `FromHttpApiData` instance for `Resolution`
sourabhxyz Mar 10, 2024
054711d
feat: add `FromHttpApiData` instance for `Order`
sourabhxyz Mar 10, 2024
83a37d8
feat: handle utf-8 encoding when decoding returned error message when…
sourabhxyz Mar 10, 2024
bdab74c
feat: add Eq, Ord, Enum, Bounded, ToJSON instances for Order
sourabhxyz Apr 2, 2024
eb2db38
feat: utxos by multiple payment credentials
sourabhxyz Apr 8, 2024
c108757
feat: add support of `asset` query parameter to utxos by payment cred…
sourabhxyz Apr 9, 2024
474a274
refactor: use `toStrict` from `Data.ByteString.Lazy` module to satisf…
sourabhxyz Apr 9, 2024
e1df1c3
feat: update cabal file to represent for latest release and add chang…
sourabhxyz Apr 9, 2024
d70479c
fix: use post verb instead of get for `paymentCredentialsUtxos` endpo…
sourabhxyz Apr 9, 2024
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
Prev Previous commit
Next Next commit
feat: Also parse error strings which are not enclosed in quotes
Closes: #49
sourabhxyz committed Feb 20, 2024
commit 77838438058296cbf8b0a171b3a16d4094f9ca33
202 changes: 99 additions & 103 deletions maestro-sdk.cabal
Original file line number Diff line number Diff line change
@@ -2,7 +2,9 @@ cabal-version: 3.0
name: maestro-sdk
version: 1.5.0
synopsis: Maestro Blockchain Indexer SDK
description: Maestro provides blockchain indexers, APIs and event management systems for the Cardano blockchain.
description:
Maestro provides blockchain indexers, APIs and event management systems for the Cardano blockchain.

license: Apache-2.0
license-file: LICENSE
author: support@gomaestro.org
@@ -12,118 +14,112 @@ build-type: Simple
category: Blockchain, Cardano, SDK, API, REST
extra-doc-files: CHANGELOG.md
extra-source-files: README.md
tested-with: GHC == { 8.10.7, 9.2.8, 9.6.2 }
tested-with: GHC ==8.10.7 || ==9.2.8 || ==9.6.2

source-repository head
type: git
location: https://github.com/maestro-org/haskell-sdk

common common
ghc-options: -Wall
default-extensions:
GADTs
DataKinds
DeriveGeneric
DerivingStrategies
DerivingVia
GeneralisedNewtypeDeriving
FlexibleInstances
FlexibleContexts
MultiParamTypeClasses
NumericUnderscores
OverloadedStrings
RecordWildCards
RoleAnnotations
ScopedTypeVariables
TemplateHaskell
TypeApplications
TypeFamilies
TypeOperators
QuasiQuotes
ghc-options: -Wall
default-extensions:
DataKinds
DeriveGeneric
DerivingStrategies
DerivingVia
FlexibleContexts
FlexibleInstances
GADTs
GeneralisedNewtypeDeriving
MultiParamTypeClasses
NumericUnderscores
OverloadedStrings
QuasiQuotes
RecordWildCards
RoleAnnotations
ScopedTypeVariables
TemplateHaskell
TypeApplications
TypeFamilies
TypeOperators

library
import: common
exposed-modules:
Maestro.API.V1
Maestro.API.V1.Accounts
Maestro.API.V1.Addresses
Maestro.API.V1.Blocks
Maestro.API.V1.Datum
Maestro.API.V1.DefiMarkets
Maestro.API.V1.General
Maestro.API.V1.Pools
Maestro.API.V1.Transactions
Maestro.API.V1.TxManager

Maestro.Client.Env
Maestro.Client.Error

Maestro.Client.V1
Maestro.Client.V1.Core
Maestro.Client.V1.Core.Pagination
Maestro.Client.V1.Accounts
Maestro.Client.V1.Addresses
Maestro.Client.V1.Blocks
Maestro.Client.V1.Datum
Maestro.Client.V1.DefiMarkets
Maestro.Client.V1.General
Maestro.Client.V1.Pools
Maestro.Client.V1.Transactions
Maestro.Client.V1.TxManager

Maestro.Types.Common

Maestro.Types.V1
Maestro.Types.V1.Accounts
Maestro.Types.V1.Addresses
Maestro.Types.V1.Blocks
Maestro.Types.V1.Datum
Maestro.Types.V1.DefiMarkets
Maestro.Types.V1.Common
Maestro.Types.V1.Common.Pagination
Maestro.Types.V1.Common.Timestamped
Maestro.Types.V1.General
Maestro.Types.V1.Pools
Maestro.Types.V1.Transactions
import: common
exposed-modules:
Maestro.API.V1
Maestro.API.V1.Accounts
Maestro.API.V1.Addresses
Maestro.API.V1.Blocks
Maestro.API.V1.Datum
Maestro.API.V1.DefiMarkets
Maestro.API.V1.General
Maestro.API.V1.Pools
Maestro.API.V1.Transactions
Maestro.API.V1.TxManager
Maestro.Client.Env
Maestro.Client.Error
Maestro.Client.V1
Maestro.Client.V1.Accounts
Maestro.Client.V1.Addresses
Maestro.Client.V1.Blocks
Maestro.Client.V1.Core
Maestro.Client.V1.Core.Pagination
Maestro.Client.V1.Datum
Maestro.Client.V1.DefiMarkets
Maestro.Client.V1.General
Maestro.Client.V1.Pools
Maestro.Client.V1.Transactions
Maestro.Client.V1.TxManager
Maestro.Types.Common
Maestro.Types.V1
Maestro.Types.V1.Accounts
Maestro.Types.V1.Addresses
Maestro.Types.V1.Blocks
Maestro.Types.V1.Common
Maestro.Types.V1.Common.Pagination
Maestro.Types.V1.Common.Timestamped
Maestro.Types.V1.Datum
Maestro.Types.V1.DefiMarkets
Maestro.Types.V1.General
Maestro.Types.V1.Pools
Maestro.Types.V1.Transactions

build-depends:
aeson ^>=2.1,
base ^>=4.14.3.0 || ^>=4.16.4.0 || ^>=4.18.0.0,
bytestring ^>=0.10 || ^>=0.11,
containers ^>=0.6,
data-default-class ^>=0.1,
deriving-aeson ^>=0.2,
http-api-data ^>=0.5 || ^>=0.6,
http-client ^>=0.7,
http-client-tls ^>=0.3,
http-types ^>=0.12,
retry ^>=0.9,
servant ^>=0.19 || ^>=0.20,
servant-client ^>=0.19 || ^>=0.20,
servant-client-core ^>=0.19 || ^>=0.20,
text ^>=1.2 || ^>=2.0,
time ^>=1.9 || ^>=1.11 || ^>=1.12
build-depends:
, aeson ^>=2.1
, base ^>=4.14.3.0 || ^>=4.16.4.0 || ^>=4.18.0.0
, bytestring >=0.10 && <0.11 || ^>=0.11
, containers ^>=0.6
, data-default-class ^>=0.1
, deriving-aeson ^>=0.2
, http-api-data >=0.5 && <0.6 || ^>=0.6
, http-client ^>=0.7
, http-client-tls ^>=0.3
, http-types ^>=0.12
, retry ^>=0.9
, servant >=0.19 && <0.20 || ^>=0.20
, servant-client >=0.19 && <0.20 || ^>=0.20
, servant-client-core >=0.19 && <0.20 || ^>=0.20
, text ^>=1.2 || ^>=2.0
, time ^>=1.9 || >=1.11 && <1.12 || ^>=1.12

hs-source-dirs: src
default-language: Haskell2010
hs-source-dirs: src
default-language: Haskell2010

test-suite maestro-sdk-tests
import: common
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Driver.hs
other-modules:
Maestro.Test.Backoff
import: common
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Driver.hs
other-modules: Maestro.Test.Backoff
build-depends:
, base ^>=4.14.3.0 || ^>=4.16.4.0 || ^>=4.18.0.0
, containers ^>=0.6.5.1
, hspec ^>=2.11.4
, maestro-sdk
, tasty ^>=1.4.3
, tasty-hspec ^>=1.2.0.4
, text ^>=1.2.4.1 || ^>=2.0.2
, time ^>=1.9.3 || ^>=1.11.1.1 || ^>=1.12.2

build-depends:
base ^>=4.14.3.0 || ^>=4.16.4.0 || ^>=4.18.0.0,
maestro-sdk,
containers ^>=0.6.5.1,
hspec ^>=2.11.4,
tasty ^>=1.4.3,
tasty-hspec ^>=1.2.0.4,
text ^>=1.2.4.1 || ^>=2.0.2,
time ^>=1.9.3 || ^>=1.11.1.1 || ^>=1.12.2
build-tool-depends:
tasty-discover:tasty-discover
build-tool-depends: tasty-discover:tasty-discover
10 changes: 6 additions & 4 deletions src/Maestro/Client/Error.hs
Original file line number Diff line number Diff line change
@@ -7,9 +7,11 @@
, fromServantClientError
) where

import Control.Exception (Exception)
import Data.Aeson (decode)
import Data.Text (Text)
import Control.Exception (Exception)
import Data.Aeson (decode)
import Data.ByteString (toStrict)

Check failure on line 12 in src/Maestro/Client/Error.hs

GitHub Actions / validate / build

Module ‘Data.ByteString’ does not export ‘toStrict’
import Data.Text (Text)
import Data.Text.Encoding (decodeLatin1)
import Deriving.Aeson
import Maestro.Types.Common (LowerFirst)
import Network.HTTP.Types
@@ -74,4 +76,4 @@
Nothing ->
case decode body of
Just (m :: Text) -> m
Nothing -> mempty
Nothing -> decodeLatin1 $ toStrict body