cosmjs icon indicating copy to clipboard operation
cosmjs copied to clipboard

Find all transactions from given contract

Open CodeWithMichal opened this issue 2 years ago • 0 comments

Hi,

I am trying to get all transactions from contract, something what in my opinion is very basic stuff, but I am struggling with this and cant find any information how to do it. Thats my code:

import { CosmWasmClient} from 'cosmwasm';

const contract = ".....";
const rpcEndpoint = "...";

const client = await CosmWasmClient.connect(rpcEndpoint);
const transactions = await client.searchTx({tags: [{key:"message.contract_address", value: contract}]})

I am getting 0 results. What am I doing wrong here? This "message.contract_address" is something I found in github but clearly doesnt work. Also, where can I find some examples with tags query? How can I know what to put in tag?

Best regards, Michał

CodeWithMichal avatar Aug 20 '22 20:08 CodeWithMichal