Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | support@geniusyield.co |
Stability | develop |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type GYLookupDatum = GYDatumHash → IO (Maybe GYDatum)
- type GYSubmitTx = GYTx → IO GYTxId
- data GYSlotActions = GYSlotActions {
- gyGetCurrentSlot' ∷ !(IO GYSlot)
- gyWaitForNextBlock' ∷ !(IO GYSlot)
- gyWaitUntilSlot' ∷ !(GYSlot → IO GYSlot)
- gyGetCurrentSlot ∷ GYProviders → IO GYSlot
- gyWaitForNextBlock ∷ GYProviders → IO GYSlot
- gyWaitForNextBlock_ ∷ GYProviders → IO ()
- gyWaitForNextBlockDefault ∷ IO GYSlot → IO GYSlot
- gyWaitUntilSlot ∷ GYProviders → GYSlot → IO GYSlot
- gyWaitUntilSlotDefault ∷ IO GYSlot → GYSlot → IO GYSlot
- makeSlotActions ∷ NominalDiffTime → IO GYSlot → IO GYSlotActions
- data GYGetParameters = GYGetParameters {
- gyGetProtocolParameters' ∷ !(IO ProtocolParameters)
- gyGetSystemStart' ∷ !(IO SystemStart)
- gyGetEraHistory' ∷ !(IO (EraHistory CardanoMode))
- gyGetStakePools' ∷ !(IO (Set PoolId))
- gyGetSlotConfig' ∷ !(IO GYSlotConfig)
- gyGetProtocolParameters ∷ GYProviders → IO ProtocolParameters
- gyGetSystemStart ∷ GYProviders → IO SystemStart
- gyGetEraHistory ∷ GYProviders → IO (EraHistory CardanoMode)
- gyGetStakePools ∷ GYProviders → IO (Set PoolId)
- gyGetSlotConfig ∷ GYProviders → IO GYSlotConfig
- makeGetParameters ∷ IO GYSlot → IO ProtocolParameters → IO SystemStart → IO (EraHistory CardanoMode) → IO (Set PoolId) → IO GYGetParameters
- data GYQueryUTxO = GYQueryUTxO {
- gyQueryUtxosAtTxOutRefs' ∷ !([GYTxOutRef] → IO GYUTxOs)
- gyQueryUtxoAtTxOutRef' ∷ !(GYTxOutRef → IO (Maybe GYUTxO))
- gyQueryUtxoRefsAtAddress' ∷ !(GYAddress → IO [GYTxOutRef])
- gyQueryUtxosAtAddresses' ∷ !([GYAddress] → IO GYUTxOs)
- gyQueryUtxosAtAddresses ∷ GYProviders → [GYAddress] → IO GYUTxOs
- gyQueryUtxosAtAddress' ∷ GYQueryUTxO → GYAddress → IO GYUTxOs
- gyQueryUtxosAtAddress ∷ GYProviders → GYAddress → IO GYUTxOs
- gyQueryUtxosAtTxOutRefs ∷ GYProviders → [GYTxOutRef] → IO GYUTxOs
- gyQueryUtxoAtTxOutRef ∷ GYProviders → GYTxOutRef → IO (Maybe GYUTxO)
- gyQueryUtxoRefsAtAddress ∷ GYProviders → GYAddress → IO [GYTxOutRef]
- gyQueryUtxoRefsAtAddressDefault ∷ (GYAddress → IO GYUTxOs) → GYAddress → IO [GYTxOutRef]
- gyQueryUtxoAtAddressesDefault ∷ (GYAddress → IO GYUTxOs) → [GYAddress] → IO GYUTxOs
- data GYLog = GYLog {
- logRun ∷ HasCallStack ⇒ GYLogNamespace → GYLogSeverity → String → IO ()
- logCleanUp ∷ IO ()
- gyLog ∷ (HasCallStack, MonadIO m) ⇒ GYProviders → GYLogNamespace → GYLogSeverity → String → m ()
- gyLogDebug ∷ (HasCallStack, MonadIO m) ⇒ GYProviders → GYLogNamespace → String → m ()
- gyLogInfo ∷ (HasCallStack, MonadIO m) ⇒ GYProviders → GYLogNamespace → String → m ()
- gyLogWarning ∷ (HasCallStack, MonadIO m) ⇒ GYProviders → GYLogNamespace → String → m ()
- gyLogError ∷ (HasCallStack, MonadIO m) ⇒ GYProviders → GYLogNamespace → String → m ()
- noLogging ∷ GYLog
- simpleConsoleLogging ∷ (String → IO ()) → GYLog
- data GYProviders = GYProviders {}
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?
Get current slot
data GYSlotActions #
How to get current slot?
GYSlotActions | |
|
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.
gyWaitUntilSlot ∷ GYProviders → GYSlot → IO GYSlot #
gyWaitUntilSlotDefault ∷ IO GYSlot → GYSlot → IO GYSlot #
Wait until slot.
Returns the new current slot, which might be larger.
∷ 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 getCurrentSlot 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.
GYGetParameters | |
|
gyGetProtocolParameters ∷ GYProviders → IO ProtocolParameters #
gyGetSystemStart ∷ GYProviders → IO SystemStart #
gyGetEraHistory ∷ GYProviders → IO (EraHistory CardanoMode) #
gyGetStakePools ∷ GYProviders → IO (Set PoolId) #
∷ IO GYSlot | Getting current slot |
→ IO ProtocolParameters | Getting protocol parameters |
→ IO SystemStart | Getting system start |
→ IO (EraHistory CardanoMode) | Getting era history |
→ IO (Set PoolId) | Getting stake pools |
→ IO GYGetParameters |
Construct efficient GYGetParameters
methods by ensuring the supplied IO queries are only made when necessary.
This uses IO to set up some mutable references used for caching.
Query UTxO
data GYQueryUTxO #
How to query utxos?
GYQueryUTxO | |
|
gyQueryUtxoAtTxOutRef ∷ GYProviders → GYTxOutRef → IO (Maybe GYUTxO) #
gyQueryUtxoRefsAtAddressDefault ∷ (GYAddress → IO GYUTxOs) → GYAddress → IO [GYTxOutRef] #
Query Utxo Refs at address (default implementation)
gyQueryUtxoAtAddressesDefault ∷ (GYAddress → IO GYUTxOs) → [GYAddress] → IO GYUTxOs #
Query Utxo for address (default implementation)
Logging
GYLog | |
|
gyLog ∷ (HasCallStack, MonadIO m) ⇒ GYProviders → GYLogNamespace → GYLogSeverity → String → m () #
gyLogDebug ∷ (HasCallStack, MonadIO m) ⇒ GYProviders → GYLogNamespace → String → m () #
gyLogInfo ∷ (HasCallStack, MonadIO m) ⇒ GYProviders → GYLogNamespace → String → m () #
gyLogWarning ∷ (HasCallStack, MonadIO m) ⇒ GYProviders → GYLogNamespace → String → m () #
gyLogError ∷ (HasCallStack, MonadIO m) ⇒ GYProviders → GYLogNamespace → String → m () #