mlabs-haskell / purescript-cardano-types

Domain types for Cardano

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

purescript-cardano-types

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...)

About

Domain types for Cardano


Languages

Language:PureScript 83.5%Language:Nix 13.8%Language:Dhall 2.0%Language:Shell 0.3%Language:Makefile 0.3%Language:JavaScript 0.2%