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

Cometa.TransactionId

Description

Transaction identifiers are exact 32-byte transaction-body hashes. Importing an identifier does not hash or verify a transaction.

import qualified Cometa.TransactionId as TransactionId
import qualified Data.ByteString as ByteString

example = TransactionId.fromBytes (ByteString.replicate 32 0)
Synopsis

Documentation

data TransactionId Source #

A transaction-body hash. Equality and ordering compare exact bytes lexicographically. Show is diagnostic, not an interchange format.

fromBytes :: ByteString -> Either Error TransactionId Source #

Import exactly 32 bytes. Other lengths return InvalidTransactionIdLength with the actual byte count.

toBytes :: TransactionId -> ByteString Source #

Exact transaction hash bytes.

fromHex :: Text -> Either Error TransactionId Source #

Import 64 ASCII hexadecimal digits, accepting either case. Invalid syntax returns InvalidHex; another decoded length returns InvalidTransactionIdLength.

toHex :: TransactionId -> Text Source #

Lowercase hexadecimal without a prefix, always 64 digits.