[SOLVED] Using Moralis API Deployed Smart Contract Functions in JavaScript (no Node)

Hello, Dear Forum Members. I have this line:

var web3 = await Moralis.enableWeb3();
var mycontract = new web3.eth.Contract(abi, contract);
mycontract.methods.mintBatch(myWallet, fileNumber, fileAmount, '0x00').send({from: accounts[0], value: 15000000});

As you have already realized I am trying to call the mintBatch function. I am interested in what send is and where can I learn about it?
Also, how is the price assigned in this case β€œ15000000” what is it anyway. In short I need to understand what send is and how the value is calculated and what it is in general and I would also like to know what β€œvalue” is represented by - is it eth, gwei, or something else.

That code is using the web3.js library so you can read the web3.js docs for what send does as well as what value is.

Are you following a tutorial or where did you get this code from?

1 Like

Very cool that you responded so quickly. I got this code from the internet, because the person who used it had the same error as me in the code.

Thank you so much, you have helped me a lot. I was able to figure it out! You are awesome :slight_smile: