com.sap.cloud.sdk.services.blockchain.multichain.model.MultichainTransaction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of blockchain Show documentation
Show all versions of blockchain Show documentation
Service integration of blockchain functionality (Beta release, still subject to change - up to discontinuation of module).
/*
* 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;
}
}