Hello,
I am trying to print all the tx hash of the success txs using uniswap router address. I have written a code but i am not getting any output. Code is not showing any errors.
can someone also please provide the CA of the uinswap router and check the code for me please.
Its a small code.
Apr 4, 2023, 1:26 PM
My code to look for pending tx and print the hash.
It is not giving any output.
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
is this the uniswap router address ?
is this the uniswap router address ?
eth mainnet
ok
not working still, control not flowing to first line of function also.
even the line 12 is not executing
why so ?
should I send my full code ? please check...
Apr 4, 2023, 1:42 PM
const subscription = web3.eth.subscribe('pendingTransactions', (err, res) => {
if (err) console.error(err);
});
subscription.on('data', (txHash) => {
setTimeout(async () => {
try {
let tx = await web3.eth.getTransaction(txHash);
if (tx && tx.to) {
if (tx.to.toLowerCase() === account) {
console.log('TX hash: ',txHash )
}
}
if (err) console.error(err);
});
subscription.on('data', (txHash) => {
setTimeout(async () => {
try {
let tx = await web3.eth.getTransaction(txHash);
if (tx && tx.to) {
if (tx.to.toLowerCase() === account) {
console.log('TX hash: ',txHash )
}
}
check this
Apr 4, 2023, 1:48 PM
okk
Apr 4, 2023, 1:48 PM