atlas-cardano
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Stabilitydevelop
Safe HaskellNone
LanguageGHC2021

GeniusYield.Providers.Common

Description

 
Synopsis

Documentation

newServantClientEnv :: String -> IO ClientEnv #

Creates a new Servant ClientEnv from a base url.

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 NonEmptyConsSummaryCardanoEras 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.

Orphan instances