Search in sources :

Example 31 with NetworkTransactionResponse

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

the class TokenClient method freeze.

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

Example 32 with NetworkTransactionResponse

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

the class TokenClient method createNonFungibleToken.

public NetworkTransactionResponse createNonFungibleToken(ExpandedAccountId expandedAccountId, String symbol, int freezeStatus, int kycStatus, ExpandedAccountId treasuryAccount, TokenSupplyType tokenSupplyType, long maxSupply, List<CustomFee> customFees) {
    log.debug("Create new non-fungible token {}", symbol);
    TokenCreateTransaction tokenCreateTransaction = getTokenCreateTransaction(expandedAccountId, symbol, freezeStatus, kycStatus, treasuryAccount, TokenType.NON_FUNGIBLE_UNIQUE, tokenSupplyType, maxSupply, customFees);
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(tokenCreateTransaction, KeyList.of(treasuryAccount.getPrivateKey()));
    TokenId tokenId = networkTransactionResponse.getReceipt().tokenId;
    log.debug("Created new non-fungible token {}", tokenId);
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) TokenCreateTransaction(com.hedera.hashgraph.sdk.TokenCreateTransaction) TokenId(com.hedera.hashgraph.sdk.TokenId)

Example 33 with NetworkTransactionResponse

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

the class TokenClient method pause.

public NetworkTransactionResponse pause(TokenId tokenId) {
    log.debug("Pausing token {}", tokenId);
    TokenPauseTransaction tokenPauseTransaction = new TokenPauseTransaction().setTokenId(tokenId).setMaxTransactionFee(sdkClient.getMaxTransactionFee()).setTransactionMemo(getMemo("Pause token"));
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(tokenPauseTransaction);
    log.debug("Paused token {}", tokenId);
    return networkTransactionResponse;
}
Also used : TokenPauseTransaction(com.hedera.hashgraph.sdk.TokenPauseTransaction) NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse)

Example 34 with NetworkTransactionResponse

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

the class TokenClient method createFungibleToken.

public NetworkTransactionResponse createFungibleToken(ExpandedAccountId expandedAccountId, String symbol, int freezeStatus, int kycStatus, ExpandedAccountId treasuryAccount, int initialSupply, TokenSupplyType tokenSupplyType, long maxSupply, List<CustomFee> customFees) {
    log.debug("Create new fungible token {}", symbol);
    TokenCreateTransaction tokenCreateTransaction = getTokenCreateTransaction(expandedAccountId, symbol, freezeStatus, kycStatus, treasuryAccount, TokenType.FUNGIBLE_COMMON, tokenSupplyType, maxSupply, customFees).setDecimals(10).setInitialSupply(initialSupply);
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(tokenCreateTransaction, KeyList.of(treasuryAccount.getPrivateKey()));
    TokenId tokenId = networkTransactionResponse.getReceipt().tokenId;
    log.debug("Created new fungible token {}", tokenId);
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) TokenCreateTransaction(com.hedera.hashgraph.sdk.TokenCreateTransaction) TokenId(com.hedera.hashgraph.sdk.TokenId)

Example 35 with NetworkTransactionResponse

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

the class TokenClient method delete.

public NetworkTransactionResponse delete(ExpandedAccountId accountId, TokenId token) {
    log.debug("Delete token {}", token);
    TokenDeleteTransaction tokenDissociateTransaction = new TokenDeleteTransaction().setTokenId(token).setMaxTransactionFee(sdkClient.getMaxTransactionFee()).setTransactionMemo(getMemo("Delete token"));
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(tokenDissociateTransaction, KeyList.of(accountId.getPrivateKey()));
    log.debug("Deleted token {}", token);
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) TokenDeleteTransaction(com.hedera.hashgraph.sdk.TokenDeleteTransaction)

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