日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Moralis教程:Moralis轉(zhuǎn)移NFTs

轉(zhuǎn)移 ERC721 代幣(不可替代)

要轉(zhuǎn)移 ERC721 代幣,請執(zhí)行以下步驟:

  1. 構(gòu)造一個options對象并設(shè)置:
    1. type:“erc721”
    2. receiver: "0x000..." //錢包地址
    3. contractAddress: "0x..." //ERC721 代幣的合約
    4. tokenId:1
  2. 調(diào)用 Moralis 傳遞函數(shù)如下圖,你可以使用?JS?或者?React?
// sending a token with token id = 1
const options = {
  type: "erc721",
  receiver: "0x..",
  contractAddress: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  tokenId: 1,
};
let transaction = await Moralis.transfer(options);
import React from "react";
import { useWeb3Transfer } from "react-moralis";

const TransferNFT = () => {
  const { fetch, error, isFetching } = useWeb3Transfer({
    type: "erc721",
    receiver: "0x..",
    contractAddress: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    tokenId: 1,
  });

  return (
    // Use your custom error component to show errors
    
{error && }
); };

轉(zhuǎn)移 ERC1155 代幣(半同質(zhì)化)

要轉(zhuǎn)移 ERC1155 代幣,請按以下步驟操作:

  1. 構(gòu)造一個options對象并設(shè)置:
    1. type:“erc721”
    2. receiver: "0x000..." //錢包地址
    3. contractAddress: "0x..." //ERC721 代幣的合約
    4. tokenId:1
    5. amount: 15 //要轉(zhuǎn)賬的代幣數(shù)量
  2. 調(diào)用 Moralis 傳遞函數(shù)如下圖,你可以使用?JS?或者?React?
// 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);
import React from "react";
import { useWeb3Transfer } from "react-moralis";

const TransferNFT = () => {
  const { fetch, error, isFetching } = useWeb3Transfer({
    type: "erc1155",
    receiver: "0x..",
    contractAddress: "0x..",
    tokenId: 1,
    amount: 15,
  });

  return (
    // Use your custom error component to show errors
    
{error && }
); };

解決結(jié)果

?Moralis.transfer()? 執(zhí)行后返回交易響應(yīng)。


分享文章:創(chuàng)新互聯(lián)Moralis教程:Moralis轉(zhuǎn)移NFTs
路徑分享:http://www.5511xx.com/article/dpohsgg.html