Skip to content

mlabs-haskell/purescript-cardano-types

Repository files navigation

purescript-cardano-types cardano-purescript

This library contains wrappers over autogenerated bindings for CSL and some types adapted from cardano-api and cardano-wallet. It is primarily used in cardano-transaction-lib.

This library presents Transaction and all its structural components as PureScript algebraic data types.

Here's what is included:

  • EncodeAeson/DecodeAeson instances - no compatibility with CSL is maintained, because JSON encoders in CSL are partial
  • AsCbor instances for types that are representable as binary
  • Show, Eq, Ord, Generic instances where they make sense
  • ToMetadata/FromMetadata and ToData/FromData typeclasses and some instances
  • Some pretty-printing functions that render a TagSet from monad-logger.
  • fromCsl / toCsl functions that lift values between CSL and purescript domains (only for types ported from CSL)

Types not from CSL:

  • Asset
  • AssetClass
  • PaymentPubKeyHash
  • UtxoMap

Limitations

  • Semigroup instances for Value, ExUnits and Mint are unlawful (they unsafely throw on numeric overflows)
  • No TransactionBuilder - for a framework to build transactions, see cardano-transaction-lib
  • No Block, BlockHeader - these are not needed for an in-browser dApp.
  • Recursion max-depth issues (JavaScript...)