All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.casper.sdk.model.transaction.pricing.ReservedPricingMode Maven / Gradle / Ivy

Go to download

SDK to streamline the 3rd party Java client integration processes. Such 3rd parties include exchanges & app developers.

The newest version!
package com.casper.sdk.model.transaction.pricing;

import com.casper.sdk.exception.NoSuchTypeException;
import com.casper.sdk.model.clvalue.serde.Target;
import com.casper.sdk.model.common.Digest;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.oak3.sbs4j.SerializerBuffer;
import dev.oak3.sbs4j.exception.ValueSerializationException;
import lombok.*;

/**
 * The payment for this transaction was previously reserved, as proven by
 * the receipt hash (this is for future use, not currently implemented).
 *
 * @author [email protected]
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@Builder
public class ReservedPricingMode implements PricingMode {
    @JsonProperty("receipt")
    private Digest receipt;

    @Override
    public void serialize(SerializerBuffer ser, Target target) throws ValueSerializationException, NoSuchTypeException {
        ser.writeU8(getByteTag());
        receipt.serialize(ser, target);
    }

    @Override
    @JsonIgnore
    public byte getByteTag() {
        return RESERVED_TAG;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy