Module

Cardano.Provider

Re-exports from Cardano.Provider.Affjax

#request

request :: forall a. Request a -> Aff (Either Error (Response a))

Makes an HTTP request.

The example below performs a GET request to the URL /resource and interprets the response body as JSON.

import Affjax.ResponseFormat (json)
...
request (defaultRequest { url = "/resource", method = Left GET, responseFormat = json})

For common cases helper functions can often be used insteAX of request . For instance, the above example is equivalent to the following.

get json "/resource"

Re-exports from Cardano.Provider.Error

#ClientError

data ClientError

Constructors

Instances

#pprintServiceError

#pprintClientError

Re-exports from Cardano.Provider.OgmiosTypes

#RedeemerPointer

type RedeemerPointer = { redeemerIndex :: UInt, redeemerTag :: RedeemerTag }

#OgmiosTxOutRef

type OgmiosTxOutRef = { index :: UInt, txId :: String }

#OgmiosTxOut

type OgmiosTxOut = { address :: OgmiosAddress, datum :: Maybe String, datumHash :: Maybe String, script :: Maybe ScriptRef, value :: Value }

#OgmiosTxIn

type OgmiosTxIn = { index :: Int, txId :: OgmiosTxId }

#OgmiosTxId

#OgmiosScript

#OgmiosRedeemerPtr

type OgmiosRedeemerPtr = { index :: UInt, purpose :: String }

#OgmiosError

#OgmiosDatum

#OgmiosAddress

#JsonRpc2Response

type JsonRpc2Response = { error :: Maybe Aeson, id :: Maybe String, jsonrpc :: String, method :: Maybe String, result :: Maybe Aeson }

Structure of all json rpc websocket responses

#ExecutionUnits

type ExecutionUnits = { memory :: BigNum, steps :: BigNum }

#DecodeOgmios

class DecodeOgmios o  where

Variation of DecodeAeson for ogmios response, defines how to parse full ogmios reponse.

Members

Instances

#showRedeemerPointer

#redeemerTypeMismatch

#redeemerTagFromString

#pprintOgmiosError

#pprintOgmiosDecodeError

#ogmiosDecodeErrorToError

#makeDecodeOgmios

makeDecodeOgmios :: forall o. These { parseError :: Aeson -> Either JsonDecodeError o } { parseResult :: Aeson -> Either JsonDecodeError o } -> Aeson -> Either OgmiosDecodeError o

Given how to parse result or error fields,

#decodeResult

decodeResult :: forall o. (Aeson -> Either JsonDecodeError o) -> Aeson -> Either OgmiosDecodeError o

Decode "result" field of ogmios response.

#decodeErrorOrResult

decodeErrorOrResult :: forall o. { parseError :: Aeson -> Either JsonDecodeError o } -> { parseResult :: Aeson -> Either JsonDecodeError o } -> Aeson -> Either OgmiosDecodeError o

Decode "result" field or if absent the error field of ogmios response.

Re-exports from Cardano.Provider.ServerConfig

#ServerConfig

type ServerConfig = { host :: Host, path :: Maybe String, port :: UInt, secure :: Boolean }

#Host

type Host = String

Re-exports from Cardano.Provider.Type

#Provider

type Provider = { doesTxExist :: TransactionHash -> AffE Boolean, evaluateTx :: Transaction -> Map OgmiosTxOutRef OgmiosTxOut -> Aff TxEvaluationR, getChainTip :: AffE Tip, getCurrentEpoch :: Aff BigNum, getDatumByHash :: DataHash -> AffE (Maybe PlutusData), getEraSummaries :: AffE EraSummaries, getOutputAddressesByTxHash :: TransactionHash -> AffE (Array Address), getPoolIds :: AffE (Array PoolPubKeyHash), getPubKeyHashDelegationsAndRewards :: NetworkId -> StakePubKeyHash -> AffE (Maybe DelegationsAndRewards), getScriptByHash :: ScriptHash -> AffE (Maybe ScriptRef), getTxAuxiliaryData :: TransactionHash -> Aff (Either GetTxMetadataError AuxiliaryData), getUtxoByOref :: TransactionInput -> AffE (Maybe TransactionOutput), getValidatorHashDelegationsAndRewards :: NetworkId -> ScriptHash -> AffE (Maybe DelegationsAndRewards), submitTx :: Transaction -> AffE TransactionHash, utxosAt :: Address -> AffE UtxoMap }

#AffE

type AffE (a :: Type) = Aff (Either ClientError a)

Modules