【发布时间】:2022-07-09 05:46:41
【问题描述】:
我正在使用 React 构建我的 NFT Minting DApp 的前端。
我试图在创建事务后在控制台中打印 etherscan/hash 的 URL,但我在事务开始时得到了日志,因此它在 etherscan 中不可用。
我检查了其他网站,但没有一个足够确定。
铸币过程完成后如何获得交易收据?
try {
ethereum
.request({
method: "eth_sendTransaction",
params: [tx],
})
.then(
async (result) =>
{
let nftTxn = await nftContract.safeMint;
console.log("Minting... please wait");
web3.eth.getTransactionReceipt(result)
.then(console.log(`Mined, see transaction: https://ropsten.etherscan.io/tx/${result}`));
}
)
【问题讨论】:
-
我的所有代码都在:github
标签: reactjs blockchain ethereum web3js