Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some queries do not work on cosmos-sdk > 0.50 chains #583

Open
freak12techno opened this issue Aug 23, 2024 · 2 comments
Open

Some queries do not work on cosmos-sdk > 0.50 chains #583

freak12techno opened this issue Aug 23, 2024 · 2 comments

Comments

@PFC-developer
Copy link

sorry for the lack of a PR

but the following will help with the account page

src/libs/client.ts

  async getTxsBySenderV50(sender: string, page?: PageRequest) {
    if(!page) page = new PageRequest()
    const query = `?order_by=2&query=message.sender='${sender}'&pagination.limit=${page.limit}&pagination.offset=${page.offset||0}`;
    return this.request(this.registry.tx_txs, {}, query);
  }

in src/modules/[chain]/account/[address].vue

line 28: const cosmosSdk =  blockchain.current?.versions.cosmosSdk||"unknown";

line 96

  if (cosmosSdk.startsWith("v0.5")) {
    blockchain.rpc.getTxsBySenderV50(address).then((x) => {
      txs.value = x.tx_responses;
    });
  } else {
    blockchain.rpc.getTxsBySender(address).then((x) => {
      txs.value = x.tx_responses;
    });
  }

line: 123

  if (cosmosSdk.startsWith("v0.5")) {
    const receivedQuery = `?&pagination.reverse=true&query=coin_received.receiver='${address}'&pagination.limit=5`;
    blockchain.rpc.getTxs(receivedQuery, {}).then((x) => {
      recentReceived.value = x.tx_responses;
    });
  } else {
    const receivedQuery = `?&pagination.reverse=true&events=coin_received.receiver='${address}'&pagination.limit=5`;
    blockchain.rpc.getTxs(receivedQuery, {}).then((x) => {
      recentReceived.value = x.tx_responses;
    });
  }
}

you can also do a similar thing in /src/modules/[chain]/staking/[validator].vue

@liangping
Copy link
Member

will fix it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants