blockchainethereumdecentraland

Can I send an NFT (erc-721) to a wallet using only code?


Can I send an NFT (erc-721) from (Decentraland) to a wallet using only code (backend)?

I am using as a provider (infura) and as a library (ethers.js).

I would appreciate any additional suggestions to follow a path.


Solution

  • Yes, you can, but you will need to interact with a contract to transfer ERC721 token.

    Look here https://docs.openzeppelin.com/contracts/3.x/api/token/erc721

    at safeTransferFrom method. You can call this method from an account that has the NFT and it will transfer it to '_to' account.