Thank you so much @peterparker, both your suggestion were right!!
-
I wrongly assumed that the metadata tag was optional, when actually it is the metadata argument that is optional.
-
Reworking how to print the error allowed me to receive an error that was solved by adding “agent.fetchRootKey()”, see this post: Fail to verify certificate in development update calls
For people stumbling on this post, the final code looks like this:
api.mintNFT(({“to”: {“address” : “123456789123456789”}, “metadata”: })).then(res => {
console.log(“success”);
resolve(true);
}).catch(reject =>{
console.log(“The error is :”, reject);
});
Much gratitude for your help and the community!