Abh*_*wat 6 blockchain ethereum web3js
我需要在以太坊中使用 web3js 计算连续交易的随机数,但getTransactionCount不返回待处理的交易。
有没有办法使用 web3js 获取所有交易,包括待处理和已完成的交易?如果不是web3js,还有其他方法吗?
您尝试过使用web3.eth.filter吗?
以下代码应该可以工作。(暂时无法测试自己)
var options = {
  fromBlock: "pending",
  toBlock: "latest",
  address: "0xabc123...",
}
web3.eth.filter(options, (error, result) => {
  if (!error)
    console.log(result);
});
| 归档时间: | 
 | 
| 查看次数: | 19951 次 | 
| 最近记录: |