TransactionBody.deserialize constructor
TransactionBody.deserialize(
- CborMapValue<
CborIntValue, CborObject> cbor
Implementation
factory TransactionBody.deserialize(
CborMapValue<CborIntValue, CborObject> cbor) {
return TransactionBody(
inputs: cbor
.getIntValueAs<CborObject?>(0)
?.convertTo<TransactionInputs, CborObject>(
(e) => TransactionInputs.deserialize(e)),
outputs: cbor
.getIntValueAs<CborObject?>(1)
?.convertTo<TransactionOutputs, CborObject>(
(e) => TransactionOutputs.deserialize(e)),
fee: cbor.getIntValueAs<CborNumeric>(2).toBigInt(),
ttl: cbor.getIntValueAs<CborNumeric?>(3)?.toBigInt(),
withdrawals: cbor
.getIntValueAs<CborObject?>(5)
?.convertTo<Withdrawals, CborMapValue>(
(e) => Withdrawals.deserialize(e)),
auxiliaryDataHash: cbor
.getIntValueAs<CborBytesValue?>(7)
?.convertTo<AuxiliaryDataHash, CborBytesValue>(
(CborBytesValue e) => AuxiliaryDataHash.deserialize(e)),
certificates: cbor
.getIntValueAs<CborObject?>(4)
?.convertTo<Certificates, CborObject>((e) => Certificates.deserialize(e)),
update: cbor.getIntValueAs<CborListValue?>(6)?.convertTo<Update, CborListValue>((e) => Update.deserialize(e)),
validityStartInterval: cbor.getIntValueAs<CborNumeric?>(8)?.toBigInt(),
mint: cbor.getIntValueAs<CborMapValue?>(9)?.convertTo<Mint, CborMapValue>((e) => Mint.deserialize(e.as("Mint"))),
scriptDataHash: cbor.getIntValueAs<CborBytesValue?>(11)?.convertTo<ScriptDataHash, CborBytesValue>((e) => ScriptDataHash.deserialize(e)),
collateral: cbor.getIntValueAs<CborObject?>(13)?.convertTo<TransactionInputs, CborObject>((e) => TransactionInputs.deserialize(e)),
requiredSigners: cbor.getIntValueAs<CborObject?>(14)?.convertTo<RequiredSigners, CborObject>((e) => RequiredSigners.deserialize(e)),
network: cbor.getIntValueAs<CborIntValue?>(15)?.convertTo<ADANetwork, CborIntValue>((e) => ADANetwork.fromTag(e.value)),
collateralReturn: cbor.getIntValueAs<CborObject?>(16)?.convertTo<TransactionOutput, CborObject>((e) => TransactionOutput.deserialize(e)),
totalCollateral: cbor.getIntValueAs<CborNumeric?>(17)?.toBigInt(),
referenceInputs: cbor.getIntValueAs<CborObject?>(18)?.convertTo<TransactionInputs, CborObject>((e) => TransactionInputs.deserialize(e)),
votingProcedures: cbor.getIntValueAs<CborMapValue?>(19)?.convertTo<VotingProcedures, CborMapValue>((e) => VotingProcedures.deserialize(e.as<CborMapValue>("VotingProcedures"))),
votingProposals: cbor.getIntValueAs<CborObject?>(20)?.convertTo<VotingProposals, CborObject>((e) => VotingProposals.deserialize(e)),
currentTreasuryValue: cbor.getIntValueAs<CborNumeric?>(21)?.toBigInt(),
donation: cbor.getIntValueAs<CborNumeric?>(22)?.toBigInt(),
serializationConfig: TransactionBodySerializationConfig(keyOrder: cbor.value.keys.map((e) => e.value).toList()));
}