# cosmwasm

> A wrapper package for all relevant cosmjs packages.

Latest version **1.1.1** (published 2022-04-11) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install cosmwasm
pnpm add cosmwasm
yarn add cosmwasm
bun add cosmwasm
```

Provides the command `cosmwasm`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2022-04-11 |
| First published | 2022-02-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 17.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | webmaster128, milan96 |

## Links

- npm: https://www.npmjs.com/package/cosmwasm
- Repository: https://github.com/CosmWasm/CosmWasmJS
- Homepage: https://github.com/CosmWasm/CosmWasmJS#readme
- Issues: https://github.com/CosmWasm/CosmWasmJS/issues
- npm.io page: https://npm.io/package/cosmwasm

## Dependencies (11)

- [@cosmjs/cli](https://npm.io/package/@cosmjs/cli.md) ^0.28.3
- [@cosmjs/math](https://npm.io/package/@cosmjs/math.md) ^0.28.3
- [@cosmjs/amino](https://npm.io/package/@cosmjs/amino.md) ^0.28.3
- [@cosmjs/utils](https://npm.io/package/@cosmjs/utils.md) ^0.28.3
- [@cosmjs/crypto](https://npm.io/package/@cosmjs/crypto.md) ^0.28.3
- [@cosmjs/encoding](https://npm.io/package/@cosmjs/encoding.md) ^0.28.3
- [@cosmjs/stargate](https://npm.io/package/@cosmjs/stargate.md) ^0.28.3
- [@cosmjs/ledger-amino](https://npm.io/package/@cosmjs/ledger-amino.md) ^0.28.3
- [@cosmjs/faucet-client](https://npm.io/package/@cosmjs/faucet-client.md) ^0.28.3
- [@cosmjs/proto-signing](https://npm.io/package/@cosmjs/proto-signing.md) ^0.28.3
- [@cosmjs/cosmwasm-stargate](https://npm.io/package/@cosmjs/cosmwasm-stargate.md) ^0.28.3

## Recent versions

- 1.1.1 (latest) — 2022-04-11
- 1.1.0 — 2022-03-16
- 1.0.3 — 2022-03-08
- 1.0.2 — 2022-03-03
- 1.0.1 — 2022-03-03
- 1.0.0 — 2022-03-03
- 0.27.1-1 — 2022-02-09
- 0.27.1-0 — 2022-02-09
- 0.27.1 — 2022-02-08
- 0.0.1 — 2022-02-08

## README

<h1><p align="center"><img alt="CosmJS" src="docs/logo.png" width="180" /></p></h1>

<div align="center">
  <a href="https://www.npmjs.com/package/cosmwasm"><img alt="npm" src="https://img.shields.io/npm/v/cosmwasm.svg"/></a>
</div>

## About

Cosmwasm.js was created to help new developers get started with their first
dApps. It is just a wrapper package to easily import needed features from
CosmJS.

## Get started

### Installation

**NPM**

`npm install cosmwasm`

**Yarn**

`yarn add cosmwasm`

## Usage

### Get a read-only cosmwasm client

```ts
import { CosmWasmClient } from "cosmwasm";

// This is your rpc endpoint
const rpcEndpoint = "https://rpc.cliffnet.cosmwasm.com:443/";

async function main() {
  const client = await CosmWasmClient.connect(rpcEndpoint);
  console.log(client);
}

main();
```

### Create a wallet and a signing stargate client

```ts
import { SigningCosmWasmClient, Secp256k1HdWallet } from "cosmwasm";

// This is your rpc endpoint
const rpcEndpoint = "https://rpc.cliffnet.cosmwasm.com:443/";

// Using a random generated mnemonic
const mnemonic =
  "rifle same bitter control garage duck grab spare mountain doctor rubber cook";

async function main() {
  // Create a wallet
  const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic);

  // Using
  const client = await SigningCosmWasmClient.connectWithSigner(
    rpcEndpoint,
    wallet,
  );
  console.log(client);
}

main();
```

### Connect with keplr and get a signing starget client

```ts
import { setupWebKeplr } from "cosmwasm";

const config = {
  chainId: "cliffnet-1",
  rpcEndpoint: "https://rpc.cliffnet.cosmwasm.com:443/",
  prefix: "wasm",
};

async function main() {
  const client = await setupWebKeplr(config);
  console.log(client);
}

main();
```

### Interacting with contracts

```ts
import { CosmWasmClient } from "cosmwasm";

// This is your rpc endpoint
const rpcEndpoint = "https://rpc.cliffnet.cosmwasm.com:443/";

// This is your contract address
const contractAddr =
  "wasm19qws2lfd8pskyn0cfgpl5yjjyq3msy5402qr8nkzff9kdnkaepyqycedfh";

async function main() {
  const client = await CosmWasmClient.connect(rpcEndpoint);
  const config = await client.queryContractSmart(contractAddr, { config: {} });

  console.log(config);
}

main();
```

---
_Source: https://npm.io/package/cosmwasm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
