1.0.0-rc.45 • Published 2 months ago

@hackbg/cosmjs-esm v1.0.0-rc.45

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
2 months ago

Fadroma CosmJS-ESM

npm.io

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
)
1.0.0-rc.45

2 months ago

1.0.0-rc.44

2 months ago

1.0.0-rc.42

2 months ago

1.0.0-rc.41

2 months ago

1.0.0-rc.40

2 months ago

1.0.0-rc.43

2 months ago

1.0.0-rc.39

2 months ago

1.0.0-rc.38

2 months ago

1.0.0-rc.35

2 months ago

1.0.0-rc.36

2 months ago

1.0.0-rc.34

3 months ago

1.0.0-rc.33

6 months ago

1.0.0-rc.32

7 months ago

1.0.0-rc.31

7 months ago

1.0.0-rc.30

7 months ago

1.0.0-rc.29

7 months ago

1.0.0-rc.28

7 months ago

1.0.0-rc.27

7 months ago

1.0.0-rc.26

7 months ago

1.0.0-rc.25

7 months ago

1.0.0-rc.24

7 months ago

1.0.0-rc.23

7 months ago

1.0.0-rc.22

7 months ago

1.0.0-rc.21

8 months ago

1.0.0-rc.20

8 months ago

1.0.0-rc.19

8 months ago

1.0.0-rc.18

8 months ago

1.0.0-rc.17

8 months ago

1.0.0-rc.16

8 months ago

1.0.0-rc.15

8 months ago

1.0.0-rc.14

8 months ago

1.0.0-rc.12

8 months ago

1.0.0-rc.11

8 months ago

1.0.0-rc.10

8 months ago

1.0.0-rc.9

8 months ago

1.0.0-rc.8

8 months ago

1.0.0-rc.7

8 months ago

1.0.0-rc.6

8 months ago

1.0.0-rc.5

8 months ago

1.0.0-rc.4

8 months ago

1.0.0-rc.3

8 months ago

1.0.0-rc.2

8 months ago