【发布时间】:2021-06-25 03:20:48
【问题描述】:
我在这里使用 etherscan-api: (https://sebs.github.io/etherscan-api/#txlist) 来获取用户的交易列表(给定公钥),并且我只获得已清算交易的列表,即使在 etherscan.io 上我也可以看到所有待处理交易,因此信息“存在”。深入研究https://github.com/sebs/etherscan-api/blob/master/lib/account.js#L122 的源代码,我发现没有任何迹象表明我可以在哪里找到待处理的交易。代码如下:
const etherscan = require('etherscan-api').init(ETHERSCAN_TOKEN, 'ropsten', '3000');
etherscan.account
.txlist(public_key, 1, 'latest', 1, 100, 'asc')
.then(res => {
console.log("tx_list: ", res.result)
})
// get num of transactions
etherscan.proxy
.eth_getTransactionCount(public_key, 'latest')
.then(res => {
let count = res.result
console.log("eth_getTransactionCount: ", parseInt(count))
})
【问题讨论】:
标签: ethereum web3 web3js metamask etherscan