Helios API/ API Reference/ Classes/

NativeScript

Helios supports Cardano native scripts. See Tx.attachScript() for how NativeScript can be used when building a transaction.

NativeScript allows creating basic multi-signature and time-based validators. This is a legacy technology, but can be cheaper than using Plutus.

Hierarchy

Index

Constructors

constructor

new NativeScript(type)

Parameters

NameType
typenumber

Overrides

CborData.constructor

Accessors

mintingPolicyHash

get mintingPolicyHash(): MintingPolicyHash

A NativeScript can be used both as a Validator and as a MintingPolicy

Returns

MintingPolicyHash

validatorHash

get validatorHash(): ValidatorHash

A NativeScript can be used both as a Validator and as a MintingPolicy

Returns

ValidatorHash

Methods

hash

hash(): number[]

Calculates the blake2b-224 (28 bytes) hash of the NativeScript.

Note: a 0 byte is prepended before to the serialized CBOR representation, before calculating the hash.

Returns

number[]

toCbor

toCbor(): number[]

Returns

number[]

Inherited from

CborData.toCbor

toCborHex

toCborHex(): string

Returns

string

Inherited from

CborData.toCborHex

toJson

toJson(): any

Returns

any

typeToCbor

typeToCbor(): number[]

Returns

number[]

fromCbor

Static fromCbor(raw): NativeScript

Parameters

NameType
rawstring | number[]

Returns

NativeScript

fromJson

Static fromJson(json): NativeScript

Parameters

NameType
jsonany

Returns

NativeScript