我有一个运行良好的 Metamask 付款。它由按钮的 onClick 触发。我想在交易挂起期间向用户展示一些东西,但我不知道如何因为返回的承诺已经是挖掘的交易。这是代码:
web3js.eth.sendTransaction({
to: '0x6Dc8956E655Ccd80187265107b848D8c5B6d2459',
from: address,
})
.then(function (txHash) {
console.log(txHash);
}).catch(error => {
console.log(error);
});
})