java.lang.Object
com.hedera.hashgraph.sdk.ContractInfo
Current information on the smart contract instance, including its balance.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AccountIdID of the cryptocurrency account owned by the contract instance, in the format used in transactions.final KeyThe state of the instance and its fields can be modified arbitrarily if this key signs a transaction to modify it.final AccountIdID of the an account to charge for auto-renewal of this contract.final DurationThe expiration time will extend every this many seconds.final HbarThe current balance of the contract.final StringID of both the contract instance and the cryptocurrency account owned by the contract instance, in the format used by Solidity.final ContractIdID of the contract instance, in the format used in transactions.final StringThe memo associated with the contract (max 100 bytes).final InstantThe current time at which this contract instance (and its account) is set to expire.final booleanWhether the contract has been deletedfinal LedgerIdThe ledger ID the response was returned from; please see HIP-198 for the network-specific IDs.final StakingInfoStaking metadata for this account.final longNumber of bytes of storage being used by this instance (which affects the cost to extend the expiration time).final Map<TokenId, TokenRelationship> The tokens associated to the contract -
Method Summary
Modifier and TypeMethodDescriptionstatic ContractInfofromBytes(byte[] bytes) Extract the contract from a byte array.(package private) static ContractInfofromProtobuf(ContractGetInfoResponse.ContractInfo contractInfo) Extract the contract from the protobuf.byte[]toBytes()Create a byte array representation.(package private) ContractGetInfoResponse.ContractInfoBuild the protobuf.toString()
-
Field Details
-
contractId
ID of the contract instance, in the format used in transactions. -
accountId
ID of the cryptocurrency account owned by the contract instance, in the format used in transactions. -
contractAccountId
ID of both the contract instance and the cryptocurrency account owned by the contract instance, in the format used by Solidity. -
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
The current time at which this contract instance (and its account) is set to expire. -
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
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 storageNumber of bytes of storage being used by this instance (which affects the cost to extend the expiration time). -
contractMemo
The memo associated with the contract (max 100 bytes). -
balance
The current balance of the contract. -
isDeleted
public final boolean isDeletedWhether the contract has been deleted -
tokenRelationships
The tokens associated to the contract -
ledgerId
The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs. -
stakingInfo
Staking metadata for this account.
-
-
Method Details
-
fromProtobuf
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
ContractGetInfoResponse.ContractInfo toProtobuf()Build the protobuf.- Returns:
- the protobuf representation
-
toString
-
toBytes
public byte[] toBytes()Create a byte array representation.- Returns:
- the byte array representation
-