Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- data SomeDeserializeError
- newtype SubmitTxException = SubmitTxException Text
- datumFromCBOR ∷ Text → Either SomeDeserializeError GYDatum
- newServantClientEnv ∷ String → IO ClientEnv
- fromJson ∷ FromData a ⇒ ByteString → Either SomeDeserializeError a
- parseEraHist ∷ (t → EraSummary) → [t] → Maybe EraHistory
- preprodEraHist ∷ Interpreter (CardanoEras StandardCrypto)
- previewEraHist ∷ Interpreter (CardanoEras StandardCrypto)
- mainnetEraHist ∷ Interpreter (CardanoEras StandardCrypto)
- silenceHeadersClientError ∷ ClientError → ClientError
- extractAssetClass ∷ Maybe GYAssetClass → Maybe (Text, Text)
Documentation
data SomeDeserializeError #
Instances
Show SomeDeserializeError # | |
Defined in GeniusYield.Providers.Common showsPrec ∷ Int → SomeDeserializeError → ShowS # show ∷ SomeDeserializeError → String # showList ∷ [SomeDeserializeError] → ShowS # | |
Eq SomeDeserializeError # | |
Defined in GeniusYield.Providers.Common |
newtype SubmitTxException #
Instances
Exception SubmitTxException # | |
Show SubmitTxException # | |
Defined in GeniusYield.Providers.Common showsPrec ∷ Int → SubmitTxException → ShowS # show ∷ SubmitTxException → String # showList ∷ [SubmitTxException] → ShowS # |
datumFromCBOR ∷ Text → Either SomeDeserializeError GYDatum #
Get datum from bytes.
fromJson ∷ FromData a ⇒ ByteString → Either SomeDeserializeError a #
parseEraHist ∷ (t → EraSummary) → [t] → Maybe EraHistory #
Convert a regular list of era summaries (a la Ogmios) into a typed EraHistory (a la Ouroboros).
NOTE ==
TODO: This must be updated with each hardfork.
See NonEmptyCons
Summary
CardanoEras
types to understand
why one cannot trivially automate this.
Well, unless one uses vectors, from dependent type land.
preprodEraHist ∷ Interpreter (CardanoEras StandardCrypto) #
Hardcoded era history for preprod.
NOTE: This is only to be used for testing.
Also see: "GeniusYield.CardanoApi.EraHistory.showEraHistory"
silenceHeadersClientError ∷ ClientError → ClientError #
Remove request headers info from returned ClientError.
This is used as quick and simple way to hide confidential information such as API token.
extractAssetClass ∷ Maybe GYAssetClass → Maybe (Text, Text) #
Extract currency symbol & token name part of an GYAssetClass
when it is of such a form. When input is Just GYLovelace
or Nothing
, this function returns Nothing
.