[SOLVED] Transferring NFT not working

Hi, so I’m using the code in the Moralis docs to transfer an NFT but it’s not doing anything.

async function transfernft(){
        const options = {
           type: 'erc721',
           receiver: '0x1...',
           contract_address: '0xD...',
           token_id: 61
       let result = await Moralis.transfer(options);

I also have


I’m using vanilla JS, and everything works, MetaMask opens up asks for conformation for transaction, after a while I get the conformation that transaction is complete but the NFT is still in the wallet address where it was.

This is my first time using Moralis NFT transfer and I don’t know what am I doing wrong.
Could someone please guide me as where my mistake is?. Thank you.

Before calling the transfernft() function, make sure you’re on the proper network for the nft

Meaning mainnet and the wallet address that owns that NFT ?

Yes, the transfer should be called by the owner. If the nft is on mainnet, the connected wallet network too should be on mainnet.

Ok so I figure it out. I was using Ethereum mainnet while the NFT was on Polygon mainnet. So I changed chain and did the transfer and it transfer but I don’t see the NFT on the opensea account where it transfer to.

It may be hidden in the account which you need to check hidden tab.

ok so I got it, thank you for your help.