Script
@harmoniclabs/cardano-ledger-ts • Docs
@harmoniclabs/cardano-ledger-ts / Script
Class: Script<T>
Type Parameters
• T extends LitteralScriptType
= LitteralScriptType
Implements
ToCbor
Constructors
new Script()
new Script<
T
>(scriptType
,bytes
):Script
<T
>
Parameters
• scriptType: T
• bytes: Uint8Array
| T
extends NativeScript
? NativeScript
: PlutusScriptJsonFormat
<PlutusScriptType
>
Returns
Script
<T
>
Defined in
Properties
bytes
readonly
bytes:Uint8Array
Defined in
cbor
readonly
cbor:T
extendsNativeScript
?never
:CborString
format expected by cardano-cli
for standard ledger format (as defined in CDDL) use toCbor
method
Defined in
hash
readonly
hash:Hash28
Defined in
type
readonly
type:T
Defined in
Methods
clone()
clone():
Script
<T
>
Returns
Script
<T
>
Defined in
toCbor()
toCbor():
CborString
format specified in the ledger CDDL
Returns
CborString
Implementation of
ToCbor.toCbor
Defined in
toCborObj()
toCborObj():
CborObj
format specified in the ledger CDDL
Returns
CborObj
Implementation of
ToCbor.toCborObj
Defined in
toJson()
toJson():
ScriptSignature
|ScriptAll
|ScriptAny
|ScriptAtLeast
|ScriptAfter
|ScriptBefore
|object
Returns
ScriptSignature
| ScriptAll
| ScriptAny
| ScriptAtLeast
| ScriptAfter
| ScriptBefore
| object
Defined in
fromCbor()
static
fromCbor(cbor
,defType
):Script
<LitteralScriptType
>
Parameters
• cbor: CanBeCborString
• defType: ScriptType
= ScriptType.PlutusV2
Returns
Defined in
fromCborObj()
static
fromCborObj(cObj
,defType
):Script
<LitteralScriptType
>
Parameters
• cObj: CborObj
• defType: ScriptType
= ScriptType.PlutusV2
Returns
Defined in
fromJson()
static
fromJson(json
):Script
<LitteralScriptType
>
Parameters
• json: any