cosmjs
cosmjs copied to clipboard
Is there any way to Get transaction details using Transaction Hash in Cosmjs ?
Hi Team ,
I am new to Cosmjs . I wanted to achieve a functionality where I can get Transaction details using Tx hash ,
I am able to do it using tendermint Rpc call ,
is there any method exist in Cosmjs which can help me to achieve this ?
(I am very new to Cosmjs)
Best Regards
You should be able to start a tendermint rpc client using the tendermint-rpc package. Something a bit like this:
import { Tendermint34Client } from '@cosmjs/tendermint-rpc'
const tmClient = await Tendermint34Client.connect("http://127.0.0.1:26657") // your rpc endpoint
const resp = await tmClient.tx({ hash: txHash})
console.log(resp.tx)