atlas-cardano-0.6.2: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2024 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Stabilitydevelop
Safe HaskellSafe-Inferred
LanguageGHC2021

GeniusYield.Types.Blueprint.TH

Description

Template Haskell utilities to work with blueprint file. It is useful to see generated Template Haskell code which can be done via -ddump-splices GHC flag. You may combine this with -ddump-to-file to save the output to a file. If you are using cabal, see this answer on where one can find dumped splice files.

Synopsis

Documentation

makeBPTypesFilePathQ [Dec] #

Generate types corresponding to definitions in the blueprint file.

Type names are generated by prefixing with BP and sanitizing the definition id, where unsupported characters are replaced by underscores.

uponBPTypesFilePathQ [Dec] #

After having spliced makeBPTypes, following adds data related instances (ToData, FromData, etc.) and applyParamsToBPValidator_ValidatorName, scriptFromBPSerialisedScript utility function.

EXAMPLE:

$(makeBPTypes "path/to/bluprint.json")

$(uponBPTypes "path/to/blueprint.json")