toCbor method

  1. @override
CborObject toCbor()
override

Converts the object to a CBOR object.

Implementation

@override
CborObject toCbor() {
  return CborMapValue.fixedLength({
    if (minfeeA != null) ...{
      const CborIntValue(0): CborUnsignedValue.u64(minfeeA!),
    },
    if (minFeeB != null) ...{
      const CborIntValue(1): CborUnsignedValue.u64(minFeeB!),
    },
    if (maxBlockBodySize != null) ...{
      const CborIntValue(2): CborUnsignedValue.u32(maxBlockBodySize!),
    },
    if (maxTxSize != null) ...{
      const CborIntValue(3): CborUnsignedValue.u32(maxTxSize!),
    },
    if (maxBlockHeaderSize != null) ...{
      const CborIntValue(4): CborUnsignedValue.u32(maxBlockHeaderSize!),
    },
    if (keyDeposit != null) ...{
      const CborIntValue(5): CborUnsignedValue.u64(keyDeposit!),
    },
    if (poolDeposit != null) ...{
      const CborIntValue(6): CborUnsignedValue.u64(poolDeposit!),
    },
    if (maxEpoch != null) ...{
      const CborIntValue(7): CborUnsignedValue.u32(maxEpoch!),
    },
    if (nOpt != null) ...{
      const CborIntValue(8): CborUnsignedValue.u32(nOpt!),
    },
    if (poolPledgeInfluence != null) ...{
      const CborIntValue(9): poolPledgeInfluence!.toCbor(),
    },
    if (expansionRate != null) ...{
      const CborIntValue(10): expansionRate!.toCbor(),
    },
    if (treasuryGrowthRate != null) ...{
      const CborIntValue(11): treasuryGrowthRate!.toCbor(),
    },
    if (d != null) ...{
      const CborIntValue(12): d!.toCbor(),
    },
    if (extraEntropy != null) ...{
      const CborIntValue(13): extraEntropy!.toCbor(),
    },
    if (protocolVersion != null) ...{
      const CborIntValue(14): protocolVersion!.toCbor(),
    },
    if (minPoolCost != null) ...{
      const CborIntValue(16): CborUnsignedValue.u64(minPoolCost!),
    },
    if (adaPerUtxoByte != null) ...{
      const CborIntValue(17): CborUnsignedValue.u64(adaPerUtxoByte!),
    },
    if (costModel != null) ...{
      const CborIntValue(18): costModel!.toCbor(),
    },
    if (executionCosts != null) ...{
      const CborIntValue(19): executionCosts!.toCbor(),
    },
    if (maxTxExUnits != null) ...{
      const CborIntValue(20): maxTxExUnits!.toCbor(),
    },
    if (maxBlockExUnits != null) ...{
      const CborIntValue(21): maxBlockExUnits!.toCbor(),
    },
    if (maxValueSize != null) ...{
      const CborIntValue(22): CborUnsignedValue.u32(maxValueSize!),
    },
    if (collateralPercentage != null) ...{
      const CborIntValue(23): CborUnsignedValue.u32(collateralPercentage!),
    },
    if (maxCollateralInputs != null) ...{
      const CborIntValue(24): CborUnsignedValue.u32(maxCollateralInputs!),
    },
  });
}