如何接收待处理交易哈希



当用户发送合约方法时,我需要获取挂起的tx哈希以向用户显示此哈希。如何实现这一点?

await contract.methods.deposit().send({ from: this.props.accounts[0], value:amount})

我找到了解决方案

    myContract.methods.myMethod(123).send({from: 
   '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe'})
    .on('transactionHash', (hash) => {
        ...
    })

最新更新