Search in sources :

Example 11 with NetworkTransactionResponse

use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.

the class TokenClient method updateTokenFeeSchedule.

public NetworkTransactionResponse updateTokenFeeSchedule(TokenId tokenId, ExpandedAccountId expandedAccountId, List<CustomFee> customFees) {
    TokenFeeScheduleUpdateTransaction transaction = new TokenFeeScheduleUpdateTransaction().setCustomFees(customFees).setMaxTransactionFee(sdkClient.getMaxTransactionFee()).setTokenId(tokenId).setTransactionMemo(getMemo("Update token fee schedule"));
    NetworkTransactionResponse response = executeTransactionAndRetrieveReceipt(transaction, KeyList.of(expandedAccountId.getPrivateKey()));
    log.debug("Updated custom fees schedule for token {}", tokenId);
    return response;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) TokenFeeScheduleUpdateTransaction(com.hedera.hashgraph.sdk.TokenFeeScheduleUpdateTransaction)

Example 12 with NetworkTransactionResponse

use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.

the class TokenClient method unfreeze.

public NetworkTransactionResponse unfreeze(TokenId tokenId, AccountId accountId) {
    TokenUnfreezeTransaction tokenUnfreezeTransaction = new TokenUnfreezeTransaction().setAccountId(accountId).setMaxTransactionFee(sdkClient.getMaxTransactionFee()).setTokenId(tokenId).setTransactionMemo(getMemo("Unfreeze token account"));
    NetworkTransactionResponse response = executeTransactionAndRetrieveReceipt(tokenUnfreezeTransaction);
    log.debug("Unfreeze account {} with token {}", accountId, tokenId);
    return response;
}
Also used : TokenUnfreezeTransaction(com.hedera.hashgraph.sdk.TokenUnfreezeTransaction) NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse)

Example 13 with NetworkTransactionResponse

use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.

the class TokenClient method burnFungible.

public NetworkTransactionResponse burnFungible(TokenId tokenId, long amount) {
    log.debug("Burn {} tokens from {}", amount, tokenId);
    TokenBurnTransaction tokenBurnTransaction = getTokenBurnTransaction(tokenId).setAmount(amount).setTransactionMemo(getMemo("Token burn"));
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(tokenBurnTransaction);
    log.debug("Burned {} extra tokens for token {}", amount, tokenId);
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) TokenBurnTransaction(com.hedera.hashgraph.sdk.TokenBurnTransaction)

Example 14 with NetworkTransactionResponse

use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.

the class TokenClient method wipeFungible.

public NetworkTransactionResponse wipeFungible(TokenId tokenId, long amount, ExpandedAccountId expandedAccountId) {
    log.debug("Wipe {} tokens from {}", amount, tokenId);
    TokenWipeTransaction transaction = getTokenWipeTransaction(tokenId, expandedAccountId).setAmount(amount);
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(transaction);
    log.debug("Wiped {} tokens from account {}", amount, expandedAccountId.getAccountId());
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) TokenWipeTransaction(com.hedera.hashgraph.sdk.TokenWipeTransaction)

Example 15 with NetworkTransactionResponse

use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.

the class TokenClient method grantKyc.

public NetworkTransactionResponse grantKyc(TokenId tokenId, AccountId accountId) {
    log.debug("Grant account {} with KYC for token {}", accountId, tokenId);
    TokenGrantKycTransaction tokenGrantKycTransaction = new TokenGrantKycTransaction().setAccountId(accountId).setTokenId(tokenId).setMaxTransactionFee(sdkClient.getMaxTransactionFee()).setTransactionMemo(getMemo("Grant kyc for token"));
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(tokenGrantKycTransaction);
    log.debug("Granted Kyc for account {} with token {}", accountId, tokenId);
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) TokenGrantKycTransaction(com.hedera.hashgraph.sdk.TokenGrantKycTransaction)

Aggregations

NetworkTransactionResponse (com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse)41 PublicKey (com.hedera.hashgraph.sdk.PublicKey)3 TopicId (com.hedera.hashgraph.sdk.TopicId)3 AccountId (com.hedera.hashgraph.sdk.AccountId)2 KeyList (com.hedera.hashgraph.sdk.KeyList)2 PrivateKey (com.hedera.hashgraph.sdk.PrivateKey)2 TokenBurnTransaction (com.hedera.hashgraph.sdk.TokenBurnTransaction)2 TokenCreateTransaction (com.hedera.hashgraph.sdk.TokenCreateTransaction)2 TokenId (com.hedera.hashgraph.sdk.TokenId)2 TokenUpdateTransaction (com.hedera.hashgraph.sdk.TokenUpdateTransaction)2 TokenWipeTransaction (com.hedera.hashgraph.sdk.TokenWipeTransaction)2 TopicMessageQuery (com.hedera.hashgraph.sdk.TopicMessageQuery)2 TransactionReceipt (com.hedera.hashgraph.sdk.TransactionReceipt)2 TransactionRecord (com.hedera.hashgraph.sdk.TransactionRecord)2 TransferTransaction (com.hedera.hashgraph.sdk.TransferTransaction)2 ExpandedAccountId (com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId)2 Given (io.cucumber.java.en.Given)2 AccountAllowanceApproveTransaction (com.hedera.hashgraph.sdk.AccountAllowanceApproveTransaction)1 AccountCreateTransaction (com.hedera.hashgraph.sdk.AccountCreateTransaction)1 ContractCreateTransaction (com.hedera.hashgraph.sdk.ContractCreateTransaction)1