# @lunie/cosmos-js

> Wrapper around getting and sending transactions from and to applications build on top of the Cosmos SDK

Latest version **0.0.22** (published 2019-06-05) · Apache-2.0 license · 0 weekly downloads

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

## Install

```sh
npm install @lunie/cosmos-js
pnpm add @lunie/cosmos-js
yarn add @lunie/cosmos-js
bun add @lunie/cosmos-js
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.22 |
| Published | 2019-06-05 |
| First published | 2019-04-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 405.3 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | Lunie International Software Systems Inc. |
| Maintainers | faboweb |
| Keywords | cosmos, sdk, blockchain |

## Links

- npm: https://www.npmjs.com/package/@lunie/cosmos-js
- npm.io page: https://npm.io/package/@lunie/cosmos-js

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.19.0

## Recent versions

- 0.0.22 (latest) — 2019-06-05
- 0.0.21 — 2019-05-24
- 0.0.20 — 2019-05-23
- 0.0.19 — 2019-05-22
- 0.0.18 — 2019-05-22
- 0.0.17 — 2019-05-22
- 0.0.16 — 2019-05-21
- 0.0.15 — 2019-05-21
- 0.0.14 — 2019-05-20
- 0.0.13 — 2019-05-19
- 0.0.12 — 2019-05-19
- 0.0.11 — 2019-05-15
- 0.0.6 — 2019-05-10
- 0.0.5 — 2019-05-10
- 0.0.4 — 2019-05-10
- … 3 more at https://npm.io/package/@lunie/cosmos-js/versions

## README

# Cosmos JS - Wrapper for Cosmos REST API

## Install

```
yarn add @lunie/cosmos-js
```

## Use

Simple example of how to send tokens.

```
import Cosmos from "@lunie/cosmos-js"

const STARGATE_URL = "https://stargate.cosmos.network"
const ADDRESS = "cosmos1abcd1234"
const cosmos = Cosmos(STARGATE_URL, ADDRESS)

// create the transaction object
const msg = cosmos
  .MsgSend({toAddress: 'cosmos1abcd09876', amounts: [{ denom: 'stake', amount: 10 }})

// estimate the needed gas amount
const gasEstimate = await msg.simulate()

// create a signer
const ledgerSigner = ... // async (signMessage: string) => { signature: Buffer, publicKey: Buffer }

// send the transaction
const { included }= await msg.send({ gas: gasEstimate }, ledgerSigner)

// await tx to be included in a block
await included()
```

## API

If you want to query data only, you don't need to specify an address.

```
import { API } from "@lunie/cosmos-js"

const STARGATE_URL = "https://stargate.cosmos.network"

const api = API(STARGATE_URL)

const validators = await api.validators()
```

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