use of io.nem.sdk.model.namespace.NamespaceId in project nem2-sdk-java by nemtech.
the class MosaicDefinitionTransaction method create.
/**
* Create a mosaic creation transaction object.
*
* @param deadline The deadline to include the transaction.
* @param mosaicName The mosaic name ex: xem.
* @param namespaceName The namespace where mosaic will be included ex: nem.
* @param mosaicProperties The mosaic properties.
* @param networkType The network type.
* @return {@link MosaicDefinitionTransaction}
*/
public static MosaicDefinitionTransaction create(Deadline deadline, String mosaicName, String namespaceName, MosaicProperties mosaicProperties, NetworkType networkType) {
Validate.notNull(mosaicName, "MosaicName must not be null");
Validate.notNull(namespaceName, "NamespaceName must not be null");
return new MosaicDefinitionTransaction(networkType, 2, deadline, BigInteger.valueOf(0), mosaicName, new NamespaceId(namespaceName), new MosaicId(IdGenerator.generateMosaicId(namespaceName, mosaicName)), mosaicProperties);
}
use of io.nem.sdk.model.namespace.NamespaceId in project nem2-sdk-java by nemtech.
the class RegisterNamespaceTransaction method createSubNamespace.
/**
* Create a sub namespace object.
*
* @param deadline - The deadline to include the transaction.
* @param namespaceName - The namespace name.
* @param parentId - The parent id name.
* @param networkType - The network type.
* @return instance of RegisterNamespaceTransaction
*/
public static RegisterNamespaceTransaction createSubNamespace(Deadline deadline, String namespaceName, NamespaceId parentId, NetworkType networkType) {
Validate.notNull(namespaceName, "NamespaceName must not be null");
Validate.notNull(parentId, "ParentId must not be null");
return new RegisterNamespaceTransaction(networkType, 2, deadline, BigInteger.valueOf(0), namespaceName, new NamespaceId(IdGenerator.generateSubNamespaceIdFromParentId(parentId.getId(), namespaceName)), NamespaceType.SubNamespace, Optional.empty(), Optional.of(parentId));
}
use of io.nem.sdk.model.namespace.NamespaceId in project nem2-sdk-java by nemtech.
the class MosaicInfoTest method shouldReturnIsTransferableWhenLevyIsImmutable.
@Test
void shouldReturnIsTransferableWhenLevyIsImmutable() {
MosaicProperties mosaicProperties = new MosaicProperties(true, true, false, 3, BigInteger.valueOf(10));
MosaicInfo mosaicInfo = new MosaicInfo(true, 0, "5A3CD9B09CD1E8000159249B", new NamespaceId(new BigInteger("-8884663987180930485")), new MosaicId(new BigInteger("-3087871471161192663")), new BigInteger("100"), new BigInteger("0"), new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), mosaicProperties);
assertFalse(mosaicInfo.isLevyMutable());
}
use of io.nem.sdk.model.namespace.NamespaceId in project nem2-sdk-java by nemtech.
the class MosaicInfoTest method shouldReturnIsSupplyMutableWhenIsImmutable.
@Test
void shouldReturnIsSupplyMutableWhenIsImmutable() {
MosaicProperties mosaicProperties = new MosaicProperties(false, true, true, 3, BigInteger.valueOf(10));
MosaicInfo mosaicInfo = new MosaicInfo(true, 0, "5A3CD9B09CD1E8000159249B", new NamespaceId(new BigInteger("-8884663987180930485")), new MosaicId(new BigInteger("-3087871471161192663")), new BigInteger("100"), new BigInteger("0"), new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), mosaicProperties);
assertFalse(mosaicInfo.isSupplyMutable());
}
use of io.nem.sdk.model.namespace.NamespaceId in project nem2-sdk-java by nemtech.
the class MosaicInfoTest method shouldReturnIsTransferableWhenItsNotTransferable.
@Test
void shouldReturnIsTransferableWhenItsNotTransferable() {
MosaicProperties mosaicProperties = new MosaicProperties(true, false, true, 3, BigInteger.valueOf(10));
MosaicInfo mosaicInfo = new MosaicInfo(true, 0, "5A3CD9B09CD1E8000159249B", new NamespaceId(new BigInteger("-8884663987180930485")), new MosaicId(new BigInteger("-3087871471161192663")), new BigInteger("100"), new BigInteger("0"), new PublicAccount("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF", NetworkType.MIJIN_TEST), mosaicProperties);
assertFalse(mosaicInfo.isTransferable());
}
Aggregations