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

Cometa.Inspection

Description

Inspect Cardano domain values using the CIP-116 JSON representation. Large ledger integers become decimal strings and binary fields use explicit text encodings. Object key order is insignificant. Inspection does not change input encodings, validate ledger acceptance, sign or submit transactions. Results are descriptive JSON, not exact-CBOR interchange. Render with encode. Expected validation/native failures remain explicit.

inspected <- Inspection.output output
-- fmap Data.Aeson.encode inspected
Synopsis

Documentation

transaction :: Transaction -> IO (Either Error Value) Source #

Inspect the complete body, validity flag, witnesses and optional auxiliary data. Native errors remain explicit; no network queries or signing occur.

subTransaction :: SubTransaction -> IO (Either Error Value) Source #

Inspect a subtransaction's body, witnesses and optional auxiliary data. No fee or outer transaction validity flag is added to the result.

body :: EncodedBody -> IO (Either Error Value) Source #

Inspect an exact encoded top-level body, including any nested transactions.

subBody :: EncodedBody -> IO (Either Error Value) Source #

Inspect an exact encoded subtransaction body using its local field schema.

value :: Value -> IO (Either Error Value) Source #

Inspect a standalone value, including signed native-asset quantities. Ada must be nonnegative and all quantities must fit the native signed 64-bit range. Invalid quantities return the errors from encodeCbor.

script :: Script -> IO (Either Error Value) Source #

Inspect a script with a native_script or plutus_script tag and payload.

nativeScript :: NativeScript -> IO (Either Error Value) Source #

Inspect only the native-script payload, including recursive signature, threshold, time and guard conditions. Omits the outer script tag wrapper; this is the CIP-116 schema, distinct from native-script construction JSON.

plutusScript :: PlutusScript -> IO (Either Error Value) Source #

Inspect the language name and compiled bytes of a Plutus script, without the outer script tag wrapper. Does not check program executability.

credential :: Credential purpose -> IO (Either Error Value) Source #

Inspect a role-indexed key or script credential as its tagged hash.

certificate :: Certificate -> IO (Either Error Value) Source #

Inspect one staking, pool, committee or DRep certificate. Deposits, refunds and epochs describe the supplied certificate without checking chain state.

governanceAction :: Action -> IO (Either Error Value) Source #

Inspect a governance action, including its concrete action tag and fields. Does not establish eligibility or interpret protocol activation rules.

proposal :: Proposal -> IO (Either Error Value) Source #

Inspect the deposit, return account, governance action and proposal anchor.

poolParameters :: PoolParameters -> IO (Either Error Value) Source #

Inspect the complete supplied pool registration parameters, including BLS, relay, owner and metadata fields when present.

protocolUpdate :: Update -> IO (Either Error Value) Source #

Inspect supplied sparse protocol changes. Absent fields stay absent; no current protocol snapshot or ledger-state query is performed.

plutusData :: EncodedPlutusData -> IO (Either Error Value) Source #

Inspect exact encoded script data. Arbitrary integers use decimal strings; map entry order and duplicate keys remain represented in the JSON arrays.

output :: Output -> IO (Either Error Value) Source #

Inspect one output's address, value, datum and optional reference script.

witnesses :: EncodedWitnesses -> IO (Either Error Value) Source #

Inspect exact witness fields, including key witnesses, scripts, data and redeemers. Does not verify signatures, budgets or script execution.

utxo :: Utxo -> IO (Either Error Value) Source #

Inspect an input reference paired with its resolved output. Does not check whether the output exists or is currently unspent on a network.

drep :: DRep -> IO (Either Error Value) Source #

Inspect a credential DRep or either predefined delegation target.

actionId :: ActionId -> IO (Either Error Value) Source #

Inspect a transaction identifier and governance-action index.

anchor :: Anchor -> IO (Either Error Value) Source #

Inspect the metadata URL and content hash without fetching the URL.

votingProcedures :: VotingProcedures -> IO (Either Error Value) Source #

Inspect voter/action choices and optional explanation anchors. Collection order follows the supplied validated representation; no vote is submitted.

metadatum :: Metadatum -> IO (Either Error Value) Source #

Inspect one validated metadata value using the tagged CIP-116 schema. Nested map order and duplicate keys remain represented in the result. This differs from the detailed and plain JSON codecs in Cometa.Metadata.

metadata :: Metadata -> IO (Either Error Value) Source #

Inspect transaction metadata as an ordered array of label/value entries. Labels use decimal strings; each value uses the tagged CIP-116 schema.

auxiliaryData :: EncodedAuxiliaryData -> IO (Either Error Value) Source #

Inspect exact auxiliary data, including metadata and native/Plutus scripts. Retains source encodings and auxiliary-data hashes without recalculation.

input :: Input -> IO (Either Error Value) Source #

Inspect the transaction identifier and output index of an input reference. Does not resolve the referenced output or establish its availability.

datum :: Datum -> IO (Either Error (Maybe Value)) Source #

Inspect a datum hash or inline datum. NoDatum returns Nothing without allocating a native datum; the other alternatives return the tagged native CIP-116 datum object. Inline data retains its arbitrary integers, map order and duplicate keys.

redeemer :: Redeemer -> IO (Either Error Value) Source #

Inspect a redeemer's purpose, index, script data and declared execution units. Does not execute the script or check its budget against a transaction.

exUnits :: ExUnits -> IO (Either Error Value) Source #

Inspect declared memory and CPU steps as decimal strings; no evaluation is performed.

protocolVersion :: ProtocolVersion -> IO (Either Error Value) Source #

Inspect protocol major and minor versions as JSON numbers.

unitInterval :: UnitInterval -> IO (Either Error Value) Source #

Inspect the exact rational numerator and denominator as decimal strings.

relay :: Relay -> IO (Either Error Value) Source #

Inspect a pool relay, preserving absent ports and IP addresses as null.

poolMetadata :: Metadata -> IO (Either Error Value) Source #

Inspect a pool metadata URL and hash without fetching the URL.

constitution :: Constitution -> IO (Either Error Value) Source #

Inspect a constitution anchor and optional guardrails hash; absence omits the hash.

voter :: Voter -> IO (Either Error Value) Source #

Inspect a committee, DRep or stake-pool voting identity with its role tag.

votingProcedure :: VotingProcedure -> IO (Either Error Value) Source #

Inspect a vote choice and optional explanation anchor; absence omits the anchor.

verificationWitness :: VerificationWitness -> IO (Either Error Value) Source #

Inspect a verification key and signature without verifying the signature.

bootstrapWitness :: BootstrapWitness -> IO (Either Error Value) Source #

Inspect a Byron witness key, signature, chain code and attributes as hexadecimal.

costModel :: CostModel -> IO (Either Error Value) Source #

Inspect ordered signed costs as decimal strings. The language belongs to the enclosing map and is absent from this array.

costModels :: CostModels -> IO (Either Error Value) Source #

Inspect known Plutus V1–V4 cost arrays. Unknown language identifiers are omitted by this schema; input values and encodings remain unchanged.

exUnitPrices :: ExUnitPrices -> IO (Either Error Value) Source #

Inspect exact lovelace prices for memory and steps. Original numerator/denominator components are retained, including prices greater than one.

poolVotingThresholds :: PoolVotingThresholds -> IO (Either Error Value) Source #

Inspect all five stake-pool approval thresholds as exact rational components.

drepVotingThresholds :: DRepVotingThresholds -> IO (Either Error Value) Source #

Inspect all ten DRep approval thresholds as exact rational components.

proposedUpdates :: ProposedUpdates -> IO (Either Error Value) Source #

Inspect legacy genesis-authorized sparse changes as an object keyed by hexadecimal genesis hashes. No authorization or era eligibility is established.

updateProposal :: UpdateProposal -> IO (Either Error Value) Source #

Inspect a legacy update proposal and activation epoch. Epoch is a JSON number, unlike decimal-string ledger quantities.

balanceInterval :: BalanceInterval -> IO (Either Error Value) Source #

Inspect an exact lovelace balance or inclusive-lower/exclusive-upper range. Absent bounds are null; contradictory bounds are described without ledger- state validation. A range with both bounds absent returns a native invalid- argument error.

balanceIntervals :: Entries RewardAddress BalanceInterval -> IO (Either Error Value) Source #

Inspect account balance requirements as ordered key/value entries. Keys are reward addresses; bounds use the balance-interval schema.

directDeposits :: Entries RewardAddress Word64 -> IO (Either Error Value) Source #

Inspect reward-account deposits as ordered key/value entries, preserving present zero amounts as decimal strings.

requiredGuards :: Entries (Credential Guard) (Maybe EncodedPlutusData) -> IO (Either Error Value) Source #

Inspect required guard credentials and optional exact script data as ordered key/value entries. Absent data is null; script-data map order and duplicate keys are retained.

assetName :: AssetName -> IO (Either Error Value) Source #

Inspect an asset name as lowercase hexadecimal, including the empty name. Text decoding is not attempted.

blake2bHash :: Blake2bHash -> IO (Either Error Value) Source #

Inspect a validated nonempty digest as lowercase hexadecimal. No hashing or role inference is performed.

blsKey :: BlsKey -> IO (Either Error Value) Source #

Inspect a pool BLS public key (96 bytes) and possession proof (48 bytes) as hexadecimal. No group-membership or proof verification is performed.

committeeMembers :: Members -> IO (Either Error Value) Source #

Inspect cold committee credentials and expiry epochs as ordered key/value entries. Credential kind and hash determine order; epochs are decimal strings.

withdrawals :: [(RewardAddress, Word64)] -> IO (Either Error Value) Source #

Inspect reward accounts and withdrawn lovelace as ordered key/value entries. Empty input, zero and duplicate accounts are retained. Accounts sort stably by encoded address bytes, distinct from ledger redeemer-index ordering.

hashes :: [Blake2bHash] -> IO (Either Error Value) Source #

Inspect digests as a JSON array, sorted stably by byte length then bytes. Duplicate digests remain; empty input produces an empty array.

guards :: [Credential Guard] -> IO (Either Error Value) Source #

Inspect guards in supplied order. Empty input returns an empty array. Key and script credentials remain tagged; repeated credentials return a native duplicate-key error.

subTransactions :: [SubTransaction] -> IO (Either Error Value) Source #

Inspect subtransactions in supplied order. Empty input returns an empty array. Repeated body identifiers return a native duplicate-key error, even if witnesses or outer framing differ. Signed body encodings are unchanged.

assets :: [(PolicyId, [(AssetName, Integer)])] -> IO (Either Error Value) Source #

Inspect policy/name associations as a JSON object keyed by hexadecimal policies and names. Empty policy groups and zero quantities remain present. Quantities must fit signed 64 bits (InvalidValueQuantity). Repeated policies use their last supplied group. Repeated names in a retained group return InvalidValueCbor: object keys cannot retain repeated entries. Ordering of object properties is insignificant.

assetEntries :: [(PolicyId, [(AssetName, Integer)])] -> IO (Either Error Value) Source #

Inspect policy groups as ordered {script_hash, assets} entries. The inner assets value is a name-keyed object, not an asset-entry array. Groups sort stably by policy bytes; empty groups and zero remain. Repeated policies use the last supplied group, matching native map decoding. Duplicate names return InvalidValueCbor; signed overflow returns InvalidValueQuantity. Use policyAssetEntries for repeated names.

policyAssets :: [(AssetName, Integer)] -> IO (Either Error Value) Source #

Inspect one policy's name/quantity associations as a hexadecimal-name-keyed object. Empty input and explicit zero are retained. Repeated names return InvalidValueCbor; quantities outside signed 64 bits return InvalidValueQuantity. No policy identity is required.

policyAssetEntries :: [(AssetName, Integer)] -> IO (Either Error Value) Source #

Inspect one policy's assets as ordered {asset_name, amount} entries. Names sort stably by byte length then bytes; repeated names keep their relative order. Empty input and explicit zeros remain. Quantities outside signed 64 bits return InvalidValueQuantity. No policy identity is required.