Class ContractInfo

java.lang.Object
com.hedera.hashgraph.sdk.ContractInfo

public final class ContractInfo extends Object
Current information on the smart contract instance, including its balance.
  • Field Details

    • contractId

      public final ContractId contractId
      ID of the contract instance, in the format used in transactions.
    • accountId

      public final AccountId accountId
      ID of the cryptocurrency account owned by the contract instance, in the format used in transactions.
    • contractAccountId

      public final String contractAccountId
      ID of both the contract instance and the cryptocurrency account owned by the contract instance, in the format used by Solidity.
    • adminKey

      @Nullable public final Key adminKey
      The state of the instance and its fields can be modified arbitrarily if this key signs a transaction to modify it. If this is null, then such modifications are not possible, and there is no administrator that can override the normal operation of this smart contract instance. Note that if it is created with no admin keys, then there is no administrator to authorize changing the admin keys, so there can never be any admin keys for that instance.
    • expirationTime

      public final Instant expirationTime
      The current time at which this contract instance (and its account) is set to expire.
    • autoRenewPeriod

      public final Duration autoRenewPeriod
      The expiration time will extend every this many seconds. If there are insufficient funds, then it extends as long as possible. If the account is empty when it expires, then it is deleted.
    • autoRenewAccountId

      @Nullable public final AccountId autoRenewAccountId
      ID of the an account to charge for auto-renewal of this contract. If not set, or set to an account with zero hbar balance, the contract's own hbar balance will be used to cover auto-renewal fees.
    • storage

      public final long storage
      Number of bytes of storage being used by this instance (which affects the cost to extend the expiration time).
    • contractMemo

      public final String contractMemo
      The memo associated with the contract (max 100 bytes).
    • balance

      public final Hbar balance
      The current balance of the contract.
    • isDeleted

      public final boolean isDeleted
      Whether the contract has been deleted
    • tokenRelationships

      public final Map<TokenId,TokenRelationship> tokenRelationships
      The tokens associated to the contract
    • ledgerId

      public final LedgerId ledgerId
      The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs.
    • stakingInfo

      @Nullable public final StakingInfo stakingInfo
      Staking metadata for this account.
  • Method Details

    • fromProtobuf

      static ContractInfo fromProtobuf(ContractGetInfoResponse.ContractInfo contractInfo)
      Extract the contract from the protobuf.
      Parameters:
      contractInfo - the protobuf
      Returns:
      the contract object
    • fromBytes

      public static ContractInfo fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException
      Extract the contract from a byte array.
      Parameters:
      bytes - the byte array
      Returns:
      the extracted contract
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - when there is an issue with the protobuf
    • toProtobuf

      Build the protobuf.
      Returns:
      the protobuf representation
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toBytes

      public byte[] toBytes()
      Create a byte array representation.
      Returns:
      the byte array representation