🖼️Transfer NFTs

Transfer NFTs on any blockchain - ETH (Ethereum), BNB (Binance Smart Chain), MATIC (Polygon)

Transfer ERC721 Tokens (Non-Fungible)

To transfer ERC721 tokens, follow the steps:

  1. Construct anoptionsobject and set

    1. type:"erc721"

    2. receiver: "0x000..." //wallet address

    3. contractAddress: "0x..." //contract of the ERC721 token

    4. tokenId: 1

  2. Call the Moralis transfer function as shown below

As it's only possible to transfer one ERC721 at a time, no amountisneeded.

// sending a token with token id = 1
const options = {
  type: "erc721",
  receiver: "0x..",
  contractAddress: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  tokenId: 1,
};
let transaction = await Moralis.transfer(options);

Transferring ERC1155 Tokens (Semi-Fungible)

To transfer ERC1155 tokens, follow the steps:

  1. Construct anoptionsobject and set

    1. type:"erc721"

    2. receiver: "0x000..." //wallet address

    3. contractAddress: "0x..." //contract of the ERC721 token

    4. tokenId: 1

    5. amount: 15 //number of tokens to transfer

  2. Call the Moralis transfer function as shown below

// sending 15 tokens with token id = 1
const options = {
  type: "erc1155",
  receiver: "0x..",
  contractAddress: "0x..",
  tokenId: 1,
  amount: 15,
};
let transaction = await Moralis.transfer(options);

Resolving the results

Moralis.transfer() returns a transaction response after it is executed. The below page shows how to consume the data returned.

🤝pageResolve Transfer

Last updated