Evolution SDK

TxOut.ts

TxOut overview


Table of contents


arbitrary

arbitrary

Signature

export declare const arbitrary: FastCheck.Arbitrary<TransactionOutput>

Added in v2.0.0

decoding

fromCBORBytes

Parse TransactionOutput from CBOR bytes.

Signature

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

Added in v2.0.0

fromCBORHex

Parse TransactionOutput from CBOR hex.

Signature

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

Added in v2.0.0

encoding

toCBORBytes

Convert TransactionOutput to CBOR bytes.

Signature

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

Added in v2.0.0

toCBORHex

Convert TransactionOutput to CBOR hex.

Signature

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

Added in v2.0.0

model

TransactionOutput (class)

Babbage-era transaction output format

CDDL:

babbage_transaction_output =
  {0 : address, 1 : value, ? 2 : datum_option, ? 3 : script_ref}

Signature

export declare class TransactionOutput

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

schemas

BabbageTransactionOutputCDDL

Babbage-era transaction output CDDL format (map)

Signature

export declare const BabbageTransactionOutputCDDL: Schema.MapFromSelf<
  typeof Schema.BigIntFromSelf,
  Schema.Schema<CBOR.CBOR, CBOR.CBOR, never>
>

Added in v2.0.0

CDDLSchema

CDDL schema for transaction outputs (union of Shelley and Babbage formats)

Signature

export declare const CDDLSchema: Schema.Union<
  [
    Schema.Tuple<
      [
        typeof Schema.Uint8ArrayFromSelf,
        Schema.SchemaClass<
          bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
          bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
          never
        >,
        Schema.Element<typeof Schema.Uint8ArrayFromSelf, "?">
      ]
    >,
    Schema.MapFromSelf<typeof Schema.BigIntFromSelf, Schema.Schema<CBOR.CBOR, CBOR.CBOR, never>>
  ]
>

Added in v2.0.0

ShelleyTransactionOutputCDDL

Shelley-era transaction output CDDL format (array)

Signature

export declare const ShelleyTransactionOutputCDDL: Schema.Tuple<
  [
    typeof Schema.Uint8ArrayFromSelf,
    Schema.SchemaClass<
      bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
      bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
      never
    >,
    Schema.Element<typeof Schema.Uint8ArrayFromSelf, "?">
  ]
>

Added in v2.0.0

transformation

FromBabbageTransactionOutputCDDL

Transformation schema for Babbage transaction outputs

Signature

export declare const FromBabbageTransactionOutputCDDL: Schema.transformOrFail<
  Schema.MapFromSelf<typeof Schema.BigIntFromSelf, Schema.Schema<CBOR.CBOR, CBOR.CBOR, never>>,
  Schema.SchemaClass<TransactionOutput, TransactionOutput, never>,
  never
>

Added in v2.0.0

FromCDDL

CDDL transformation schema for transaction outputs (supports both Shelley and Babbage formats)

Encoding logic:

  • Uses Shelley format (array) when no scriptRef and either no datumOption or only DatumHash
  • Uses Babbage format (map) when scriptRef is present or datumOption contains InlineDatum

Decoding: Accepts both formats

Signature

export declare const FromCDDL: Schema.transformOrFail<
  Schema.Union<
    [
      Schema.Tuple<
        [
          typeof Schema.Uint8ArrayFromSelf,
          Schema.SchemaClass<
            bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
            bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
            never
          >,
          Schema.Element<typeof Schema.Uint8ArrayFromSelf, "?">
        ]
      >,
      Schema.MapFromSelf<typeof Schema.BigIntFromSelf, Schema.Schema<CBOR.CBOR, CBOR.CBOR, never>>
    ]
  >,
  Schema.SchemaClass<TransactionOutput, TransactionOutput, never>,
  never
>

Added in v2.0.0

FromShelleyTransactionOutputCDDL

Transformation schema for Shelley transaction outputs

Signature

export declare const FromShelleyTransactionOutputCDDL: Schema.transformOrFail<
  Schema.Tuple<
    [
      typeof Schema.Uint8ArrayFromSelf,
      Schema.SchemaClass<
        bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
        bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
        never
      >,
      Schema.Element<typeof Schema.Uint8ArrayFromSelf, "?">
    ]
  >,
  Schema.SchemaClass<TransactionOutput, TransactionOutput, never>,
  never
>

Added in v2.0.0

transformer

FromCBORBytes

CBOR bytes transformation schema for TransactionOutput.

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.Union<
      [
        Schema.Tuple<
          [
            typeof Schema.Uint8ArrayFromSelf,
            Schema.SchemaClass<
              bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
              bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
              never
            >,
            Schema.Element<typeof Schema.Uint8ArrayFromSelf, "?">
          ]
        >,
        Schema.MapFromSelf<typeof Schema.BigIntFromSelf, Schema.Schema<CBOR.CBOR, CBOR.CBOR, never>>
      ]
    >,
    Schema.SchemaClass<TransactionOutput, TransactionOutput, never>,
    never
  >
>

Added in v2.0.0

FromCBORHex

CBOR hex transformation schema for TransactionOutput.

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.Union<
        [
          Schema.Tuple<
            [
              typeof Schema.Uint8ArrayFromSelf,
              Schema.SchemaClass<
                bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
                bigint | readonly [bigint, ReadonlyMap<any, ReadonlyMap<any, bigint>>],
                never
              >,
              Schema.Element<typeof Schema.Uint8ArrayFromSelf, "?">
            ]
          >,
          Schema.MapFromSelf<typeof Schema.BigIntFromSelf, Schema.Schema<CBOR.CBOR, CBOR.CBOR, never>>
        ]
      >,
      Schema.SchemaClass<TransactionOutput, TransactionOutput, never>,
      never
    >
  >
>

Added in v2.0.0