Transferring NFT

Can we still use the following API to transfer NFT from one wallet to another wallet? Why the demo has no gas fee charge? So, it is free to transfer NFT?

https://v1docs.moralis.io/moralis-dapp/sending-assets/transfer-nfts

It is not a free transfer. Gas will be calculated at the wallet during the transfer.

This is not an web3 api endpoint, you can still use this with the v1 sdk.

1 Like

Thanks for your replying. We are developing a wallet app based on a iOS swift project. We cannot find any API for demo for transfering NFT by moralis platform. If we use V1 SDK, how we add gas price?

Option is add gas is not available with v1 sdk. You have to use web.js/ether.js directly for including gas related params.

1 Like

Where can I find documents or demos for web.js or ether.js? I checked this link, https://web3js.readthedocs.io/en/v1.7.0, but did not find any clue for transferring NFT. :sob:

Take a look at the solution from here for an example.

Since you want to interact with NFT smart contract, you need to do a web3 contract call. check this docs.
https://web3js.readthedocs.io/en/v1.2.0/web3-eth-contract.html

1 Like

I see the send method in the chapter of β€œweb3.eth.Contract” in web3js document. I will try this to implement transferring NFT. Thanks for your help. :handshake:

1 Like

but in send method, there is no to address parameter. How I specify which wallet this NFT should go to?

You can pass the contract function parameters using the .method
example:

contract.methods.functionName(
//function params go here
).send()

https://web3js.readthedocs.io/en/v1.2.0/web3-eth-contract.html#id12

you can take a look a the function ABI for the type of inputs which are accepted by the smart contract fucntion.