Skip to main content

Tx

@harmoniclabs/cardano-ledger-ts • Docs


@harmoniclabs/cardano-ledger-ts / Tx

Class: Tx

Implements​

  • ITx
  • ToCbor
  • ToJson

Constructors​

new Tx()​

new Tx(tx): Tx

Parameters​

• tx: ITx

Returns​

Tx

Defined in​

src/tx/Tx.ts:79

Properties​

addVKeyWitness()​

readonly addVKeyWitness: (vkeyWit) => void

checks that the signer is needed if true adds the witness otherwise nothing happens (the signature is not added)

one might prefer to use this method instead of signWith when signature is provided by a third party (example CIP30 wallet)

Parameters​

• vkeyWit: VKeyWitness

Returns​

void

Defined in​

src/tx/Tx.ts:47


auxiliaryData?​

readonly optional auxiliaryData: null | AuxiliaryData

Implementation of​

ITx.auxiliaryData

Defined in​

src/tx/Tx.ts:37


body​

readonly body: TxBody

Implementation of​

ITx.body

Defined in​

src/tx/Tx.ts:34


hash​

readonly hash: Hash32

getter

Defined in​

src/tx/Tx.ts:77


isComplete​

readonly isComplete: boolean

Defined in​

src/tx/Tx.ts:73


isScriptValid​

readonly isScriptValid: boolean

Implementation of​

ITx.isScriptValid

Defined in​

src/tx/Tx.ts:36


signWith()​

readonly signWith: (signer) => void

checks that the signer is needed if true signs the transaction with the specified key otherwise nothing happens (the signature is not added)

Parameters​

• signer: PrivateKey | XPrv

Returns​

void

Defined in​

src/tx/Tx.ts:53


signWithCip30Wallet()​

readonly signWithCip30Wallet: (cip30wallet) => Promise<void>

signs the transaction using any browser wallet that follows the [CIP-0030 standard] (https://github.com/cardano-foundation/CIPs/tree/master/CIP-0030#apisigntxtx-cbortransaction-partialsign-bool--false-promisecbortransaction_witness_set)

Parameters​

• cip30wallet: Cip30LikeSignTx

Returns​

Promise<void>

Defined in​

src/tx/Tx.ts:60


witnesses​

readonly witnesses: TxWitnessSet

Implementation of​

ITx.witnesses

Defined in​

src/tx/Tx.ts:35

Methods​

toCbor()​

toCbor(): CborString

Returns​

CborString

Implementation of​

ToCbor.toCbor

Defined in​

src/tx/Tx.ts:215


toCborObj()​

toCborObj(): CborObj

Returns​

CborObj

Implementation of​

ToCbor.toCborObj

Defined in​

src/tx/Tx.ts:219


toJson()​

toJson(): object

Returns​

object

auxiliaryData​

auxiliaryData: undefined | object

body​

body: object

body.auxDataHash​

auxDataHash: undefined | string

body.certs​

certs: undefined | (object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object | object)[]

body.collateralInputs​

collateralInputs: undefined | object[]

body.collateralReturn​

collateralReturn: undefined | object

body.fee​

fee: string

body.inputs​

inputs: object[]

body.mint​

mint: undefined | ValueJson

body.network​

network: undefined | NetworkT

body.outputs​

outputs: object[]

body.protocolUpdate​

protocolUpdate: undefined | object

body.refInputs​

refInputs: undefined | object[]

body.requiredSigners​

requiredSigners: undefined | string[]

body.scriptDataHash​

scriptDataHash: undefined | string

body.totCollateral​

totCollateral: undefined | string

body.ttl​

ttl: undefined | string

body.validityIntervalStart​

validityIntervalStart: undefined | string

body.withdrawals​

withdrawals: undefined | object

isScriptValid​

isScriptValid: boolean

witnesses​

witnesses: object

witnesses.bootstrapWitnesses​

bootstrapWitnesses: undefined | object[]

witnesses.datums​

datums: undefined | any[]

witnesses.nativeScripts​

nativeScripts: undefined | (ScriptSignature | ScriptAll | ScriptAny | ScriptAtLeast | ScriptAfter | ScriptBefore | object)[]

witnesses.plutusV1Scripts​

plutusV1Scripts: undefined | (ScriptSignature | ScriptAll | ScriptAny | ScriptAtLeast | ScriptAfter | ScriptBefore | object)[]

witnesses.plutusV2Scripts​

plutusV2Scripts: undefined | (ScriptSignature | ScriptAll | ScriptAny | ScriptAtLeast | ScriptAfter | ScriptBefore | object)[]

witnesses.plutusV3Scripts​

plutusV3Scripts: undefined | (ScriptSignature | ScriptAll | ScriptAny | ScriptAtLeast | ScriptAfter | ScriptBefore | object)[]

witnesses.redeemers​

redeemers: undefined | object[]

witnesses.vkeyWitnesses​

vkeyWitnesses: undefined | object[]

Implementation of​

ToJson.toJson

Defined in​

src/tx/Tx.ts:258


fromCbor()​

static fromCbor(cStr): Tx

Parameters​

• cStr: CanBeCborString

Returns​

Tx

Defined in​

src/tx/Tx.ts:231


fromCborObj()​

static fromCborObj(cObj): Tx

Parameters​

• cObj: CborObj

Returns​

Tx

Defined in​

src/tx/Tx.ts:235