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
readonlybytes:Uint8Array
Defined in
cbor
readonlycbor:TextendsNativeScript?never:CborString
format expected by cardano-cli
for standard ledger format (as defined in CDDL) use toCbor method
Defined in
hash
readonlyhash:Hash28
Defined in
type
readonlytype: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()
staticfromCbor(cbor,defType):Script<LitteralScriptType>
Parameters
• cbor: CanBeCborString
• defType: ScriptType = ScriptType.PlutusV2
Returns
Defined in
fromCborObj()
staticfromCborObj(cObj,defType):Script<LitteralScriptType>
Parameters
• cObj: CborObj
• defType: ScriptType = ScriptType.PlutusV2
Returns
Defined in
fromJson()
staticfromJson(json):Script<LitteralScriptType>
Parameters
• json: any