Class OmniTransactionInfo

java.lang.Object
foundation.omni.json.pojo.OmniTransactionInfo

public class OmniTransactionInfo extends Object
(Mostly) Immutable representation of OmniTransaction info JSON

It is not fully-immutable because of addOtherInfo(String, Object) which should only be used by Jackson when deserializing. In the future we might use subclasses and polymorphism to define the properties for each type of Omni transaction.

This is returned by OmniClient.omniGetTransaction(Sha256Hash), OmniClient.omniListTransactions(), and OmniClient.omniListTransactions().

  • Constructor Details

    • OmniTransactionInfo

      public OmniTransactionInfo(org.bitcoinj.base.Sha256Hash txId, org.bitcoinj.base.Address sendingAddress, org.bitcoinj.base.Address referenceAddress, boolean isMine, int confirmations, String fee, long blockTime, boolean valid, int positionInBlock, int version, int typeInt, String type, OmniValue amount, OmniValue totalAmount, boolean divisible, CurrencyID propertyId, org.bitcoinj.base.Sha256Hash blockHash, int block, CurrencyID propertyIdForSale, CurrencyID propertyIdDesired)
  • Method Details

    • addOtherInfo

      public void addOtherInfo(String propertyKey, Object value)
    • getOtherInfo

      public Map<String,Object> getOtherInfo()
    • getTxId

      public org.bitcoinj.base.Sha256Hash getTxId()
    • getSendingAddress

      public org.bitcoinj.base.Address getSendingAddress()
    • getReferenceAddress

      public org.bitcoinj.base.Address getReferenceAddress()
    • isMine

      public boolean isMine()
    • getConfirmations

      public int getConfirmations()
    • getFee

      public org.bitcoinj.base.Coin getFee()
    • getBlockTime

      public Instant getBlockTime()
    • isValid

      public boolean isValid()
    • getPositionInBlock

      public int getPositionInBlock()
    • getVersion

      public int getVersion()
    • getTypeInt

      public int getTypeInt()
    • getType

      public String getType()
    • transactionType

      public Optional<Transactions.TransactionType> transactionType()
      Get the transaction type as an Optional Transactions.TransactionType or as an Optional.empty() if it's a transaction type not (yet) included in Transactions.TransactionType.
      Returns:
      The type or Optional.empty() if it's an unknown type
    • getAmount

      public OmniValue getAmount()
    • getTotalAmount

      public OmniValue getTotalAmount()
    • isDivisible

      public boolean isDivisible()
    • getPropertyId

      public CurrencyID getPropertyId()
    • getBlockHash

      public org.bitcoinj.base.Sha256Hash getBlockHash()
    • getBlock

      public int getBlock()
    • getPropertyIdForSale

      public CurrencyID getPropertyIdForSale()
    • getPropertyIdDesired

      public CurrencyID getPropertyIdDesired()