# terra-javascript-library

> This package provides Terra Blockchain client side APIs to support building transaction, singing, or querying chain data.

Latest version **1.0.7** (published 2019-06-21) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install terra-javascript-library
pnpm add terra-javascript-library
yarn add terra-javascript-library
bun add terra-javascript-library
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2019-06-21 |
| First published | 2019-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 30.7 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | YunSuk-Yeo |
| Maintainers | yun_yeo |
| Keywords | terra, luna, core, terra, blockchain |

## Links

- npm: https://www.npmjs.com/package/terra-javascript-library
- Repository: https://github.com/YunSuk-Yeo/terra-javascript-library
- Issues: https://github.com/YunSuk-Yeo/terra-javascript-library/issues
- npm.io page: https://npm.io/package/terra-javascript-library

## Dependencies (8)

- [bip32](https://npm.io/package/bip32.md) ^2.0.3
- [bip39](https://npm.io/package/bip39.md) ^3.0.2
- [bech32](https://npm.io/package/bech32.md) ^1.1.3
- [crypto-js](https://npm.io/package/crypto-js.md) ^3.1.9-1
- [secp256k1](https://npm.io/package/secp256k1.md) ^3.7.1
- [typescript](https://npm.io/package/typescript.md) ^3.5.1
- [@types/node](https://npm.io/package/@types/node.md) ^12.0.8
- [@types/bech32](https://npm.io/package/@types/bech32.md) ^1.1.1

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2019-06-21
- 1.0.6 — 2019-06-21
- 1.0.5 — 2019-06-21
- 1.0.4 — 2019-06-21
- 1.0.3 — 2019-06-21
- 1.0.2 — 2019-06-21
- 1.0.1 — 2019-06-21

## README

# Terra Javascript Library
This project provides Javascript & Node.js SDK library for [Core](https://github.com/terra-project/core) of [Terra](https://terra.money).

## Send 
```
const menemonic = "bunker grunt glow february coin right thunder special width only achieve reject dice laugh venue chapter quantum feel you dial much trip display more"
const masterKey = await terra.deriveMasterKey(menemonic)
const keypair = terra.deriveKeypair(masterKey)
const accAddr = terra.getAccAddress(keypair.publicKey)

const msgSend = terra.buildSend([
  {
    "amount": "1000000",
    "denom": "uluna"
  }
], accAddr, "terra1ptdx6akgk7wwemlk5j73artt5t6j8am08ql3qv");


const stdTx = terra.buildStdTx([msgSend], {
  "gas": "200000",
  "amount": [
    {
      "amount": "1000",
      "denom": "uluna"
    }
  ]
}, "library test")
const jsonTx = stdTx.value
const txSignature = terra.sign(jsonTx, keypair, {
  sequence: "0",
  account_number: "167",
  chain_id: "soju-0009"
})
const signedTx = terra.createSignedTx(stdTx.value, txSignature)
const broadcastBody = terra.createBroadcastBody(signedTx, "block")

console.log(accAddr, broadcastBody)
```

## Building Msgs
* buildPricePrevoteMsg
* buildPriceVote
* buildSend
* buildMultiSend

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