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