| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Provider
Description
Inject blockchain queries and explicit transaction effects as ordinary IO functions. Missing values use Maybe, successful empty queries use empty lists, and expected failures use Either. These independent observations do not imply an atomic ledger snapshot. Operations never submit a transaction implicitly.
fake = (unavailable "Offline fixture" 42) {utxosAt = _ -> pure (Right [])}
Synopsis
- data Provider = Provider {
- name :: !Text
- networkMagic :: !Word32
- protocolParameters :: IO (Either Error Parameters)
- utxosAt :: Address -> IO (Either Error [Utxo])
- rewardBalance :: RewardAddress -> IO (Either Error Word64)
- utxosWithAsset :: Address -> AssetId -> IO (Either Error [Utxo])
- utxoWithAsset :: AssetId -> IO (Either Error (Maybe Utxo))
- resolveInputs :: [Input] -> IO (Either Error [Utxo])
- resolveDatum :: Hash32 -> IO (Either Error (Maybe EncodedPlutusData))
- awaitTransaction :: TransactionId -> Word64 -> IO (Either Error Bool)
- submitTransaction :: Transaction -> IO (Either Error TransactionId)
- evaluateTransaction :: Transaction -> [Utxo] -> IO (Either Error Budgets)
- unavailable :: Text -> Word32 -> Provider
Documentation
An application-supplied backend. Fields may perform network effects, use a local cache or return deterministic fixtures. Exceptions propagate normally; expected backend failures belong in Left. No equality or Show instance is defined for function-valued capabilities.
Constructors
| Provider | |
Fields
| |