Helios API/ API Reference/ Classes/

Datum

Represents either an inline datum, or a hashed datum.

Inside the Helios language this type is named OutputDatum in order to distinguish it from user defined Datums, But outside helios scripts there isn't much sense to keep using the name 'OutputDatum' instead of Datum.

Hierarchy

Index

Constructors

constructor

new Datum()

Inherited from

CborData.constructor

Accessors

data

get data(): null | UplcData

Returns

null | UplcData

hash

get hash(): DatumHash

Returns

DatumHash

Methods

dump

dump(): any

Returns

any

isHashed

isHashed(): boolean

Returns

boolean

isInline

isInline(): boolean

Returns

boolean

toCbor

toCbor(): number[]

Returns

number[]

Inherited from

CborData.toCbor

toCborHex

toCborHex(): string

Returns

string

Inherited from

CborData.toCborHex

toData

toData(): ConstrData

Returns

ConstrData

fromCbor

Static fromCbor(bytes): Datum

Parameters

NameType
bytesnumber[]

Returns

Datum

fromUplcData

Static fromUplcData(data): null | Datum

Parameters

NameType
dataUplcData

Returns

null | Datum

hashed

Static hashed(data): Datum

Constructs a HashedDatum. The input data is hashed internally.

Parameters

Returns

Datum

inline

Static inline(data): Datum

Parameters

Returns

Datum