cometa-0.1.0.0: Idiomatic Haskell bindings to cardano-c
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cometa.Provider.Blockfrost

Description

A scoped Blockfrost backend for the ordinary Provider record. Queries return domain values and report explicit errors. Pagination uses ascending pages of 100 results, rejects repeated identities, and permits at most 10000 pages per query. Independent requests do not form an atomic ledger snapshot.

Submission is explicit and never retried automatically. Confirmation means the transaction appears in a block; it does not establish finality. Remote evaluation uses the documented Ogmios v5 dialect: V1/V2 scripts and spending, minting, certificate and withdrawal purposes. Unsupported newer features fail explicitly; local Cometa.Evaluation.Native supports the binding's native VM.

withProvider (defaultConfig Preview (Just project)) $ provider ->
  Cometa.Provider.utxosAt provider address
Synopsis

Documentation

data Network Source #

Cardano chain identity. A custom endpoint does not change its network magic.

Constructors

Mainnet

Cardano mainnet, with network magic 764824073.

Preprod

Pre-production test network, with network magic 1.

Preview

Preview test network, with network magic 2.

Instances

Instances details
Bounded Network Source # 
Instance details

Defined in Cometa.Provider.Blockfrost.Internal.Config

Enum Network Source # 
Instance details

Defined in Cometa.Provider.Blockfrost.Internal.Config

Show Network Source # 
Instance details

Defined in Cometa.Provider.Blockfrost.Internal.Config

Eq Network Source # 
Instance details

Defined in Cometa.Provider.Blockfrost.Internal.Config

Methods

(==) :: Network -> Network -> Bool #

(/=) :: Network -> Network -> Bool #

Ord Network Source # 
Instance details

Defined in Cometa.Provider.Blockfrost.Internal.Config

data ProjectId Source #

An opaque API credential. No printable instance exposes its contents.

Instances

Instances details
Eq ProjectId Source # 
Instance details

Defined in Cometa.Provider.Blockfrost.Internal.Config

mkProjectId :: Text -> Either Error ProjectId Source #

Import 1 through 128 ASCII letters, digits, hyphens or underscores. Whitespace and header delimiters are rejected without echoing the input.

data Config Source #

HTTP and confirmation-poll settings. Validate once with withProvider. Millisecond durations must be between 1 and 60,000 inclusive.

Constructors

Config 

Fields

  • network :: !Network

    Chain identity and network magic, independent of the endpoint URL.

  • endpoint :: !Text

    Absolute HTTP or HTTPS base URL, including any path prefix and query parameters. User information and fragments are not supported. Operation query parameters override base parameters with the same name.

  • projectId :: !(Maybe ProjectId)

    Optional project credential. Nothing omits the project_id header.

  • responseTimeoutMillis :: !Int

    Whole-request deadline, in milliseconds, from 1 through 60000.

  • pollIntervalMillis :: !Int

    Delay between confirmation polls, in milliseconds, from 1 through 60000.

defaultConfig :: Network -> Maybe ProjectId -> Config Source #

The network's official HTTPS endpoint, a 30-second whole-request timeout, and a one-second confirmation poll period. Supply Nothing when the endpoint does not require a project credential; set endpoint for a custom service.

withProvider :: Config -> (Provider -> IO (Either Error a)) -> IO (Either Error a) Source #

Validate an absolute HTTP or HTTPS endpoint and configuration, share one scoped HTTP transport, and run a caller workflow with one expected-error boundary. Supply credentials from application configuration, or omit them for a service that does not require authentication. Custom path prefixes and base query parameters are retained; operation query parameters take precedence. No environment variables or files are read implicitly. Escaped provider operations fail with RuntimeClosed after the scope. Scope exit waits for active requests; cancellation propagates after cleanup.