I am trying to create an asset with the following code:
async sendCreateAsset(asset: any): Promise<any> {
let client = new algosdk.Algodv2(environment.algodApiToken, environment.testNetAddress, environment.port);
let suggestedParams = await client.getTransactionParams().do();
// MD5 Hash
let metadatahash = "16efaa3924a6fd9d3a4824799a4ac65d";
let addr = asset.creatorAddress;
let decimals = 0;
let note = algosdk.encodeObj(asset.description);
console.log("Generating transaction...");
let txn = algosdk.makeAssetCreateTxnWithSuggestedParams(
asset.creatorAddress,
note,
+asset.quantity,
+decimals,
false,
addr, addr, addr, addr,
asset.unitName,
asset.assetName,
asset.assetURL,
metadatahash,
suggestedParams
);
console.log("encoding transaction");
let encodedTxn = await AlgoSigner.encoding.msgpackToBase64(txn.toByte());
console.log(encodedTxn);
console.log("sign transaction");
await AlgoSigner.signTxn([
{
txn: encodedTxn
},
]);
}
I receive following error:
Thanks in advance.