npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hackbg/cosmjs-esm

v1.0.0-rc.45

Published

Cosmos/CosmWasm SDKs as a monolithic ESM package

Downloads

208

Readme

Fadroma CosmJS-ESM

This library powers @fadroma/cw, the generic Cosmos client library that is part of @hackbg/fadroma, the portable full-stack groundwork for decentralized applications.

It is maintained by Hack.bg. Contact us at hello at hack dot bg if you need a hand with CosmWasm development!

About this package

This package contains a fork of cosmos/cosmjs and confio/cosmjs-types.

It is distributed as a Derivative Work under the Apache License 2.0, and differs from @cosmjs/stargate in the following ways:

  • All of the packages from the @cosmjs/ namespace, as well as the cosmjs-types library, are unified into a single package, @hackbg/cosmjs-esm.

  • Versioning is planned to start from 1.0.0 once a project depending on this library reaches production. SemVer will be applied, and breaking changes to the API will be tracked rigorously.

  • As the name suggests, this is an ESM-first package. Any CommonJS vestiges are removed. See @hackbg/ubik if you would like to try a modern VanillaJS workflow based on browsers' native support for ES Modules and Import Maps.

  • All type imports are now correctly marked as import type, and directories now have index files. This way, you don't have to rely on backwards compatibility solutions that paper over some of the unacknowled pitfalls of TypeScript.

Example query

The @fadroma/cw package implements the Fadroma Agent API, which provides easy access for the bank and compute modules, and enables easy deployment of smart contracts.

For chain features that are currently not covered by the Agent API, you can use the following approach:

import { CWConnection, CosmJS } from '@fadroma/cw'

const Staking = CosmJS.Proto.Cosmos.Staking.v1beta1;

const client = await new CWConnection({
  url: '...' // RPC URL
  chainId: '...',
}).qClient

const { value } = await client.queryAbci(
  '/cosmos.staking.v1beta1.Query/Validator',
  Staking.Query.QueryValidatorRequest.encode({
    validatorAddr: address
  }).finish()
)

const result = Staking.Query.QueryValidatorResponse.decode(
  value
)