syntax = "proto3";

package proto;

option java_package = "com.hederahashgraph.api.proto.java";
option java_multiple_files = true;

import "Timestamp.proto";
import "Duration.proto";
import "BasicTypes.proto";
import "QueryHeader.proto";
import "ResponseHeader.proto";
import "CryptoAddClaim.proto";

/* Get all the information about an account, including the balance. This does not get the list of account records. */
message CryptoGetInfoQuery {
    QueryHeader header = 1; // standard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither).
    AccountID accountID = 2; // the account for which information is requested
}

/* Response when the client sends the node CryptoGetInfoQuery */
message CryptoGetInfoResponse {
    ResponseHeader header = 1; //standard response from node to client, including the requested fields: cost, or state proof, or both, or neither

    message AccountInfo {
        AccountID accountID = 1; // the account for which this information applies
        string contractAccountID = 2; // ID of both the contract instance and the cryptocurrency account owned by the contract instance, in the format used by Solidity
        bool deleted = 3; // if true, then this account has been deleted, it will disappear when it expires, and all transactions for it will fail except the transaction to extend its expiration date
        AccountID proxyAccountID = 4; // ID of the account to which this account is proxy staked. If proxyAccountID is null, or is an invalid account, or is an account that isn't a node, then this account is automatically proxy staked to a node chosen by the network, but without earning payments. If the proxyAccountID account refuses to accept proxy staking at the given fraction, or if it is not currently running a node, then it will behave as if both proxyAccountID and proxyFraction were null.
        int32 proxyFraction = 5; // payments earned from proxy staking are shared between the node and this account, with proxyFraction / 10000 going to this account
        int64 proxyReceived = 6; // total number of tinybars proxy staked to this account
        Key key = 7; // the key for the account, which must sign in order to transfer out, or to modify the account in any way other than extending its expiration date.
        uint64 balance = 8; // the current number of tinybars in the account
        uint64 generateSendRecordThreshold = 9; // account records will be created (and this account charged for them) for any transaction withdrawing more than this many tinybars
        uint64 generateReceiveRecordThreshold = 10; // account records will be created (and this account charged for them) for any transaction depositing more than this many tinybars
        bool receiverSigRequired = 11; // if true, no transaction can transfer to this account unless signed by this account's key
        Timestamp expirationTime = 12; // the current time at which this account is set to expire
        Duration autoRenewPeriod = 13; // the expiration time will extend every this many seconds. If there are insufficient funds, then it extends as long as possible. If it is empty when it expires, then it is deleted.
        repeated Claim claims = 14; // all of the claims attached to the account (each of which is a hash along with the keys that authorized it and can delete it )
    }
    AccountInfo accountInfo = 2; // info about the account (a state proof can be generated for this)
}
