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
-
↳
NativeScript
Index
Constructors
constructor
• new NativeScript(type
)
Parameters
Name | Type |
---|---|
type | number |
Overrides
Accessors
mintingPolicyHash
• get
mintingPolicyHash(): MintingPolicyHash
A NativeScript
can be used both as a Validator and as a MintingPolicy
Returns
validatorHash
• get
validatorHash(): ValidatorHash
A NativeScript
can be used both as a Validator and as a MintingPolicy
Returns
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
toCborHex
▸ toCborHex(): string
Returns
string
Inherited from
toJson
▸ toJson(): any
Returns
any
typeToCbor
▸ typeToCbor(): number
[]
Returns
number
[]
fromCbor
▸ Static
fromCbor(raw
): NativeScript
Parameters
Name | Type |
---|---|
raw | string | number [] |
Returns
fromJson
▸ Static
fromJson(json
): NativeScript
Parameters
Name | Type |
---|---|
json | any |