use of com.hedera.hashgraph.sdk.CustomFractionalFee in project hedera-sdk-java by hashgraph.
the class TokenCreateIntegrationTest method canCreateTokenWithCustomFees.
@Test
@DisplayName("Can create token with custom fees")
void canCreateTokenWithCustomFees() throws Exception {
var testEnv = new IntegrationTestEnv(1).useThrowawayAccount();
var customFees = new ArrayList<CustomFee>();
customFees.add(new CustomFixedFee().setAmount(10).setFeeCollectorAccountId(testEnv.operatorId));
customFees.add(new CustomFractionalFee().setNumerator(1).setDenominator(20).setMin(1).setMax(10).setFeeCollectorAccountId(testEnv.operatorId));
var tokenId = new TokenCreateTransaction().setTokenName("ffff").setTokenSymbol("F").setTreasuryAccountId(testEnv.operatorId).setAdminKey(testEnv.operatorKey).setCustomFees(customFees).execute(testEnv.client).getReceipt(testEnv.client).tokenId;
testEnv.close(tokenId);
}
Aggregations