掃二維碼與項目經理溝通
我們在微信上24小時期待你的聲音
解答本文疑問/技術咨詢/運營咨詢/技術建議/互聯(lián)網交流
要轉移 ERC721 代幣,請執(zhí)行以下步驟:

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 && }
);
};要轉移 ERC1155 代幣,請按以下步驟操作:
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 && }
);
};?Moralis.transfer()? 執(zhí)行后返回交易響應。

我們在微信上24小時期待你的聲音
解答本文疑問/技術咨詢/運營咨詢/技術建議/互聯(lián)網交流