When searching for newly created tokens using factory.on("PairCreated", async (token0, token1, addressPair)
is there any way to get the Txn Hash of each new pair to use in conjunction with .getTransactionReceipt
?
1 Answer
is there any way to get the Txn Hash of each new pair to use in conjunction with
.getTransactionReceipt
?
Yes, just use :
factory.on("PairCreated", async (token0, token1, addressPair, event) => {});
And you can read the tx hash in event.transactionHash
or call event.getTransactionReceipt
directly.