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

com.sap.cloud.sdk.services.blockchain.multichain.model.MultichainTransaction Maven / Gradle / Ivy

Go to download

Service integration of blockchain functionality (Beta release, still subject to change - up to discontinuation of module).

There is a newer version: 3.14.0
Show newest version
/*
 * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
 */

package com.sap.cloud.sdk.services.blockchain.multichain.model;

import java.time.Instant;
import java.util.List;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.google.common.annotations.Beta;
import com.sap.cloud.sdk.services.blockchain.multichain.utils.UnixTimestampDeserializer;

import lombok.Data;

/**
 * Information about a transaction in service. For more details see https://www.multichain.com/developers/json-rpc-api/
 */
@Data
@JsonIgnoreProperties( ignoreUnknown = true )
@Beta
public class MultichainTransaction
{
    @Nonnull
    private String hex;

    @Nonnull
    private String txid;

    @Nonnull
    private Integer version;

    @Nonnull
    private Integer locktime;

    @Nullable
    private Object data;

    @Nonnull
    private List vin;

    @Nonnull
    private List vout;

    @Nullable
    private String blockhash; // if tx not yet in commited block, these are null

    @Nullable
    private Integer confirmations; // see above

    @Nullable
    @JsonDeserialize( using = UnixTimestampDeserializer.class )
    private Instant time; // see above

    @Nullable
    @JsonDeserialize( using = UnixTimestampDeserializer.class )
    private Instant blocktime; // see above

    public MultichainTransaction(
        @JsonProperty( value = "hex", required = true ) @Nonnull final String hex,
        @JsonProperty( value = "txid", required = true ) @Nonnull final String txid,
        @JsonProperty( value = "version", required = true ) @Nonnull final Integer version,
        @JsonProperty( value = "locktime", required = true ) @Nonnull final Integer locktime,
        @JsonProperty( "data" ) @Nullable final Object data,
        @JsonProperty( value = "vin", required = true ) @Nonnull final List vin,
        @JsonProperty( value = "vout", required = true ) @Nonnull final List vout,
        @JsonProperty( "blockhash" ) @Nullable final String blockhash,
        @JsonProperty( "confirmations" ) @Nullable final Integer confirmations,
        @JsonProperty( "time" ) @Nullable final Instant time,
        @JsonProperty( "blocktime" ) @Nullable final Instant blocktime )
    {
        this.hex = hex;
        this.txid = txid;
        this.version = version;
        this.locktime = locktime;
        this.data = data;
        this.vin = vin;
        this.vout = vout;
        this.blockhash = blockhash;
        this.confirmations = confirmations;
        this.time = time;
        this.blocktime = blocktime;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy