question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Function `getAccount` in SigningCosmWasmClient doesn't work properly

See original GitHub issue

Function getAccount in SigningCosmWasmClient doesn’t work properly. Seems like js expects Account instead of BaseAccount Response from the node with cosmos-sdk v0.41.0 { height: '1497', result: { type: 'cosmos-sdk/BaseAccount', value: { address: 'darc1rzdt9wrzwv3x7vv6f7xpyaqqgf3lt6phptqtsx', public_key: [Object], sequence: '2' } } } And code expects cosmos-sdk/Account if (responseData.result.type !== "cosmos-sdk/Account") { throw new Error("Unexpected response data format"); }

Node versions: github.com/cosmos/cosmos-sdk v0.41.0 github.com/CosmWasm/wasmvm v0.13.0

JS package 0.24.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
webmaster128commented, Mar 11, 2021

This is a duplicate of https://github.com/cosmos/cosmjs/issues/537.

The problem here is that the Cosmo SDK broke their promise to provide a compatible LCD API by changing the type identifier of the account from Launchpad to Stargate. I suspect cosmos-sdk/Account is an interface and cosmos-sdk/BaseAccount is an implementation of that interface.

You are using @cosmjs/launchpad, right? I think the way forward would be to migrate to the @cosmjs/stargate package, that provides similar functionality. @cosmjs/stargate does not use the LCD API anymore. Instead it connects to Tendermint RPC. See https://gist.github.com/webmaster128/8444d42a7eceeda2544c8a59fbd7e1d9 for some starting points.

0reactions
webmaster128commented, Jun 16, 2022

Is there any solution with keeping using @cosmjs/launchpad?

Nope. @cosmjs/launchpad never supported connecting to a Cosmos SDK 0.40+ backend. If it worked for some things, it was luck. But it is known to be incompatible because Cosmos SDK changed the account structure in 0.40 (Stargate).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contract Semantics | CosmWasm Documentation
In the Cosmos SDK, a transaction returns a number of events to the user, along with an optional data "result". This result is...
Read more >
CosmWasmClient Part 2: Writing - Medium
In the first part of this duology, we saw how to use the class CosmWasmClient from CosmWasm JS for reading data from a...
Read more >
CosmWasm for Developers - Cosmos Blog
CosmWasm is a new smart contracting platform built for the cosmos ecosystem. ... (it definitely takes more work to get your first sample...
Read more >
CosmWasm/CosmJS: from zero to hero - YouTube
Description:Presenters: Orkun Külçe, Dev relations engineerAbel Fernández Nandín, Frontend engineer CosmWasm is a new smart contracting ...
Read more >
Unable to verify leaf signature - Stack Overflow
Note: the following is dangerous, and will allow API content to be intercepted and modified between the client and the server. This also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found