| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Singular.Registry.Blueprint.Schema
Contents
Description
The CIP-57 schema model behind Blueprint: the
Blueprint, Validator, Schema and Constructor types with their
Aeson parsers, and validateData for checking Data
values against a declared schema.
This is the schema-and-validation owner extracted from
Singular.Registry.Blueprint; the public module re-exports it and is
its only intended consumer surface.
Synopsis
- data Blueprint = Blueprint {
- validators :: [Validator]
- definitions :: Map Text Schema
- data Validator = Validator {
- vTitle :: Text
- vDatum :: Maybe Schema
- vRedeemer :: Schema
- vHash :: Text
- vCompiledCode :: Maybe Text
- vParameters :: Int
- data Schema
- = SBytes
- | SInteger
- | SList Schema
- | STuple [Schema]
- | SConstructors [Constructor]
- | SRef Text
- data Constructor = Constructor {}
- validateData :: Map Text Schema -> Schema -> Data -> Bool
Schema types
A parsed CIP-57 blueprint.
Constructors
| Blueprint | |
Fields
| |
Instances
| FromJSON Blueprint Source # | |
Defined in Singular.Registry.Blueprint.Schema | |
| Show Blueprint Source # | |
Defined in Singular.Registry.Blueprint.Schema | |
| Eq Blueprint Source # | |
Defined in Singular.Registry.Blueprint.Schema | |
A validator entry in the blueprint.
Constructors
| Validator | |
Fields
| |
Instances
| FromJSON Validator Source # | |
Defined in Singular.Registry.Blueprint.Schema | |
| Show Validator Source # | |
Defined in Singular.Registry.Blueprint.Schema | |
| Eq Validator Source # | |
Defined in Singular.Registry.Blueprint.Schema | |
CIP-57 schema for a Plutus data type.
Constructors
| SBytes | {"dataType": "bytes"} |
| SInteger | {"dataType": "integer"} |
| SList Schema |
|
| STuple [Schema] |
|
| SConstructors [Constructor] | {"anyOf": [...constructors...]} |
| SRef Text | {"$ref": "#definitions..."} |
Instances
| FromJSON Schema Source # | |
Defined in Singular.Registry.Blueprint.Schema | |
| Show Schema Source # | |
Defined in Singular.Registry.Blueprint.Schema | |
| Eq Schema Source # | |
Defined in Singular.Registry.Blueprint.Schema | |
data Constructor Source #
A single constructor alternative in a schema.
Constructors
| Constructor | |
Instances
| FromJSON Constructor Source # | |
Defined in Singular.Registry.Blueprint.Schema Methods parseJSON :: Value -> Parser Constructor parseJSONList :: Value -> Parser [Constructor] omittedField :: Maybe Constructor | |
| Show Constructor Source # | |
Defined in Singular.Registry.Blueprint.Schema Methods showsPrec :: Int -> Constructor -> ShowS Source # show :: Constructor -> String Source # showList :: [Constructor] -> ShowS Source # | |
| Eq Constructor Source # | |
Defined in Singular.Registry.Blueprint.Schema Methods (==) :: Constructor -> Constructor -> Bool Source # (/=) :: Constructor -> Constructor -> Bool Source # | |