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
Defined in
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
auxiliaryData?
readonly
optional
auxiliaryData:null
|AuxiliaryData
Implementation of
Defined in
body
readonly
body:TxBody
Implementation of
Defined in
hash
readonly
hash:Hash32
getter
Defined in
isComplete
readonly
isComplete:boolean
Defined in
isScriptValid
readonly
isScriptValid:boolean
Implementation of
Defined in
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
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
witnesses
readonly
witnesses:TxWitnessSet
Implementation of
Defined in
Methods
toCbor()
toCbor():
CborString
Returns
CborString
Implementation of
ToCbor.toCbor
Defined in
toCborObj()
toCborObj():
CborObj
Returns
CborObj
Implementation of
ToCbor.toCborObj
Defined in
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
fromCbor()
static
fromCbor(cStr
):Tx
Parameters
• cStr: CanBeCborString
Returns
Defined in
fromCborObj()
static
fromCborObj(cObj
):Tx
Parameters
• cObj: CborObj