Evolution SDK
ModulesBlueprint

blueprint/types.ts

types overview


Table of contents


blueprint

BlueprintCompilerType (type alias)

CIP-57 Plutus Blueprint types defined using Effect Schema

Signature

export type BlueprintCompilerType = {
  readonly name: string
  readonly version: string
}

Added in v2.0.0

utils

BaseSchemaDefinition

Signature

export declare const BaseSchemaDefinition: Schema.Struct<{
  title: Schema.optional<typeof Schema.String>
  description: Schema.optional<typeof Schema.String>
}>

BlueprintCompiler

Signature

export declare const BlueprintCompiler: Schema.Struct<{ name: typeof Schema.String; version: typeof Schema.String }>

BlueprintPreamble

Signature

export declare const BlueprintPreamble: Schema.Struct<{
  title: typeof Schema.String
  description: Schema.optional<typeof Schema.String>
  version: typeof Schema.String
  plutusVersion: Schema.Literal<["v1", "v2", "v3"]>
  compiler: Schema.optional<Schema.Struct<{ name: typeof Schema.String; version: typeof Schema.String }>>
  license: Schema.optional<typeof Schema.String>
}>

BlueprintPreambleType (type alias)

Signature

export type BlueprintPreambleType = {
  readonly title: string
  readonly description?: string
  readonly version: string
  readonly plutusVersion: "v1" | "v2" | "v3"
  readonly compiler?: BlueprintCompilerType
  readonly license?: string
}

BytesDefinition

Signature

export declare const BytesDefinition: Schema.Struct<{
  dataType: Schema.Literal<["bytes"]>
  title: Schema.optional<typeof Schema.String>
  description: Schema.optional<typeof Schema.String>
}>

BytesDefinitionType (type alias)

Signature

export type BytesDefinitionType = {
  readonly title?: string
  readonly description?: string
  readonly dataType: "bytes"
}

ConstructorDefinition (class)

Constructor definition (recursive)

Signature

export declare class ConstructorDefinition

ConstructorDefinitionType (type alias)

Signature

export type ConstructorDefinitionType = {
  readonly title?: string
  readonly description?: string
  readonly dataType: "constructor"
  readonly index: number
  readonly fields: ReadonlyArray<ConstructorFieldType>
}

ConstructorField (class)

Constructor field with optional schema reference (recursive)

Signature

export declare class ConstructorField

ConstructorFieldType (type alias)

Signature

export type ConstructorFieldType = {
  readonly title?: string
  readonly description?: string
  readonly $ref?: string
  readonly schema?: SchemaDefinitionType
}

DataDefinition

Signature

export declare const DataDefinition: Schema.Struct<{
  title: Schema.Literal<["Data"]>
  description: Schema.optional<typeof Schema.String>
}>

DataDefinitionType (type alias)

Signature

export type DataDefinitionType = {
  readonly title: "Data"
  readonly description?: string
}

EmptySchema

Signature

export declare const EmptySchema: Schema.Struct<{}>

EmptySchemaType (type alias)

Signature

export type EmptySchemaType = {}

IntegerDefinition

Signature

export declare const IntegerDefinition: Schema.Struct<{
  dataType: Schema.Literal<["integer"]>
  title: Schema.optional<typeof Schema.String>
  description: Schema.optional<typeof Schema.String>
}>

IntegerDefinitionType (type alias)

Signature

export type IntegerDefinitionType = {
  readonly title?: string
  readonly description?: string
  readonly dataType: "integer"
}

ListDefinition (class)

List definition (recursive)

Signature

export declare class ListDefinition

ListDefinitionType (type alias)

Signature

export type ListDefinitionType = {
  readonly title?: string
  readonly description?: string
  readonly dataType: "list"
  readonly items: SchemaDefinitionType | SchemaRefType
}

MapDefinition (class)

Map definition (recursive)

Signature

export declare class MapDefinition

MapDefinitionType (type alias)

Signature

export type MapDefinitionType = {
  readonly title?: string
  readonly description?: string
  readonly dataType: "map"
  readonly keys: SchemaDefinitionType | SchemaRefType
  readonly values: SchemaDefinitionType | SchemaRefType
}

ParameterSchema

Signature

export declare const ParameterSchema: Schema.Struct<{
  title: Schema.optional<typeof Schema.String>
  schema: Schema.Union<
    [
      Schema.Struct<{
        dataType: Schema.Literal<["bytes"]>
        title: Schema.optional<typeof Schema.String>
        description: Schema.optional<typeof Schema.String>
      }>,
      Schema.Struct<{
        dataType: Schema.Literal<["integer"]>
        title: Schema.optional<typeof Schema.String>
        description: Schema.optional<typeof Schema.String>
      }>,
      typeof ConstructorDefinition,
      typeof UnionDefinition,
      Schema.Struct<{ title: Schema.Literal<["Data"]>; description: Schema.optional<typeof Schema.String> }>,
      Schema.Struct<{ $ref: typeof Schema.String }>,
      Schema.Struct<{}>,
      typeof ListDefinition,
      typeof MapDefinition
    ]
  >
}>

ParameterSchemaType (type alias)

Signature

export type ParameterSchemaType = {
  readonly title?: string
  readonly schema: SchemaDefinitionType
}

ParsedBlueprint (interface)

Signature

export interface ParsedBlueprint {
  schemas: Record<string, Schema.Schema.Any>
  validators: Record<string, ValidatorMetadata>
}

PlutusBlueprint

Signature

export declare const PlutusBlueprint: Schema.Struct<{
  preamble: Schema.Struct<{
    title: typeof Schema.String
    description: Schema.optional<typeof Schema.String>
    version: typeof Schema.String
    plutusVersion: Schema.Literal<["v1", "v2", "v3"]>
    compiler: Schema.optional<Schema.Struct<{ name: typeof Schema.String; version: typeof Schema.String }>>
    license: Schema.optional<typeof Schema.String>
  }>
  validators: Schema.Array$<
    Schema.Struct<{
      title: typeof Schema.String
      description: Schema.optional<typeof Schema.String>
      datum: Schema.optional<
        Schema.Struct<{
          title: Schema.optional<typeof Schema.String>
          schema: Schema.Union<
            [
              Schema.Struct<{
                dataType: Schema.Literal<["bytes"]>
                title: Schema.optional<typeof Schema.String>
                description: Schema.optional<typeof Schema.String>
              }>,
              Schema.Struct<{
                dataType: Schema.Literal<["integer"]>
                title: Schema.optional<typeof Schema.String>
                description: Schema.optional<typeof Schema.String>
              }>,
              typeof ConstructorDefinition,
              typeof UnionDefinition,
              Schema.Struct<{ title: Schema.Literal<["Data"]>; description: Schema.optional<typeof Schema.String> }>,
              Schema.Struct<{ $ref: typeof Schema.String }>,
              Schema.Struct<{}>,
              typeof ListDefinition,
              typeof MapDefinition
            ]
          >
        }>
      >
      redeemer: Schema.optional<
        Schema.Struct<{
          title: Schema.optional<typeof Schema.String>
          schema: Schema.Union<
            [
              Schema.Struct<{
                dataType: Schema.Literal<["bytes"]>
                title: Schema.optional<typeof Schema.String>
                description: Schema.optional<typeof Schema.String>
              }>,
              Schema.Struct<{
                dataType: Schema.Literal<["integer"]>
                title: Schema.optional<typeof Schema.String>
                description: Schema.optional<typeof Schema.String>
              }>,
              typeof ConstructorDefinition,
              typeof UnionDefinition,
              Schema.Struct<{ title: Schema.Literal<["Data"]>; description: Schema.optional<typeof Schema.String> }>,
              Schema.Struct<{ $ref: typeof Schema.String }>,
              Schema.Struct<{}>,
              typeof ListDefinition,
              typeof MapDefinition
            ]
          >
        }>
      >
      parameters: Schema.optional<
        Schema.Array$<
          Schema.Struct<{
            title: Schema.optional<typeof Schema.String>
            schema: Schema.Union<
              [
                Schema.Struct<{
                  dataType: Schema.Literal<["bytes"]>
                  title: Schema.optional<typeof Schema.String>
                  description: Schema.optional<typeof Schema.String>
                }>,
                Schema.Struct<{
                  dataType: Schema.Literal<["integer"]>
                  title: Schema.optional<typeof Schema.String>
                  description: Schema.optional<typeof Schema.String>
                }>,
                typeof ConstructorDefinition,
                typeof UnionDefinition,
                Schema.Struct<{ title: Schema.Literal<["Data"]>; description: Schema.optional<typeof Schema.String> }>,
                Schema.Struct<{ $ref: typeof Schema.String }>,
                Schema.Struct<{}>,
                typeof ListDefinition,
                typeof MapDefinition
              ]
            >
          }>
        >
      >
      compiledCode: typeof Schema.String
      hash: typeof Schema.String
    }>
  >
  definitions: Schema.Record$<
    typeof Schema.String,
    Schema.Union<
      [
        Schema.Struct<{
          dataType: Schema.Literal<["bytes"]>
          title: Schema.optional<typeof Schema.String>
          description: Schema.optional<typeof Schema.String>
        }>,
        Schema.Struct<{
          dataType: Schema.Literal<["integer"]>
          title: Schema.optional<typeof Schema.String>
          description: Schema.optional<typeof Schema.String>
        }>,
        typeof ConstructorDefinition,
        typeof UnionDefinition,
        Schema.Struct<{ title: Schema.Literal<["Data"]>; description: Schema.optional<typeof Schema.String> }>,
        Schema.Struct<{ $ref: typeof Schema.String }>,
        Schema.Struct<{}>,
        typeof ListDefinition,
        typeof MapDefinition
      ]
    >
  >
}>

PlutusBlueprint (type alias)

Signature

export type PlutusBlueprint = {
  readonly preamble: BlueprintPreambleType
  readonly validators: ReadonlyArray<ValidatorDefinitionType>
  readonly definitions: Record<string, SchemaDefinitionType>
}

SchemaDefinition

Signature

export declare const SchemaDefinition: Schema.Union<
  [
    Schema.Struct<{
      dataType: Schema.Literal<["bytes"]>
      title: Schema.optional<typeof Schema.String>
      description: Schema.optional<typeof Schema.String>
    }>,
    Schema.Struct<{
      dataType: Schema.Literal<["integer"]>
      title: Schema.optional<typeof Schema.String>
      description: Schema.optional<typeof Schema.String>
    }>,
    typeof ConstructorDefinition,
    typeof UnionDefinition,
    Schema.Struct<{ title: Schema.Literal<["Data"]>; description: Schema.optional<typeof Schema.String> }>,
    Schema.Struct<{ $ref: typeof Schema.String }>,
    Schema.Struct<{}>,
    typeof ListDefinition,
    typeof MapDefinition
  ]
>

SchemaDefinitionType (type alias)

Signature

export type SchemaDefinitionType =
  | BytesDefinitionType
  | IntegerDefinitionType
  | DataDefinitionType
  | EmptySchemaType
  | SchemaRefType
  | ConstructorDefinitionType
  | UnionDefinitionType
  | ListDefinitionType
  | MapDefinitionType

SchemaRef

Signature

export declare const SchemaRef: Schema.Struct<{ $ref: typeof Schema.String }>

SchemaRefType (type alias)

Signature

export type SchemaRefType = {
  readonly $ref: string
}

UnionDefinition (class)

Union/Enum definition (recursive)

Signature

export declare class UnionDefinition

UnionDefinitionType (type alias)

Signature

export type UnionDefinitionType = {
  readonly title?: string
  readonly anyOf: ReadonlyArray<SchemaDefinitionType>
}

ValidatorDefinition

Signature

export declare const ValidatorDefinition: Schema.Struct<{
  title: typeof Schema.String
  description: Schema.optional<typeof Schema.String>
  datum: Schema.optional<
    Schema.Struct<{
      title: Schema.optional<typeof Schema.String>
      schema: Schema.Union<
        [
          Schema.Struct<{
            dataType: Schema.Literal<["bytes"]>
            title: Schema.optional<typeof Schema.String>
            description: Schema.optional<typeof Schema.String>
          }>,
          Schema.Struct<{
            dataType: Schema.Literal<["integer"]>
            title: Schema.optional<typeof Schema.String>
            description: Schema.optional<typeof Schema.String>
          }>,
          typeof ConstructorDefinition,
          typeof UnionDefinition,
          Schema.Struct<{ title: Schema.Literal<["Data"]>; description: Schema.optional<typeof Schema.String> }>,
          Schema.Struct<{ $ref: typeof Schema.String }>,
          Schema.Struct<{}>,
          typeof ListDefinition,
          typeof MapDefinition
        ]
      >
    }>
  >
  redeemer: Schema.optional<
    Schema.Struct<{
      title: Schema.optional<typeof Schema.String>
      schema: Schema.Union<
        [
          Schema.Struct<{
            dataType: Schema.Literal<["bytes"]>
            title: Schema.optional<typeof Schema.String>
            description: Schema.optional<typeof Schema.String>
          }>,
          Schema.Struct<{
            dataType: Schema.Literal<["integer"]>
            title: Schema.optional<typeof Schema.String>
            description: Schema.optional<typeof Schema.String>
          }>,
          typeof ConstructorDefinition,
          typeof UnionDefinition,
          Schema.Struct<{ title: Schema.Literal<["Data"]>; description: Schema.optional<typeof Schema.String> }>,
          Schema.Struct<{ $ref: typeof Schema.String }>,
          Schema.Struct<{}>,
          typeof ListDefinition,
          typeof MapDefinition
        ]
      >
    }>
  >
  parameters: Schema.optional<
    Schema.Array$<
      Schema.Struct<{
        title: Schema.optional<typeof Schema.String>
        schema: Schema.Union<
          [
            Schema.Struct<{
              dataType: Schema.Literal<["bytes"]>
              title: Schema.optional<typeof Schema.String>
              description: Schema.optional<typeof Schema.String>
            }>,
            Schema.Struct<{
              dataType: Schema.Literal<["integer"]>
              title: Schema.optional<typeof Schema.String>
              description: Schema.optional<typeof Schema.String>
            }>,
            typeof ConstructorDefinition,
            typeof UnionDefinition,
            Schema.Struct<{ title: Schema.Literal<["Data"]>; description: Schema.optional<typeof Schema.String> }>,
            Schema.Struct<{ $ref: typeof Schema.String }>,
            Schema.Struct<{}>,
            typeof ListDefinition,
            typeof MapDefinition
          ]
        >
      }>
    >
  >
  compiledCode: typeof Schema.String
  hash: typeof Schema.String
}>

ValidatorDefinitionType (type alias)

Signature

export type ValidatorDefinitionType = {
  readonly title: string
  readonly description?: string
  readonly datum?: ParameterSchemaType
  readonly redeemer?: ParameterSchemaType
  readonly parameters?: ReadonlyArray<ParameterSchemaType>
  readonly compiledCode: string
  readonly hash: string
}

ValidatorMetadata (interface)

Signature

export interface ValidatorMetadata {
  title: string
  hash: string
  compiledCode: string
  datum?: Schema.Schema.Any
  redeemer?: Schema.Schema.Any
  parameters?: Array<Schema.Schema.Any>
}