CosmJS 0.32 supports SDK 0.50

Simon Warta
CosmWasm
Published in
2 min readNov 23, 2023

Today we are happy to announce the latest release of CosmJS: 0.32.0. It brings support for Cosmos SDK 0.50 (Eden), among other improvements.

Foto von Julien Photo auf Unsplash

Telescope 1.0 and bigint

The npm packages @cosmjs/* version 0.32.0 upgraded their protobuf types to comjs-types 0.9.0. Those types are now generated using Telescope 1.0. This brings stronger type safety around non-nullable message fields, changes all usages of Long to bigint and removes the runtime dependency protobufjs. When upgrading CosmJS, please also upgrade comjs-types to 0.9.0 and adapt the codebase to use bigint. Shoutout to the entire Cosmology team for all the improvements to the code generation, which is critical for working with the Cosmos SDK.

Telescope code generation powers CosmJS

Timeout height for transactions

sign/signAndBroadcast/signAndBroadcastSync and related functions now have an additional parameter to specify the timeout height. After this height, a signed transaction will be considered invalid by the chain. This can be used to ensure your transaction is either committed in a reasonable time or will never be executed. Kudos to Jan from Skip for this addition!

MsgTransfer memo support

The SigningStargateClient.sendIbcTokens API already contains a transaction memo. Creating support for the MsgTransfer memo in the same API would be too convoluted. In order to give used access to the full functionality, the wrapper function sendIbcTokens was now deprecated. Better use signAndBroadcast together with a MsgTransferEncodeObject instead from now on.

CometBFT 0.38 support

The package @cosmjs/tendermint-rpc now has a new Comet38Client in addition to Tendermint34Client and Tendermint37Client , supporting chains running on Comet BFT 0.38. This is the version needed for Cosmos SDK 0.50 chains. The function connectComet does the auto-detection of the backend and returns a CometClient union type, which means any of the three available clients.

Cosmos SDK 0.50 support

Building on the CometBFT 0.38 auto-detection, we now test CosmJS against Cosmos SDK 0.50, and it works well overall. There are a few caveats we found, like rawLog fields is unset now (use events instead), and a few Amino JSON messages do not yet work. But overall, it is working without changes to in the application needed order than the CosmJS upgrade. Please note that support for new features is not yet included but existing functionality will just work.

Other notable changes

  • Amino JSON signing for MsgInstantiateContract2 was fixed
  • Numeric values in key/value pairs during txSearch were fixed
  • All gasWanted/gasUsed fields were changed from number to bigint

The full CHANGELOG is available here.

--

--