getTokenAllowence throwing invalid parameters

I am trying get token allowence on a NFT Token for transfer,

await Moralis.Web3API.token.getTokenAllowance({
        owner_address: account,
        spender_address: '0xAc2A4fC4A8Fba6db202963AF6B87e0b73191BDFe',
        address: address (NFT token address)
})

image

In particular this function may work only with ERC20 tokens and not also for NFTs

can you try with an ERC20 address instead of an NFT token address?

I want to get transfer approval for NFT how will I be able to do that with Moralis and I don’t want to directly transfer NFT it will be handled by the smart contract ( safetransfer )

you can use executeFunction for the transfer and you can use executeFunction or runContractFunction to check the approval (you will need the ABI)

https://docs.moralis.io/moralis-server/web3-sdk/native#runcontractfunction

It would be great if it was mentioned in documentation

I want to get the approval for transfer from user side before the smart contract function runs.

you can use executeFunction for that, in order to make an approval it requires to do a transaction

Got it thank you thank you