Skip to main content

TxBody

@harmoniclabs/cardano-ledger-tsDocs


@harmoniclabs/cardano-ledger-ts / TxBody

Class: TxBody

Implements

Constructors

new TxBody()

new TxBody(body): TxBody

Parameters

body: ITxBody

object describing the transaction

Returns

TxBody

Throws

only if the the body parameter does not respect the ITxBody interface DOES NOT THROW if the transaction is unbalanced; that needs to be checked using TxBody.isValueConserved static method

Defined in

src/tx/body/TxBody.ts:142

Properties

auxDataHash?

readonly optional auxDataHash: AuxiliaryDataHash

Implementation of

ITxBody.auxDataHash

Defined in

src/tx/body/TxBody.ts:115


certs?

readonly optional certs: Certificate[]

Implementation of

ITxBody.certs

Defined in

src/tx/body/TxBody.ts:112


collateralInputs?

readonly optional collateralInputs: UTxO[]

Implementation of

ITxBody.collateralInputs

Defined in

src/tx/body/TxBody.ts:119


collateralReturn?

readonly optional collateralReturn: TxOut

Implementation of

ITxBody.collateralReturn

Defined in

src/tx/body/TxBody.ts:122


currentTreasuryValue?

readonly optional currentTreasuryValue: bigint

Implementation of

ITxBody.currentTreasuryValue

Defined in

src/tx/body/TxBody.ts:128


donation?

readonly optional donation: bigint

Implementation of

ITxBody.donation

Defined in

src/tx/body/TxBody.ts:129


fee

readonly fee: bigint

Implementation of

ITxBody.fee

Defined in

src/tx/body/TxBody.ts:110


hash

readonly hash: Hash32

getter

Defined in

src/tx/body/TxBody.ts:134


inputs

readonly inputs: [UTxO, ...UTxO[]]

Implementation of

ITxBody.inputs

Defined in

src/tx/body/TxBody.ts:108


mint?

readonly optional mint: Value

Implementation of

ITxBody.mint

Defined in

src/tx/body/TxBody.ts:117


network?

readonly optional network: NetworkT

Implementation of

ITxBody.network

Defined in

src/tx/body/TxBody.ts:121


outputs

readonly outputs: TxOut[]

Implementation of

ITxBody.outputs

Defined in

src/tx/body/TxBody.ts:109


proposalProcedures?

readonly optional proposalProcedures: ProposalProcedure[]

Implementation of

ITxBody.proposalProcedures

Defined in

src/tx/body/TxBody.ts:127


protocolUpdate?

readonly optional protocolUpdate: LegacyPPUpdateProposal

Implementation of

ITxBody.protocolUpdate

Defined in

src/tx/body/TxBody.ts:114


refInputs?

readonly optional refInputs: UTxO[]

Implementation of

ITxBody.refInputs

Defined in

src/tx/body/TxBody.ts:124


requiredSigners?

readonly optional requiredSigners: PubKeyHash[]

Implementation of

ITxBody.requiredSigners

Defined in

src/tx/body/TxBody.ts:120


scriptDataHash?

readonly optional scriptDataHash: ScriptDataHash

Implementation of

ITxBody.scriptDataHash

Defined in

src/tx/body/TxBody.ts:118


totCollateral?

readonly optional totCollateral: bigint

Implementation of

ITxBody.totCollateral

Defined in

src/tx/body/TxBody.ts:123


ttl?

readonly optional ttl: bigint

Implementation of

ITxBody.ttl

Defined in

src/tx/body/TxBody.ts:111


validityIntervalStart?

readonly optional validityIntervalStart: bigint

Implementation of

ITxBody.validityIntervalStart

Defined in

src/tx/body/TxBody.ts:116


votingProcedures?

readonly optional votingProcedures: VotingProcedures

Implementation of

ITxBody.votingProcedures

Defined in

src/tx/body/TxBody.ts:126


withdrawals?

readonly optional withdrawals: TxWithdrawals

Implementation of

ITxBody.withdrawals

Defined in

src/tx/body/TxBody.ts:113

Methods

toCbor()

toCbor(): CborString

Returns

CborString

Implementation of

ToCbor.toCbor

Defined in

src/tx/body/TxBody.ts:465


toCborObj()

toCborObj(): CborObj

Returns

CborObj

Implementation of

ToCbor.toCborObj

Defined in

src/tx/body/TxBody.ts:469


toJson()

toJson(): object

Returns

object

auxDataHash

auxDataHash: undefined | string

certs

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

collateralInputs

collateralInputs: undefined | object[]

collateralReturn

collateralReturn: undefined | object

fee

fee: string

inputs

inputs: object[]

mint

mint: undefined | ValueJson

network

network: undefined | NetworkT

outputs

outputs: object[]

protocolUpdate

protocolUpdate: undefined | object

refInputs

refInputs: undefined | object[]

requiredSigners

requiredSigners: undefined | string[]

scriptDataHash

scriptDataHash: undefined | string

totCollateral

totCollateral: undefined | string

ttl

ttl: undefined | string

validityIntervalStart

validityIntervalStart: undefined | string

withdrawals

withdrawals: undefined | object

Implementation of

ToJson.toJson

Defined in

src/tx/body/TxBody.ts:641


fromCbor()

static fromCbor(cStr): TxBody

Parameters

cStr: CanBeCborString

Returns

TxBody

Defined in

src/tx/body/TxBody.ts:557


fromCborObj()

static fromCborObj(cObj): TxBody

Parameters

cObj: CborObj

Returns

TxBody

Defined in

src/tx/body/TxBody.ts:561


isValueConserved()

static isValueConserved(tx): boolean

tests that inputs + withdrawals + refund + mints === outputs + burns + deposit + fee

Parameters

tx: TxBody

Returns

boolean

Todo

add mints and burns

Deprecated

until mints and burns are added

Defined in

src/tx/body/TxBody.ts:673