Evolution SDK

ScriptRef.ts

ScriptRef overview


Table of contents


arbitrary

arbitrary

FastCheck arbitrary for generating random ScriptRef instances.

Signature

export declare const arbitrary: FastCheck.Arbitrary<ScriptRef>

Added in v2.0.0

encoding

toBytes

Encode ScriptRef to bytes.

Signature

export declare const toBytes: (data: ScriptRef) => any

Added in v2.0.0

toCBORBytes

Encode ScriptRef to CBOR bytes.

Signature

export declare const toCBORBytes: (data: ScriptRef, options?: CBOR.CodecOptions) => any

Added in v2.0.0

toCBORHex

Encode ScriptRef to CBOR hex string.

Signature

export declare const toCBORHex: (data: ScriptRef, options?: CBOR.CodecOptions) => string

Added in v2.0.0

toHex

Encode ScriptRef to hex string.

Signature

export declare const toHex: (data: ScriptRef) => string

Added in v2.0.0

parsing

fromBytes

Parse ScriptRef from bytes.

Signature

export declare const fromBytes: (bytes: Uint8Array) => ScriptRef

Added in v2.0.0

fromCBORBytes

Parse ScriptRef from CBOR bytes.

Signature

export declare const fromCBORBytes: (bytes: Uint8Array, options?: CBOR.CodecOptions) => ScriptRef

Added in v2.0.0

fromCBORHex

Parse ScriptRef from CBOR hex string.

Signature

export declare const fromCBORHex: (hex: string, options?: CBOR.CodecOptions) => ScriptRef

Added in v2.0.0

fromHex

Parse ScriptRef from hex string.

Signature

export declare const fromHex: (hex: string) => ScriptRef

Added in v2.0.0

schemas

FromBytes

Schema for transforming from bytes to ScriptRef.

Signature

export declare const FromBytes: Schema.transform<
  typeof Schema.Uint8ArrayFromSelf,
  Schema.SchemaClass<ScriptRef, ScriptRef, never>
>

Added in v2.0.0

FromCBORBytes

/** CBOR bytes transformation schema for ScriptRef.

Signature

export declare const FromCBORBytes: (
  options?: CBOR.CodecOptions
) => Schema.transform<
  Schema.transformOrFail<
    typeof Schema.Uint8ArrayFromSelf,
    Schema.declare<CBOR.CBOR, CBOR.CBOR, readonly [], never>,
    never
  >,
  Schema.transformOrFail<
    Schema.TaggedStruct<"Tag", { tag: Schema.Literal<[24]>; value: typeof Schema.Uint8ArrayFromSelf }>,
    Schema.SchemaClass<ScriptRef, ScriptRef, never>,
    never
  >
>

Added in v2.0.0

FromCBORHex

CBOR hex transformation schema for ScriptRef.

Signature

export declare const FromCBORHex: (
  options?: CBOR.CodecOptions
) => Schema.transform<
  Schema.Schema<Uint8Array, string, never>,
  Schema.transform<
    Schema.transformOrFail<
      typeof Schema.Uint8ArrayFromSelf,
      Schema.declare<CBOR.CBOR, CBOR.CBOR, readonly [], never>,
      never
    >,
    Schema.transformOrFail<
      Schema.TaggedStruct<"Tag", { tag: Schema.Literal<[24]>; value: typeof Schema.Uint8ArrayFromSelf }>,
      Schema.SchemaClass<ScriptRef, ScriptRef, never>,
      never
    >
  >
>

Added in v2.0.0

FromCDDL

CDDL schema for ScriptRef following the Conway specification.

script_ref = #6.24(bytes .cbor script)

This transforms between CBOR tag 24 structure and ScriptRef model.

Signature

export declare const FromCDDL: Schema.transformOrFail<
  Schema.TaggedStruct<"Tag", { tag: Schema.Literal<[24]>; value: typeof Schema.Uint8ArrayFromSelf }>,
  Schema.SchemaClass<ScriptRef, ScriptRef, never>,
  never
>

Added in v2.0.0

FromHex

Schema for transforming from hex to ScriptRef.

Signature

export declare const FromHex: Schema.transform<
  Schema.Schema<Uint8Array, string, never>,
  Schema.transform<typeof Schema.Uint8ArrayFromSelf, Schema.SchemaClass<ScriptRef, ScriptRef, never>>
>

Added in v2.0.0

ScriptRef (class)

Schema for ScriptRef representing a reference to a script in a transaction output.

CDDL: script_ref = #6.24(bytes .cbor script)

This represents the CBOR-encoded script bytes. The script_ref uses CBOR tag 24 to indicate it contains CBOR-encoded script data.

Signature

export declare class ScriptRef

Added in v2.0.0

toJSON (method)

Signature

toJSON()

toString (method)

Signature

toString(): string

[Inspectable.NodeInspectSymbol] (method)

Signature

[Inspectable.NodeInspectSymbol](): unknown

[Equal.symbol] (method)

Signature

[Equal.symbol](that: unknown): boolean

[Hash.symbol] (method)

Signature

[Hash.symbol](): number

utils

CDDLSchema

Signature

export declare const CDDLSchema: Schema.TaggedStruct<
  "Tag",
  { tag: Schema.Literal<[24]>; value: typeof Schema.Uint8ArrayFromSelf }
>