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

GeniusYield.Types.Providers

Description

 
Synopsis

Lookup Datum

type GYLookupDatum = GYDatumHash -> IO (Maybe GYDatum) #

How to query a datum by its hash?

Submit Tx

type GYSubmitTx = GYTx -> IO GYTxId #

How to submit a transaction?

Await Tx Confirmed

type GYAwaitTx = GYAwaitTxParameters -> GYTxId -> IO () #

How to await for a transaction confirmation?

data GYAwaitTxParameters #

Await transaction parameters.

Constructors

GYAwaitTxParameters 

Fields

  • maxAttempts :: !Int

    Max number of attempts before give up.

  • checkInterval :: !Int

    Wait time for each attempt (in microseconds).

  • confirmations :: !Word64

    Min number of block confirmation. NOTE: We might wait for more blocks than what is mentioned here but certainly not less.

Get current slot

data GYSlotActions #

How to get current slot?

gyWaitForNextBlock_ :: GYProviders -> IO () #

gyWaitForNextBlock variant which doesn't return current slot.

gyWaitForNextBlockDefault :: IO GYSlot -> IO GYSlot #

Wait for the next block.

threadDelay until current slot getter returns another value.

gyWaitUntilSlotDefault :: IO GYSlot -> GYSlot -> IO GYSlot #

Wait until slot.

Returns the new current slot, which might be larger.

makeSlotActions #

Arguments

:: NominalDiffTime

The time to cache current slots for.

-> IO GYSlot

Getting current slot directly from the provider

-> IO GYSlotActions 

Construct efficient GYSlotActions methods by ensuring the supplied getSlotOfCurrentBlock is only made after a given duration of time has passed.

This uses IO to set up some mutable references used for caching.

Get network parameters

data GYGetParameters #

How to get protocol parameters? ... and other data to do balancing.

makeGetParameters #

Arguments

:: IO ApiProtocolParameters

Getting protocol parameters

-> IO SystemStart

Getting system start

-> IO EraHistory

Getting era history

-> IO GYSlot

Getting slot of current block (to know for epoch)

-> IO GYGetParameters 

Construct efficient GYGetParameters methods by ensuring the supplied IO queries are only made when necessary.

In particular era histories and system start are cached throughout the run of the program whereas protocol parameters are cached only for a single epoch.

This uses IO to set up some mutable references used for caching.

Query UTxO

gyQueryUtxosAtAddressWithDatumsDefault :: Monad m => (GYAddress -> Maybe GYAssetClass -> m GYUTxOs) -> (GYDatumHash -> m (Maybe GYDatum)) -> GYAddress -> Maybe GYAssetClass -> m [(GYUTxO, Maybe GYDatum)] #

Lookup UTxOs at given GYAddress with their datums. This is a default implementation using utxosAtAddress and lookupDatum.

gyQueryUtxosAtAddressesWithDatumsDefault :: Monad m => ([GYAddress] -> m GYUTxOs) -> (GYDatumHash -> m (Maybe GYDatum)) -> [GYAddress] -> m [(GYUTxO, Maybe GYDatum)] #

Lookup UTxOs at zero or more GYAddress with their datums. This is a default implementation using utxosAtAddresses and lookupDatum.

gyQueryUtxosAtPaymentCredsWithDatumsDefault :: Monad m => ([GYPaymentCredential] -> m GYUTxOs) -> (GYDatumHash -> m (Maybe GYDatum)) -> [GYPaymentCredential] -> m [(GYUTxO, Maybe GYDatum)] #

Lookup UTxOs at zero or more GYPaymentCredential with their datums. This is a default implementation using utxosAtPaymentCredentials and lookupDatum.

gyQueryUtxosAtPaymentCredWithDatumsDefault :: Monad m => (GYPaymentCredential -> Maybe GYAssetClass -> m GYUTxOs) -> (GYDatumHash -> m (Maybe GYDatum)) -> GYPaymentCredential -> Maybe GYAssetClass -> m [(GYUTxO, Maybe GYDatum)] #

Lookup UTxOs at given GYPaymentCredential with their datums. This is a default implementation using utxosAtPaymentCredential and lookupDatum.

gyQueryUtxosAtTxOutRefsWithDatumsDefault :: Monad m => ([GYTxOutRef] -> m GYUTxOs) -> (GYDatumHash -> m (Maybe GYDatum)) -> [GYTxOutRef] -> m [(GYUTxO, Maybe GYDatum)] #

Lookup UTxOs at zero or more GYTxOutRef with their datums. This is a default implementation using utxosAtTxOutRefs and lookupDatum.

data GYQueryUTxO #

How to query utxos?

gyQueryUtxoRefsAtAddressDefault :: (GYAddress -> Maybe GYAssetClass -> IO GYUTxOs) -> GYAddress -> IO [GYTxOutRef] #

Query Utxo Refs at address (default implementation)

gyQueryUtxoAtAddressesDefault :: (GYAddress -> Maybe GYAssetClass -> IO GYUTxOs) -> [GYAddress] -> IO GYUTxOs #

Query Utxo for addresses (default implementation)

gyQueryUtxoAtPaymentCredentialsDefault :: (GYPaymentCredential -> Maybe GYAssetClass -> IO GYUTxOs) -> [GYPaymentCredential] -> IO GYUTxOs #

Query Utxo for payment credentials (default implementation)

gyQueryUtxosAtTxOutRefsDefault :: (GYTxOutRef -> IO (Maybe GYUTxO)) -> [GYTxOutRef] -> IO GYUTxOs #

Query Utxos at output refs (default implementation).

Logging

simpleLogging :: GYLogSeverity -> (Text -> IO ()) -> GYLogConfiguration #

Logging messages using the given severity filter with given IO action.

Providers

data GYProviders #

Constructors

GYProviders 

Fields