Evolution SDK

NativeScriptJSON.ts

NativeScriptJSON overview


Table of contents


model

NativeJSON (type alias)

Represents a cardano-cli JSON script syntax

Native type follows the standard described in the https://github.com/IntersectMBO/cardano-node/blob/1.26.1-with-cardano-cli/doc/reference/simple-scripts.md#json-script-syntax

Signature

export type NativeJSON =
  | {
      type: "sig"
      keyHash: string
    }
  | {
      type: "before"
      slot: number
    }
  | {
      type: "after"
      slot: number
    }
  | {
      type: "all"
      scripts: ReadonlyArray<NativeJSON>
    }
  | {
      type: "any"
      scripts: ReadonlyArray<NativeJSON>
    }
  | {
      type: "atLeast"
      required: number
      scripts: ReadonlyArray<NativeJSON>
    }

Added in v2.0.0

schemas

NativeJSONSchema

Schema for NativeJSON union type.

Signature

export declare const NativeJSONSchema: Schema.Union<
  [
    Schema.Struct<{ type: Schema.Literal<["sig"]>; keyHash: typeof Schema.String }>,
    Schema.Struct<{ type: Schema.Literal<["before"]>; slot: typeof Schema.Number }>,
    Schema.Struct<{ type: Schema.Literal<["after"]>; slot: typeof Schema.Number }>,
    Schema.Struct<{
      type: Schema.Literal<["all"]>
      scripts: Schema.Array$<Schema.suspend<NativeJSON, NativeJSON, never>>
    }>,
    Schema.Struct<{
      type: Schema.Literal<["any"]>
      scripts: Schema.Array$<Schema.suspend<NativeJSON, NativeJSON, never>>
    }>,
    Schema.Struct<{
      type: Schema.Literal<["atLeast"]>
      required: typeof Schema.Number
      scripts: Schema.Array$<Schema.suspend<NativeJSON, NativeJSON, never>>
    }>
  ]
>

Added in v2.0.0