Genrate and Mint NFT

Hello guys,

I am following a moralis tutorial to generate and mint nft, and they have this minting function, but its not moralis call, is there alternative function for this function in moralis.

async function mintToken(_uri){
const encodedFunction = web3.eth.abi.encodeFunctionCall({
name: ā€œmintTokenā€,
type: ā€œfunctionā€,
inputs: [{
type: ā€˜stringā€™,
name: ā€˜tokenURIā€™
}]
}, [_uri]);

const transactionParameters = {
to: nft_contract_address,
from: ethereum.selectedAddress,
data: encodedFunction
};
const txt = await ethereum.request({
method: ā€˜eth_sendTransactionā€™,
params: [transactionParameters]
});
return txt
}

Thanks in Advance.

you can try to use Moralis.executeFunction: https://docs.moralis.io/moralis-server/web3/web3#executefunction

can you give an example how exactly to use this executeFunction, for example what parameters I should use from the passed object in mintToken(uri(<-this one)) function, and where exactly and what to pass from the uri object to the ABI