The contract has a function:
function purchaseTokens() external payable {
require(msg.value>0);
...etceteras...
}
What I need is an app.js part, something that would look like this (lets say I want to hard-code 12 wei for a deposit):
purchaseTokens : function (){
App.contracts.name_of_contract.deployed().then(async function(instance){
let message = await instance.purchaseTokens.call('12');
App.showMessage(message);
}).catch((err) =>{
App.showError(err);
})
},
However, the js function returns: TypeError: Cannot read property 'toString' of null.
What should I do for the app.js part ?