Skip to main content

Script

@harmoniclabs/cardano-ledger-tsDocs


@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

src/script/Script.ts:41

Properties

bytes

readonly bytes: Uint8Array

Defined in

src/script/Script.ts:32


cbor

readonly cbor: T extends NativeScript ? never : CborString

format expected by cardano-cli

for standard ledger format (as defined in CDDL) use toCbor method

Defined in

src/script/Script.ts:38


hash

readonly hash: Hash28

Defined in

src/script/Script.ts:39


type

readonly type: T

Defined in

src/script/Script.ts:31

Methods

clone()

clone(): Script<T>

Returns

Script<T>

Defined in

src/script/Script.ts:163


toCbor()

toCbor(): CborString

format specified in the ledger CDDL

Returns

CborString

Implementation of

ToCbor.toCbor

Defined in

src/script/Script.ts:213


toCborObj()

toCborObj(): CborObj

format specified in the ledger CDDL

Returns

CborObj

Implementation of

ToCbor.toCborObj

Defined in

src/script/Script.ts:220


toJson()

toJson(): ScriptSignature | ScriptAll | ScriptAny | ScriptAtLeast | ScriptAfter | ScriptBefore | object

Returns

ScriptSignature | ScriptAll | ScriptAny | ScriptAtLeast | ScriptAfter | ScriptBefore | object

Defined in

src/script/Script.ts:171


fromCbor()

static fromCbor(cbor, defType): Script<LitteralScriptType>

Parameters

cbor: CanBeCborString

defType: ScriptType = ScriptType.PlutusV2

Returns

Script<LitteralScriptType>

Defined in

src/script/Script.ts:240


fromCborObj()

static fromCborObj(cObj, defType): Script<LitteralScriptType>

Parameters

cObj: CborObj

defType: ScriptType = ScriptType.PlutusV2

Returns

Script<LitteralScriptType>

Defined in

src/script/Script.ts:245


fromJson()

static fromJson(json): Script<LitteralScriptType>

Parameters

json: any

Returns

Script<LitteralScriptType>

Defined in

src/script/Script.ts:195