I am minting an NFT (using metadata) through the following function in smart contract:
function mintToken(string memory tokenURI)
public
payable
returns (uint256)
{
_tokenIds.increment();
uint256 newItemId=_tokenIds.current();
_mint(msg.sender,newItemId);
_setTokenURI(newItemId,tokenURI);
return newItemId;
}
In app side I am using moralis execute function i.e.
const options = {
chain: 'rinkeby',
contractAddress: 'deployed contract',
functionName: 'mintToken',
abi: this.contractABI,
params: {
tokenURI: this.metadata_URL,
},
};
let NFT_smart = await Moralis.executeFunction(options);
console.log('this is the minted nft');
console.log(NFT_smart);
But the response of the minted NFT doesnβt contain the token id of the NFT that is minted, and I need that id to perform various functions in the application after it is bein minted such as transfer the NFT.
How can I get the token Id from the minted NFT? Its a high priority task, any help would be appreciated. Thank you
This is the attached output