cosmjs icon indicating copy to clipboard operation
cosmjs copied to clipboard

Is there any way to Get transaction details using Transaction Hash in Cosmjs ?

Open SethiShivam opened this issue 4 years ago • 1 comments

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

SethiShivam avatar Oct 18 '21 22:10 SethiShivam

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)

cmwaters avatar Oct 30 '21 15:10 cmwaters