ByteArrayData

One of Plutus-Core's 5 builtin data types, representing a list of bytes. Parent class is UplcData.

Constructor

new helios.ByteArrayData(bytes: []number)

Static methods

fromCbor

Decodes CBOR bytes representing a ByteArrayData instance. Mutates the bytes argument.

helios.ByteArrayData.fromCbor(bytes: []number): helios.ByteArrayData

fromString

Encodes a utf-8 string as a ByteArrayData instance.

helios.ByteArrayData.fromString(str: string): helios.ByteArrayData

Getters

bytes

Returns the underlying list of bytes.

byte_array_data.bytes: number[]

Methods

toCbor

Encodes a ByteArrayData instance using CBOR.

byte_array_data.toCbor(): number[]

toHex

Returns the hexadecimal string representation of the underlying bytes.

byte_array_data.toHex(): string

toSchemaJson

Returns the JSON representation of a ByteArrayData instance. Needed for interacting with external tools like cardano-cli and Lucid.

byte_array_data.toSchemaJson(): string