Search in sources :

Example 6 with NetworkTransactionResponse

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

the class FileClient method createFile.

public NetworkTransactionResponse createFile(byte[] content) {
    log.debug("Create new file");
    String memo = getMemo("Create file");
    FileCreateTransaction fileCreateTransaction = new FileCreateTransaction().setKeys(sdkClient.getExpandedOperatorAccountId().getPublicKey()).setContents(content).setFileMemo(memo).setTransactionMemo(memo);
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(fileCreateTransaction, KeyList.of(sdkClient.getExpandedOperatorAccountId().getPrivateKey()));
    FileId fileId = networkTransactionResponse.getReceipt().fileId;
    log.debug("Created new file {}", fileId);
    return networkTransactionResponse;
}
Also used : FileCreateTransaction(com.hedera.hashgraph.sdk.FileCreateTransaction) NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) FileId(com.hedera.hashgraph.sdk.FileId)

Example 7 with NetworkTransactionResponse

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

the class TokenClient method unpause.

public NetworkTransactionResponse unpause(TokenId tokenId) {
    log.debug("Unpausing token {}", tokenId);
    TokenUnpauseTransaction tokenUnpauseTransaction = new TokenUnpauseTransaction().setTokenId(tokenId).setMaxTransactionFee(sdkClient.getMaxTransactionFee()).setTransactionMemo(getMemo("Unpause token"));
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(tokenUnpauseTransaction);
    log.debug("Unpaused token {}", tokenId);
    return networkTransactionResponse;
}
Also used : TokenUnpauseTransaction(com.hedera.hashgraph.sdk.TokenUnpauseTransaction) NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse)

Example 8 with NetworkTransactionResponse

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

the class TokenClient method updateTokenTreasury.

public NetworkTransactionResponse updateTokenTreasury(TokenId tokenId, ExpandedAccountId newTreasuryId) {
    AccountId treasuryAccountId = newTreasuryId.getAccountId();
    String memo = getMemo("Update token");
    TokenUpdateTransaction tokenUpdateTransaction = new TokenUpdateTransaction().setTokenId(tokenId).setTokenMemo(memo).setTreasuryAccountId(treasuryAccountId).setTransactionMemo(memo);
    KeyList keyList = KeyList.of(newTreasuryId.getPrivateKey());
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(tokenUpdateTransaction, keyList);
    log.debug("Updated token {} treasury account {}.", tokenId, treasuryAccountId);
    return networkTransactionResponse;
}
Also used : AccountId(com.hedera.hashgraph.sdk.AccountId) ExpandedAccountId(com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId) NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) KeyList(com.hedera.hashgraph.sdk.KeyList) TokenUpdateTransaction(com.hedera.hashgraph.sdk.TokenUpdateTransaction)

Example 9 with NetworkTransactionResponse

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

the class TokenClient method burnNonFungible.

public NetworkTransactionResponse burnNonFungible(TokenId tokenId, long serialNumber) {
    log.debug("Burn serial number {} from token {}", serialNumber, tokenId);
    TokenBurnTransaction tokenBurnTransaction = getTokenBurnTransaction(tokenId).addSerial(serialNumber).setTransactionMemo(getMemo("Token burn"));
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(tokenBurnTransaction);
    log.debug("Burned serial number {} from token {}", serialNumber, tokenId);
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) TokenBurnTransaction(com.hedera.hashgraph.sdk.TokenBurnTransaction)

Example 10 with NetworkTransactionResponse

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

the class TokenClient method associate.

public NetworkTransactionResponse associate(ExpandedAccountId accountId, TokenId token) {
    log.debug("Associate account {} with token {}", accountId.getAccountId(), token);
    TokenAssociateTransaction tokenAssociateTransaction = new TokenAssociateTransaction().setAccountId(accountId.getAccountId()).setMaxTransactionFee(sdkClient.getMaxTransactionFee()).setTokenIds((List.of(token))).setTransactionMemo(getMemo("Associate w token"));
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(tokenAssociateTransaction, KeyList.of(accountId.getPrivateKey()));
    log.debug("Associated {} with token {}", accountId, token);
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) TokenAssociateTransaction(com.hedera.hashgraph.sdk.TokenAssociateTransaction)

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