Search in sources :

Example 6 with MosaicBuilder

use of io.nem.symbol.catapult.builders.MosaicBuilder in project nem2-sdk-java by nemtech.

the class InflationReceipt method serialize.

/**
 * Serialize receipt and returns receipt bytes
 *
 * @return receipt bytes
 */
@Override
public byte[] serialize() {
    short version = (short) getVersion().getValue();
    ReceiptTypeDto type = ReceiptTypeDto.rawValueOf((short) getType().getValue());
    MosaicBuilder mosaic = MosaicBuilder.create(new MosaicIdDto(getMosaicId().getIdAsLong()), SerializationUtils.toAmount(getAmount()));
    return InflationReceiptBuilder.create(version, type, mosaic).serialize();
}
Also used : MosaicBuilder(io.nem.symbol.catapult.builders.MosaicBuilder) MosaicIdDto(io.nem.symbol.catapult.builders.MosaicIdDto) ReceiptTypeDto(io.nem.symbol.catapult.builders.ReceiptTypeDto)

Aggregations

MosaicBuilder (io.nem.symbol.catapult.builders.MosaicBuilder)6 AddressDto (io.nem.symbol.catapult.builders.AddressDto)5 HeightDto (io.nem.symbol.catapult.builders.HeightDto)3 MosaicIdDto (io.nem.symbol.catapult.builders.MosaicIdDto)3 ReceiptTypeDto (io.nem.symbol.catapult.builders.ReceiptTypeDto)3 Hash256Dto (io.nem.symbol.catapult.builders.Hash256Dto)2 LockStatusDto (io.nem.symbol.catapult.builders.LockStatusDto)2 AccountKeyTypeFlagsDto (io.nem.symbol.catapult.builders.AccountKeyTypeFlagsDto)1 AccountTypeDto (io.nem.symbol.catapult.builders.AccountTypeDto)1 HeightActivityBucketsBuilder (io.nem.symbol.catapult.builders.HeightActivityBucketsBuilder)1 ImportanceDto (io.nem.symbol.catapult.builders.ImportanceDto)1 ImportanceHeightDto (io.nem.symbol.catapult.builders.ImportanceHeightDto)1 ImportanceSnapshotBuilder (io.nem.symbol.catapult.builders.ImportanceSnapshotBuilder)1 KeyDto (io.nem.symbol.catapult.builders.KeyDto)1 LockHashAlgorithmDto (io.nem.symbol.catapult.builders.LockHashAlgorithmDto)1 PinnedVotingKeyBuilder (io.nem.symbol.catapult.builders.PinnedVotingKeyBuilder)1 VotingKeyDto (io.nem.symbol.catapult.builders.VotingKeyDto)1