use of com.hedera.hashgraph.sdk.TokenId in project hedera-mirror-node by hashgraph.
the class TokenFeature method burnNft.
@Given("I burn serial number {int} from token {int}")
public void burnNft(int serialNumberIndex, int tokenIndex) {
TokenId tokenId = tokenIds.get(tokenIndex);
networkTransactionResponse = tokenClient.burnNonFungible(tokenId, tokenSerialNumbers.get(tokenId).get(serialNumberIndex));
assertNotNull(networkTransactionResponse.getTransactionId());
assertNotNull(networkTransactionResponse.getReceipt());
}
use of com.hedera.hashgraph.sdk.TokenId 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;
}
use of com.hedera.hashgraph.sdk.TokenId 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;
}
use of com.hedera.hashgraph.sdk.TokenId in project hedera-mirror-node by hashgraph.
the class TokenFeature method verifyMirrorTokenWithCustomFeesSchedule.
@Then("the mirror node REST API should confirm token {int} with custom fees schedule")
@Retryable(value = { AssertionError.class }, backoff = @Backoff(delayExpression = "#{@restPollingProperties.minBackoff.toMillis()}"), maxAttemptsExpression = "#{@restPollingProperties.maxAttempts}")
public void verifyMirrorTokenWithCustomFeesSchedule(Integer tokenIndex) {
MirrorTransaction transaction = verifyTransactions(200);
TokenId tokenId = tokenIds.get(getIndexOrDefault(tokenIndex));
verifyTokenWithCustomFeesSchedule(tokenId, transaction.getConsensusTimestamp());
}
use of com.hedera.hashgraph.sdk.TokenId in project hedera-mirror-node by hashgraph.
the class TokenFeature method transferNftsToRecipient.
@Then("^I transfer serial number (?:(.*) )?of token (?:(.*) )?to recipient(?: (.*))?$")
public void transferNftsToRecipient(Integer serialNumberIndex, Integer tokenIndex, Integer recipientIndex) {
ExpandedAccountId payer = tokenClient.getSdkClient().getExpandedOperatorAccountId();
TokenId tokenId = tokenIds.get(getIndexOrDefault(tokenIndex));
transferNfts(tokenId, tokenSerialNumbers.get(tokenId).get(getIndexOrDefault(serialNumberIndex)), payer, recipients.get(getIndexOrDefault(recipientIndex)).getAccountId());
}
Aggregations