Format when passing an argument to motoko function

Have you try to provide an empty array for the optional value?

api.mintNFT( {“to”: {“address” : “123456789123456789”, metadata: [] } } ).

According my tests and discussed here, I think that optional values becomes mandatory array values on the frontend side.

If still doesn’t work, if you wrap your code with a try catch you do not get any errors in the console of the browser?

try {
   api.mintNFT(.....
} catch (err) {
   console.error(err);
}
4 Likes