Error message:
{ code: 0, data: { timeStamp: 114514807, error: 'Internal Server Error', message: 'org.nem.core.serialization.SerializationException: java.lang.IllegalArgumentException: name does not match the desired pattern', status: 500 } }
our source code:
`
createMosaic : function(){
var privateKey = '7bfb69ab63df2a7ab4c690b206ddc4538dfae07e5cde4919dbe4ff385c6aff2a';
//var namespaceId = 'Brgy';
var mosaicName ='MoneyGram';
var initialSupply = 1000;
var divisibility = 2;
var transferable = true;
var supplyMutable = true;
var common = nem.model.objects.create('common')('', privateKey);
// Get a MosaicDefinitionCreationTransaction object
var tx = nem.model.objects.get("mosaicDefinitionTransaction");
// Define the mosaic
tx.mosaicName = mosaicName;
tx.namespaceParent = {
"fqn": "nanomoto"
};
tx.mosaicDescription = 'My mosaic';
// Set properties (see https://nemproject.github.io/#mosaicProperties)
tx.properties.initialSupply = initialSupply;
tx.properties.divisibility = divisibility;
tx.properties.transferable = transferable;
tx.properties.supplyMutable = supplyMutable;
tx.levy = {};
//console.log(tx);
// Prepare the transaction object
var transactionEntity = nem.model.transactions.prepare("mosaicDefinitionTransaction")(common, tx, nem.model.network.data.testnet.id);
console.log(transactionEntity);
nem.model.transactions.send(common, transactionEntity, endpoint).then(function(res){
console.log(res);
},
function(err){
console.log(err);
});
},`
Error message:
{ code: 0, data: { timeStamp: 114514807, error: 'Internal Server Error', message: 'org.nem.core.serialization.SerializationException: java.lang.IllegalArgumentException: name does not match the desired pattern', status: 500 } }
our source code: ` createMosaic : function(){ var privateKey = '7bfb69ab63df2a7ab4c690b206ddc4538dfae07e5cde4919dbe4ff385c6aff2a'; //var namespaceId = 'Brgy';
var mosaicName ='MoneyGram'; var initialSupply = 1000; var divisibility = 2; var transferable = true; var supplyMutable = true; var common = nem.model.objects.create('common')('', privateKey);
We follow the instruction here: https://github.com/QuantumMechanics/NEM-sdk/blob/master/examples/nodejs/createMosaic.js#L19