Search in sources :

Example 11 with AccountInfoQuery

use of com.hedera.hashgraph.sdk.AccountInfoQuery in project hedera-sdk-java by hashgraph.

the class GetAccountInfoExample method main.

public static void main(String[] args) throws PrecheckStatusException, TimeoutException {
    Client client = Client.forName(HEDERA_NETWORK);
    // Defaults the operator account ID and key such that all generated transactions will be paid for
    // by this account and be signed by this key
    client.setOperator(OPERATOR_ID, OPERATOR_KEY);
    AccountInfo info = new AccountInfoQuery().setAccountId(client.getOperatorAccountId()).setQueryPayment(new Hbar(1)).execute(client);
    System.out.println("info.key                          = " + info.key);
    System.out.println("info.isReceiverSignatureRequired  = " + info.isReceiverSignatureRequired);
    System.out.println("info.expirationTime               = " + info.expirationTime);
}
Also used : AccountInfoQuery(com.hedera.hashgraph.sdk.AccountInfoQuery) Hbar(com.hedera.hashgraph.sdk.Hbar) Client(com.hedera.hashgraph.sdk.Client) AccountInfo(com.hedera.hashgraph.sdk.AccountInfo)

Aggregations

AccountInfoQuery (com.hedera.hashgraph.sdk.AccountInfoQuery)11 Hbar (com.hedera.hashgraph.sdk.Hbar)11 DisplayName (org.junit.jupiter.api.DisplayName)8 Test (org.junit.jupiter.api.Test)8 AccountCreateTransaction (com.hedera.hashgraph.sdk.AccountCreateTransaction)7 AccountInfo (com.hedera.hashgraph.sdk.AccountInfo)3 AccountUpdateTransaction (com.hedera.hashgraph.sdk.AccountUpdateTransaction)3 Client (com.hedera.hashgraph.sdk.Client)3 TransferTransaction (com.hedera.hashgraph.sdk.TransferTransaction)3 AccountId (com.hedera.hashgraph.sdk.AccountId)2 PrivateKey (com.hedera.hashgraph.sdk.PrivateKey)2 Var (com.google.errorprone.annotations.Var)1 AccountBalance (com.hedera.hashgraph.sdk.AccountBalance)1 AccountBalanceQuery (com.hedera.hashgraph.sdk.AccountBalanceQuery)1 PublicKey (com.hedera.hashgraph.sdk.PublicKey)1 TokenCreateTransaction (com.hedera.hashgraph.sdk.TokenCreateTransaction)1 TokenDeleteTransaction (com.hedera.hashgraph.sdk.TokenDeleteTransaction)1 TransactionResponse (com.hedera.hashgraph.sdk.TransactionResponse)1