Class OmniPropertyInfo

java.lang.Object
foundation.omni.json.pojo.SmartPropertyListInfo
foundation.omni.json.pojo.OmniPropertyInfo

public class OmniPropertyInfo extends SmartPropertyListInfo
JSON bean representing the set of information on an Omni Property as returned by the omni_getproperty RPC method. It is a subclass of SmartPropertyListInfo because it is a superset of that information.
  • Constructor Details

    • OmniPropertyInfo

      public OmniPropertyInfo(CurrencyID propertyid, String name, String category, String subCategory, String data, String url, Boolean divisible, org.bitcoinj.base.Address issuer, org.bitcoinj.base.Sha256Hash creationTxId, boolean fixedIssuance, boolean managedIssuance, boolean freezingEnabled, String totaltokensString)
    • OmniPropertyInfo

      public OmniPropertyInfo(CurrencyID propertyid, String name, String category, String subCategory, String data, String url, Boolean divisible, org.bitcoinj.base.Address issuer, org.bitcoinj.base.Sha256Hash creationTxId, boolean fixedIssuance, boolean managedIssuance, boolean freezingEnabled, OmniValue totalTokens)
    • OmniPropertyInfo

      public OmniPropertyInfo(org.bitcoinj.base.BitcoinNetwork bitcoinNetwork, SmartPropertyListInfo sptListInfo)
      Construct OmniPropertyInfo from SmartPropertyListInfo Since there is no way to fetch OmniPropertyInfo for all properties with a single request, this converter can be used to create a OmniPropertyInfo from a SmartPropertyListInfo with default values for the extra fields. TODO: Address the fact that (in this case) we really don't have all the info and the default values we are using are potentially incorrect TODO: Figure out a way of efficiently getting OmniPropertyInfo for all properties.
      Parameters:
      sptListInfo - record to adapt
    • OmniPropertyInfo

      @Deprecated public OmniPropertyInfo(SmartPropertyListInfo sptListInfo)
      Produces OmniPropertyInfo with a MainNet default issuer Address. This can result in invalid Address exceptions when used on TestNet or RegTest. This constructor will be removed in the next release.
      Parameters:
      sptListInfo - record to adapt
  • Method Details

    • getIssuer

      public org.bitcoinj.base.Address getIssuer()
    • getCreationtxid

      public org.bitcoinj.base.Sha256Hash getCreationtxid()
    • isFixedissuance

      public boolean isFixedissuance()
    • isManagedissuance

      public boolean isManagedissuance()
    • isFreezingenabled

      public boolean isFreezingenabled()
    • getTotaltokens

      public OmniValue getTotaltokens()
    • mockBitcoinPropertyInfo

      public static OmniPropertyInfo mockBitcoinPropertyInfo(org.bitcoinj.base.BitcoinNetwork network)
      Return a mock OmniPropertyInfo for Bitcoin. Many of the fields are "n/a" and we give the final, total number of tokens, not the current, dynamic value. This is useful in cases where we need Bitcoin in the list of tokens, but don't have access to current Bitcoin data. OmniProxy is able to provide accurate, dynamic information so does not use this mock value.
      Returns:
      static (mock) info for Bitcoin
    • bitcoinPropertyInfo

      public static OmniPropertyInfo bitcoinPropertyInfo(org.bitcoinj.base.BitcoinNetwork network, org.bitcoinj.base.Coin bitcoinSupply)
      Return OmniPropertyInfo for Bitcoin. Many of the fields are "n/a" but we give current, dynamic count of bitcoins. This method is used by OmniProxy with the current count of coins from TxOutSetInfo.
      Returns:
      info for Bitcoin with current number of coins